Back to home page

Enduro/X

 
 

    


0001 /**
0002  * @brief UBF library - header file for UBF error handling.
0003  *
0004  * @file ferror.h
0005  */
0006 /* -----------------------------------------------------------------------------
0007  * Enduro/X Middleware Platform for Distributed Transaction Processing
0008  * Copyright (C) 2009-2016, ATR Baltic, Ltd. All Rights Reserved.
0009  * Copyright (C) 2017-2023, Mavimax, Ltd. All Rights Reserved.
0010  * This software is released under one of the following licenses:
0011  * AGPL (with Java and Go exceptions) or Mavimax's license for commercial use.
0012  * See LICENSE file for full text.
0013  * -----------------------------------------------------------------------------
0014  * AGPL license:
0015  *
0016  * This program is free software; you can redistribute it and/or modify it under
0017  * the terms of the GNU Affero General Public License, version 3 as published
0018  * by the Free Software Foundation;
0019  *
0020  * This program is distributed in the hope that it will be useful, but WITHOUT ANY
0021  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
0022  * PARTICULAR PURPOSE. See the GNU Affero General Public License, version 3
0023  * for more details.
0024  *
0025  * You should have received a copy of the GNU Affero General Public License along 
0026  * with this program; if not, write to the Free Software Foundation, Inc.,
0027  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0028  *
0029  * -----------------------------------------------------------------------------
0030  * A commercial use license is available from Mavimax, Ltd
0031  * contact@mavimax.com
0032  * -----------------------------------------------------------------------------
0033  */
0034 #ifndef FERROR_H
0035 #define FERROR_H
0036 
0037 #ifdef  __cplusplus
0038 extern "C" {
0039 #endif
0040 
0041 /*---------------------------Includes-----------------------------------*/
0042 #include <regex.h>
0043 #include <ndrstandard.h>
0044 /*---------------------------Externs------------------------------------*/
0045 /*---------------------------Macros-------------------------------------*/
0046 #define MAX_ERROR_LEN   1024
0047 /*---------------------------Enums--------------------------------------*/
0048 /*---------------------------Typedefs-----------------------------------*/
0049     
0050 /**
0051  * UBF error handler save/restore
0052  */
0053 typedef struct
0054 {
0055     char ubf_error_msg_buf[MAX_ERROR_LEN+1];
0056     int ubf_error;
0057 } ndrx_ubf_error_t;
0058 
0059 /*---------------------------Globals------------------------------------*/
0060 /*---------------------------Statics------------------------------------*/
0061 /*---------------------------Prototypes---------------------------------*/
0062 extern NDRX_API void ndrx_Bset_error(int error_code);
0063 extern NDRX_API void ndrx_Bset_error_msg(int error_code, char *msg);
0064 extern NDRX_API void ndrx_Bset_error_fmt(int error_code, const char *fmt, ...);
0065 /* Is error already set?  */
0066 extern NDRX_API int ndrx_Bis_error(void);
0067 extern NDRX_API void ndrx_Bappend_error_msg(char *msg);
0068 
0069 extern NDRX_API void ndrx_Bunset_error(void);
0070 
0071 /* This is not related with UBF error, we will handle it here anyway
0072  * because file is part of error handling
0073  */
0074 extern NDRX_API void ndrx_report_regexp_error(char *fun_nm, int err, regex_t *rp);
0075 
0076 extern NDRX_API void ndrx_Bsave_error(ndrx_ubf_error_t *p_err);
0077 extern NDRX_API void ndrx_Brestore_error(ndrx_ubf_error_t *p_err);
0078 
0079 #ifdef  __cplusplus
0080 }
0081 #endif
0082 
0083 #endif  /* FERROR_H */
0084 
0085 /* vim: set ts=4 sw=4 et smartindent: */