|
Greenbone Vulnerability Management Libraries 22.32.0
|
Implementation of API to handle globally stored preferences. More...
#include "prefs.h"#include "settings.h"#include <glib.h>#include <stdio.h>#include <stdlib.h>#include <string.h>

Go to the source code of this file.
Macros | |
| #define | G_LOG_DOMAIN "libgvm base" |
| GLib log domain. | |
Functions | |
| void | prefs_set (const gchar *key, const gchar *value) |
| Set a string preference value via a key. | |
| static void | prefs_init (void) |
| Initializes the preferences structure. If it was already initialized, remove old settings and start from scratch. | |
| GHashTable * | preferences_get (void) |
| Get the pointer to the global preferences structure. Eventually this function should not be used anywhere. | |
| const gchar * | prefs_get (const gchar *key) |
| Get a string preference value via a key. | |
| int | prefs_get_bool (const gchar *key) |
| Get a boolean expression of a preference value via a key. | |
| void | prefs_config (const char *config) |
| Apply the configs from given file as preferences. | |
| void | prefs_dump (void) |
| Dump the preferences to stdout. | |
Variables | |
| static GHashTable * | global_prefs = NULL |
Implementation of API to handle globally stored preferences.
A global store of preferences to scanner and NVTs is handled by this module.
Definition in file prefs.c.
| GHashTable * preferences_get | ( | void | ) |
Get the pointer to the global preferences structure. Eventually this function should not be used anywhere.
Definition at line 81 of file prefs.c.
References global_prefs, and prefs_init().
Referenced by Ensure(), and Ensure().


| void prefs_config | ( | const char * | config | ) |
Apply the configs from given file as preferences.
| config | Filename of the configuration file. |
Definition at line 156 of file prefs.c.
References cleanup_settings_iterator(), global_prefs, init_settings_iterator_from_file(), prefs_init(), prefs_set(), settings_iterator_name(), settings_iterator_next(), and settings_iterator_value().
Referenced by Ensure().


| void prefs_dump | ( | void | ) |
Dump the preferences to stdout.
Definition at line 184 of file prefs.c.
References global_prefs.
| const gchar * prefs_get | ( | const gchar * | key | ) |
Get a string preference value via a key.
| key | The identifier for the preference. |
Definition at line 99 of file prefs.c.
References global_prefs, and prefs_init().
Referenced by Ensure(), Ensure(), Ensure(), Ensure(), and Ensure().


| int prefs_get_bool | ( | const gchar * | key | ) |
Get a boolean expression of a preference value via a key.
| key | The identifier for the preference. |
Definition at line 119 of file prefs.c.
References global_prefs, and prefs_init().
Referenced by Ensure(), Ensure(), and Ensure().


|
static |
Initializes the preferences structure. If it was already initialized, remove old settings and start from scratch.
Definition at line 40 of file prefs.c.
References global_prefs, and prefs_set().
Referenced by preferences_get(), prefs_config(), prefs_get(), prefs_get_bool(), and prefs_set().


| void prefs_set | ( | const gchar * | key, |
| const gchar * | value ) |
Set a string preference value via a key.
| key | The identifier for the preference. A copy of this will be created if necessary. |
| value | The value to set. A copy of this will be created. |
Definition at line 142 of file prefs.c.
References global_prefs, and prefs_init().
Referenced by Ensure(), Ensure(), Ensure(), Ensure(), Ensure(), prefs_config(), and prefs_init().


|
static |
Definition at line 29 of file prefs.c.
Referenced by AfterEach(), BeforeEach(), preferences_get(), prefs_config(), prefs_dump(), prefs_get(), prefs_get_bool(), prefs_init(), and prefs_set().