|
@@ -125,7 +125,7 @@ extern "C" {
|
125
|
125
|
|
126
|
126
|
bool cmDataIsValue( const cmData_t* p );
|
127
|
127
|
bool cmDataIsPtr( const cmData_t* p );
|
128
|
|
- bool cmDataIsStruct( const cmData_t* p );
|
|
128
|
+ bool cmDataIsStruct( const cmData_t* p ); // is a pair,list or record
|
129
|
129
|
|
130
|
130
|
/*
|
131
|
131
|
TODO:
|
|
@@ -367,17 +367,20 @@ extern "C" {
|
367
|
367
|
|
368
|
368
|
// Prepend 'p' to 'parents' child list.
|
369
|
369
|
// The source node 'p' is not duplicated it is simply linked in.
|
|
370
|
+ // 'p' is automatically unlinked prior to being prepended.
|
370
|
371
|
// Returns 'p'.
|
371
|
372
|
cmData_t* cmDataPrependChild(cmData_t* parent, cmData_t* p );
|
372
|
373
|
|
373
|
374
|
// Append 'p' to the end of 'parent' child list.
|
374
|
375
|
// The source node 'p' is not duplicated it is simply linked in.
|
375
|
|
- // Returns 'p'.
|
|
376
|
+ // 'p' is automatically unlinked prior to being appended.
|
|
377
|
+ // Returns 'p'.
|
376
|
378
|
cmData_t* cmDataAppendChild( cmData_t* parent, cmData_t* p );
|
377
|
379
|
|
378
|
380
|
// Insert 'p' at index. Index must be in the range:
|
379
|
381
|
// 0 to cmDataChildCount(parent).
|
380
|
382
|
// The source node 'p' is not duplicated it is simply linked in.
|
|
383
|
+ // 'p' is automatically unlinked prior to being inserted.
|
381
|
384
|
// Returns 'p'.
|
382
|
385
|
cmData_t* cmDataInsertChild( cmData_t* parent, unsigned index, cmData_t* p );
|
383
|
386
|
|
|
@@ -408,12 +411,18 @@ extern "C" {
|
408
|
411
|
// The data space for the 'label' string is dynamically allocated.
|
409
|
412
|
cmData_t* cmDataPairSetKeyLabel( cmData_t* p, const cmChar_t* label );
|
410
|
413
|
|
|
414
|
+ // Create a pair value by assigning a key and value to 'p'.
|
|
415
|
+ // 'p' is unlinked and freed prior to the key value assignment.
|
|
416
|
+ // 'key' and 'value' are simply linked in they are not duplicated or reallocated.
|
411
|
417
|
cmData_t* cmDataMakePair( cmData_t* parent, cmData_t* p, cmData_t* key, cmData_t* value );
|
412
|
418
|
|
413
|
|
- // Dynamically allocate a pair node
|
|
419
|
+ // Dynamically allocate a pair node. Both the key and value nodes are reallocated.
|
414
|
420
|
cmData_t* cmDataAllocPair( cmData_t* parent, const cmData_t* key, const cmData_t* value );
|
|
421
|
+
|
|
422
|
+ // Dynamically allocate the id but link (w/o realloc) the value.
|
415
|
423
|
cmData_t* cmDataAllocPairId( cmData_t* parent, unsigned keyId, cmData_t* value );
|
416
|
|
- // The data space for the 'label' string is dynamically allocated.
|
|
424
|
+
|
|
425
|
+ // Dynamically allocate the label but link (w/o realloc) the value.
|
417
|
426
|
cmData_t* cmDataAllocPairLabel( cmData_t* parent, const cmChar_t* label, cmData_t* value );
|
418
|
427
|
|
419
|
428
|
//----------------------------------------------------------------------------
|
|
@@ -476,6 +485,9 @@ extern "C" {
|
476
|
485
|
cmData_t* cmRecdMake( cmData_t* parent, cmData_t* p );
|
477
|
486
|
cmData_t* cmRecdAlloc( cmData_t* parent );
|
478
|
487
|
|
|
488
|
+ // Append a pair node by linking the pair node 'pair' to the record node 'p'.
|
|
489
|
+ // 'pair' is simply linked to 'p' via cmDataAppendChild() no
|
|
490
|
+ // reallocation or duplicattion takes place.
|
479
|
491
|
cmData_t* cmRecdAppendPair( cmData_t* p, cmData_t* pair );
|
480
|
492
|
|
481
|
493
|
|