return;
r = config_parse(NULL, BOOTCHART_CONF, f,
- NULL, config_item_table_lookup, (void*) items, true, false, NULL);
+ NULL, config_item_table_lookup, items, true, false, NULL);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));
STRV_FOREACH(f, u->dropin_paths) {
config_parse(u->id, *f, NULL,
UNIT_VTABLE(u)->sections, config_item_perf_lookup,
- (void*) load_fragment_gperf_lookup, false, false, u);
+ load_fragment_gperf_lookup, false, false, u);
}
u->dropin_mtime = now(CLOCK_REALTIME);
/* Now, parse the file contents */
r = config_parse(u->id, filename, f, UNIT_VTABLE(u)->sections,
config_item_perf_lookup,
- (void*) load_fragment_gperf_lookup, false, true, u);
+ load_fragment_gperf_lookup, false, true, u);
if (r < 0)
return r;
}
return 0;
}
- r = config_parse(NULL, fn, f, "Manager\0", config_item_table_lookup, (void*) items, false, false, NULL);
+ r = config_parse(NULL, fn, f, "Manager\0", config_item_table_lookup, items, false, false, NULL);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));
static int add_dbus(const char *path, const char *fname, const char *type) {
_cleanup_free_ char *name = NULL, *exec = NULL, *user = NULL, *service = NULL;
- ConfigTableItem table[] = {
+ const ConfigTableItem table[] = {
{ "D-BUS Service", "Name", config_parse_string, 0, &name },
{ "D-BUS Service", "Exec", config_parse_string, 0, &exec },
{ "D-BUS Service", "User", config_parse_string, 0, &user },
NULL,
"Coredump\0",
config_item_table_lookup,
- (void*) items,
+ items,
false,
false,
NULL);
}
r = config_parse(NULL, fn, f, "Journal\0", config_item_perf_lookup,
- (void*) journald_gperf_lookup, false, false, s);
+ journald_gperf_lookup, false, false, s);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));
}
r = config_parse(NULL, fn, f, "Login\0", config_item_perf_lookup,
- (void*) logind_gperf_lookup, false, false, m);
+ logind_gperf_lookup, false, false, m);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));
r = config_parse(NULL, filename, file,
"Match\0NetDev\0VLAN\0MACVLAN\0VXLAN\0Tunnel\0Peer\0Tun\0Tap\0Bond\0",
- config_item_perf_lookup, (void*) network_netdev_gperf_lookup,
+ config_item_perf_lookup, network_netdev_gperf_lookup,
false, false, netdev);
if (r < 0) {
log_warning("Could not parse config file %s: %s", filename, strerror(-r));
network->dhcp_routes = true;
network->dhcp_sendhost = true;
- r = config_parse(NULL, filename, file, "Match\0Network\0Address\0Route\0DHCP\0DHCPv4\0", config_item_perf_lookup,
- (void*) network_network_gperf_lookup, false, false, network);
+ r = config_parse(NULL, filename, file,
+ "Match\0Network\0Address\0Route\0DHCP\0DHCPv4\0",
+ config_item_perf_lookup, network_network_gperf_lookup,
+ false, false, network);
if (r < 0) {
log_warning("Could not parse config file %s: %s", filename, strerror(-r));
return r;
assert(m);
- r = config_parse(NULL,
- "/etc/systemd/resolved.conf", NULL,
+ r = config_parse(NULL, "/etc/systemd/resolved.conf", NULL,
"Resolve\0",
- config_item_perf_lookup, (void*) resolved_gperf_lookup,
+ config_item_perf_lookup, resolved_gperf_lookup,
false, false, m);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));
}
int config_item_table_lookup(
- void *table,
+ const void *table,
const char *section,
const char *lvalue,
ConfigParserCallback *func,
void **data,
void *userdata) {
- ConfigTableItem *t;
+ const ConfigTableItem *t;
assert(table);
assert(lvalue);
}
int config_item_perf_lookup(
- void *table,
+ const void *table,
const char *section,
const char *lvalue,
ConfigParserCallback *func,
const char *filename,
unsigned line,
ConfigItemLookup lookup,
- void *table,
+ const void *table,
const char *section,
unsigned section_line,
const char *lvalue,
unsigned line,
const char *sections,
ConfigItemLookup lookup,
- void *table,
+ const void *table,
bool relaxed,
bool allow_include,
char **section,
FILE *f,
const char *sections,
ConfigItemLookup lookup,
- void *table,
+ const void *table,
bool relaxed,
bool allow_include,
void *userdata) {
/* Prototype for a generic high-level lookup function */
typedef int (*ConfigItemLookup)(
- void *table,
+ const void *table,
const char *section,
const char *lvalue,
ConfigParserCallback *func,
/* Linear table search implementation of ConfigItemLookup, based on
* ConfigTableItem arrays */
-int config_item_table_lookup(void *table, const char *section, const char *lvalue, ConfigParserCallback *func, int *ltype, void **data, void *userdata);
+int config_item_table_lookup(const void *table, const char *section, const char *lvalue, ConfigParserCallback *func, int *ltype, void **data, void *userdata);
/* gperf implementation of ConfigItemLookup, based on gperf
* ConfigPerfItem tables */
-int config_item_perf_lookup(void *table, const char *section, const char *lvalue, ConfigParserCallback *func, int *ltype, void **data, void *userdata);
+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,
- void *table,
+ const void *table,
bool relaxed,
bool allow_include,
void *userdata);
return -ENOMEM;
}
- r = config_parse(NULL, path, f, NULL, config_item_table_lookup, (void*) items, true, true, info);
+ r = config_parse(NULL, path, f, NULL, config_item_table_lookup, items, true, true, info);
if (r < 0)
return r;
"Failed to open configuration file " PKGSYSCONFDIR "/sleep.conf: %m");
else {
r = config_parse(NULL, PKGSYSCONFDIR "/sleep.conf", f, "Sleep\0",
- config_item_table_lookup, (void*) items, false, false, NULL);
+ config_item_table_lookup, items, false, false, NULL);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));
}
}
r = config_parse(NULL, fn, f, "Time\0", config_item_perf_lookup,
- (void*) timesyncd_gperf_lookup, false, false, m);
+ timesyncd_gperf_lookup, false, false, m);
if (r < 0)
log_warning("Failed to parse configuration file: %s", strerror(-r));
return -errno;
}
- r = config_parse(NULL, filename, f, NULL, config_item_table_lookup, (void*) items, true, false, NULL);
+ r = config_parse(NULL, filename, f, NULL, config_item_table_lookup, items, true, false, NULL);
if (r < 0) {
log_error("Failed to parse password file %s: %s", filename, strerror(-r));
goto finish;
link->wol = _WOL_INVALID;
link->duplex = _DUP_INVALID;
- r = config_parse(NULL, filename, file, "Match\0Link\0Ethernet\0", config_item_perf_lookup,
- (void*) link_config_gperf_lookup, false, false, link);
+ r = config_parse(NULL, filename, file,
+ "Match\0Link\0Ethernet\0",
+ config_item_perf_lookup, link_config_gperf_lookup,
+ false, false, link);
if (r < 0) {
log_warning("Could not parse config file %s: %s", filename, strerror(-r));
return r;