File: swupdate_settings.h

package info (click to toggle)
swupdate 2025.12%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,004 kB
  • sloc: ansic: 66,621; python: 6,291; makefile: 791; sh: 538; javascript: 229
file content (26 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * (C) Copyright 2016-2023
 * Stefano Babic <stefano.babic@swupdate.org>
 *
 * SPDX-License-Identifier:     GPL-2.0-only
 */

#pragma once

#include <unistd.h>

typedef int (*settings_callback)(void *elem, void *data);

#include <libconfig.h>

typedef struct {
	config_t cfg;
} swupdate_cfg_handle;

void swupdate_cfg_init(swupdate_cfg_handle *handle);
int swupdate_cfg_read_file(swupdate_cfg_handle *handle, const char *filename);

void swupdate_cfg_destroy(swupdate_cfg_handle *handle);
int read_module_settings(swupdate_cfg_handle *handle, const char *module, settings_callback fcn, void *data);
int read_settings_user_id(swupdate_cfg_handle *handle, const char *module, uid_t *userid, gid_t *groupid);
int settings_into_dict(void *settings, void *data);