This is the core object to describe a path inside the tree. More...
#include <t2fs.h>
Data Fields | |
| t2fsSchemaNode * | schema |
| uint32_t | id |
| Index of this node. | |
| uint32_t | offset |
| Offset to this node. | |
| uint32_t | size |
| Data size of this node. | |
| uint8_t * | data |
Data of this node, can be another offset table (branch node) or data (data/leaf node) depending on schema->childType. | |
| t2fsInput * | input |
| For reading data. | |
| t2fsNode * | parent |
| The parent node. | |
| uint32_t | childCount |
| How many child nodes this node has. | |
| t2fsNode * | childNodes |
| Pointer to the child node(s). | |
| uint8_t | isCompressed |
| Indicator that the data is compressed. | |
| uint8_t | hasBeenRead |
| Indicator that the data for this node has been read. | |
| t_t2fs * | lib |
| Pointer to our context for convenience. | |
This is the core object to describe a path inside the tree.
| t2fsSchemaNode* s_t2fsNode::schema |
| uint32_t s_t2fsNode::id |
Index of this node.
| uint32_t s_t2fsNode::offset |
Offset to this node.
Real in file offset to beginning of this table or real in file offset to data when schema->childType is NODE_TYPE_DATA. Except for when one of the parent nodes is compressed, then it's the offset in the decompressed buffer.
| uint32_t s_t2fsNode::size |
Data size of this node.
Total size of this node. Every node is expected to be 8 byte padded, so minimum size would be 8. On the root node this should be the total file size - 8.
| uint8_t* s_t2fsNode::data |
Data of this node, can be another offset table (branch node) or data (data/leaf node) depending on schema->childType.
On load data request this will point to new allocated data (read from file), except for when the node or one of it's parents is compressed and holds input.buf, then it's pointed to somewhere inside input.buf. So do only free when data is not NULL and input.buf is NULL.
| t2fsInput* s_t2fsNode::input |
For reading data.
By default this will be a pointer to t_t2fs.root.input, except for when isCompressed, then a new one is allocated and should be freed when this node gets freed.
| t2fsNode* s_t2fsNode::parent |
The parent node.
May only NULL on the root node.
| uint32_t s_t2fsNode::childCount |
How many child nodes this node has.
| t2fsNode* s_t2fsNode::childNodes |
Pointer to the child node(s).
This may be NULL when there are none or this is a NODE_TYPE_DATA.
| uint8_t s_t2fsNode::isCompressed |
Indicator that the data is compressed.
| uint8_t s_t2fsNode::hasBeenRead |
Indicator that the data for this node has been read.
| t_t2fs* s_t2fsNode::lib |
Pointer to our context for convenience.