1N/A
1N/A/* : : generated by proto : : */
1N/A/***********************************************************************
1N/A* *
1N/A* This software is part of the ast package *
1N/A* Copyright (c) 1985-2011 AT&T Intellectual Property *
1N/A* and is licensed under the *
1N/A* Common Public License, Version 1.0 *
1N/A* by AT&T Intellectual Property *
1N/A* *
1N/A* A copy of the License is available at *
1N/A* http://www.opensource.org/licenses/cpl1.0.txt *
1N/A* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
1N/A* *
1N/A* Information and Software Systems Research *
1N/A* AT&T Research *
1N/A* Florham Park NJ *
1N/A* *
1N/A* Glenn Fowler <gsf@research.att.com> *
1N/A* David Korn <dgk@research.att.com> *
1N/A* Phong Vo <kpv@research.att.com> *
1N/A* *
1N/A***********************************************************************/
1N/A
1N/A/*
1N/A * common ast debug definitions
1N/A * include after the ast headers
1N/A */
1N/A
1N/A#ifndef _DEBUG_H
1N/A#if !defined(__PROTO__)
1N/A#include <prototyped.h>
1N/A#endif
1N/A#if !defined(__LINKAGE__)
1N/A#define __LINKAGE__ /* 2004-08-11 transition */
1N/A#endif
1N/A
1N/A#define _DEBUG_H
1N/A
1N/A#include <ast.h>
1N/A#include <error.h>
1N/A
1N/A#if !defined(DEBUG) && _BLD_DEBUG
1N/A#define DEBUG _BLD_DEBUG
1N/A#endif
1N/A
1N/A#if DEBUG || _BLD_DEBUG
1N/A
1N/A#define debug(x) x
1N/A#define message(x) do if (error_info.trace < 0) { error x; } while (0)
1N/A#define messagef(x) do if (error_info.trace < 0) { errorf x; } while (0)
1N/A
1N/A#define DEBUG_BEGTIME() debug_elapsed(1)
1N/A#define DEBUG_GETTIME() debug_elapsed(0)
1N/A#define DEBUG_ASSERT(p) ((p) ? 0 : (debug_fatal(__FILE__, __LINE__),0))
1N/A#define DEBUG_COUNT(n) ((n) += 1)
1N/A#define DEBUG_TALLY(c,n,v) ((c) ? ((n) += (v)) : (n))
1N/A#define DEBUG_INCREASE(n) ((n) += 1)
1N/A#define DEBUG_DECREASE(n) ((n) -= 1)
1N/A#define DEBUG_DECLARE(t,v) t v
1N/A#define DEBUG_SET(n,v) ((n) = (v))
1N/A#define DEBUG_PRINT(fd,s,v) do {char _b[1024];write(fd,_b,sfsprintf(_b,sizeof(_b),s,v));} while(0)
1N/A#define DEBUG_WRITE(fd,d,n) write((fd),(d),(n))
1N/A#define DEBUG_TEMP(temp) (temp) /* debugging stuff that should be removed */
1N/A#define DEBUG_BREAK break
1N/A#define DEBUG_CONTINUE continue
1N/A#define DEBUG_GOTO(label) do { debug_fatal(__FILE__, __LINE__); goto label; } while(0)
1N/A#define DEBUG_RETURN(x) do { debug_fatal(__FILE__, __LINE__); return(x); } while(0)
1N/A
1N/A#else
1N/A
1N/A#define debug(x)
1N/A#define message(x)
1N/A#define messagef(x)
1N/A
1N/A#define DEBUG_BEGTIME()
1N/A#define DEBUG_GETTIME()
1N/A#define DEBUG_ASSERT(p)
1N/A#define DEBUG_COUNT(n)
1N/A#define DEBUG_TALLY(c,n,v)
1N/A#define DEBUG_INCREASE(n)
1N/A#define DEBUG_DECREASE(n)
1N/A#define DEBUG_DECLARE(t,v)
1N/A#define DEBUG_SET(n,v)
1N/A#define DEBUG_PRINT(fd,s,v)
1N/A#define DEBUG_WRITE(fd,d,n)
1N/A#define DEBUG_TEMP(x)
1N/A#define DEBUG_BREAK break
1N/A#define DEBUG_CONTINUE continue
1N/A#define DEBUG_GOTO(label) goto label
1N/A#define DEBUG_RETURN(x) return(x)
1N/A
1N/A#endif
1N/A
1N/A#ifndef BREAK
1N/A#define BREAK DEBUG_BREAK
1N/A#endif
1N/A#ifndef CONTINUE
1N/A#define CONTINUE DEBUG_CONTINUE
1N/A#endif
1N/A#ifndef GOTO
1N/A#define GOTO(label) DEBUG_GOTO(label)
1N/A#endif
1N/A#ifndef RETURN
1N/A#define RETURN(x) DEBUG_RETURN(x)
1N/A#endif
1N/A
1N/A#if _BLD_ast && defined(__EXPORT__)
1N/A#undef __MANGLE__
1N/A#define __MANGLE__ __LINKAGE__ __EXPORT__
1N/A#endif
1N/A
1N/Aextern __MANGLE__ double debug_elapsed __PROTO__((int));
1N/Aextern __MANGLE__ void debug_fatal __PROTO__((const char*, int));
1N/Aextern __MANGLE__ void systrace __PROTO__((const char*));
1N/A
1N/A#undef __MANGLE__
1N/A#define __MANGLE__ __LINKAGE__
1N/A
1N/A#endif