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

Function var_enter

src/engine/variable.c:341–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339 */
340
341static LIST * * var_enter( struct module_t * module, OBJECT * symbol )
342{
343 int found;
344 VARIABLE * v;
345 int n;
346
347 if ( ( n = module_get_fixed_var( module, symbol ) ) != -1 )
348 return &module->fixed_variables[ n ];
349
350 if ( !module->variables )
351 module->variables = hashinit( sizeof( VARIABLE ), "variables" );
352
353 v = (VARIABLE *)hash_insert( module->variables, symbol, &found );
354 if ( !found )
355 {
356 v->symbol = object_copy( symbol );
357 v->value = L0;
358 }
359
360 return &v->value;
361}
362
363
364/*

Callers 2

var_setFunction · 0.85
var_swapFunction · 0.85

Calls 4

module_get_fixed_varFunction · 0.85
hashinitFunction · 0.85
hash_insertFunction · 0.85
object_copyFunction · 0.85

Tested by

no test coverage detected