settings.h
Go to the documentation of this file.
/* SPDX-FileCopyrightText: 2010-2023 Greenbone AG
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _GVM_BASE_SETTINGS_H
#define _GVM_BASE_SETTINGS_H
#include <glib.h>
typedef struct
{
gchar *file_name;
gchar *group_name;
GKeyFile *key_file;
} settings_t;
void
settings_cleanup (settings_t *);
typedef struct
{
gchar **keys;
settings_t settings;
gchar **current_key;
gchar **last_key;
} settings_iterator_t;
int
init_settings_iterator_from_file (settings_iterator_t *, const gchar *,
const gchar *);
void
cleanup_settings_iterator (settings_iterator_t *);
int
settings_iterator_next (settings_iterator_t *);
const gchar *
settings_iterator_name (settings_iterator_t *);
gchar *
settings_iterator_value (settings_iterator_t *);
#endif /* not _GVM_BASE_SETTINGS_H */
cleanup_settings_iterator
void cleanup_settings_iterator(settings_iterator_t *)
Cleanup a settings iterator.
Definition settings.c:136
settings_iterator_value
gchar * settings_iterator_value(settings_iterator_t *)
Get the value from a settings iterator.
Definition settings.c:179
init_settings_iterator_from_file
int init_settings_iterator_from_file(settings_iterator_t *, const gchar *, const gchar *)
Initialise a settings iterator from a file.
Definition settings.c:98
settings_iterator_name
const gchar * settings_iterator_name(settings_iterator_t *)
Get the name from a settings iterator.
Definition settings.c:166
settings_iterator_next
int settings_iterator_next(settings_iterator_t *)
Increment an iterator.
Definition settings.c:150
settings_cleanup
void settings_cleanup(settings_t *)
Cleanup a settings structure.
Definition settings.c:81
settings_iterator_t
Struct holding options to iterate over a GKeyFile.
Definition settings.h:36
settings_iterator_t::current_key
gchar ** current_key
Definition settings.h:39
settings_iterator_t::settings
settings_t settings
Definition settings.h:38
settings_iterator_t::keys
gchar ** keys
Definition settings.h:37
settings_iterator_t::last_key
gchar ** last_key
Definition settings.h:40
settings_t
Struct holding options for settings taken from a key-value config file.
Definition settings.h:23
settings_t::key_file
GKeyFile * key_file
Definition settings.h:26
settings_t::group_name
gchar * group_name
Definition settings.h:25
settings_t::file_name
gchar * file_name
Definition settings.h:24