/* : : generated by proto : : */ /*********************************************************************** * * * This software is part of the ast package * * Copyright (c) 1985-2010 AT&T Intellectual Property * * and is licensed under the * * Common Public License, Version 1.0 * * by AT&T Intellectual Property * * * * A copy of the License is available at * * http://www.opensource.org/licenses/cpl1.0.txt * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * * * * Information and Software Systems Research * * AT&T Research * * Florham Park NJ * * * * Glenn Fowler * * David Korn * * Phong Vo * * * ***********************************************************************/ /* * Glenn Fowler * AT&T Research * * option, error and message formatter external definitions */ #ifndef _ERROR_H #if !defined(__PROTO__) #include #endif #if !defined(__LINKAGE__) #define __LINKAGE__ /* 2004-08-11 transition */ #endif #define _ERROR_H #include #include #include #define ERROR_VERSION 20070319L #if !defined(errno) && defined(__DYNAMIC__) #define errno __DYNAMIC__(errno) #endif #define ERROR_debug(n) (-(n)) #define ERROR_exit(n) ((n)+ERROR_ERROR) #define ERROR_system(n) (((n)+ERROR_ERROR)|ERROR_SYSTEM) #define ERROR_usage(n) ((((n)?2:0)+ERROR_ERROR)|ERROR_USAGE) #define ERROR_warn(n) (ERROR_WARNING) #ifndef ERROR_catalog #define ERROR_catalog(t) t #endif #ifndef ERROR_dictionary #define ERROR_dictionary(t) t #endif #ifndef ERROR_translate #define ERROR_translating() (error_info.translate&&(ast.locale.set&(1<= ERROR_ERROR count */ \ int flags; /* context flags */ \ int line; /* input|output line number */ \ int warnings; /* ERROR_WARNING count */ \ char* file; /* input|output file name */ \ char* id; /* command id */ struct Error_context_s /* context stack element */ { ERROR_CONTEXT }; struct Error_info_s /* error state */ { int fd; /* write(2) fd */ void (*exit) __PROTO__((int)); /* error exit */ ssize_t (*write) __PROTO__((int, const __V_*, size_t)); /* error output */ /* the rest are implicitly initialized */ int clear; /* default clear ERROR_* flags */ int core; /* level>=core -> core dump */ int indent; /* debug trace indent level */ int init; /* initialized */ int last_errno; /* last reported errno */ int mask; /* multi level debug trace mask */ int set; /* default set ERROR_* flags */ int trace; /* debug trace level */ char* version; /* ERROR_SOURCE command version */ int (*auxilliary) __PROTO__((Sfio_t*, int, int)); /* aux info to append */ ERROR_CONTEXT /* top of context stack */ Error_context_t empty; /* empty context stack element */ unsigned long time; /* debug time trace */ char* (*translate) __PROTO__((const char*, const char*, const char*, const char*)); /* format translator */ const char* catalog; /* message catalog */ }; #ifndef errno extern __MANGLE__ int errno; /* system call error status */ #endif #if _BLD_ast && defined(__EXPORT__) #undef __MANGLE__ #define __MANGLE__ __LINKAGE__ __EXPORT__ #endif #if !_BLD_ast && defined(__IMPORT__) #undef __MANGLE__ #define __MANGLE__ __LINKAGE__ __IMPORT__ #endif extern __MANGLE__ Error_info_t* _error_infop_; #define error_info (*_error_infop_) #undef __MANGLE__ #define __MANGLE__ __LINKAGE__ #if _BLD_ast && defined(__EXPORT__) #undef __MANGLE__ #define __MANGLE__ __LINKAGE__ __EXPORT__ #endif extern __MANGLE__ void error __PROTO__((int, ...)); extern __MANGLE__ int errormsg __PROTO__((const char*, int, ...)); extern __MANGLE__ int errorf __PROTO__((__V_*, __V_*, int, ...)); extern __MANGLE__ void errorv __PROTO__((const char*, int, va_list)); #ifndef errorx extern __MANGLE__ char* errorx __PROTO__((const char*, const char*, const char*, const char*)); #endif extern __MANGLE__ Error_info_t* errorctx __PROTO__((Error_info_t*, int, int)); #undef __MANGLE__ #define __MANGLE__ __LINKAGE__ #endif