[BACK]Return to internal.H CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / windows / mcpp

Annotation of OpenXM_contrib2/windows/mcpp/internal.H, Revision 1.1

1.1     ! ohara       1: /* $OpenXM$ */
        !             2: /*-
        !             3:  * Copyright (c) 1998, 2002-2008 Kiyoshi Matsui <kmatsui@t3.rim.or.jp>
        !             4:  * All rights reserved.
        !             5:  *
        !             6:  * Some parts of this code are derived from the public domain software
        !             7:  * DECUS cpp (1984,1985) written by Martin Minow.
        !             8:  *
        !             9:  * Redistribution and use in source and binary forms, with or without
        !            10:  * modification, are permitted provided that the following conditions
        !            11:  * are met:
        !            12:  * 1. Redistributions of source code must retain the above copyright
        !            13:  *    notice, this list of conditions and the following disclaimer.
        !            14:  * 2. Redistributions in binary form must reproduce the above copyright
        !            15:  *    notice, this list of conditions and the following disclaimer in the
        !            16:  *    documentation and/or other materials provided with the distribution.
        !            17:  *
        !            18:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
        !            19:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            20:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            21:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
        !            22:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            23:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            24:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            25:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            26:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            27:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            28:  * SUCH DAMAGE.
        !            29:  */
        !            30:
        !            31: /*
        !            32:  *                          I N T E R N A L . H
        !            33:  *      I n t e r n a l   D e f i n i t i o n s   f o r   M C P P
        !            34:  *
        !            35:  * In general, definitions in this file should not be changed by implementor.
        !            36:  */
        !            37:
        !            38: #ifndef SYSTEM_H
        !            39:     #error "system.H" must be included prior to "internal.H"
        !            40: #endif
        !            41:
        !            42: #include "mcpp_out.h"
        !            43:
        !            44: #if MCPP_LIB
        !            45: #include "mcpp_lib.h"   /* External interface when used as library  */
        !            46: #endif
        !            47:
        !            48: #define EOS             '\0'        /* End of string                */
        !            49: #define CHAR_EOF        0           /* Returned by get_ch() on eof  */
        !            50:
        !            51: #define VA_ARGS         (UCHARMAX + 1)      /* Signal of variable arguments */
        !            52: #define GVA_ARGS        (VA_ARGS * 2)       /* GCC-specific variable args   */
        !            53: #define AVA_ARGS        (VA_ARGS | GVA_ARGS)/* Any variable arguments       */
        !            54: #define DEF_PRAGMA      (-1 - AVA_ARGS)     /* _Pragma() pseudo-macro       */
        !            55: #define DEF_NOARGS      (-2 - AVA_ARGS)     /* #define foo vs #define foo() */
        !            56: #define DEF_NOARGS_PREDEF_OLD   (DEF_NOARGS - 1)
        !            57:                         /* Compiler-predefined macro without leading '_'    */
        !            58: #define DEF_NOARGS_PREDEF   (DEF_NOARGS - 2)/* Compiler-predefined macro    */
        !            59: #define DEF_NOARGS_STANDARD (DEF_NOARGS - 3)/* Standard predefined macro    */
        !            60: #define DEF_NOARGS_DYNAMIC  (DEF_NOARGS - 4)/* Standard dynamically defined */
        !            61:
        !            62: /*
        !            63:  * These magic characters must be control characters which can't be used
        !            64:  * in source file.
        !            65:  */
        !            66: /* for '#pragma MCPP debug macro_call' and -K option in STD mode.   */
        !            67: #define MAC_INF         0x18        /* Magic for macro informations */
        !            68: /* In STD and POST_STD modes (IN_SRC and TOK_SEP are for STD mode only).    */
        !            69: #define DEF_MAGIC       0x19        /* Magic to prevent recursive expansion */
        !            70: #define IN_SRC          0x1A        /* Magic of name from source    */
        !            71: #define RT_END          0x1C        /* Magic of macro rescan boundary   */
        !            72: #define ST_QUOTE        0x1D        /* Magic for stringizing        */
        !            73: #define CAT             0x1E        /* Token concatenation delim.   */
        !            74: #define TOK_SEP         0x1F        /* Magic to wrap expanded macro */
        !            75: /* In OLD_PREP mode.    */
        !            76: #define COM_SEP         0x1F        /* Comment of 0-length          */
        !            77:
        !            78: #define MAC_PARM        0x7F        /* Macro parameter signal       */
        !            79:
        !            80: /* Special character types  */
        !            81: #define LET             1           /* Letter (alphabet and _)      */
        !            82: #define DIG             2           /* Digit                        */
        !            83: #define DOT             4           /* . might start a number       */
        !            84: #define PUNC            8           /* Punctuators and operators    */
        !            85: #define QUO             0x10        /* Both flavors of quotation ",'*/
        !            86: #define SPA             0x20        /* White spaces                 */
        !            87: #define HSP             0x40
        !            88:                     /* Horizontal white spaces (' ', '\t', TOK_SEP) */
        !            89:
        !            90: /*
        !            91:  * Codes for operators used in #if expression.
        !            92:  * The value of the scanned operator is stored in 'openum'.
        !            93:  */
        !            94: #define INV             0           /* Invalid, must be zero        */
        !            95: #define OP_EOE          INV         /* End of expression            */
        !            96: #define VAL             1           /* Value (operand)              */
        !            97: #define OP_LPA          2           /* (    */
        !            98: /* The following are unary.     */
        !            99: #define FIRST_UNOP      OP_PLU      /* First unary operator         */
        !           100: #define OP_PLU          3           /* +    */
        !           101: #define OP_NEG          4           /* -    */
        !           102: #define OP_COM          5           /* ~    */
        !           103: #define OP_NOT          6           /* !    */
        !           104: #define LAST_UNOP       OP_NOT      /* Last unary operator          */
        !           105: /* The following are binary.    */
        !           106: #define FIRST_BINOP     OP_MUL      /* First binary operator        */
        !           107: #define OP_MUL          7           /* *    */
        !           108: #define OP_DIV          8           /* /    */
        !           109: #define OP_MOD          9           /* %    */
        !           110: #define OP_ADD          10          /* +    */
        !           111: #define OP_SUB          11          /* -    */
        !           112: #define OP_SL           12          /* <<   */
        !           113: #define OP_SR           13          /* >>   */
        !           114: #define OP_LT           14          /* <    */
        !           115: #define OP_LE           15          /* <=   */
        !           116: #define OP_GT           16          /* >    */
        !           117: #define OP_GE           17          /* >=   */
        !           118: #define OP_EQ           18          /* ==   */
        !           119: #define OP_NE           19          /* !=   */
        !           120: #define OP_AND          20          /* &    */
        !           121: #define OP_XOR          21          /* ^    */
        !           122: #define OP_OR           22          /* |    */
        !           123: #define OP_ANA          23          /* &&   */
        !           124: #define OP_ORO          24          /* ||   */
        !           125: #define OP_QUE          25          /* ?    */
        !           126: #define OP_COL          26          /* :    */
        !           127: #define LAST_BINOP      OP_COL      /* Last binary operator         */
        !           128: /* Parenthesis  */
        !           129: #define OP_RPA          27          /* )    */
        !           130: #define OP_END          28          /* End of expression marker     */
        !           131: #define OP_FAIL         (OP_END + 1)    /* For error returns        */
        !           132:
        !           133: /*
        !           134:  * The following are operators used in macro definition only.
        !           135:  */
        !           136: /* In STD and POST_STD modes.   */
        !           137: #define OP_STR          30          /* #    */
        !           138: #define OP_CAT          31          /* ##   */
        !           139: #define OP_ELL          32          /* ...  */
        !           140:
        !           141: /*
        !           142:  * The following are C source operators or punctuators,
        !           143:  * not preprocessing operators.
        !           144:  * Note: "sizeof", "defined" are read as identifier for convenience.
        !           145:  */
        !           146: #define OP_1            33  /* Any other single byte ops or puncs   */
        !           147:                                     /* =, ., ;, [, ], {, }, ','     */
        !           148: #define OP_2            34  /* Any other two bytes operators        */
        !           149:                     /* &=, |=, ++, +=, --, -=, ->, %=, *=, /=, ^=,  */
        !           150: #define OP_3            35  /* Three bytes operators :  <<=, >>=    */
        !           151: /*
        !           152:  * The following are operators spelled in digraphs.
        !           153:  */
        !           154: /* In STD and POST_STD modes.   */
        !           155: #define OP_LBRACE_D     0x40        /* <% i.e. {    */
        !           156: #define OP_RBRACE_D     0x41        /* %> i.e. }    */
        !           157: #define OP_LBRCK_D      0x42        /* <: i.e. [    */
        !           158: #define OP_RBRCK_D      0x43        /* :> i.e. ]    */
        !           159: #define OP_SHARP_D      0x44        /* %: i.e. #    */
        !           160: #define OP_DSHARP_D     0x45        /* %:%: i.e. ## */
        !           161: #define OP_DIGRAPH      0x40    /* (OP_*_D & OP_DIGRAPH) == 0x40    */
        !           162:
        !           163: /*
        !           164:  * The following are for lexical scanning only.
        !           165:  */
        !           166: /* Token types          */
        !           167: #define NO_TOKEN        0
        !           168: #define NAM             65          /* Identifier (name, keyword)   */
        !           169: #define NUM             66          /* Preprocessing number         */
        !           170: #define STR             67          /* Character string literal     */
        !           171: #define CHR             69          /* Integer character constant   */
        !           172:
        !           173: /* In STD and POST_STD modes.   */
        !           174: #define WSTR            68          /* Wide string literal          */
        !           175: #define WCHR            70          /* Wide character constant      */
        !           176:
        !           177: #define OPE             71          /* Operator or punctuator       */
        !           178: #define SPE             72          /* Unknown token (@ or others)  */
        !           179: #define SEP             73          /* Token separator or magics    */
        !           180:
        !           181: /*
        !           182:  * The following are values of 'mcpp_debug' variable which is set by the
        !           183:  * arguments of '#pragma MCPP debug' directive.
        !           184:  */
        !           185: #define PATH            1
        !           186: #define TOKEN           2
        !           187: #define EXPAND          4
        !           188: #define MACRO_CALL      8
        !           189: #define IF              16
        !           190: #define EXPRESSION      32
        !           191: #define GETC            64
        !           192: #define MEMORY          128
        !           193:
        !           194: /* MAC_* represent macro information types for -K option.   */
        !           195: #define MAC_CALL_START  1
        !           196: #define MAC_CALL_END    2
        !           197: #define MAC_ARG_START   3
        !           198: #define MAC_ARG_END     4
        !           199:
        !           200: /* MB_ERROR signals wrong multi-byte character sequence.    */
        !           201: #define MB_ERROR        0x8000
        !           202:
        !           203: #if MCPP_LIB && HOST_COMPILER == GNUC   \
        !           204:         && (SYS_FAMILY == SYS_UNIX && SYSTEM != SYS_CYGWIN)
        !           205:     /* For GCC 4.* on UNIXes    */
        !           206: #pragma GCC visibility push( hidden)    /* Hide these names from outside    */
        !           207: #endif
        !           208:
        !           209: /*
        !           210:  * The DEFBUF structure stores information about #defined macros.
        !           211:  * Note that DEFBUF->parmnames is parameter names catenated with commas,
        !           212:  * which is saved for the check of redefinition for STD mode.
        !           213:  * 'parmnames' and 'repl' are allocated to the area succeding to name.
        !           214:  */
        !           215: typedef struct defbuf {
        !           216:         struct defbuf * link;       /* Pointer to next def in chain */
        !           217:         short           nargs;      /* Number of parameters         */
        !           218:         char *          parmnames;  /* -> Parameter names catenated by ','  */
        !           219:         char *          repl;       /* Pointer to replacement text  */
        !           220:         const char *    fname;      /* Macro is defined in the source file  */
        !           221:         long            mline;      /*          at the line.        */
        !           222:         char            push;       /* Push level indicator         */
        !           223:         char            name[1];    /* Macro name                   */
        !           224: } DEFBUF;
        !           225:
        !           226: /*
        !           227:  * The FILEINFO structure stores information about open files and macros
        !           228:  * being expanded.
        !           229:  */
        !           230: typedef struct fileinfo {
        !           231:         char *          bptr;       /* Current pointer into buffer  */
        !           232:         long            line;       /* Current line number of file  */
        !           233:         FILE *          fp;         /* Source file if non-null      */
        !           234:         long            pos;        /* Position next to #include    */
        !           235:         struct fileinfo *   parent; /* Link to includer             */
        !           236:         struct ifinfo *     initif; /* Initial ifstack (return there on EOF)*/
        !           237:         int             sys_header; /* System header file or not    */
        !           238:         int             include_opt;        /* Specified by -include option */
        !           239:         const char **   dirp;       /* Include directory the file resides   */
        !           240:         const char *    src_dir;    /* Directory of source file     */
        !           241:         const char *    real_fname; /* Real file name               */
        !           242:         const char *    full_fname; /* Real full path list          */
        !           243:         char *          filename;   /* File/macro name (maybe changed)      */
        !           244:         char *          buffer;     /* Buffer of current input line */
        !           245: #if MCPP_LIB
        !           246:         /* Save output functions during push/pop of #includes   */
        !           247:         int (* last_fputc)  ( int c, OUTDEST od);
        !           248:         int (* last_fputs)  ( const char * s, OUTDEST od);
        !           249:         int (* last_fprintf)( OUTDEST od, const char * format, ...);
        !           250: #endif
        !           251: } FILEINFO;
        !           252:
        !           253: /*
        !           254:  * IFINFO stores information of conditional compilation.
        !           255:  */
        !           256: typedef struct ifinfo {
        !           257:         int             stat;       /* State of compilation         */
        !           258:         long            ifline;     /* Line #if started             */
        !           259:         long            elseline;   /* Line #else started           */
        !           260: } IFINFO;
        !           261:
        !           262: /*
        !           263:  * These bits are set in IFINFO.stat
        !           264:  */
        !           265: #define WAS_COMPILING   1           /* TRUE if compile set at entry */
        !           266: #define ELSE_SEEN       2           /* TRUE when #else processed    */
        !           267: #define TRUE_SEEN       4           /* TRUE when #if TRUE processed */
        !           268:
        !           269: #define compiling       ifstack[0].stat
        !           270:
        !           271: #define FP2DEST(fp) \
        !           272:     (fp == fp_out) ? OUT : \
        !           273:     ((fp == fp_err) ? ERR : \
        !           274:     ((fp == fp_debug) ? DBG : \
        !           275:     ((OUTDEST) -1)))
        !           276:
        !           277: /* VAL_SIGN structure stores information about evaluated number.    */
        !           278: typedef struct val_sign {
        !           279:         expr_t          val;        /* Value                        */
        !           280:         int             sign;       /* Signed, unsigned, error      */
        !           281: } VAL_SIGN;
        !           282:
        !           283: /* Values of VAL_SIGN.sign. */
        !           284: #define SIGNED          1
        !           285: #define UNSIGNED        0
        !           286: #define VAL_ERROR       (-1)
        !           287:
        !           288: /* LINE_COL stores information of line and column data  */
        !           289: typedef struct line_col {
        !           290:         long            line;
        !           291:         size_t          col;
        !           292: } LINE_COL;
        !           293:
        !           294: /* Value of macro_line on macro call error.         */
        !           295: #define MACRO_ERROR     (-1L)
        !           296:
        !           297: /*
        !           298:  * Values of insert_sep (flag of insertion of token separator).
        !           299:  * Used only in POST_STD mode.
        !           300:  */
        !           301: #define NO_SEP          0   /* No separator is inserted             */
        !           302: #define INSERT_SEP      1   /* Next get_ch() insert a separator     */
        !           303: #define INSERTED_SEP    2   /* Last get_ch() Inserted a separator   */
        !           304:
        !           305: #define str_eq(s1, s2)  (strcmp(s1, s2) == 0)
        !           306:
        !           307: #ifndef IO_SUCCESS
        !           308: #define IO_SUCCESS      0
        !           309: #endif
        !           310: #ifndef IO_ERROR
        !           311: #define IO_ERROR        (errno ? errno : 1)
        !           312: #endif
        !           313:
        !           314: /*
        !           315:  * Externs
        !           316:  */
        !           317:
        !           318: /* The minimum translation limits specified by the Standards.       */
        !           319: extern struct std_limits_ {
        !           320:         long    str_len;            /* Least maximum of string len. */
        !           321:         size_t  id_len;             /* Least maximum of ident len.  */
        !           322:         int     n_mac_pars;         /* Least maximum of num of pars.*/
        !           323:         int     exp_nest;           /* Least maximum of expr nest   */
        !           324:         int     blk_nest;           /* Least maximum of block nest  */
        !           325:         int     inc_nest;           /* Least maximum of include nest*/
        !           326:         long    n_macro;            /* Least maximum of num of macro*/
        !           327:         long    line_num;           /* Maximum source line number   */
        !           328: } std_limits;
        !           329: /* The boolean flags specified by the execution options.    */
        !           330: extern struct option_flags_ {
        !           331:         int     c;                  /* -C option (keep comments)    */
        !           332:         int     k;                  /* -k option (keep white spaces)*/
        !           333:         int     z;      /* -z option (no-output of included file)   */
        !           334:         int     p;                  /* -P option (no #line output)  */
        !           335:         int     q;                  /* -Q option (diag to mcpp.err) */
        !           336:         int     v;                  /* -v option (verbose)          */
        !           337:         int     trig;               /* -3 option (toggle trigraphs) */
        !           338:         int     dig;                /* -2 option (toggle digraphs)  */
        !           339:         int     lang_asm;           /* -a option (assembler source) */
        !           340:         int     no_source_line;     /* Do not output line in diag.  */
        !           341:         int     dollar_in_name;     /* Allow $ in identifiers       */
        !           342: } option_flags;
        !           343:
        !           344: extern int      mcpp_mode;          /* Mode of preprocessing        */
        !           345: extern int      stdc_val;           /* Value of __STDC__            */
        !           346: extern long     stdc_ver;           /* Value of __STDC_VERSION__    */
        !           347: extern long     cplus_val;          /* Value of __cplusplus for C++ */
        !           348: extern int      stdc2;      /* cplus_val or (stdc_ver >= 199901L)   */
        !           349: extern int      stdc3;      /* (stdc_ver or cplus_val) >= 199901L   */
        !           350: extern int      standard;           /* mcpp_mode is STD or POST_STD */
        !           351: extern int      std_line_prefix;    /* #line in C source style      */
        !           352: extern int      warn_level;         /* Level of warning             */
        !           353: extern int      errors;             /* Error counter                */
        !           354: extern long     src_line;           /* Current source line number   */
        !           355: extern int      wrong_line;         /* Force #line to compiler      */
        !           356: extern int      newlines;           /* Count of blank lines         */
        !           357: extern int      keep_comments;      /* Don't remove comments        */
        !           358: extern int      keep_spaces;        /* Don't remove white spaces    */
        !           359: extern int      include_nest;       /* Nesting level of #include    */
        !           360: extern const char *     null;       /* "" string for convenience    */
        !           361: extern const char **    inc_dirp;   /* Directory of #includer       */
        !           362: extern const char *     cur_fname;  /* Current source file name     */
        !           363: extern int      no_output;          /* Don't output included file   */
        !           364: extern int      in_directive;       /* In process of #directive     */
        !           365: extern int      in_define;          /* In #define line              */
        !           366: extern int      in_getarg;          /* Collecting arguments of macro*/
        !           367: extern int      in_include;         /* In #include line             */
        !           368: extern int      in_if;              /* In #if and non-skipped expr. */
        !           369: extern long     macro_line;         /* Line number of macro call    */
        !           370: extern char *   macro_name;         /* Currently expanding macro    */
        !           371: extern int      openum;             /* Number of operator or punct. */
        !           372: extern IFINFO *     ifptr;          /* -> current ifstack item      */
        !           373: extern FILEINFO *   infile;         /* Current input file or macro  */
        !           374: extern FILE *   fp_in;              /* Input stream to preprocess   */
        !           375: extern FILE *   fp_out;             /* Output stream preprocessed   */
        !           376: extern FILE *   fp_err;             /* Diagnostics stream           */
        !           377: extern FILE *   fp_debug;           /* Debugging information stream */
        !           378: extern int      insert_sep;         /* Inserted token separator flag*/
        !           379: extern int      mkdep;              /* Output source file dependency*/
        !           380: extern int      mbchar;             /* Encoding of multi-byte char  */
        !           381: extern int      mbchk;              /* Possible multi-byte char     */
        !           382: extern int      bsl_in_mbchar;      /* 2nd byte of mbchar has '\\'  */
        !           383: extern int      bsl_need_escape;/* '\\' in mbchar should be escaped */
        !           384: extern int      mcpp_debug;         /* Class of debug information   */
        !           385: extern long     in_asm;             /* In #asm - #endasm block      */
        !           386: extern jmp_buf  error_exit;         /* Exit on fatal error          */
        !           387: extern char *   cur_fullname;       /* Full name of current source  */
        !           388: extern short *  char_type;          /* Character classifier         */
        !           389: extern char *   workp;              /* Free space in work[]         */
        !           390: extern char * const     work_end;   /* End of work[] buffer         */
        !           391: extern char     identifier[];       /* Lastly scanned name          */
        !           392: extern IFINFO   ifstack[];          /* Information of #if nesting   */
        !           393: extern char     work_buf[];
        !           394:         /* Temporary buffer for directive line and macro expansion  */
        !           395:
        !           396: /* main.c   */
        !           397: extern void     un_predefine( int clearall);
        !           398:                 /* Undefine predefined macros   */
        !           399:
        !           400: /* directive.c  */
        !           401: extern void     directive( void);
        !           402:                 /* Process #directive line      */
        !           403: extern DEFBUF * do_define( int ignore_redef, int predefine);
        !           404:                 /* Do #define directive         */
        !           405: extern DEFBUF * look_id( const char * name);
        !           406:                 /* Look for a #define'd thing   */
        !           407: extern DEFBUF **    look_prev( const char * name, int * cmp);
        !           408:                 /* Look for place to insert def.*/
        !           409: extern DEFBUF * look_and_install( const char * name, int numargs
        !           410:         , const char * parmnames, const char * repl);
        !           411:                 /* Look and insert macro def.   */
        !           412: extern DEFBUF * install_macro( const char * name, int numargs
        !           413:         , const char * parmnames, const char * repl, DEFBUF ** prevp, int cmp
        !           414:         , int predefine);
        !           415:                 /* Install a def to symbol table*/
        !           416: extern int      undefine( const char * name);
        !           417:                 /* Delete from symbol table     */
        !           418: extern void     dump_a_def( const char * why, const DEFBUF * dp, int newdef
        !           419:         , int comment, FILE * fp);
        !           420:                 /* Dump a specific macro def    */
        !           421: extern void     dump_def( int comment, int K_opt);
        !           422:                 /* Dump current macro defs      */
        !           423:
        !           424: /* eval.c   */
        !           425: extern expr_t   eval_if( void);
        !           426:                 /* Evaluate #if expression      */
        !           427: extern VAL_SIGN *   eval_num( const char * nump);
        !           428:                 /* Evaluate preprocessing number*/
        !           429:
        !           430: /* expand.c */
        !           431: extern char *   (* expand_macro)( DEFBUF * defp, char * out, char * out_end
        !           432:         , LINE_COL line_col, int * pragma_op);
        !           433:                 /* Expand a macro completely    */
        !           434: extern void     expand_init( int compat, int strict_ansi);
        !           435:                 /* Initialize expand_macro()    */
        !           436: extern DEFBUF * is_macro( char ** cp);
        !           437:                 /* The sequence is a macro call?*/
        !           438:
        !           439: /* mbchar.c     */
        !           440: extern size_t   (* mb_read)( int c1, char ** in_pp, char ** out_pp);
        !           441:                 /* Read mbchar sequence         */
        !           442: extern const char *     set_encoding( char * name, char * env, int pragma);
        !           443:                 /* Multi-byte char encoding     */
        !           444: extern void     mb_init( void);
        !           445:                 /* Initialize mbchar variables  */
        !           446: extern uexpr_t  mb_eval( char ** seq_pp);
        !           447:                 /* Evaluate mbchar in #if       */
        !           448: extern int      last_is_mbchar( const char * in, int len);
        !           449:                 /* The line ends with MBCHAR ?  */
        !           450:
        !           451: /* support.c    */
        !           452: extern int      get_unexpandable( int c, int diag);
        !           453:                 /* Get next unexpandable token  */
        !           454: extern void     skip_nl( void);
        !           455:                 /* Skip to the end of the line  */
        !           456: extern int      skip_ws( void);
        !           457:                 /* Skip over white-spaces       */
        !           458: extern int      scan_token( int c, char ** out_pp, char * out_end);
        !           459:                 /* Get the next token           */
        !           460: extern char *   scan_quote( int delim, char * out, char * out_end, int diag);
        !           461:                 /* Scan a quoted literal        */
        !           462: extern int      id_operator( const char * name);
        !           463:                 /* Check identifier-like ops    */
        !           464: extern void     expanding( const char * name, int to_be_freed);
        !           465:                 /* Save macro name expanding    */
        !           466: extern void     clear_exp_mac( void);
        !           467:                 /* Clear expanding macro infs   */
        !           468: extern int      get_ch( void);
        !           469:                 /* Get the next char from input */
        !           470: extern int      cnv_trigraph( char * in);
        !           471:                 /* Do trigraph replacement      */
        !           472: extern int      cnv_digraph( char * in);
        !           473:                 /* Convert digraphs to usual tok*/
        !           474: extern void     unget_ch( void);
        !           475:                 /* Push back the char to input  */
        !           476: extern FILEINFO *   unget_string( const char * text, const char * name);
        !           477:                 /* Push back the string to input*/
        !           478: extern char *   save_string( const char * text);
        !           479:                 /* Stuff string in malloc mem.  */
        !           480: extern FILEINFO *   get_file( const char * name, const char * src_dir
        !           481:         , const char * fullname, size_t bufsize, int include_opt);
        !           482:                 /* New FILEINFO initialization  */
        !           483: extern char *   (xmalloc)( size_t size);
        !           484:                 /* Get memory or die            */
        !           485: extern char *   (xrealloc)( char * ptr, size_t size);
        !           486:                 /* Reallocate memory or die     */
        !           487: extern LINE_COL *   get_src_location( LINE_COL * p_line_col);
        !           488:                 /* Get location on source file  */
        !           489: extern void     cfatal( const char * format, const char * arg1, long arg2
        !           490:         , const char * arg3);
        !           491:                 /* Print a fatal error and exit */
        !           492: extern void     cerror( const char * format, const char * arg1, long arg2
        !           493:         , const char * arg3);
        !           494:                 /* Print an error message       */
        !           495: extern void     cwarn( const char * format, const char * arg1, long arg2
        !           496:         , const char * arg3);
        !           497:                 /* Print a warning message      */
        !           498: extern void     dump_string( const char * why, const char * text);
        !           499:                 /* Dump text readably           */
        !           500: extern void     dump_unget( const char * why);
        !           501:                 /* Dump all ungotten junk       */
        !           502: /* Support for alternate output mechanisms (e.g. memory buffers) */
        !           503: extern int      (* mcpp_fputc)( int c, OUTDEST od),
        !           504:                 (* mcpp_fputs)( const char * s, OUTDEST od),
        !           505:                 (* mcpp_fprintf)( OUTDEST od, const char * format, ...);
        !           506:
        !           507: /* system.c */
        !           508: extern void     do_options( int argc, char ** argv, char ** in_pp
        !           509:         , char ** out_pp);
        !           510:                 /* Process command line args    */
        !           511: extern void     init_sys_macro( void);
        !           512:                 /* Define system-specific macro */
        !           513: extern void     at_start( void);
        !           514:                 /* Commands prior to main input */
        !           515: extern void     put_depend( const char * filename);
        !           516:                 /* Output source dependency line*/
        !           517: extern int      do_include( int next);
        !           518:                 /* Process #include directive   */
        !           519: extern void     add_file( FILE * fp, const char * src_dir
        !           520:         , const char * filename, const char * fullname, int include_opt);
        !           521:                 /* Chain the included file      */
        !           522: extern void     sharp( FILEINFO * sharp_file, int marker);
        !           523:                 /* Output # line number         */
        !           524: extern void     do_pragma( void);
        !           525:                 /* Process #pragma directive    */
        !           526: extern void     put_asm( void);
        !           527:                 /* Putout an asm code line      */
        !           528: extern void     do_old( void);
        !           529:                 /* Process older directives     */
        !           530: extern void     at_end( void);
        !           531:                 /* Do the final commands        */
        !           532: extern void     print_heap( void);
        !           533:                 /* Print blocks of heap memory  */
        !           534: #if ! HOST_HAVE_STPCPY
        !           535: extern char *   stpcpy( char * dest, const char * src);
        !           536:                 /* Non-Standard library function*/
        !           537: #endif
        !           538:
        !           539: #if MCPP_LIB    /* Setting to use mcpp as a subroutine  */
        !           540: /* directive.c  */
        !           541: extern void     clear_symtable( void);
        !           542:                 /* Free all macro definitions   */
        !           543: /* system.c     */
        !           544: extern void     clear_filelist( void);
        !           545:                 /* Free filename and directory list     */
        !           546: /* The following 5 functions are to Initialize static variables.    */
        !           547: /* directive.c  */
        !           548: extern void     init_directive( void);
        !           549: /* eval.c   */
        !           550: extern void     init_eval( void);
        !           551: /* support.c    */
        !           552: extern void     init_support( void);
        !           553: /* system.c */
        !           554: extern void     init_system( void);
        !           555:
        !           556: #if HOST_COMPILER == GNUC && (SYS_FAMILY == SYS_UNIX && SYSTEM != SYS_CYGWIN)
        !           557: #pragma GCC visibility pop
        !           558: #endif
        !           559: #endif
        !           560:
        !           561: #if HOST_HAVE_STPCPY
        !           562: extern char *   stpcpy( char * dest, const char * src);
        !           563: #endif

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