MCPcopy Create free account
hub / github.com/boostorg/build / var_get

Function var_get

v2/engine/variable.c:165–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163 */
164
165LIST * var_get( struct module_t * module, OBJECT * symbol )
166{
167 LIST * result = L0;
168#ifdef OPT_AT_FILES
169 /* Some "fixed" variables... */
170 if ( object_equal( symbol, constant_TMPDIR ) )
171 {
172 list_free( saved_var );
173 result = saved_var = list_new( object_new( path_tmpdir()->value ) );
174 }
175 else if ( object_equal( symbol, constant_TMPNAME ) )
176 {
177 list_free( saved_var );
178 result = saved_var = list_new( path_tmpnam() );
179 }
180 else if ( object_equal( symbol, constant_TMPFILE ) )
181 {
182 list_free( saved_var );
183 result = saved_var = list_new( path_tmpfile() );
184 }
185 else if ( object_equal( symbol, constant_STDOUT ) )
186 {
187 list_free( saved_var );
188 result = saved_var = list_new( object_copy( constant_STDOUT ) );
189 }
190 else if ( object_equal( symbol, constant_STDERR ) )
191 {
192 list_free( saved_var );
193 result = saved_var = list_new( object_copy( constant_STDERR ) );
194 }
195 else
196#endif
197 {
198 VARIABLE * v;
199 int n;
200
201 if ( ( n = module_get_fixed_var( module, symbol ) ) != -1 )
202 {
203 if ( DEBUG_VARGET )
204 var_dump( symbol, module->fixed_variables[ n ], "get" );
205 result = module->fixed_variables[ n ];
206 }
207 else if ( module->variables && ( v = (VARIABLE *)hash_find(
208 module->variables, symbol ) ) )
209 {
210 if ( DEBUG_VARGET )
211 var_dump( v->symbol, v->value, "get" );
212 result = v->value;
213 }
214 }
215 return result;
216}
217
218
219LIST * var_get_and_clear_raw( module_t * module, OBJECT * symbol )

Callers 15

cache_nameFunction · 0.85
cache_maxageFunction · 0.85
call_timing_ruleFunction · 0.85
call_action_ruleFunction · 0.85
make1cmdsFunction · 0.85
make1settingsFunction · 0.85
make0Function · 0.85
bjam_variableFunction · 0.85
headersFunction · 0.85
call_bind_ruleFunction · 0.85
searchFunction · 0.85

Calls 11

object_equalFunction · 0.85
list_freeFunction · 0.85
list_newFunction · 0.85
object_newFunction · 0.85
path_tmpdirFunction · 0.85
path_tmpnamFunction · 0.85
path_tmpfileFunction · 0.85
object_copyFunction · 0.85
module_get_fixed_varFunction · 0.85
var_dumpFunction · 0.85
hash_findFunction · 0.85

Tested by

no test coverage detected