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

Function addsettings

src/engine/rules.cpp:333–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331 */
332
333SETTINGS * addsettings( SETTINGS * head, int flag, OBJECT * symbol,
334 LIST * value )
335{
336 SETTINGS * v;
337
338 /* Look for previous settings. */
339 for ( v = head; v; v = v->next )
340 if ( object_equal( v->symbol, symbol ) )
341 break;
342
343 /* If not previously set, alloc a new. */
344 /* If appending, do so. */
345 /* Else free old and set new. */
346 if ( !v )
347 {
348 v = settings_freelist;
349 if ( v )
350 settings_freelist = v->next;
351 else
352 v = (SETTINGS *)BJAM_MALLOC( sizeof( *v ) );
353
354 v->symbol = object_copy( symbol );
355 v->value = value;
356 v->next = head;
357 head = v;
358 }
359 else if ( flag == VAR_APPEND )
360 {
361 v->value = list_append( v->value, value );
362 }
363 else if ( flag != VAR_DEFAULT )
364 {
365 list_free( v->value );
366 v->value = value;
367 }
368 else
369 list_free( value );
370
371 /* Return (new) head of list. */
372 return head;
373}
374
375
376/*

Callers 3

make1settingsFunction · 0.85
copysettingsFunction · 0.85
function_runFunction · 0.85

Calls 4

object_equalFunction · 0.85
object_copyFunction · 0.85
list_appendFunction · 0.85
list_freeFunction · 0.85

Tested by

no test coverage detected