/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1986-2011 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> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* preprocessor library public definitions
*/
#ifndef _PP_H
#define _PP_H
#ifdef ppsymbol
/*
* undo old nmake cpp name-space intrusion
* this disables __LINE__, __FILE__, __DATE__ and __TIME__
*/
#define __LINE__ 0
#endif
#if PROTOMAIN
#define Hash_table_t char
#define Sfio_t char
#else
#include <limits.h>
#include <hash.h>
#include <error.h>
#include <ccode.h>
#endif
#define PPWRITE(n) do{if(write(1,pp.outbuf,n)!=(n))pperror(ERROR_SYSTEM|3,"%s: write error",pp.outfile);pp.offset+=(n);pp.lastout=pp.outbuf[(n)-1];}while(0)
#define ppflushout() do{if(pp.outp>pp.outbuf){PPWRITE(pp.outp-pp.outbuf);pp.outp=pp.outbuf;}}while(0)
#define ppcheckout() do{if(pp.outp>pp.oute){PPWRITE(PPBUFSIZ);if(pp.outbuf==pp.outb){pp.outbuf+=PPBUFSIZ;pp.oute+=PPBUFSIZ;}else{pp.outbuf-=PPBUFSIZ;memcpy(pp.outbuf,pp.oute,pp.outp-pp.oute);pp.oute-=PPBUFSIZ;pp.outp-=2*PPBUFSIZ;}}}while(0)
#define ppsymref(t,n) (struct ppsymbol*)hashlook(t,n,pp.truncate?HASH_LOOKUP:HASH_LOOKUP|HASH_INTERNAL,NiL)
#define ppsymset(t,n) (struct ppsymbol*)hashlook(t,n,HASH_CREATE|HASH_SIZE(sizeof(struct ppsymbol)),NiL)
#if CHAR_MIN < 0
#else
#endif
/*
* numeric modifiers
*
* NOTE: 0400 is claimed by error in yacc
* (N_PP+30) is the largest valid pp token
* free tokens start at T_TOKEN
*/
/*
* NOTE: preserve the token ranges and encodings for is*(x)
*/
#if !defined(T_DOUBLE)
/*
* numeric constants
*/
/*
* identifier and invalid token
*/
/*
* quoted constants
*/
/*
* multichar operators
*/
/*
* C++ tokens
*/
/*
* compiler tokens
*/
#endif
/*
* start of free tokens
*/
{
#ifdef _PP_DIRS_PRIVATE_
#endif
};
{
};
{
#ifdef _PP_MACRO_PRIVATE_
#endif
};
{
#ifdef _PP_SYMBOL_PRIVATE_
#endif
};
#define _PP_CONTEXT_PUBLIC_ \
int flags; /* PP_[a-z]* flags */ \
{
/* exposed for the output macros */
#ifdef _PP_CONTEXT_PUBLIC_
_PP_CONTEXT_PUBLIC_ /* public context */
#endif
#ifdef _PP_CONTEXT_PRIVATE_
_PP_CONTEXT_PRIVATE_ /* library private context */
#endif
#ifdef _PP_GLOBALS_PRIVATE_
_PP_GLOBALS_PRIVATE_ /* library private additions */
#endif
};
/*
* library interface globals
*/
extern char ppctype[];
extern int ppargs(char**, int);
extern void ppcpp(void);
extern void ppcomment(char*, char*, char*, int);
extern void* ppcontext(void*, int);
extern void pperror(int, ...);
extern void ppincref(char*, char*, int, int);
extern void ppinput(char*, char*, int);
extern int pplex(void);
extern void ppline(int, char*);
extern void ppop(int, ...);
extern void pppragma(char*, char*, char*, char*, int);
extern int ppprintf(char*, ...);
extern int ppsync(void);
#endif