Go to the source code of this file.
Data Structures | |
| struct | s_t2fsInput |
| object to handle input reading More... | |
| struct | s_t2fsNode |
| This is the core object to describe a path inside the tree. More... | |
| struct | s_t2fsNodePath |
| struct | s_t2fs |
| This is the core LibT2FS object that you will be passing around. More... | |
Macros | |
| #define | T2FS_NODE_SANE_MAX_COUNT 65000 |
| #define | T2FS_NODE_SANE_MIN_OFFSET 0x10 |
| #define | T2FS_PRINT_ERROR_NODE(node, ...) |
| #define | T2FS_PRINT_WARN_NODE(node, ...) |
| #define | T2FS_PRINT_DEBUG_NODE(node, ...) |
| #define | NODE_MAX_LEVEL 64 |
| #define | NODE_PATH_END (uint32_t)-1 |
Typedefs | |
| typedef enum e_t2fsReadSize | t2fsReadSize |
| To handle swapping endianness. | |
| typedef struct s_t2fs | t_t2fs |
| This is the core LibT2FS object that you will be passing around. | |
| typedef struct s_t2fsInput | t2fsInput |
| object to handle input reading | |
| typedef size_t | t2fs_read_callback(t2fsInput *input, void *dest, size_t size) |
| typedef size_t | t2fs_read_value_callback(t2fsInput *input, void *dest, t2fsReadSize size) |
| typedef int | t2fs_seek_callback(t2fsInput *input, long offset, int whence) |
| typedef struct s_t2fsNode | t2fsNode |
| This is the core object to describe a path inside the tree. | |
| typedef struct s_t2fsNodePath | t2fsNodePath |
Enumerations | |
| enum | e_t2fsReadSize { T2FS_READ_16 = 2 , T2FS_READ_32 = 4 } |
| To handle swapping endianness. More... | |
| enum | t2fsStatus { T2FS_OK = 0 , T2FS_ERROR = 1 } |
Functions | |
| void | t2fs_node_init (t2fsNode *node) |
| void | t2fs_node_free_childeren (t2fsNode *node) |
| This should be called after successfully call to t2fs_node_read_branch(). | |
| int | t2fs_node_read_data (t2fsNode *node) |
| Read node data. | |
| int | t2fs_node_read_branch (t_t2fs *lib, t2fsNode *node) |
| Read child branch node(s). | |
| int | t2fs_node_read_recurse (t_t2fs *lib, t2fsNode *node, uint8_t loadData) |
| Recursive read all child branch node(s) and optionally load the endpoint(s) data. | |
| uint8_t | t2fs_node_has_index (const t2fsNode *const node, uint32_t index) |
| Check if the node has a child node with the given index. | |
| t2fsNode * | t2fs_node_find_by_name (t2fsNode *start, const char *name, uint32_t level, uint32_t maxLevel) |
| Find child node by schema name. | |
| void | t2fs_node_print_recursive (const t2fsNode *const node, uint32_t indent) |
| int | t2fs_node_guess_read_recursive (t_t2fs *lib, t2fsNode *node, uint8_t loadData, uint8_t decompress) |
| void | t2fs_node_path_init (t2fsNodePath *np) |
| void | t2fs_node_path_parse (t2fsNodePath *np, t2fsNode *node) |
| void | t2fs_node_path_print (const t_t2fs *const lib, const t2fsNodePath *const np) |
| int | t2fs_node_path_to_string (const t2fsNodePath *const np, char *buf, size_t bufsize) |
| void | t2fs_print_error_node (int printType, const char *const func, t2fsNode *node, const char *const fmt,...) |
| void | t2fs_init (t_t2fs *lib) |
| Always initialize your t_t2fs object. | |
| t2fsStatus | t2fs_open (t_t2fs *lib, const char *const filepath, const char *const schemaPath, uint8_t searchSchema) |
| Open .dat/.lss/.lsm file. | |
| void | t2fs_close (t_t2fs *lib) |
| Close opened file and free all allocated node/data memory. | |
This header it self only contains stuff to navigate and access cart/ROM data. To get some use out of the data look at the 'higher' level models/*.h API.
Decompression and deinterleaving are handled by LibT2FS so you don't have to worry about those, unless you are helping developing this :-)
| #define T2FS_NODE_SANE_MAX_COUNT 65000 |
| #define T2FS_NODE_SANE_MIN_OFFSET 0x10 |
| #define T2FS_PRINT_ERROR_NODE | ( | node, | |
| ... ) |
| #define T2FS_PRINT_WARN_NODE | ( | node, | |
| ... ) |
| #define T2FS_PRINT_DEBUG_NODE | ( | node, | |
| ... ) |
| #define NODE_MAX_LEVEL 64 |
| #define NODE_PATH_END (uint32_t)-1 |
| typedef enum e_t2fsReadSize t2fsReadSize |
To handle swapping endianness.
| typedef struct s_t2fsInput t2fsInput |
object to handle input reading
| typedef size_t t2fs_read_callback(t2fsInput *input, void *dest, size_t size) |
| typedef size_t t2fs_read_value_callback(t2fsInput *input, void *dest, t2fsReadSize size) |
| typedef int t2fs_seek_callback(t2fsInput *input, long offset, int whence) |
| typedef struct s_t2fsNode t2fsNode |
This is the core object to describe a path inside the tree.
| typedef struct s_t2fsNodePath t2fsNodePath |
| enum e_t2fsReadSize |
| enum t2fsStatus |
| void t2fs_node_init | ( | t2fsNode * | node | ) |
| void t2fs_node_free_childeren | ( | t2fsNode * | node | ) |
This should be called after successfully call to t2fs_node_read_branch().
This will recursive free all the child nodes and their potential data.
| int t2fs_node_read_data | ( | t2fsNode * | node | ) |
Read node data.
Read child branch node(s).
Recursive read all child branch node(s) and optionally load the endpoint(s) data.
| uint8_t t2fs_node_has_index | ( | const t2fsNode *const | node, |
| uint32_t | index ) |
Check if the node has a child node with the given index.
| t2fsNode * t2fs_node_find_by_name | ( | t2fsNode * | start, |
| const char * | name, | ||
| uint32_t | level, | ||
| uint32_t | maxLevel ) |
Find child node by schema name.
| void t2fs_node_print_recursive | ( | const t2fsNode *const | node, |
| uint32_t | indent ) |
| int t2fs_node_guess_read_recursive | ( | t_t2fs * | lib, |
| t2fsNode * | node, | ||
| uint8_t | loadData, | ||
| uint8_t | decompress ) |
| void t2fs_node_path_init | ( | t2fsNodePath * | np | ) |
| void t2fs_node_path_parse | ( | t2fsNodePath * | np, |
| t2fsNode * | node ) |
| void t2fs_node_path_print | ( | const t_t2fs *const | lib, |
| const t2fsNodePath *const | np ) |
| int t2fs_node_path_to_string | ( | const t2fsNodePath *const | np, |
| char * | buf, | ||
| size_t | bufsize ) |
| void t2fs_print_error_node | ( | int | printType, |
| const char *const | func, | ||
| t2fsNode * | node, | ||
| const char *const | fmt, | ||
| ... ) |
| t2fsStatus t2fs_open | ( | t_t2fs * | lib, |
| const char *const | filepath, | ||
| const char *const | schemaPath, | ||
| uint8_t | searchSchema ) |
Open .dat/.lss/.lsm file.
When a schema is given or found it will read the root node, meaning that the root child nodes are set. So for example we can get amount of textures in the textures node. It won't load any data.
| lib | Your freshly initialized t_t2fs object. |
| filepath | Filepath to the .dat/.lss/.lsm file, this may NOT be NULL. |
| schemaPath | Filepath to the schema file (.json) to use. Giving NULL is allowed for when you want to automatically detect and find the schema file or for debugging/guessing node operations. |
| searchSchema | Automatically try to detect and find the schema file. |
| void t2fs_close | ( | t_t2fs * | lib | ) |
Close opened file and free all allocated node/data memory.