/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* option, error and message formatter external definitions
*/
#ifndef _ERROR_H
#define _ERROR_H
#include <ast.h>
#include <option.h>
#include <errno.h>
#if !defined(errno) && defined(__DYNAMIC__)
#endif
#define ERROR_debug(n) (-(n))
#ifndef ERROR_catalog
#define ERROR_catalog(t) t
#endif
#ifndef ERROR_dictionary
#define ERROR_dictionary(t) t
#endif
#ifndef ERROR_translate
#define ERROR_translate(l,i,d,m) (ERROR_translating()?errorx((const char*)(l),(const char*)(i),(const char*)(d),(const char*)(m)):(char*)(m))
#endif
#ifdef ECONNRESET
#else
#endif
/*
* errorpush()/errorpop() are obsolete -- use errorctx() instead
*/
#ifndef ERROR_CONTEXT_T
#endif
#define errorpush(p,f) (*(p)=*ERROR_CONTEXT_BASE,*ERROR_CONTEXT_BASE=error_info.empty,error_info.context=(Error_context_t*)(p),error_info.flags=(f))
#define ERROR_CONTEXT \
int errors; /* >= 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 */
{
};
{
/* the rest are implicitly initialized */
ERROR_CONTEXT /* top of context stack */
};
#ifndef errno
extern int errno; /* system call error status */
#endif
#if _BLD_ast && defined(__EXPORT__)
#define extern extern __EXPORT__
#endif
#if !_BLD_ast && defined(__IMPORT__)
#define extern extern __IMPORT__
#endif
extern Error_info_t* _error_infop_;
#undef extern
#if _BLD_ast && defined(__EXPORT__)
#define extern __EXPORT__
#endif
extern void error(int, ...);
extern int errormsg(const char*, int, ...);
extern int errorf(void*, void*, int, ...);
#ifndef errorx
extern char* errorx(const char*, const char*, const char*, const char*);
#endif
#undef extern
#endif