LibT2FS 0.1
C API for accessing TEngine data in memory.
Loading...
Searching...
No Matches
s_t2fsNode Struct Reference

This is the core object to describe a path inside the tree. More...

#include <t2fs.h>

Data Fields

t2fsSchemaNodeschema
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.
t2fsInputinput
 For reading data.
t2fsNodeparent
 The parent node.
uint32_t childCount
 How many child nodes this node has.
t2fsNodechildNodes
 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_t2fslib
 Pointer to our context for convenience.

Detailed Description

This is the core object to describe a path inside the tree.

Field Documentation

◆ schema

t2fsSchemaNode* s_t2fsNode::schema

◆ id

uint32_t s_t2fsNode::id

Index of this node.

◆ offset

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.

◆ size

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.

◆ data

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.

◆ input

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.

◆ parent

t2fsNode* s_t2fsNode::parent

The parent node.

May only NULL on the root node.

◆ childCount

uint32_t s_t2fsNode::childCount

How many child nodes this node has.

◆ childNodes

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.

◆ isCompressed

uint8_t s_t2fsNode::isCompressed

Indicator that the data is compressed.

◆ hasBeenRead

uint8_t s_t2fsNode::hasBeenRead

Indicator that the data for this node has been read.

◆ lib

t_t2fs* s_t2fsNode::lib

Pointer to our context for convenience.


The documentation for this struct was generated from the following file: