/*----------------------------------------------------------------------
   onerror.h

   Copyright (c) 1992-1994 Raima Corporation.  All Rights Reserved.
----------------------------------------------------------------------*/

#ifndef  ONERROR_H
#define  ONERROR_H

#ifndef NO_NESTED_H
#define  INCL_DOSPROCESS
#define  INCL_BASE
#define  INCL_NOPM
#include <os2.h>
#endif

#define  cmdRETURN      0
#define  cmdCONTINUE    1
#define  cmdABEND       2

extern   short    CmdRETURN;
extern   short    CmdCONTINUE;
extern   short    CmdABEND;

short _OnError(char *pszRoutine, char *pszFile, unsigned short usLine,
               short rc, short errAction);

#define  OnError(func, rc, x)                            \
         if (_OnError(func, __FILE__, __LINE__, rc, x))  \
            if (x == CmdRETURN)                          \
               return rc
#endif

