/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2012 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Phong Vo <[email protected]> *19* *20***********************************************************************/21/*22* standalone mini error interface23*/2425#ifndef _ERROR_H26#define _ERROR_H 12728#include <option.h>29#include <stdarg.h>3031typedef struct Error_info_s32{33int errors;34int line;35int warnings;36char* catalog;37char* file;38char* id;39} Error_info_t;4041#define ERROR_catalog(s) s4243#define ERROR_INFO 0 /* info message -- no err_id */44#define ERROR_WARNING 1 /* warning message */45#define ERROR_ERROR 2 /* error message -- no err_exit */46#define ERROR_FATAL 3 /* error message with err_exit */47#define ERROR_PANIC ERROR_LEVEL /* panic message with err_exit */4849#define ERROR_LEVEL 0x00ff /* level portion of status */50#define ERROR_SYSTEM 0x0100 /* report system errno message */51#define ERROR_USAGE 0x0800 /* usage message */5253#define error_info _err_info54#define error _err_msg55#define errorv _err_msgv5657extern Error_info_t error_info;5859#define errorx(l,x,c,m) (char*)m6061extern void error(int, ...);62extern int errorf(void*, void*, int, ...);63extern void errorv(const char*, int, va_list);6465#endif666768