/ gwdirdata.h / Functions / Description

Functions



dir_data_new

Creates a new dir data.
struct dir_data * dir_data_new ( void);
This function creates a new dir data. It's an allocation function.

Result: a pointer to the dir data structure.
Returns NULL when an error occured.
.


dir_data_set_info

Sets the dir data's informations.
gint dir_data_set_info ( struct dir_data *p, struct file_info *info);
This function sets the directory's information. Directory informations is a struct file_info.


Parameters
p the dir data to set the informations
info the directory informations

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


dir_data_set_child

Sets the dir data's children.
gint dir_data_set_child ( struct dir_data *p, GList *child);
This function sets the directory's children. The list of children is the list of file and subfolders in the directory.


Parameters
p the dir data to set the children
child the list of children

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


dir_data_append_child

Appends in the dir data's children a new child.
gint dir_data_append_child ( struct dir_data *p, struct file_info *child);
This function appends in the dir dat's children list a new child.


Parameters
p the dir data to append a child
child the child

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


dir_data_remove_child

Removes and frees in the dir data's children a child.
gint dir_data_remove_child ( struct dir_data *p, struct file_info *child);
This function removes and frees in the dir dat's children list a child.


Parameters
p the dir data to removes and frees a child
child the child

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


dir_data_get_info

Gets dir data's informations.
struct file_info * dir_data_get_info ( struct dir_data *p);
This function gets the dir data's informations.


Parameters
p the dir data to get informations

Result: the file informations.
Returns NULL when an error occured.
.


dir_data_get_child

Gets dir data's list of children.
GList * dir_data_get_child ( struct dir_data *p);
This function gets the dir data's list of children. This list is the list of files and subfolders in the directory.


Parameters
p the dir data to get list of children

Result: the list of children.
Returns NULL when an error occured.
.


dir_data_get_child_named

Gets special dir data's child.
GList * dir_data_get_child_named ( struct dir_data *p, gchar *name);
This function gets the dir data's child with a special name.


Parameters
p the dir data to get the child

Result: the child.
Returns NULL when an error occured.
.


dir_data_get_num_file

Gets the number of file in the dir data.
int dir_data_get_num_file ( struct dir_data *p);
This function gets the number of files and subfolders in the dir data.


Parameters
p the dir data to get the number of file

Result: the number of files and subfolders.
Returns NULL when an error occured.
.


dir_data_free

Frees datas structure.
gboolean dir_data_free ( struct dir_data *p);
This function frees the dir data's datas.

Parameters
p the dir data to free

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