⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ctypes.h

📁 Open Watcom 的 C 编译器源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
    union {
        struct textsegment  *seginfo;       /* 26-oct-91 */
        int                 seginfo_index;  /* for pre-compiled header */
    };
    type_modifiers  attrib;   /* LANG_CDECL, _PASCAL, _FORTRAN */
    sym_flags       flags;
    unsigned char   level;
    struct {
        unsigned char stg_class  : 3;
        unsigned char declspec   : 2;
        unsigned char naked      : 1;
        unsigned char is_parm    : 1;
        unsigned char rent       : 1;
    };
} SYM_ENTRY, *SYMPTR;

typedef struct parm_entry {
    struct  parm_entry      *next_parm;
    SYM_ENTRY               sym;
} PARM_ENTRY, *PARMPTR;


typedef struct field_entry {
    union {
        struct field_entry *next_field;
        int    field_len;           /* used for pre-compiled header */
    };
    union {
        TYPEPTR field_type;
        int     field_type_index;   /* used for pre-compiled header */
    };
    XREFPTR xref;
#if _CPU == 386
    unsigned long offset;
#else
    unsigned offset;
#endif
    type_modifiers  attrib;         /* LANG_CDECL, _PASCAL, _FORTRAN */
    int     level;
    int     hash;
    struct  field_entry *next_field_same_hash;
    char    name[1];
} FIELD_ENTRY, *FIELDPTR;

#define FIELD_HASH_SIZE SYM_HASH_SIZE

typedef struct enum_entry {
    struct  enum_entry *next_enum;  /* used in hash table */
    struct  enum_entry *thread;     /* list belonging to same enum */
    XREFPTR xref;
    union {
        struct tag_entry *parent;
        int  enum_len;              /* for pre-compiled header */
    };
    int     hash;
    uint64  value;
    char    name[1];
} ENUMDEFN, *ENUMPTR;

typedef struct enum_info {          /* used to obtain info about an ENUM */
    struct tag_entry    *parent;
    int                 level;
    uint64              value;
} ENUM_INFO;

typedef struct tag_entry {
    struct tag_entry *next_tag;
    union {
        TYPEPTR sym_type;
        int     sym_type_index;     /* for pre-compiled header */
    };
    XREFPTR xref;
    union {
        ENUMPTR  enum_list;         /* for ENUM */
        FIELDPTR field_list;        /* for STRUCT or UNION */
    } u;
    unsigned long size;             /* size of STRUCT, UNION or ENUM */
    union {
        int         refno;
        int         tag_index;      /* for pre-compiled header */
    };
#if _HOST == 386
    unsigned short  hash;           /* hash value for tag */
    char            level;
    unsigned char   alignment;      /* alignment required */
#else
    unsigned        hash;
    unsigned        level;
    unsigned        alignment;
#endif
    union   {
        ENUMPTR  last_enum;         /* for ENUM */
        FIELDPTR last_field;        /* for STRUCT or UNION */
    };
    char            name[1];
} TAGDEFN, *TAGPTR;

#define TAG_HASH_SIZE   SYM_HASH_SIZE
extern  void WalkTagList( void (*func)(TAGPTR) );

typedef struct {
    union   {
        long        long_values[2];
        int64       long64;
        double      double_value;
        long_double long_double_value;
        STR_HANDLE  string_leaf;
        struct {
            long        offset;
            SYM_HANDLE  sym_handle;
        } var;
    } u;
#if _HOST == 386
    byte    opr;            /* contains T_xxxx token value */
    byte    flags;
#else
    int     opr;            /* contains T_xxxx token value */
    int     flags;
#endif
} DATA_QUAD;

/* flags for QUAD.flags field */

enum quad_flags {           /* code data */
    Q_2_INTS_IN_ONE = 0x02, /*       Y02   two integral values */
    Q_DATA          = 0x04, /*  Y04  Y04   DATA_QUAD */
    Q_NEAR_POINTER  = 0x08, /*       Y08   near T_ID */
    Q_FAR_POINTER   = 0x10, /*       Y10   far T_ID */
    Q_CODE_POINTER  = 0x20, /*       Y20   function name */
    Q_REPEATED_DATA = 0x80, /*       Y80   repeated data item */
    Q_NULL          = 0x00
};

typedef struct {
    TYPEPTR              typ;       // type seen
    int                  seg;       // seg from a typedef
    stg_classes          stg;       // storage class
    type_modifiers       mod;       // const, vol flags
    declspec_class       decl;      // dllimport...
    bool                 naked;     // declspec naked
} decl_info;

typedef enum {
    DECL_STATE_NONE    = 0x00,
    DECL_STATE_NOTYPE  = 0x01,
    DECL_STATE_ISPARM  = 0x02,
    DECL_STATE_NOSTWRN = 0x04,
} decl_state;

#include <stddef.h>
#include "cgaux.h"
#include "cops.h"

typedef struct label_entry {
    struct symtab_entry     *thread;
    struct label_entry      *next_label;
    LABEL_INDEX             ref_list;
    unsigned                defined     : 1;
    unsigned                referenced  : 1;
    char                    name[1];
} LABELDEFN, *LABELPTR;

struct segment_list {
    struct segment_list     *next_segment;
    int                     segment_number;
    unsigned                size_left;
};

struct debug_fwd_types {
    struct  debug_fwd_types *next;
    TYPEPTR                 typ;
    char                    *debug_name;
    unsigned                scope;
};

struct seg_info {
    SEGADDR_T index;        /* segment #, EMS page #, disk seek # */
    unsigned allocated : 1; /* 1 => has been allocated */
};

/* scoreboard used to record statements like "i=5" */

struct scoreboard {
    struct scoreboard   *next;
    SYM_HANDLE          sym_handle;
    TREEPTR             const_leaf;
};

struct comp_flags {
    unsigned label_dropped          : 1;
    unsigned has_main               : 1;
    unsigned float_used             : 1;
    unsigned signed_char            : 1;
    unsigned stats_printed          : 1;
    unsigned far_strings            : 1;
    unsigned check_syntax           : 1;
    unsigned meaningless_stmt       : 1;

    unsigned pre_processing         : 2;    /* values: 0,1,2 */
    unsigned scanning_cpp_comment   : 1;
    unsigned inside_asm_stmt        : 1;
    unsigned thread_data_present    : 1;    /* __declspec(thread) */
    unsigned in_finally_block       : 1;    /* in _finally { ... } */
    unsigned unix_ext               : 1;    /* like sizeof( void ) == 1 */
    unsigned slack_byte_warning     : 1;

    unsigned ef_switch_used         : 1;
    unsigned in_pragma              : 1;
    unsigned br_switch_used         : 1;    /* -br: use DLL C runtime */
    unsigned extensions_enabled     : 1;
    unsigned inline_functions       : 1;
    unsigned auto_agg_inits         : 1;
    unsigned use_full_codegen_od    : 1;
    unsigned has_wchar_entry        : 1;

    unsigned bc_switch_used         : 1;    /* build charater mode */
    unsigned bg_switch_used         : 1;    /* build gui      mode */
    unsigned emit_library_any       : 1;
    unsigned emit_targimp_symbols   : 1;    /* emit per target auto symbols */
    unsigned low_on_memory_printed  : 1;
    unsigned extra_stats_wanted     : 1;
    unsigned external_defn_found    : 1;
    unsigned scanning_comment       : 1;
    unsigned initializing_data      : 1;

    unsigned dump_prototypes        : 1;    /* keep typedefs in prototypes*/
    unsigned non_zero_data          : 1;
    unsigned quiet_mode             : 1;
    unsigned useful_side_effect     : 1;
    unsigned keep_comments          : 1;    /* wcpp - output comments */
    unsigned cpp_line_wanted        : 1;    /* wcpp - emit #line    */
    unsigned generate_prototypes    : 1;    /* generate prototypes  */
    unsigned no_conmsg              : 1;    /* don't write wng &err to console */

    unsigned bss_segment_used       : 1;
    unsigned zu_switch_used         : 1;
    unsigned extended_defines       : 1;
    unsigned errfile_written        : 1;
    unsigned main_has_parms         : 1;    /* on if "main" has parm(s) */
    unsigned pcode_generated        : 1;    /* on if pcode generated */
    unsigned register_conventions   : 1;    /* on for -3r, off for -3s */
    unsigned pgm_used_8087          : 1;    /* on => 8087 ins. generated */

    unsigned emit_library_with_main : 1;    /* on => put LIB name in obj */
    unsigned strings_in_code_segment: 1;    /* on => put strings in CODE */
    unsigned ok_to_use_precompiled_hdr: 1;  /* on => ok to use PCH */
    unsigned strict_ANSI            : 1;    /* on => strict ANSI C (-zA)*/
    unsigned expand_macros          : 1;    /* on => expand macros in WCPP*/
    unsigned exception_filter_expr  : 1;    /* on => parsing _except(expr)*/
    unsigned exception_handler      : 1;    /* on => inside _except block*/
    unsigned comments_wanted        : 1;    /* on => comments wanted     */

    unsigned wide_char_string       : 1;    /* on => T_STRING is L"xxx"  */
    unsigned banner_printed         : 1;    /* on => banner printed      */
    unsigned undefine_all_macros    : 1;    /* on => -u all macros       */
    unsigned emit_browser_info      : 1;    /* -db emit broswer info */
    unsigned cppi_segment_used      : 1;    /* C++ initializer segment */
    unsigned rescan_buffer_done     : 1;    /* ## re-scan buffer used up */
    unsigned cpp_output             : 1;    /* WCC doing CPP output      */
    unsigned cpp_output_to_file     : 1;    /* WCC doing CPP output to?.i*/

/*  /d1+
    generate info on BP-chains if possible
    generate sym info on the following items:
            - autos with address taken
            - autos of type struct or array
            - externs and statics
            - parms with /3s
*/
    unsigned debug_info_some        : 1;    /* d1 + some typing info     */
    unsigned register_conv_set      : 1;    /* has call conv been set    */
    unsigned emit_names             : 1;    /* /en switch used           */
    unsigned cpp_output_requested   : 1;    /* CPP output requested      */
    unsigned warnings_cause_bad_exit: 1;    /* warnings=>non-zero exit   */
    unsigned save_restore_segregs   : 1;    /* save/restore segregs      */
    unsigned has_winmain            : 1;    /* WinMain defined           */
    unsigned make_enums_an_int      : 1;    /* force all enums to be int */
    unsigned original_enum_setting  : 1;    /* reset value if pragma used*/

    unsigned zc_switch_used         : 1;    /* -zc switch specified   */
    unsigned use_unicode            : 1;    /* use unicode for L"abc" */
    unsigned op_switch_used         : 1;    /* -op force floats to mem */
    unsigned no_debug_type_names    : 1;    /* -d2~ switch specified  */
    unsigned asciiout_used          : 1;    /* (asciiout specified  */
    unsigned noxedit_used           : 1;    /* (noxedit specified  */
    unsigned in_pcode_func          : 1;    /* generating Pcode */
    unsigned addr_of_auto_taken     : 1;    /*=>can't opt tail recursion*/

    unsigned pcode_was_generated    : 1;    /* some funcs were pcoded */
    unsigned continued_string       : 1;    /* continuing big string */
    unsigned sg_switch_used         : 1;    /* /sg switch used */
    unsigned bm_switch_used         : 1;    /* /bm switch used */
    unsigned bd_switch_used         : 1;    /* /bd switch used */
    unsigned bw_switch_used         : 1;    /* /bw switch used */
    unsigned zm_switch_used         : 1;    /* /zm switch used */
    unsigned has_libmain            : 1;    /* LibMain defined */

    unsigned ep_switch_used         : 1;    /* emit prolog hooks */
    unsigned ee_switch_used         : 1;    /* emit epilog hooks */
    unsigned dump_types_with_names  : 1;    /* -d3 information */
    unsigned ec_switch_used         : 1;    /* emit coverage hooks */
    unsigned jis_to_unicode         : 1;    /* convert JIS to UNICODE */
    unsigned using_overlays         : 1;    /* user doing overlays */
    unsigned unique_functions       : 1;    /* func addrs are unique */
    unsigned st_switch_used         : 1;    /* touch stack through esp */

    unsigned make_precompiled_header: 1;    /* make precompiled header */
    unsigned emit_dependencies      : 1;    /* include file dependencies*/
    unsigned multiple_code_segments : 1;    /* more than 1 code seg */
    unsigned returns_promoted       : 1;    /* return char/short as int */
    unsigned pending_dead_code      : 1;    /* aborts func in an expr */
    unsigned use_precompiled_header : 1;    /* use precompiled header */
    unsigned doing_macro_expansion  : 1;    /* doing macro expansion */
    unsigned no_pch_warnings        : 1;    /* disable PCH warnings */

    unsigned align_structs_on_qwords: 1;    /* for ALPHA */
    unsigned axp_align_emu          : 1;    /* for ALPHA */
    unsigned no_check_inits         : 1;    /* ease init  type checking*/
    unsigned no_check_qualifiers    : 1;    /* ease qualifier mismatch */
    unsigned curdir_inc             : 1;    /* check current dir for include files */
    unsigned use_stdcall_at_number  : 1;    /* add @nn thing */
    unsigned rent                   : 1;    /* make re-entrant r/w split thind  */
    unsigned unaligned_segs         : 1;    /* don't align segments */
    unsigned trigraph_alert         : 1;    /* trigraph char alert */

    unsigned generate_auto_depend   : 1;    /* Generate make auto depend file */
    unsigned c99_extensions         : 1;    /* C99 extensions enabled */
    unsigned use_long_double        : 1;    /* Make CC send long double types to code gen */
};

struct global_comp_flags {  // things that live across compiles
    unsigned cc_reuse               : 1;    /* in a resuable version batch, dll*/
    unsigned cc_first_use           : 1;    /* first time thru           */
};

#if (_OS == _QNX) || (_OS == _LINUX)
    #define errout  stderr
#else
    #define errout  stdout
#endif

/* Target System types */
enum {
    TS_OTHER,
    TS_DOS,
    TS_NT,
    TS_WINDOWS,
    TS_CHEAP_WINDOWS,
    TS_NETWARE,
    TS_OS2,
    TS_QNX,
    TS_NETWARE5,
    TS_LINUX
};

/*
   return values from CompatibleType
*/
/* values for ESCChar routine */
#define RTN_SAVE_NEXT_CHAR      0
#define RTN_NEXT_BUF_CHAR       1

typedef struct call_list {
    struct call_list   *next;
    TREEPTR             callnode;
    unsigned            source_fno;     // OPR_STMT
    int                 srclinenum;     // OPR_STMT, and OPR_NOP for callnode
} call_list;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -