Greenbone Vulnerability Management Libraries: base/settings.h Source File

Greenbone Vulnerability Management Libraries 23.1.2

settings.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2010-2023 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
12
13#ifndef _GVM_BASE_SETTINGS_H
14#define _GVM_BASE_SETTINGS_H
15
16#include <glib.h>
17
22 typedef struct
23{
24 gchar *file_name;
25 gchar *group_name;
26 GKeyFile *key_file;
27} settings_t;
28
29void
30 settings_cleanup (settings_t *);
31
35 typedef struct
36{
37 gchar **keys;
38 settings_t settings;
39 gchar **current_key;
40 gchar **last_key;
41} settings_iterator_t;
42
43int
44 init_settings_iterator_from_file (settings_iterator_t *, const gchar *,
45 const gchar *);
46void
47 cleanup_settings_iterator (settings_iterator_t *);
48int
49 settings_iterator_next (settings_iterator_t *);
50const gchar *
51 settings_iterator_name (settings_iterator_t *);
52gchar *
53 settings_iterator_value (settings_iterator_t *);
54
55#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