/ gwcatalogmanager.h / Functions / Description

Functions



catalog_load_file

Loads a catalog file.
gint catalog_load_file ( struct catalog_file_info *catalog_info, GtkCTree *ctree, GtkCTreeNode *parent);
This function creates the catalog's tree from a GWhere format file.

Parameters
catalog_info the catalog's datas
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_load_file_version_1

Loads a catalog file.
gint catalog_load_file_version_1 ( struct catalog_file_info *catalog_info, gzFile fic, GtkCTree *ctree, GtkCTreeNode *parent);
This function creates the catalog's tree from a GWhere format file from a file formated with file version 1.
Goto to specification for file format specifications.


Parameters
catalog_info the catalog's datas
fic the file source descriptor
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_load_file_version_2

Loads a catalog file.
gint catalog_load_file_version_2 ( struct catalog_file_info *catalog_info, gzFile fic, GtkCTree *ctree, GtkCTreeNode *parent, GWStringBuffer *sb);
This function creates the catalog's tree from a GWhere format file from a file formated with file version 2.
Goto to specification for file format specifications.


Parameters
catalog_info the catalog's datas
fic the file source descriptor
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root
sb the used string buffer to read catalog file

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_load_disk_1

Loads a disk from catalog file.
gint catalog_load_disk_1 ( gzFile fic, GtkCTree *ctree, GtkCTreeNode *parent);
This function loads a disk to the catalog's tree from a GWhere format file from a file formated with file version 1.
Goto to specification for file format specifications.


Parameters
fic the file source descriptor
ctree the tree where disk will be loaded
parent the node in the tree where is the catalog root

Result: returns the number under directories.
.


catalog_load_disk_2

Loads a disk from catalog file.
gint catalog_load_disk_2 ( gzFile fic, GtkCTree *ctree, GtkCTreeNode *parent, GWStringBuffer *sb);
This function loads a disk to the catalog's tree from a GWhere format file from a file formated with file version 2.
Goto to specification for file format specifications.


Parameters
fic the file source descriptor
ctree the tree where disk will be loaded
parent the node in the tree where is the catalog root
sb the string buffer used to read the catalog file

Result: returns the number under directories.
.


catalog_load_dir_1

Loads a directory from catalog file.
gint catalog_load_dir_1 ( gzFile fic, GtkCTree *ctree, GtkCTreeNode *parent);
This function loads a directory to the catalog's tree from a GWhere format file from a file formated with file version 1.
Goto to specification for file format specifications.


Parameters
fic the file source descriptor
ctree the tree where directory will be loaded
parent the node in the tree where is the parent directory is

Result: returns the number under directories.
.


catalog_load_dir_2

Loads a directory from catalog file.
gint catalog_load_dir_2 ( gzFile fic, GtkCTree *ctree, GtkCTreeNode *parent, GWStringBuffer *sb);
This function loads a directory to the catalog's tree from a GWhere format file from a file formated with file version 2.
Goto to specification for file format specifications.


Parameters
fic the file source descriptor
ctree the tree where directory will be loaded
parent the node in the tree where is the parent directory is
sb the string buffer used to read the catalog file

Result: returns the number under directories.
.


catalog_add_disk

This function adds a disk to the catalog.
gint catalog_add_disk ( struct scan_disk_info *scan_disk, GtkCTree *ctree, GtkCTreeNode *parent);
This function adds a disk to the catalog's tree.


Parameters
scan_disk the ScanDiskInfo to scan
ctree the tree where the disk will be added
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_add_dir

This function adds a directory to the catalog.
gint catalog_add_dir ( struct scan_disk_info *scan_disk, gchar *directory, struct dir_info *dir_info, GtkCTree *ctree, GtkCTreeNode *parent);
This function adds a directory to the catalog's tree.


Parameters
scan_disk the scan disk
directory the directory name to add
dir_info the directory informations
ctree the tree where the disk will be added
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_save_file

Saves a catalog to a file.
gint catalog_save_file ( gchar *file, GtkCTree *ctree, GtkCTreeNode *parent);
This function saves the catalog's tree to a GWhere format file.

Parameters
file the file name to save
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_save_file_version_1

Saves a catalog to a file.
gint catalog_save_file_version_1 ( gchar *file, GtkCTree *ctree, GtkCTreeNode *parent);
This function saves the catalog's tree to a GWhere format file from a file formated with file version 1.


Parameters
file the file name to save
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_save_file_version_2

Saves a catalog to a file.
gint catalog_save_file_version_2 ( gchar *file, GtkCTree *ctree, GtkCTreeNode *parent);
This function saves the catalog's tree to a GWhere format file from a file formated with file version 2.


Parameters
file the file name to save
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_save_file_disk_1

Saves a disk to a file.
gint catalog_save_file_disk_1 ( gint fic, GtkCTree *ctree, GtkCTreeNode *parent);
This function saves the disk in the catalog's tree to a GWhere format file from a file formated with file version 1.


Parameters
file the file name to save
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_save_file_disk_2

Saves a disk to a file.
gint catalog_save_file_disk_2 ( gint fic, GtkCTree *ctree, GtkCTreeNode *parent);
This function saves the disk in the catalog's tree to a GWhere format file from a file formated with file version 2.


Parameters
file the file name to save
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_save_file_dir_1

Saves a directory to a file.
gint catalog_save_file_dir_1 ( gint fic, GtkCTree *ctree, GtkCTreeNode *parent);
This function saves the directory in the catalog's tree to a GWhere format file from a file formated with file version 1.


Parameters
file the file name to save
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_save_file_dir_2

Saves a directory to a file.
gint catalog_save_file_dir_2 ( gzFile fic, GtkCTree *ctree, GtkCTreeNode *parent, GWStringBuffer *buf[2]);
This function saves the directory in the catalog's tree to a GWhere format file from a file formated with file version 2.


Parameters
file the file name to save
ctree the tree where catalog will be loaded
parent the node in the tree where is the catalog root
buf the used string buffer to encode all string to file format

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_ctree_data_free

Frees all data's ctree.
gint catalog_ctree_data_free ( GList *p);
This function frees all datas allocated for the ctree. These datas are attached to each node of the catalog's tree in order to list all files.


Parameters
p the list of datas

Result: an error code.
Returns 0 when it's done.
Returns -1 when an error occured.
.


catalog_disk_info_new_from_table

Creates a new disk information from a catalog file.
struct disk_info * catalog_disk_info_new_from_table ( gchar **attrib, gint file_version);
This function creates a new disk information from table readed in a catalog file and from a file version. It's an allocation function.

Parameters
attrib the table of attributes
file_version the number of file version

Result: a pointer to the disk information structure.
.


catalog_disk_info_new_from_str

Creates a new disk information from a catalog file.
struct disk_info * catalog_disk_info_new_from_str ( gchar *str, gint file_version, struct catalog_file_info *catalog_info);
This function creates a new disk information from string readed in a catalog file and from a file version. It's an allocation function.

Parameters
str the string of attributes
file_version the number of file version
catalog_info the catalog which contains some needed categories

Result: a pointer to the disk information structure.
.


catalog_disk_info_to_file

Makes a string to save disk informations.
gchar * catalog_disk_info_to_file ( struct disk_info *p, gint file_version);
This function makes a formated string to save disk informations in a file.

Parameters
p the disk informations to save
file_version the file version to save disk informations

Result: the string to save.
Returns null when an error occured.
.


catalog_file_info_new_from_table

Creates a new file information from a catalog file.
struct file_info * catalog_file_info_new_from_table ( gchar **attrib, gboolean folder, gint file_version);
This function creates a new file information from table readed in a catalog file and from a file version. It's an allocation function.

Parameters
attrib the table of attributes
folder indicates if this is a folder
file_version the number of file version
catalog_info the catalog which contains some needed categories

Result: a pointer to the file information structure.
.


catalog_file_info_new_from_str

Creates a new file information from a catalog file.
struct file_info * catalog_file_info_new_from_str ( gchar *str, gboolean folder, gint file_version, struct catalog_file_info *catalog_info);
This function creates a new file information from a string readed in a catalog file and from a file version. It's an allocation function.

Parameters
str the string of attributes
folder indicates if this is a folder
file_version the number of file version
catalog_info the catalog which contains some needed categories

Result: a pointer to the file information structure.
.


catalog_file_info_to_file

Makes a string to save file informations.
gchar * catalog_file_info_to_file ( struct file_info *p, gint file_version);
This function makes a formated string to save file informations in a file.

Parameters
p the file informations to save
file_version the file version to save file informations

Result: the string to save.
Returns null when an error occured.
.