|
|
1.1 ! root 1: #ifndef SYMBOL_H ! 2: #define SYMBOL_H ! 3: ! 4: /* ! 5: *-IMPORTS: ! 6: * <sys/compat.h> ! 7: * CONST ! 8: * EXTERN_C_BEGIN ! 9: * EXTERN_C_END ! 10: * PROTO () ! 11: * <stddef.h> ! 12: * size_t ! 13: */ ! 14: ! 15: #include <sys/compat.h> ! 16: #include <stddef.h> ! 17: ! 18: ! 19: /* ! 20: * Don't pull in the other application #includes. ! 21: */ ! 22: ! 23: #ifndef BUILD_T ! 24: #define BUILD_T ! 25: typedef struct builder build_t; ! 26: #endif ! 27: ! 28: #ifndef INPUT_T ! 29: #define INPUT_T ! 30: typedef struct input input_t; ! 31: #endif ! 32: ! 33: #ifndef SYMBOL_T ! 34: #define SYMBOL_T ! 35: typedef struct symbol symbol_t; ! 36: #endif ! 37: ! 38: #ifndef LEX_T ! 39: #define LEX_T ! 40: typedef struct lexinfo lex_t; ! 41: #endif ! 42: ! 43: #ifndef TOKEN_T ! 44: #define TOKEN_T ! 45: typedef struct token token_t; ! 46: #endif ! 47: ! 48: ! 49: /* ! 50: * This is the structure tokens are built into. ! 51: */ ! 52: ! 53: struct symbol { ! 54: symbol_t * s_next; /* next symbol */ ! 55: CONST unsigned char ! 56: * s_data; /* octets occupied by symbol data */ ! 57: size_t s_size; /* length of symbol data */ ! 58: }; ! 59: ! 60: ! 61: /* ! 62: * Alternate EOF character so our clients don't have to pull in <stdio.h>, ! 63: * should be the same as READ_EOF and IN_EOF. ! 64: */ ! 65: ! 66: #define SYM_EOF -1 ! 67: ! 68: ! 69: typedef int (* dev_func_p) PROTO ((input_t * _input, lex_t * _lexp)); ! 70: ! 71: ! 72: EXTERN_C_BEGIN ! 73: ! 74: int symbol_init PROTO ((void)); ! 75: ! 76: void read_dev_file PROTO ((CONST char * _name, ! 77: dev_func_p _devfuncp)); ! 78: int read_symbol PROTO ((input_t * _input, lex_t * _lexp, ! 79: symbol_t ** _sym)); ! 80: symbol_t * sym_intern PROTO ((token_t * tok)); ! 81: symbol_t * sym_find PROTO ((CONST unsigned char * data, ! 82: size_t len)); ! 83: symbol_t * string_to_symbol PROTO ((CONST unsigned char * str, ! 84: size_t len)); ! 85: ! 86: EXTERN_C_END ! 87: ! 88: #endif /* ! defined (SYMBOL_H) */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.