Add a path field
This commit is contained in:
17
hipadaba.c
17
hipadaba.c
@@ -127,6 +127,9 @@ void DeleteNodeData(pHdb node)
|
||||
if (node->name != NULL) {
|
||||
free(node->name);
|
||||
}
|
||||
if (node->path != NULL) {
|
||||
free(node->path);
|
||||
}
|
||||
ReleaseHdbValue(&node->value);
|
||||
node->magic = 000000;
|
||||
|
||||
@@ -562,7 +565,7 @@ int compareHdbValue(hdbValue v1, hdbValue v2)
|
||||
}
|
||||
break;
|
||||
case HIPFLOAT:
|
||||
if (ABS(v1.v.doubleValue - v2.v.doubleValue) < .01) {
|
||||
if (ABS(v1.v.doubleValue - v2.v.doubleValue) < .0001) { /* DFC */
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
@@ -737,6 +740,7 @@ void AddHipadabaChild(pHdb parent, pHdb child, void *callData)
|
||||
* step to end of child chain
|
||||
*/
|
||||
while (current != NULL) {
|
||||
assert(strcmp(current->name, child->name) != 0);
|
||||
prev = current;
|
||||
current = current->next;
|
||||
}
|
||||
@@ -856,6 +860,7 @@ char *GetHipadabaPath(pHdb node)
|
||||
strcat(pPtr, "/");
|
||||
strcat(pPtr, nodeStack[i]->name);
|
||||
}
|
||||
node->path = pPtr;
|
||||
return pPtr;
|
||||
}
|
||||
|
||||
@@ -1112,6 +1117,16 @@ void SetHdbProperty(pHdb node, char *key, char *value)
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int HasHdbProperty(pHdb node, char *key)
|
||||
{
|
||||
if (node != NULL && node->properties != NULL) {
|
||||
return StringDictExists(node->properties, key);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int GetHdbProperty(pHdb node, char *key, char *value, int len)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user