OpenVAS Libraries  6.0+beta5
Functions
hash_table_file.h File Reference
#include <glib.h>

Go to the source code of this file.

Functions

gboolean hash_table_file_write (GHashTable *ghashtable, const char *filename)
 Writes key/value pairs from a g_hash_table into a key/value file. More...
 
GHashTable * hash_table_file_read (const char *filename)
 Reads key/value pairs (strings) from a file back into a GHashtable. More...
 
GHashTable * hash_table_file_read_text (const char *text, gsize length)
 Reads key/value pairs (strings) from a text into a GHashtable. More...
 

Detailed Description

Protos for module hash_table_file.c.

Function Documentation

GHashTable* hash_table_file_read ( const char *  filename)

Reads key/value pairs (strings) from a file back into a GHashtable.

The file has to follow freedesktop.org specifications.

Parameters
filenameThe filename to read from.
Returns
A GHashTable, mirroring the file or NULL in case of an error.
See Also
hash_table_file_write
GKeyFile
GHashTable* hash_table_file_read_text ( const char *  text,
gsize  length 
)

Reads key/value pairs (strings) from a text into a GHashtable.

The text has to follow freedesktop.org specifications (e.g. be the text of a ini- file).

Parameters
textThe text to use.
lengthLenght of text.
Returns
A GHashTable, mirroring the text or NULL in case of an error.
See Also
hash_table_file_read
hash_table_file_write
GKeyFile
gboolean hash_table_file_write ( GHashTable *  ghashtable,
const char *  filename 
)

Writes key/value pairs from a g_hash_table into a key/value file.

The procedure will only work with string keys and string values. The file format follows freedesktop.org specifications, the group will be GROUP_NONE (define).

Parameters
ghashtableThe hashtable to read key/value pairs from.
filenameThe filename for the key/value file.
Returns
TRUE in case of success, FALSE otherwise.
See Also
hash_table_file_read
GKeyFile