home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / harbb30g.zip / INCLUDE / errorapi.h < prev    next >
C/C++ Source or Header  |  1999-09-17  |  6KB  |  137 lines

  1. /*
  2.  * $Id: errorapi.h,v 1.29 1999/09/17 02:17:29 vszel Exp $
  3.  */
  4.  
  5. /*
  6.  * Harbour Project source code:
  7.  * Header file for the Error API
  8.  *
  9.  * Copyright 1999 Antonio Linares <alinares@fivetech.com>
  10.  * www - http://www.harbour-project.org
  11.  *
  12.  * This program is free software; you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation; either version 2 of the License, or
  15.  * (at your option) any later version, with one exception:
  16.  *
  17.  * The exception is that if you link the Harbour Runtime Library (HRL)
  18.  * and/or the Harbour Virtual Machine (HVM) with other files to produce
  19.  * an executable, this does not by itself cause the resulting executable
  20.  * to be covered by the GNU General Public License. Your use of that
  21.  * executable is in no way restricted on account of linking the HRL
  22.  * and/or HVM code into it.
  23.  *
  24.  * This program is distributed in the hope that it will be useful,
  25.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  27.  * GNU General Public License for more details.
  28.  *
  29.  * You should have received a copy of the GNU General Public License
  30.  * along with this program; if not, write to the Free Software
  31.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
  32.  * their web site at http://www.gnu.org/).
  33.  *
  34.  */
  35.  
  36. #ifndef HB_ERRORAPI_H_
  37. #define HB_ERRORAPI_H_
  38.  
  39. #include "extend.h"
  40. #include "error.ch"
  41.  
  42. /* Error codes (returned from hb_errLaunch()) */
  43.  
  44. #define E_BREAK                         0xFFFF
  45. #define E_RETRY                         1
  46. #define E_DEFAULT                       0
  47.  
  48. /* Error flags */
  49.  
  50. #define EF_NONE                         0
  51. #define EF_CANRETRY                     1
  52. #define EF_CANSUBSTITUTE                2
  53. #define EF_CANDEFAULT                   4
  54.  
  55. /* oError:Severity */
  56.  
  57. /* ... defined in extend.ch */
  58.  
  59. /* oError:SubSystem (commonly used) */
  60.  
  61. #define HB_ERR_SS_BASE                  "BASE"
  62. #define HB_ERR_SS_TERMINAL              "TERM"
  63. #define HB_ERR_SS_DBCMD                 "DBCMD"
  64. #define HB_ERR_SS_TOOLS                 "TOOLS"
  65.  
  66. /* oError:GenCode */
  67.  
  68. /* ... defined in extend.ch */
  69.  
  70. /* Internal error numbers */
  71.  
  72. #define HB_ERR_IE_NOT_ENOUGH_MEM        1024
  73. #define HB_ERR_IE_ERR_RECOV_FAIL        1025
  74. #define HB_ERR_IE_UNREC_ERROR           1026
  75. #define HB_ERR_IE_GENERIC               1027
  76.  
  77. /* Standard API */
  78.  
  79. extern char *   hb_errGetDescription    ( PHB_ITEM pError );
  80. extern char *   hb_errGetFileName       ( PHB_ITEM pError );
  81. extern USHORT   hb_errGetFlags          ( PHB_ITEM pError );
  82. extern USHORT   hb_errGetGenCode        ( PHB_ITEM pError );
  83. extern char *   hb_errGetOperation      ( PHB_ITEM pError );
  84. extern USHORT   hb_errGetOsCode         ( PHB_ITEM pError );
  85. extern USHORT   hb_errGetSeverity       ( PHB_ITEM pError );
  86. extern USHORT   hb_errGetSubCode        ( PHB_ITEM pError );
  87. extern char *   hb_errGetSubSystem      ( PHB_ITEM pError );
  88. extern USHORT   hb_errGetTries          ( PHB_ITEM pError );
  89. extern USHORT   hb_errLaunch            ( PHB_ITEM pError );
  90. extern PHB_ITEM hb_errNew               ( void );
  91. extern PHB_ITEM hb_errPutArgs           ( PHB_ITEM pError, USHORT uiArgCount, ... );
  92. extern PHB_ITEM hb_errPutDescription    ( PHB_ITEM pError, char * szDescription );
  93. extern PHB_ITEM hb_errPutFileName       ( PHB_ITEM pError, char * szFileName );
  94. extern PHB_ITEM hb_errPutFlags          ( PHB_ITEM pError, USHORT uiFlags );
  95. extern PHB_ITEM hb_errPutGenCode        ( PHB_ITEM pError, USHORT uiGenCode );
  96. extern PHB_ITEM hb_errPutOperation      ( PHB_ITEM pError, char * szOperation );
  97. extern PHB_ITEM hb_errPutOsCode         ( PHB_ITEM pError, USHORT uiOsCode );
  98. extern PHB_ITEM hb_errPutSeverity       ( PHB_ITEM pError, USHORT uiSeverity );
  99. extern PHB_ITEM hb_errPutSubCode        ( PHB_ITEM pError, USHORT uiSubCode );
  100. extern PHB_ITEM hb_errPutSubSystem      ( PHB_ITEM pError, char * szSubSystem );
  101. extern PHB_ITEM hb_errPutTries          ( PHB_ITEM pError, USHORT uiTries );
  102. extern void     hb_errRelease           ( PHB_ITEM pError );
  103.  
  104. /* Harbour additions */
  105.  
  106. extern void     hb_errInit              ( void );
  107. extern void     hb_errExit              ( void );
  108.  
  109. extern PHB_ITEM hb_errLaunchSubst       ( PHB_ITEM pError );
  110.  
  111. extern PHB_ITEM hb_errRT_New( USHORT uiSeverity, char * szSubSystem,
  112.    ULONG  ulGenCode,
  113.    ULONG  ulSubCode,
  114.    char * szDescription,
  115.    char * szOperation,
  116.    USHORT uiOsCode,
  117.    USHORT uiFlags );
  118.  
  119. extern PHB_ITEM hb_errRT_New_Subst( USHORT uiSeverity, char * szSubSystem,
  120.    ULONG  ulGenCode,
  121.    ULONG  ulSubCode,
  122.    char * szDescription,
  123.    char * szOperation,
  124.    USHORT uiOsCode,
  125.    USHORT uiFlags );
  126.  
  127. extern USHORT   hb_errRT_BASE           ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation );
  128. extern USHORT   hb_errRT_BASE_Ext1      ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, USHORT uiOsCode, USHORT uiFlags );
  129. extern PHB_ITEM hb_errRT_BASE_Subst     ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation );
  130. extern USHORT   hb_errRT_TERM           ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation, USHORT uiOSCode, USHORT uiFlags );
  131. extern USHORT   hb_errRT_DBCMD          ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation );
  132. extern USHORT   hb_errRT_TOOLS          ( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation );
  133.  
  134. extern void     hb_errInternal          ( ULONG ulIntCode, char * szText, char * szPar1, char * szPar2 );
  135.  
  136. #endif /* HB_ERRORAPI_H_ */
  137.