conf: cleanup and relocation of common parsing functions and helpers

- legacy.[ch]: strictly legacy .conf parser boilerplate only
 - conf.[ch]: .conf parser and generic configuration functionality

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-07-30 15:21:26 +02:00
1 parent c20d64587c
commit 47a18140c1
9 files changed
+831 -826

No files matched your search

+30 -22
View File
@@ -27,6 +27,10 @@
#include "cgroup.h"
#include "svc.h"
#include <sys/resource.h>
#define BOOTSTRAP (runlevel == INIT_LEVEL)
extern int runlevel;
extern int cfglevel;
extern int cmdlevel;
@@ -46,34 +50,38 @@ extern char *hostname;
extern char *runparts;
extern char *osheading;
extern int logfile_size_max;
extern int logfile_count_max;
extern int runparts_progress;
extern int runparts_sysv;
#define CGROUP_NAME_SIZE 16
#define CGROUP_SETTINGS_SIZE 128
extern int logfile_size_max;
extern int logfile_count_max;
extern char cgroup_current[CGROUP_NAME_SIZE];
extern char cgroup_settings_current[CGROUP_SETTINGS_SIZE];
extern int cgroup_delegate_current;
extern struct rlimit initial_rlimit[RLIMIT_NLIMITS];
extern struct rlimit global_rlimit[RLIMIT_NLIMITS];
extern char cgroup_current[CGROUP_NAME_SIZE];
extern char cgroup_settings_current[CGROUP_SETTINGS_SIZE];
extern int cgroup_delegate_current;
int str2rlim(char *str);
char *rlim2str(int rlim);
int conf_init (uev_ctx_t *ctx);
int conf_reload (void);
int conf_any_change (void);
int conf_changed (char *file);
int conf_monitor (void);
int conf_init (uev_ctx_t *ctx);
int conf_reload (void);
int conf_any_change (void);
int conf_changed (char *file);
int conf_monitor (void);
void conf_saverc (void);
void conf_save_exec_order (svc_t *svc, char *cmdline, int result);
void conf_save_service (int type, char *cfg, char *file);
void conf_parse_cmdline (int argc, char *argv[]);
void conf_reset_env (void);
void conf_saverc (void);
void conf_save_exec_order (svc_t *svc, char *cmdline, int result);
void conf_save_service (int type, char *cfg, char *file);
void conf_parse_cmdline (int argc, char *argv[]);
char *conf_parse_env (char *line, char **val);
int conf_parse_runlevels (char *runlevels);
void conf_parse_cond (svc_t *svc, char *cond);
void conf_reset_env (void);
void conf_set_env (char *line);
char *conf_parse_env (char *line, char **val);
void conf_parse_rlimit (char *line, struct rlimit arr[]);
int conf_parse_runlevels (const char *runlevels);
void conf_parse_cond (svc_t *svc, char *cond);
int conf_parse_file (char *file, int is_rcsd);
#endif /* FINIT_CONF_H_ */