1 /* 2 * Copyright 2011 Steven Watanabe 3 * 4 * This file is part of Jam - see jam.c for Copyright information. 5 */ 6 7 /* 8 * constants.c - constant objects 9 * 10 * External functions: 11 * 12 * constants_init() - initialize constants 13 * constants_done() - free constants 14 * 15 */ 16 17 #include "constants.h" 18 19 constants_init(void)20void constants_init( void ) 21 { 22 constant_empty = object_new( "" ); 23 constant_dot = object_new( "." ); 24 constant_plus = object_new( "+" ); 25 constant_star = object_new( "*" ); 26 constant_question_mark = object_new( "?" ); 27 constant_ok = object_new( "ok" ); 28 constant_true = object_new( "true" ); 29 constant_name = object_new( "__name__" ); 30 constant_bases = object_new( "__bases__" ); 31 constant_class = object_new( "__class__" ); 32 constant_typecheck = object_new( ".typecheck" ); 33 constant_builtin = object_new( "(builtin)" ); 34 constant_HCACHEFILE = object_new( "HCACHEFILE" ); 35 constant_HCACHEMAXAGE = object_new( "HCACHEMAXAGE" ); 36 constant_HDRSCAN = object_new( "HDRSCAN" ); 37 constant_HDRRULE = object_new( "HDRRULE" ); 38 constant_BINDRULE = object_new( "BINDRULE" ); 39 constant_LOCATE = object_new( "LOCATE" ); 40 constant_SEARCH = object_new( "SEARCH" ); 41 constant_JAM_SEMAPHORE = object_new( "JAM_SEMAPHORE" ); 42 constant_TIMING_RULE = object_new( "__TIMING_RULE__" ); 43 constant_ACTION_RULE = object_new( "__ACTION_RULE__" ); 44 constant_JAMSHELL = object_new( "JAMSHELL" ); 45 constant_TMPDIR = object_new( "TMPDIR" ); 46 constant_TMPNAME = object_new( "TMPNAME" ); 47 constant_TMPFILE = object_new( "TMPFILE" ); 48 constant_STDOUT = object_new( "STDOUT" ); 49 constant_STDERR = object_new( "STDERR" ); 50 constant_JAMDATE = object_new( "JAMDATE" ); 51 constant_JAM_TIMESTAMP_RESOLUTION = object_new( "JAM_TIMESTAMP_RESOLUTION" ); 52 constant_JAM_VERSION = object_new( "JAM_VERSION" ); 53 constant_JAMUNAME = object_new( "JAMUNAME" ); 54 constant_ENVIRON = object_new( ".ENVIRON" ); 55 constant_ARGV = object_new( "ARGV" ); 56 constant_all = object_new( "all" ); 57 constant_PARALLELISM = object_new( "PARALLELISM" ); 58 constant_KEEP_GOING = object_new( "KEEP_GOING" ); 59 constant_other = object_new( "[OTHER]" ); 60 constant_total = object_new( "[TOTAL]" ); 61 constant_FILE_DIRSCAN = object_new( "FILE_DIRSCAN" ); 62 constant_MAIN = object_new( "MAIN" ); 63 constant_MAIN_MAKE = object_new( "MAIN_MAKE" ); 64 constant_MAKE_MAKE0 = object_new( "MAKE_MAKE0" ); 65 constant_MAKE_MAKE1 = object_new( "MAKE_MAKE1" ); 66 constant_MAKE_MAKE0SORT = object_new( "MAKE_MAKE0SORT" ); 67 constant_BINDMODULE = object_new( "BINDMODULE" ); 68 constant_IMPORT_MODULE = object_new( "IMPORT_MODULE" ); 69 constant_BUILTIN_GLOB_BACK = object_new( "BUILTIN_GLOB_BACK" ); 70 constant_timestamp = object_new( "timestamp" ); 71 constant_python = object_new("__python__"); 72 constant_python_interface = object_new( "python_interface" ); 73 constant_extra_pythonpath = object_new( "EXTRA_PYTHONPATH" ); 74 constant_MAIN_PYTHON = object_new( "MAIN_PYTHON" ); 75 constant_BUILTIN_GLOB_ARCHIVE_BACK= object_new( "BUILTIN_GLOB_ARCHIVE_BACK" ); 76 constant_FILE_ARCHIVESCAN = object_new( "FILE_ARCHIVESCAN" ); 77 } 78 constants_done(void)79void constants_done( void ) 80 { 81 object_free( constant_empty ); 82 object_free( constant_dot ); 83 object_free( constant_plus ); 84 object_free( constant_star ); 85 object_free( constant_question_mark ); 86 object_free( constant_ok ); 87 object_free( constant_true ); 88 object_free( constant_name ); 89 object_free( constant_bases ); 90 object_free( constant_class ); 91 object_free( constant_typecheck ); 92 object_free( constant_builtin ); 93 object_free( constant_HCACHEFILE ); 94 object_free( constant_HCACHEMAXAGE ); 95 object_free( constant_HDRSCAN ); 96 object_free( constant_HDRRULE ); 97 object_free( constant_BINDRULE ); 98 object_free( constant_LOCATE ); 99 object_free( constant_SEARCH ); 100 object_free( constant_JAM_SEMAPHORE ); 101 object_free( constant_TIMING_RULE ); 102 object_free( constant_ACTION_RULE ); 103 object_free( constant_JAMSHELL ); 104 object_free( constant_TMPDIR ); 105 object_free( constant_TMPNAME ); 106 object_free( constant_TMPFILE ); 107 object_free( constant_STDOUT ); 108 object_free( constant_STDERR ); 109 object_free( constant_JAMDATE ); 110 object_free( constant_JAM_TIMESTAMP_RESOLUTION ); 111 object_free( constant_JAM_VERSION ); 112 object_free( constant_JAMUNAME ); 113 object_free( constant_ENVIRON ); 114 object_free( constant_ARGV ); 115 object_free( constant_all ); 116 object_free( constant_PARALLELISM ); 117 object_free( constant_KEEP_GOING ); 118 object_free( constant_other ); 119 object_free( constant_total ); 120 object_free( constant_FILE_DIRSCAN ); 121 object_free( constant_MAIN ); 122 object_free( constant_MAIN_MAKE ); 123 object_free( constant_MAKE_MAKE0 ); 124 object_free( constant_MAKE_MAKE1 ); 125 object_free( constant_MAKE_MAKE0SORT ); 126 object_free( constant_BINDMODULE ); 127 object_free( constant_IMPORT_MODULE ); 128 object_free( constant_BUILTIN_GLOB_BACK ); 129 object_free( constant_timestamp ); 130 object_free( constant_python ); 131 object_free( constant_python_interface ); 132 object_free( constant_extra_pythonpath ); 133 object_free( constant_MAIN_PYTHON ); 134 object_free( constant_FILE_ARCHIVESCAN ); 135 object_free( constant_BUILTIN_GLOB_ARCHIVE_BACK ); 136 } 137 138 OBJECT * constant_empty; 139 OBJECT * constant_dot; 140 OBJECT * constant_plus; 141 OBJECT * constant_star; 142 OBJECT * constant_question_mark; 143 OBJECT * constant_ok; 144 OBJECT * constant_true; 145 OBJECT * constant_name; 146 OBJECT * constant_bases; 147 OBJECT * constant_class; 148 OBJECT * constant_typecheck; 149 OBJECT * constant_builtin; 150 OBJECT * constant_HCACHEFILE; 151 OBJECT * constant_HCACHEMAXAGE; 152 OBJECT * constant_HDRSCAN; 153 OBJECT * constant_HDRRULE; 154 OBJECT * constant_BINDRULE; 155 OBJECT * constant_LOCATE; 156 OBJECT * constant_SEARCH; 157 OBJECT * constant_JAM_SEMAPHORE; 158 OBJECT * constant_TIMING_RULE; 159 OBJECT * constant_ACTION_RULE; 160 OBJECT * constant_JAMSHELL; 161 OBJECT * constant_TMPDIR; 162 OBJECT * constant_TMPNAME; 163 OBJECT * constant_TMPFILE; 164 OBJECT * constant_STDOUT; 165 OBJECT * constant_STDERR; 166 OBJECT * constant_JAMDATE; 167 OBJECT * constant_JAM_VERSION; 168 OBJECT * constant_JAMUNAME; 169 OBJECT * constant_ENVIRON; 170 OBJECT * constant_ARGV; 171 OBJECT * constant_all; 172 OBJECT * constant_PARALLELISM; 173 OBJECT * constant_KEEP_GOING; 174 OBJECT * constant_other; 175 OBJECT * constant_total; 176 OBJECT * constant_FILE_DIRSCAN; 177 OBJECT * constant_MAIN; 178 OBJECT * constant_MAIN_MAKE; 179 OBJECT * constant_MAKE_MAKE0; 180 OBJECT * constant_MAKE_MAKE1; 181 OBJECT * constant_MAKE_MAKE0SORT; 182 OBJECT * constant_BINDMODULE; 183 OBJECT * constant_IMPORT_MODULE; 184 OBJECT * constant_BUILTIN_GLOB_BACK; 185 OBJECT * constant_timestamp; 186 OBJECT * constant_JAM_TIMESTAMP_RESOLUTION; 187 OBJECT * constant_python; 188 OBJECT * constant_python_interface; 189 OBJECT * constant_extra_pythonpath; 190 OBJECT * constant_MAIN_PYTHON; 191 OBJECT * constant_FILE_ARCHIVESCAN; 192 OBJECT * constant_BUILTIN_GLOB_ARCHIVE_BACK; 193