#include <string.h>#include "libnjb.h"#include "njb_error.h"#include "defs.h"#include "base.h"#include "unicode.h"#include "protocol3.h"#include "byteorder.h"#include "datafile.h"Functions | |
| njb_datafile_t * | datafile_new (void) |
| void | NJB_Datafile_Destroy (njb_datafile_t *df) |
| u_int64_t | datafile_size (njb_datafile_t *df) |
| void | datafile_set_size (njb_datafile_t *df, u_int64_t size) |
| void | datafile_set_time (njb_datafile_t *df, time_t ts) |
| int | datafile_set_name (njb_datafile_t *df, const char *filename) |
| int | datafile_set_folder (njb_datafile_t *df, const char *folder) |
| njb_datafile_t * | datafile_unpack (unsigned char *data, size_t nbytes) |
| unsigned char * | datafile_pack (njb_datafile_t *df, u_int32_t *size) |
| unsigned char * | datafile_pack3 (njb_t *njb, njb_datafile_t *df, u_int32_t *size) |
| unsigned char * | new_folder_pack3 (njb_t *njb, const char *name, u_int32_t *size) |
Variables | |
| int | __sub_depth |
| int | njb_unicode_flag |
| njb_datafile_t* datafile_new | ( | void | ) |
Creates a new datafile struct.
| unsigned char* datafile_pack | ( | njb_datafile_t * | df, | |
| u_int32_t * | size | |||
| ) |
A function that packs a datafile tag into the format used by the NJB1.
| df | the datafile tag to pack. | |
| size | a pointer to a variable that shall hold the size of the packed object after this function has been called. |
| unsigned char* datafile_pack3 | ( | njb_t * | njb, | |
| njb_datafile_t * | df, | |||
| u_int32_t * | size | |||
| ) |
This function packs (serialize, marshall) a high-level representation of a datafile metadata structure into a simple byte-array as used by the series 3 devices.
| njb | the NJB object to use | |
| df | the datafile in libnjb structure format | |
| size | a pointer to an integer that will hold the resulting size of the packed structure |
| int datafile_set_folder | ( | njb_datafile_t * | df, | |
| const char * | folder | |||
| ) |
Helper function that sets the foldername of a datafile.
| df | the datafile to be altered. | |
| folder | the new folder name. Folder names always begin and end with a backslash (\) with a backslash separator between levels, like this: "\foo\bar\fnord\". |
| int datafile_set_name | ( | njb_datafile_t * | df, | |
| const char * | filename | |||
| ) |
Helper function that sets the name of a datafile.
| df | the datafile to be altered. | |
| filename | the new name. |
| void datafile_set_size | ( | njb_datafile_t * | df, | |
| u_int64_t | size | |||
| ) |
Helper function that sets the size of the datafile.
| df | the datafile to be altered. | |
| size | the size of the file as a 64bit unsigned integer. |
| void datafile_set_time | ( | njb_datafile_t * | df, | |
| time_t | ts | |||
| ) |
Helper function that sets the timestamp for a datafile.
| df | the datafile to be altered. | |
| ts | the new timestamp for this datafile. |
| u_int64_t datafile_size | ( | njb_datafile_t * | df | ) |
Helper function that returns the size of the datafile as a 64bit unsigned integer
| df | the datafile whose size we are interested in. |
| njb_datafile_t* datafile_unpack | ( | unsigned char * | data, | |
| size_t | nbytes | |||
| ) |
Unpacks a datafile struct from NJB1.
| data | the raw binary data to unpack | |
| nbytes | the size of the raw binary data in bytes |
| unsigned char* new_folder_pack3 | ( | njb_t * | njb, | |
| const char * | name, | |||
| u_int32_t * | size | |||
| ) |
This creates a folder metadata entry for a new folder on the series 3 devices. (Not applicable for NJB1.)
| njb | the NJB object to use | |
| name | the name of the new folder, must have a reasonable format! | |
| size | a pointer to an integer that will hold the resulting size of the packed folder structure |
| int __sub_depth |
The current subroutine depth for all of libnjb (global)
1.5.2