pike.git / src / errors.h

version» Context lines:

pike.git/src/errors.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: errors.h,v 1.38 2008/05/23 19:39:06 grubba Exp $ + || $Id: errors.h,v 1.39 2008/05/27 01:39:44 mast Exp $   */      #ifdef ERR_DECLARE   #define DECLARE_PURE_ERROR(NAME, SCNAME, INHERIT) \    PMOD_EXPORT struct program *PIKE_CONCAT(NAME,_error_program);   #define DECLARE_ERROR(NAME, SCNAME, INHERIT, DECL) \    DECLARE_PURE_ERROR(NAME, SCNAME, INHERIT) \    ptrdiff_t PIKE_CONCAT(NAME,_error_offset); \    DECL   
pike.git/src/errors.h:33:   /* Some compilers (eg cl) don't like empty structs... */   /* #define EMPTY ERR_VAR(INT_TYPE, int, PIKE_T_INT, ignored__) */      #endif /* ERR_EXT_DECLARE */      #ifdef ERR_SETUP   #define DECLARE_PURE_ERROR(NAME, SCNAME, INHERIT) do { \    start_new_program(); \    INHERIT \    add_string_constant("error_type", #SCNAME, 0); \ +  add_string_constant ("error_name", "Error." #SCNAME, ID_PRIVATE|ID_USED); \    add_integer_constant("is_" #NAME "_error",1,0); \    PIKE_CONCAT(NAME,_error_program)=end_program(); \    add_program_constant( #SCNAME "Error",PIKE_CONCAT(NAME,_error_program),0); \    } while(0);   #define DECLARE_ERROR(NAME, SCNAME, INHERIT, DECL) do { \    ptrdiff_t current_offset=0; \    struct PIKE_CONCAT(NAME,_error_struct) foo; \    DECLARE_PURE_ERROR(NAME, SCNAME, \    INHERIT \    current_offset = \
pike.git/src/errors.h:118:    ERR_FUNC_SAVE_ID (generic_err_message_fun, "message", f_error_message,    tFunc(tVoid,tString), 0)    ERR_FUNC_SAVE_ID (generic_err_backtrace_fun, "backtrace", f_error_backtrace,    tFunc(tVoid,tArr(tMixed)),0)    ERR_FUNC("_sprintf", f_error__sprintf,    tFunc(tOr(tInt,tVoid) tOr(tMapping,tVoid),tString), ID_STATIC)    ERR_FUNC("_is_type", f_error__is_type, tFunc(tString, tInt01), ID_STATIC)    ERR_FUNC("create",f_error_create,tFunc(tStr tOr(tVoid,tArr(tMixed)),tVoid),ID_STATIC)   )    - #define GENERIC_ERROR_THIS ((struct generic_error_struct *)CURRENT_STORAGE) -  +    DECLARE_ERROR(index, Index,    ERR_INHERIT(generic),    ERR_VAR(struct svalue, tMix, PIKE_T_MIXED, value)    ERR_VAR(struct svalue, tMix, PIKE_T_MIXED, index)   )      DECLARE_ERROR(bad_argument, BadArgument,    ERR_INHERIT(generic),    ERR_VAR(INT_TYPE, tInt, PIKE_T_INT, which_argument)    ERR_VAR(struct pike_string *, tStr,PIKE_T_STRING,expected_type)