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

Function addsettings

v2/engine/rules.c:334–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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