.ad 8
.bm 8
.fm 4
.bt $Copyright by   Software AG, 1993$$Page %$
.tm 12
.hm 6
.hs 3
.tt 1 $NME$Project Distributed Database System$vos02uc$
.tt 2 $$$
.tt 3 $R.Roedling$ N A M E $1995-05-16$
***********************************************************
.nf


    ========== licence begin LGPL
    Copyright (C) 2002 SAP AG

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    ========== licence end

.fo
.nf
.sp
Module  :
=========
.sp
Purpose :
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :

.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :

.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :

.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : R.Roedling
.sp
.cp 3
Created : 1994-10-24
.sp
.cp 3
Version : 1994-10-24
.sp
.cp 3
Release :  6.1.1.13 	 Date : 1995-06-14
.br
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:

.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:

.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:

.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
/*PRETTY*/


//
// INCLUDE FILES
//


//
//  DEFINES
//

#define MOD__  "VOS02UC : "
#define MF__   MOD__"UNDEFINED"

#define MAXEXIT 10


//
//  MACROS
//


//
//  LOCAL TYPE AND STRUCT DEFINITIONS
//


//
//  EXPORTED VARIABLES
//
#if defined ( _WIN32 )
 static PFNEXITLIST sql02u_ExitCallBack[MAXEXIT];
#endif


//
//  LOCAL VARIABLES
//


//
//  FUNCTION PROTOTYPES
//


//
//  LOCAL FUNCTION PROTOTYPES
//


//
// ========================== GLOBAL FUNCTIONS ================================
//

APIRET sql02u_add_exit_list ( PFNEXITLIST pExitFunc )
  {
  #undef  MF__
  #define MF__ MOD__"sql02u_add_exit_list"
  APIRET rc = NO_ERROR;
  #if defined ( _WIN32 )
   INT i;
  #endif

  DBGPAS;

  #if defined ( _WIN32 )
   for (i = 0; i < MAXEXIT; ++i)
     {
     if (!sql02u_ExitCallBack[i]) break;
     }

   if (i >= MAXEXIT)
     {
     DBG1((MF__, "Exit callback list overflow!"));
     return (ERROR_OUT_OF_STRUCTURES);
     }

   sql02u_ExitCallBack[i] = pExitFunc;
  #else
    rc = DosExitList ( EXLST_ADD, pExitFunc );
  #endif

  return ( rc );
  }

/*------------------------------*/

APIRET sql02u_next_exit_func ( VOID )
  {
  #undef  MF__
  #define MF__ MOD__"sql02u_next_exit_func"
  APIRET rc = NO_ERROR;

  DBGPAS;

  #if defined ( _WIN32 )
  #else
    rc = DosExitList ( EXLST_EXIT, NULL );
  #endif

  return ( rc );
  }

/*------------------------------*/

#if defined ( _WIN32 )
 VOID sql02u_run_exit_func ( VOID )
   {
   #undef  MF__
   #define MF__ MOD__"sql02u_run_exit_func"
   int    i;

   for ( i = MAXEXIT-1; i >= 0; --i)
     {
     if (sql02u_ExitCallBack[i])
       (*sql02u_ExitCallBack[i])( 0 );
     }
   }

#endif

//
// ========================== LOCAL FUNCTIONS =================================
//

//
// =============================== END ========================================
//
.CM *-END-* code ----------------------------------------
.SP 2
***********************************************************
.PA
