struct extra_dump_item {
// not separate named fields, for convenient iteration
- char *fields[COUNT_INI_FIELDS];
+ const char *fields[COUNT_INI_FIELDS];
};
int handle_extra_program(int out_fd, struct extra_dump_item *item)
assert(out_fd >= 0);
assert(item);
- char *const title = item->fields[INI_FIELD_TITLE];
- char *const path = item->fields[INI_FIELD_PATH];
- char *const args = item->fields[INI_FIELD_ARGS] ?: "";
- char *const env = item->fields[INI_FIELD_ENV] ?: "";
+ const char *const title = item->fields[INI_FIELD_TITLE];
+ const char *const path = item->fields[INI_FIELD_PATH];
+ const char *const args = item->fields[INI_FIELD_ARGS] ?: "";
+ const char *const env = item->fields[INI_FIELD_ENV] ?: "";
if (!title || !path) {
fprintf_fd(out_fd, "\nNo title or path in extra program config");
assert(out_fd >= 0);
assert(item);
- char *const title = item->fields[INI_FIELD_TITLE];
- char *const path = item->fields[INI_FIELD_PATH];
+ const char *const title = item->fields[INI_FIELD_TITLE];
+ const char *const path = item->fields[INI_FIELD_PATH];
if (!title || !path) {
fprintf_fd(out_fd, "\nNo title or path in extra file config");
return EXIT_CONFERR;
typedef int (*handle_ini_section_t)(int out_fd, struct extra_dump_item *);
-static int handle_ini_Nth_section(int out_fd, dictionary *ini, int n, handle_ini_section_t handle_ini_section)
+static int handle_ini_Nth_section(int out_fd, const dictionary *ini, int n, handle_ini_section_t handle_ini_section)
{
assert(out_fd >= 0);
assert(ini);
assert(n < iniparser_getnsec(ini));
assert(handle_ini_section);
- char *const secname = iniparser_getsecname(ini, n);
+ const char *const secname = iniparser_getsecname(ini, n);
assert(secname); // can only be NULL if `ini` is NULL or `n` is outta bounds
const size_t secname_len = strlen(secname);
return REP_TYPE_INVALID;
}
-static bool config_load_from_dict(config_t *c, dictionary *ini)
+static bool config_load_from_dict(config_t *c, const dictionary *ini)
{
assert(c);
- char *str = iniparser_getstring(ini, CRASH_SECTION ":CrashRootPath", NULL);
+ const char *str = iniparser_getstring(ini, CRASH_SECTION ":CrashRootPath", NULL);
if (str) {
char *crash_root_path = strdup(str);
if (!crash_root_path) {