tree-wide: rename config_parse_many to …_nulstr
In preparation for adding a version which takes a strv.
This commit is contained in:
parent
047a0dacde
commit
43688c49d1
|
@ -79,7 +79,7 @@
|
|||
#endif
|
||||
|
||||
/* Return a nulstr for a standard cascade of configuration paths,
|
||||
* suitable to pass to conf_files_list_nulstr() or config_parse_many()
|
||||
* suitable to pass to conf_files_list_nulstr() or config_parse_many_nulstr()
|
||||
* to implement drop-in directories for extending configuration
|
||||
* files. */
|
||||
#define CONF_PATHS_NULSTR(n) \
|
||||
|
|
|
@ -715,7 +715,7 @@ static int parse_config_file(void) {
|
|||
CONF_PATHS_NULSTR("systemd/system.conf.d") :
|
||||
CONF_PATHS_NULSTR("systemd/user.conf.d");
|
||||
|
||||
config_parse_many(fn, conf_dirs_nulstr, "Manager\0", config_item_table_lookup, items, false, NULL);
|
||||
config_parse_many_nulstr(fn, conf_dirs_nulstr, "Manager\0", config_item_table_lookup, items, false, NULL);
|
||||
|
||||
/* Traditionally "0" was used to turn off the default unit timeouts. Fix this up so that we used USEC_INFINITY
|
||||
* like everywhere else. */
|
||||
|
|
|
@ -128,7 +128,7 @@ static int parse_config(void) {
|
|||
{}
|
||||
};
|
||||
|
||||
return config_parse_many(PKGSYSCONFDIR "/coredump.conf",
|
||||
return config_parse_many_nulstr(PKGSYSCONFDIR "/coredump.conf",
|
||||
CONF_PATHS_NULSTR("systemd/coredump.conf.d"),
|
||||
"Coredump\0",
|
||||
config_item_table_lookup, items,
|
||||
|
|
|
@ -1198,7 +1198,7 @@ static int parse_config(void) {
|
|||
{ "Remote", "TrustedCertificateFile", config_parse_path, 0, &arg_trust },
|
||||
{}};
|
||||
|
||||
return config_parse_many(PKGSYSCONFDIR "/journal-remote.conf",
|
||||
return config_parse_many_nulstr(PKGSYSCONFDIR "/journal-remote.conf",
|
||||
CONF_PATHS_NULSTR("systemd/journal-remote.conf.d"),
|
||||
"Remote\0", config_item_table_lookup, items,
|
||||
false, NULL);
|
||||
|
|
|
@ -542,7 +542,7 @@ static int parse_config(void) {
|
|||
{ "Upload", "TrustedCertificateFile", config_parse_path, 0, &arg_trust },
|
||||
{}};
|
||||
|
||||
return config_parse_many(PKGSYSCONFDIR "/journal-upload.conf",
|
||||
return config_parse_many_nulstr(PKGSYSCONFDIR "/journal-upload.conf",
|
||||
CONF_PATHS_NULSTR("systemd/journal-upload.conf.d"),
|
||||
"Upload\0", config_item_table_lookup, items,
|
||||
false, NULL);
|
||||
|
|
|
@ -1474,7 +1474,7 @@ static int server_parse_proc_cmdline(Server *s) {
|
|||
static int server_parse_config_file(Server *s) {
|
||||
assert(s);
|
||||
|
||||
return config_parse_many(PKGSYSCONFDIR "/journald.conf",
|
||||
return config_parse_many_nulstr(PKGSYSCONFDIR "/journald.conf",
|
||||
CONF_PATHS_NULSTR("systemd/journald.conf.d"),
|
||||
"Journal\0",
|
||||
config_item_perf_lookup, journald_gperf_lookup,
|
||||
|
|
|
@ -1002,7 +1002,7 @@ static int manager_dispatch_idle_action(sd_event_source *s, uint64_t t, void *us
|
|||
static int manager_parse_config_file(Manager *m) {
|
||||
assert(m);
|
||||
|
||||
return config_parse_many(PKGSYSCONFDIR "/logind.conf",
|
||||
return config_parse_many_nulstr(PKGSYSCONFDIR "/logind.conf",
|
||||
CONF_PATHS_NULSTR("systemd/logind.conf.d"),
|
||||
"Login\0",
|
||||
config_item_perf_lookup, logind_gperf_lookup,
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
int manager_parse_config_file(Manager *m) {
|
||||
assert(m);
|
||||
|
||||
return config_parse_many(PKGSYSCONFDIR "/networkd.conf",
|
||||
return config_parse_many_nulstr(PKGSYSCONFDIR "/networkd.conf",
|
||||
CONF_PATHS_NULSTR("systemd/networkd.conf.d"),
|
||||
"DHCP\0",
|
||||
config_item_perf_lookup, networkd_gperf_lookup,
|
||||
|
|
|
@ -151,7 +151,7 @@ static int network_load_one(Manager *manager, const char *filename) {
|
|||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = config_parse_many(filename, dropin_dirs_nulstr,
|
||||
r = config_parse_many_nulstr(filename, dropin_dirs_nulstr,
|
||||
"Match\0"
|
||||
"Link\0"
|
||||
"Network\0"
|
||||
|
|
|
@ -221,7 +221,7 @@ int manager_parse_config_file(Manager *m) {
|
|||
|
||||
assert(m);
|
||||
|
||||
r = config_parse_many(PKGSYSCONFDIR "/resolved.conf",
|
||||
r = config_parse_many_nulstr(PKGSYSCONFDIR "/resolved.conf",
|
||||
CONF_PATHS_NULSTR("systemd/resolved.conf.d"),
|
||||
"Resolve\0",
|
||||
config_item_perf_lookup, resolved_gperf_lookup,
|
||||
|
|
|
@ -397,13 +397,15 @@ int config_parse(const char *unit,
|
|||
}
|
||||
|
||||
/* Parse each config file in the specified directories. */
|
||||
int config_parse_many(const char *conf_file,
|
||||
const char *conf_file_dirs,
|
||||
const char *sections,
|
||||
ConfigItemLookup lookup,
|
||||
const void *table,
|
||||
bool relaxed,
|
||||
void *userdata) {
|
||||
int config_parse_many_nulstr(
|
||||
const char *conf_file,
|
||||
const char *conf_file_dirs,
|
||||
const char *sections,
|
||||
ConfigItemLookup lookup,
|
||||
const void *table,
|
||||
bool relaxed,
|
||||
void *userdata) {
|
||||
|
||||
_cleanup_strv_free_ char **files = NULL;
|
||||
char **fn;
|
||||
int r;
|
||||
|
|
|
@ -84,24 +84,26 @@ int config_item_table_lookup(const void *table, const char *section, const char
|
|||
* ConfigPerfItem tables */
|
||||
int config_item_perf_lookup(const void *table, const char *section, const char *lvalue, ConfigParserCallback *func, int *ltype, void **data, void *userdata);
|
||||
|
||||
int config_parse(const char *unit,
|
||||
const char *filename,
|
||||
FILE *f,
|
||||
const char *sections, /* nulstr */
|
||||
ConfigItemLookup lookup,
|
||||
const void *table,
|
||||
bool relaxed,
|
||||
bool allow_include,
|
||||
bool warn,
|
||||
void *userdata);
|
||||
int config_parse(
|
||||
const char *unit,
|
||||
const char *filename,
|
||||
FILE *f,
|
||||
const char *sections, /* nulstr */
|
||||
ConfigItemLookup lookup,
|
||||
const void *table,
|
||||
bool relaxed,
|
||||
bool allow_include,
|
||||
bool warn,
|
||||
void *userdata);
|
||||
|
||||
int config_parse_many(const char *conf_file, /* possibly NULL */
|
||||
const char *conf_file_dirs, /* nulstr */
|
||||
const char *sections, /* nulstr */
|
||||
ConfigItemLookup lookup,
|
||||
const void *table,
|
||||
bool relaxed,
|
||||
void *userdata);
|
||||
int config_parse_many_nulstr(
|
||||
const char *conf_file, /* possibly NULL */
|
||||
const char *conf_file_dirs, /* nulstr */
|
||||
const char *sections, /* nulstr */
|
||||
ConfigItemLookup lookup,
|
||||
const void *table,
|
||||
bool relaxed,
|
||||
void *userdata);
|
||||
|
||||
/* Generic parsers */
|
||||
int config_parse_int(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
|
||||
|
|
|
@ -58,7 +58,7 @@ int parse_sleep_config(const char *verb, char ***_modes, char ***_states) {
|
|||
{}
|
||||
};
|
||||
|
||||
config_parse_many(PKGSYSCONFDIR "/sleep.conf",
|
||||
config_parse_many_nulstr(PKGSYSCONFDIR "/sleep.conf",
|
||||
CONF_PATHS_NULSTR("systemd/sleep.conf.d"),
|
||||
"Sleep\0", config_item_table_lookup, items,
|
||||
false, NULL);
|
||||
|
|
|
@ -98,7 +98,7 @@ int config_parse_servers(
|
|||
int manager_parse_config_file(Manager *m) {
|
||||
assert(m);
|
||||
|
||||
return config_parse_many(PKGSYSCONFDIR "/timesyncd.conf",
|
||||
return config_parse_many_nulstr(PKGSYSCONFDIR "/timesyncd.conf",
|
||||
CONF_PATHS_NULSTR("systemd/timesyncd.conf.d"),
|
||||
"Time\0",
|
||||
config_item_perf_lookup, timesyncd_gperf_lookup,
|
||||
|
|
Loading…
Reference in New Issue