[BACK]Return to cpp.h CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / windows / cpp

Annotation of OpenXM_contrib2/windows/cpp/cpp.h, Revision 1.1.1.1

1.1       noro        1: /*
                      2:  * Copyright (c) 1994-2000 FUJITSU LABORATORIES LIMITED
                      3:  * All rights reserved.
                      4:  *
                      5:  * FUJITSU LABORATORIES LIMITED ("FLL") hereby grants you a limited,
                      6:  * non-exclusive and royalty-free license to use, copy, modify and
                      7:  * redistribute, solely for non-commercial and non-profit purposes, the
                      8:  * computer program, "Risa/Asir" ("SOFTWARE"), subject to the terms and
                      9:  * conditions of this Agreement. For the avoidance of doubt, you acquire
                     10:  * only a limited right to use the SOFTWARE hereunder, and FLL or any
                     11:  * third party developer retains all rights, including but not limited to
                     12:  * copyrights, in and to the SOFTWARE.
                     13:  *
                     14:  * (1) FLL does not grant you a license in any way for commercial
                     15:  * purposes. You may use the SOFTWARE only for non-commercial and
                     16:  * non-profit purposes only, such as academic, research and internal
                     17:  * business use.
                     18:  * (2) The SOFTWARE is protected by the Copyright Law of Japan and
                     19:  * international copyright treaties. If you make copies of the SOFTWARE,
                     20:  * with or without modification, as permitted hereunder, you shall affix
                     21:  * to all such copies of the SOFTWARE the above copyright notice.
                     22:  * (3) An explicit reference to this SOFTWARE and its copyright owner
                     23:  * shall be made on your publication or presentation in any form of the
                     24:  * results obtained by use of the SOFTWARE.
                     25:  * (4) In the event that you modify the SOFTWARE, you shall notify FLL by
                     26:  * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification
                     27:  * for such modification or the source code of the modified part of the
                     28:  * SOFTWARE.
                     29:  *
                     30:  * THE SOFTWARE IS PROVIDED AS IS WITHOUT ANY WARRANTY OF ANY KIND. FLL
                     31:  * MAKES ABSOLUTELY NO WARRANTIES, EXPRESSED, IMPLIED OR STATUTORY, AND
                     32:  * EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS
                     33:  * FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT OF THIRD PARTIES'
                     34:  * RIGHTS. NO FLL DEALER, AGENT, EMPLOYEES IS AUTHORIZED TO MAKE ANY
                     35:  * MODIFICATIONS, EXTENSIONS, OR ADDITIONS TO THIS WARRANTY.
                     36:  * UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT,
                     37:  * OR OTHERWISE, SHALL FLL BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
                     38:  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL
                     39:  * DAMAGES OF ANY CHARACTER, INCLUDING, WITHOUT LIMITATION, DAMAGES
                     40:  * ARISING OUT OF OR RELATING TO THE SOFTWARE OR THIS AGREEMENT, DAMAGES
                     41:  * FOR LOSS OF GOODWILL, WORK STOPPAGE, OR LOSS OF DATA, OR FOR ANY
                     42:  * DAMAGES, EVEN IF FLL SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF
                     43:  * SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. EVEN IF A PART
                     44:  * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
                     45:  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
                     46:  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
                     47:  *
                     48:  * $OpenXM: OpenXM_contrib2/asir2000/parse/cpp.h,v 1.3 2000/08/22 05:04:26 noro Exp $
                     49: */
                     50: #ifndef _ACCUM_
                     51: #define _ACCUM_
                     52:
                     53: #include <string.h>
                     54:
                     55: typedef struct {
                     56:          int have;
                     57:          int used;
                     58:          char *buf; } ACCUM;
                     59:
                     60: char *init_accum(void);
                     61: char *accum_result(char *A);
                     62: char accum_regret(char *A);
                     63: char *accum_buf(char *A);
                     64:
                     65: #endif
                     66: #ifndef _EXPR_
                     67: #define _EXPR_
                     68:
                     69: typedef struct _node {
                     70:          int leaf;
                     71:          char *name;
                     72:          struct _node *left;
                     73:          struct _node *right;
                     74:          int op; } NODE;
                     75:
                     76: NODE *read_expr();
                     77: NODE *read_expr_p(void);
                     78:
                     79: extern int expr_sharp;
                     80:
                     81: #endif
                     82: #ifndef _IF_
                     83: #define _IF_
                     84:
                     85: typedef struct _if {
                     86:          struct _if *next;
                     87:          int condstate; } IF;
                     88: #define IFSTATE_TRUE 0
                     89: #define IFSTATE_FALSE 1
                     90: #define IFSTATE_STAYFALSE 2
                     91:
                     92: extern IF *ifstack;
                     93: extern int n_skipped_ifs;
                     94:
                     95: #endif
                     96: #ifndef _IO_
                     97: #define _IO_
                     98:
                     99: #include <stdio.h>
                    100:
                    101: #if 0
                    102: #define MAX_PUSHBACK 8192
                    103: #define MAXFILES 20
                    104: #endif
                    105: #define MAX_PUSHBACK 512
                    106: #define MAXFILES 4
                    107:
                    108: extern int linefirst;
                    109: extern int willbefirst;
                    110:
                    111: #define outfile cpp_outfile
                    112: extern FILE *outfile;
                    113:
                    114: /*
                    115: extern int fstackdepth;
                    116: extern char pushback[_NFILE][MAX_PUSHBACK];
                    117: extern int npushed[_NFILE];
                    118: extern FILE *fstack[_NFILE];
                    119: extern char *fn[_NFILE];
                    120: extern char *incldir[_NFILE];
                    121: extern int lineno[_NFILE];
                    122: */
                    123:
                    124: char Get(void);
                    125: char getnonspace(void);
                    126: char getnonhspace(void);
                    127: char getnhsexpand(void);
                    128: char getexpand(void);
                    129: char *curfile(void);
                    130: char **Curfile(void);
                    131: int curline(void);
                    132: int *Curline(void);
                    133: char *curdir(void);
                    134: char **Curdir(void);
                    135: char *read_ctrl(void);
                    136: char *read_ident(void);
                    137:
                    138: #endif
                    139: #ifndef _IS_
                    140: #define _IS_
                    141:
                    142: #include <ctype.h>
                    143:
                    144: int ishspace(char c);
                    145: int isbsymchar(char c);
                    146: int issymchar(char c);
                    147:
                    148: #endif
                    149: #ifndef _MALLOC_
                    150: #define _MALLOC_
                    151:
                    152: #if 0
                    153: #define malloc check0_malloc
                    154: #define realloc check0_realloc
                    155: #endif
                    156:
                    157: #if defined(THINK_C)
                    158: char *malloc(int);
                    159: char *realloc(void *,int);
                    160: #else
                    161: char *malloc(size_t);
                    162: char *realloc(void *, size_t);
                    163: #endif
                    164: char *copyofstr(char *str);
                    165: char *copyofblk(char *blk, int len);
                    166: #define NEW(type) ((type *) malloc((int)sizeof(type)))
                    167: #define OLD(x) free((char *) x)
                    168: #define check_malloc(ptr) Check_malloc((char *)(ptr))
                    169:
                    170: #endif
                    171: #ifndef _STATS_H_9617d11a_
                    172: #define _STATS_H_9617d11a_
                    173:
                    174: extern int n_defines;
                    175: extern int n_undefines;
                    176: extern int n_hits;
                    177: extern int n_misses;
                    178:
                    179: #endif
                    180: #ifndef _SYMTBL_
                    181: #define _SYMTBL_
                    182:
                    183: typedef struct _def {
                    184:          struct _def *link;
                    185:          char *name;
                    186:          int nargs;
                    187:          unsigned char *repl;
                    188:          int how;
                    189: #define DEF_PREDEF  0
                    190: #define DEF_CMDLINE 1
                    191: #define DEF_DEFINE  2
                    192:          } DEF;
                    193:
                    194: extern DEF **symtbl;
                    195: extern int symtbl_size;
                    196: extern int n_in_table;
                    197:
                    198: DEF *find_def(char *name);
                    199:
                    200: #endif
                    201: #ifndef unctrl
                    202: #define unctrl(c) _unctrl[0xff&(int)(c)]
                    203: #define Unctrl(c) _Unctrl[0xff&(int)(c)]
                    204: extern char *_unctrl[];
                    205: extern char *_Unctrl[];
                    206: #endif
                    207:
                    208: void dump_single(DEF *);
                    209: void dump_expr(NODE *);
                    210: void do_at(void);
                    211: void do_debug(void);
                    212: void read_formals(void);
                    213: void do_dump(void);
                    214: void err_head(void);
                    215: void do_eval(void);
                    216: int get_quote_char(void);
                    217: NODE *read_expr_11(void);
                    218: NODE *read_expr_10(void);
                    219: NODE *read_expr_9(void);
                    220: NODE *read_expr_8(void);
                    221: NODE *read_expr_7(void);
                    222: NODE *read_expr_6(void);
                    223: NODE *read_expr_5(void);
                    224: NODE *read_expr_4(void);
                    225: NODE *read_expr_3(void);
                    226: NODE *read_expr_2(void);
                    227: NODE *read_expr_1(void);
                    228: NODE *read_expr_0(void);
                    229: NODE *read_expr_(void);
                    230: NODE *read_expr_p(void);
                    231: void iftrue(void);
                    232: void iffalse(void);
                    233: void init_include(void);
                    234: void flush_final_nl(void);
                    235: void input_mark(void);
                    236: void input_unmark(void);
                    237: void input_recover(void);
                    238: void mark_file_beginning(void);
                    239: void mark_file_ending(void);
                    240: void mark_charpushed(void);
                    241: void mark_get_line(void);
                    242: void do_line(void);
                    243: void do_pragma(void);
                    244: void do_set(void);
                    245: void do_sharp(void);
                    246: void flush_sharp_line(void);
                    247: void init_stats(void);
                    248: void save_stats(void);
                    249: void init_symtbl(void);
                    250: void undef_predefs(void);
                    251: void do_while(void);
                    252: void do_endwhile(void);
                    253: void Check_malloc(char * ptr);
                    254:
                    255: void output_ifstate(int state);
                    256: void out_at(int line, char *file);
                    257: void outputc(char c);
                    258: void outputs(char *s);
                    259: void outputd(int n);
                    260:
                    261: void do_at(void);
                    262: void do_debug(void);
                    263: void do_define(int sharp, int redef);
                    264: void do_dump(void);
                    265: void do_eval(void);
                    266: void do_if(int expr_sharp);
                    267: void do_ifdef(int expr_sharp);
                    268: void do_ifndef(int expr_sharp);
                    269: void do_else(int expr_sharp);
                    270: void do_elif(int expr_sharp);
                    271: void do_endif(int expr_sharp);
                    272: void do_include(int expr_sharp);
                    273: void do_line(void);
                    274: void do_pragma(void);
                    275: void do_set(void);
                    276: void do_sharp(void);
                    277: void do_undef(int expr_sharp);
                    278: void do_while(void);
                    279: void do_endwhile(void);
                    280: int free(char *);
                    281: void Push(char);
                    282: void putx(int);
                    283: void Bcopy(char *from, char *to, int len);
                    284: void maybe_print(char);
                    285: void read_include_file(char *,int,int);
                    286: void mark_got_from_pushback(char);
                    287: void mark_got_from_file(char);
                    288: void mark_got(char);
                    289: void define(char *,int,unsigned char *,int);
                    290: int undef(char *);
                    291: void push_new_file(char *,FILE *);
                    292: void defd(char *,int);
                    293: void free_expr(NODE *n);
                    294: int in_false_if(void);
                    295: int eval_expr(int,int);
                    296: void abort();

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>