home *** CD-ROM | disk | FTP | other *** search
- DOS Aborted Application Cleanup
-
- In the MS-DOS environment, the connection between the application and
- the server will not be properly closed on abnormal program exits unless
- certain steps are taken to clean up the application-server connection.
- Ordinarily, an application directly (or indirectly via CLISAM) cleans up
- the connection by a call to STPUSR().
-
- When an application abnormally terminates, disconnect() must be called.
- c-tree includes several methods of handling control-c and critical errors.
- In short, the net result should be that disconnect() is called before
- the application exits, whether done by the c-tree default routines or a
- user abnormal exit handler. c-tree actions can be specified by setting
- the constants CBRKmode and CERRmode. These are in ctaxit.h.
-
- CBRKmode defines the actions performed on a control-c interrupt (int
- 23). Possible values are:
-
- CBRK_NONE - Do not install the c-tree interrupt 23 handler. This
- would be used when a user-supplied handler is already
- in place. Another case is when using console I/O
- routines that treat control-c and control-break as
- normal characters or otherwise inhibit the abort. If the
- control-c causes an abort, be sure to call disconnect().
-
- CBRK_DFL - The interrupt 23h handler is installed. When an abort
- due to control-c is signaled, then the handler will
- call disconnect(), then let the program terminate.
-
- CBRK_IGN - The handler is installed, however, the handler returns
- "ignore" status to MS-DOS (The newline/^C is still
- echoed to the screen; you must use other i/o techniques
- to avoid this).
-
- CERRmode defines the actions performed on a critical error interrupt (int
- 24). Possible values are:
-
- CERR_NONE - Do not install the c-tree interrupt 24 handler. This
- would be used when a user-supplied handler is already
- in place. The existing handler should be modified to
- call disconnect() if c-tree has been activated.
-
- CERR_DFL - The handler is installed. It passes control to the
- default handler, i.e., prompt user for intervention.
- If the returned status from the default handler
- specifies abort (i.e., user selected Abort), then
- disconnect() is called. Since, in this mode, the handler
- "chains" to the next handler, it can be used with an
- existing user or library supplied handler if the
- user/library handler is installed BEFORE c-tree routines
- are called, thus avoiding changes to existing handler
- code.
-
- CERR_FAIL - The handler is installed. When a critical error occurs,
- the handler returns status to MS-DOS indicating that
- the call should return the error to the program that
- made the system call. The calling program will receive
- DOS error 0x83 (and can get extended error codes if
- desired).
-
-
- There are other abnormal termination reasons not covered by the c-tree
- handler such as floating point error (trap with signal()). Any
- handlers for these should call disconnect() if c-tree has been
- activated and the program will be aborted.
-
- end of readme.cup
-