44 #include "../base/settings.h" 47 static struct arglist *global_prefs = NULL;
60 global_prefs = g_malloc0 (
sizeof (
struct arglist));
117 if (str && !strcmp (str,
"yes"))
180 struct arglist * prefs = global_prefs;
182 while (prefs && prefs->
next)
184 printf (
"%s = %s\n", prefs->
name, (
char *) prefs->
value);
200 char *pref_name = g_strdup_printf (
"timeout.%s",
oid);
202 int timeout = (
val ? atoi (
val) : 0);
const gchar * settings_iterator_name(settings_iterator_t *iterator)
Get the name from a settings iterator.
gboolean settings_iterator_next(settings_iterator_t *iterator)
Increment an iterator.
int arg_set_value(struct arglist *arglst, const char *name, void *value)
void arg_free(struct arglist *arg)
const gchar * prefs_get(const gchar *key)
Get a string preference value via a key.
void cleanup_settings_iterator(settings_iterator_t *iterator)
Cleanup a settings iterator.
void arg_add_value(struct arglist *arglst, const char *name, int type, void *value)
void prefs_set(const gchar *key, const gchar *value)
Set a string preference value via a key.
const gchar * settings_iterator_value(settings_iterator_t *iterator)
Get the value from a settings iterator.
void prefs_config(const char *config)
Apply the configs from given file as preferences.
struct arglist * preferences_get(void)
Get the pointer to the global preferences structure. Eventually this function should not be used anyw...
int init_settings_iterator_from_file(settings_iterator_t *iterator, const gchar *filename, const gchar *group)
Initialise a settings iterator from a file.
int arg_get_type(struct arglist *args, const char *name)
void * arg_get_value(struct arglist *args, const char *name)
int prefs_nvt_timeout(const char *oid)
Returns the timeout defined by the client or 0 if none was set.
int prefs_get_bool(const gchar *key)
Get a boolean expression of a preference value via a key.
void prefs_dump(void)
Dump the preferences to stdout.