|
CX Framework
Cross-platform C utility framework
|
Macros | |
| #define | ssdSet(root, path, createpath, val) _ssdSet(root, path, createpath, val, (SSDLockState*)_ssdCurrentLockState) |
| #define | ssdSetC(root, path, createpath, val) _ssdSetC(root, path, createpath, val, (SSDLockState*)_ssdCurrentLockState) |
| #define | ssdRemove(root, path) _ssdRemove(root, path, (SSDLockState*)_ssdCurrentLockState) |
Functions for setting, removing, and modifying values in the tree.
| #define ssdRemove | ( | root, | |
| path | |||
| ) | _ssdRemove(root, path, (SSDLockState*)_ssdCurrentLockState) |
bool ssdRemove(SSDNode *root, strref path)
Removes a value at the specified path from the tree.
| root | The root node |
| path | Path to the value to remove |
| #define ssdSet | ( | root, | |
| path, | |||
| createpath, | |||
| val | |||
| ) | _ssdSet(root, path, createpath, val, (SSDLockState*)_ssdCurrentLockState) |
bool ssdSet(SSDNode *root, strref path, bool createpath, stvar val)
Sets a value at the specified path in the tree.
If createpath is true, any intermediate nodes along the path are automatically created as hashtables. If false and the path doesn't exist, the operation fails.
| root | The root node |
| path | Path where to set the value (NULL for root node) |
| createpath | If true, create intermediate nodes as needed |
| val | The value to set (copied into the tree) |
Example:
| #define ssdSetC | ( | root, | |
| path, | |||
| createpath, | |||
| val | |||
| ) | _ssdSetC(root, path, createpath, val, (SSDLockState*)_ssdCurrentLockState) |
bool ssdSetC(SSDNode *root, strref path, bool createpath, stvar *val)
Sets a value at the specified path, consuming the provided stvar.
This function takes ownership of the value and will consume it even on failure. This is more efficient than ssdSet() when you don't need to keep the original value.
| root | The root node |
| path | Path where to set the value |
| createpath | If true, create intermediate nodes as needed |
| val | Pointer to the value (consumed and invalidated) |