/ gwcategory.h / Functions / Description

Functions



category_new

Creates a new category.
struct category * category_new ( void);
This function creates a new category. It's an allocation function.

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


category_set_index

Sets the category's index.
gint category_set_index ( struct category *p, gint index);
This function sets the category's index. This index must be unique.


Parameters
p the category to set the name
index the index number

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


category_set_name

Sets the category's name.
gint category_set_name ( struct category *p, gchar *name);
This function sets the category's name.
The name may be null. It's dangerous!!

Parameters
p the category to set the name
name the name

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


category_set_description

Sets the category's description.
gint category_set_description ( struct category *p, gchar *description);
This function sets the category's description.


Parameters
p the category to set the description
description the description

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


category_set_number_catalog

Sets the category's number catalogs.
gint category_set_number_catalog ( struct category *p, gint num);
This function sets the number of catalogs which use this category.


Parameters
p the category to set the number of catalogs
num the number of catalogs

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


category_set_number_disk

Sets the category's number disks.
gint category_set_number_disk ( struct category *p, gint num);
This function sets the number of disks which use this category.


Parameters
p the category to set the number of disks
num the number of disks

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


category_set_number_folder

Sets the category's number folders.
gint category_set_number_folder ( struct category *p, gint num);
This function sets the number of folders which use this category.


Parameters
p the category to set the number of folders
num the number of folders

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


category_set_number_file

Sets the category's number files.
gint category_set_number_file ( struct category *p, gint num);
This function sets the number of files which use this category.


Parameters
p the category to set the number of files
num the number of files

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


category_get_index

Gets the category's index.
gint category_get_index ( struct category *p);
This function gets the category's index.


Parameters
p the category to get index

Result: the category index.
Returns -1 when an error occured.
.


category_get_name

Gets the category's name.
gchar * category_get_name ( struct category *p);
This function gets the category's name.


Parameters
p the category to get name

Result: the category name.
Returns "" if the category name is NULL Returns NULL when an error occured.
.


category_get_description

Gets the category's description.
gchar * category_get_description ( struct category *p);
This function gets the category's description.


Parameters
p the category to get description

Result: the category description.
Returns "" if the category description is NULL Returns NULL when an error occured.
.


category_get_number_catalog

Gets the category's number catalogs.
gint category_get_number_catalog ( struct category *p);
This function gets the number of catalogs which use this category.


Parameters
p the category to get number of catalogs

Result: the number of catalogs.
Returns -1 when an error occured.
.


category_get_number_disk

Gets the category's number disks.
gint category_get_number_disk ( struct category *p);
This function gets the number of disks which use this category.


Parameters
p the category to get number of disks

Result: the number of disks.
Returns -1 when an error occured.
.


category_get_number_folder

Gets the category's number folders.
gint category_get_number_folder ( struct category *p);
This function gets the number of folders which use this category.


Parameters
p the category to get number of folders

Result: the number of folders.
Returns -1 when an error occured.
.


category_get_number_file

Gets the category's number files.
gint category_get_number_file ( struct category *p);
This function gets the number of files which use this category.


Parameters
p the category to get number of files

Result: the number of files.
Returns -1 when an error occured.
.


category_add_catalog

Adds a catalog to the category
gint category_add_catalog ( struct category *p);
This function adds a catalog that use this category. This function increments the category's number of catalogs.


Parameters
p the category to add a catalog

Result: the number of catalogs.
Returns -1 when an error occured.
.


category_add_disk

Adds a disk to the category
gint category_add_disk ( struct category *p);
This function adds a disk that use this category. This function increments the category's number of disks.


Parameters
p the category to add a disk

Result: the number of disks.
Returns -1 when an error occured.
.


category_add_folder

Adds a folder to the category
gint category_add_folder ( struct category *p);
This function adds a folder that use this category. This function increments the category's number of folders.


Parameters
p the category to add a folder

Result: the number of folders.
Returns -1 when an error occured.
.


category_add_file

Adds a file to the category
gint category_add_file ( struct category *p);
This function adds a file that use this category. This function increments the category's number of files.


Parameters
p the category to add a file

Result: the number of files.
Returns -1 when an error occured.
.


category_remove_catalog

Removes a catalog to the category
gint category_remove_catalog ( struct category *p);
This function removes a catalog that use this category. This function decriment the category's number of catalogs.


Parameters
p the category to remove a catalog

Result: the number of catalogs.
Returns -1 when an error occured.
.


category_remove_disk

Removes a disk to the category
gint category_remove_disk ( struct category *p);
This function removes a disk that use this category. This function decriment the category's number of disks.


Parameters
p the category to remove a disk

Result: the number of disks.
Returns -1 when an error occured.
.


category_remove_folder

Removes a folder to the category
gint category_remove_folder ( struct category *p);
This function removes a folder that use this category. This function decriment the category's number of folders.


Parameters
p the category to remove a folder

Result: the number of folders.
Returns -1 when an error occured.
.


category_remove_file

Removes a file to the category
gint category_remove_file ( struct category *p);
This function removes a file that use this category. This function decriment the category's number of files.


Parameters
p the category to remove a file

Result: the number of files.
Returns -1 when an error occured.
.


category_can_removed

Gets if the category can be removed.
gboolean category_can_removed ( struct category *p);
This function gets if the category can be removed. The category can be removed if nothing use this category


Parameters
p the category to know if it can be removed

Result: is can be removed.
Returns FALSE when an error occured.
.


category_free

Frees datas structure.
gint category_free ( struct category *p);
This function frees the category's datas.

Parameters
p the category to free

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