Grouping/Ungrouping of TI files

tifiles_content_create_group

TIEXPORT2 FileContent** TICALL tifiles_content_create_group(int n_entries)

Convenient function which create a NULL-terminated array of #FileContent structures (typically used to store a group file).

n :
number of variables to allocate
Return value :
the array or NULL if failed.

tifiles_content_delete_group

TIEXPORT2 int TICALL tifiles_content_delete_group(FileContent **array)

Convenient function which free a NULL-terminated array of #FileContent structures (typically used to store a group file) and the array itself.

Return value :
always 0.

tifiles_group_contents

TIEXPORT2 int TICALL tifiles_group_contents(FileContent **src_contents, FileContent **dst_content)

Must be freed when no longer needed as well as the content of each #FileContent structure (use #tifiles_content_delete_regular as usual).

src_contents :
a pointer on an array of #FileContent structures. The array must be NULL-terminated.
dst_content :
the address of a pointer. This pointer will see the allocated group file.
Return value :
an error code if unsuccessful, 0 otherwise.

tifiles_ungroup_content

TIEXPORT2 int TICALL tifiles_ungroup_content(FileContent *src, FileContent ***dest)



src_content :
a pointer on the structure to unpack.
dst_contents :
the address of your pointer. This pointers will point on a
Return value :
an error code if unsuccessful, 0 otherwise.

tifiles_group_files

TIEXPORT2 int TICALL tifiles_group_files(char **src_filenames, const char *dst_filename)

Group several TI files into a single one (group file).

src_filenames :
a NULL-terminated array of strings (list of files to group).
dst_filename :
the filename where to store the group.
Return value :
an error code if unsuccessful, 0 otherwise.

tifiles_ungroup_file

TIEXPORT2 int TICALL tifiles_ungroup_file(const char *src_filename, char ***dst_filenames)



src_filename :
full path of file to ungroup.
dst_filenames :
NULL or the address of a pointer where to store a NULL-terminated
Return value :
there is no existence check; files may be overwritten ! %dst_filenames must be freed when no longer used. Return value: an error code if unsuccessful, 0 otherwise.

tifiles_content_add_entry

TIEXPORT2 int TICALL tifiles_content_add_entry(FileContent *content, VarEntry *ve)

Adds the entry to the file content and updates internal structures. Beware: the entry is not duplicated.

content :
a file content (single/group only).
ve :
the entry to add
Return value :
the number of entries.

tifiles_content_del_entry

TIEXPORT2 int TICALL tifiles_content_del_entry(FileContent *content, VarEntry *ve)

Search for entry name and remove it from file content (not tested !).

content :
a file content (single/group only).
ve :
the entry to remove
Return value :
the number of entries or -1 if not found.

tifiles_group_add_file

TIEXPORT2 int TICALL tifiles_group_add_file(const char *src_filename, const char *dst_filename)

Add src_filename content to dst_filename content and write to dst_filename.

src_filename :
the file to add to group file
dst_filename :
the group file
Return value :
0 if successful, an error code otherwise.

tifiles_group_del_file

TIEXPORT2 int TICALL tifiles_group_del_file(VarEntry *entry, const char *dst_filename)

Search for entry and remove it from file.

src_filename :
the file to remove from group file
dst_filename :
the group file
Return value :
0 if successful, an error code otherwise.

Return to the main index