|
|
1.1 ! root 1: #include <stdio.h> ! 2: ! 3: /* ! 4: * Cemantics. Intelligent C loader and binder. ! 5: */ ! 6: ! 7: #ifndef DEBUG ! 8: #define DEBUG 1 ! 9: #endif DEBUG ! 10: ! 11: /* ! 12: * LIB_PATH is prefix for library pathnames. ! 13: * -lxxx maps to LIB_PATHxxx ! 14: */ ! 15: #ifndef LIB_PATH ! 16: #define LIB_PATH "/usr/lib/cyntax/lib" ! 17: #endif LIB_PATH ! 18: ! 19: /* ! 20: * ALLOC_SIZE Memory allocation chunk for alloc() style macros. ! 21: * OUTZ Output buffer size. ! 22: * STABZ Symbol table size. ! 23: * STR_INC String allocation increment (page pointers). ! 24: */ ! 25: #define ALLOC_SIZE (8*1024) ! 26: #define OUTZ (4*1024) ! 27: #define STABZ 251 ! 28: #define STR_INC 16 ! 29: ! 30: typedef struct inst inst; ! 31: typedef struct symbol symbol; ! 32: typedef struct type type; ! 33: typedef struct var var; ! 34: ! 35: extern char *alloc_end; ! 36: extern char *alloc_ptr; ! 37: extern char *my_name; ! 38: extern char *load_out; ! 39: extern int debug; ! 40: extern int errors; ! 41: extern int file_errors; ! 42: extern int in_lib; ! 43: extern int modtimes; ! 44: extern int out_fid; ! 45: extern int pedantic; ! 46: extern int tell_times; ! 47: extern int verbose; ! 48: extern char *data_base; ! 49: extern char *str_base; ! 50: extern char *data_end; ! 51: extern char *data_ptr; ! 52: extern long new_type_index; ! 53: extern long str_num; ! 54: extern long type_index; ! 55: extern long var_index; ! 56: extern inst *global_list; ! 57: extern symbol *src_file; ! 58: extern symbol **str_trans; ! 59: extern type **type_trans; ! 60: extern var **var_trans; ! 61: ! 62: extern char *alloc_fill(); ! 63: extern char *salloc(); ! 64: extern char *srealloc(); ! 65: extern char *stime(); ! 66: extern long getu(); ! 67: extern long getv(); ! 68: extern long get4(); ! 69: extern void print_basetype(); ! 70: extern void put_file(); ! 71: extern void put_type(); ! 72: extern void say_file(); ! 73: extern void skip(); ! 74: ! 75: #define SYSERROR (-1) ! 76: ! 77: #define loop for (;;) ! 78: #define getd() (*data_ptr++) ! 79: #define skip4() (data_ptr += 4) ! 80: #define talloc(t) (t *)alloc(sizeof (t)) ! 81: #define alloc(n) ((alloc_ptr += (n)) > alloc_end ? alloc_fill((long)n) : (alloc_ptr - (n))) ! 82: #define vector(p, n, t) (t *)srealloc((char *)p, (long)(n) * sizeof (t))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.