home *** CD-ROM | disk | FTP | other *** search
- /*-----------------------------------------------------------------------
- dberr.c -- db_VISTA database error handler module.
- Version for use with db_VISTA runtime system.
-
- Copyright (c) 1984-1990, Raima Corporation, All Rights Reserved
- -----------------------------------------------------------------------*/
-
- /* ********************** EDIT HISTORY *******************************
-
- SCR DATE INI DESCRIPTION
- ----- --------- --- -----------------------------------------------------
- 441 09-Dec-88 RSC Placed windows specific stuff within ifdef WINDOWS
- 17-Feb-89 RSC Fixed bad fix for SCR 441
- */
-
- #include <stdio.h>
- #include "vista.h"
- #include "dberr.h"
-
-
- /* ======================================================================
- Database error handler
- */
- EXTERNAL_FIXED dberr( errnum )
- int errnum;
- {
- char DB_FAR *errmsg;
- char buf[41];
-
- if (errnum < 0) {
- if (errnum < 0 && errnum > -100)
- errmsg = user_error[-(errnum+1)];
- else if (errnum <= -900)
- errmsg = system_error[-(errnum+900)];
- if ( db_global.error_func ) {
- (*(db_global.error_func))(errnum, errmsg);
- }
- else {
- printf("\n*** db_VISTA database error %d - %s\n", errnum, errmsg);
- printf("press <return> to continue ");
- gets(buf);
- }
- }
- db_status = (errnum == S_DEBUG) ? S_OKAY : errnum;
- return( db_status );
- }
-
- /* ======================================================================
- Database auto-recovery notification function
- */
- void INTERNAL_FIXED dbautorec()
- {
- /*------------------------------------------------------------------
- This function is called by the db_VISTA runtime whenever
- a database recovery is about to occur. Any desired user
- interaction code (such as an "auto-recovery in process" message)
- should be included here.
- ------------------------------------------------------------------*/
- /* we currently call dberr to display a "recovery in process" message */
- dberr(S_RECOVERY);
- }
- /* vpp -F -nUNIX -nWINDOWS -nVMS -nOS2 DBERR.c */
- /* vpp -F -nFAR_ALLOC -nARCHIVING -nDB_DLL -nBSD -nMEMLOCK -nIS_UNIX_REALLY -nREOPEN_FILES DBERR.c */