the function contains a loop and if expressions and whatnot. Let's
define it as regular function, to make the header easier to read and let
the compiler more freedom on whether to inline this or not.
return 0;
}
+
+BootEntry* boot_config_find_entry(BootConfig *config, const char *id) {
+ assert(config);
+ assert(id);
+
+ for (size_t j = 0; j < config->n_entries; j++)
+ if (streq_ptr(config->entries[j].id, id) ||
+ streq_ptr(config->entries[j].id_old, id))
+ return config->entries + j;
+
+ return NULL;
+}
.selected_entry = -1, \
}
-static inline BootEntry* boot_config_find_entry(BootConfig *config, const char *id) {
- assert(config);
- assert(id);
-
- for (size_t j = 0; j < config->n_entries; j++)
- if (streq_ptr(config->entries[j].id, id) ||
- streq_ptr(config->entries[j].id_old, id))
- return config->entries + j;
-
- return NULL;
-}
+BootEntry* boot_config_find_entry(BootConfig *config, const char *id);
static inline BootEntry* boot_config_default_entry(BootConfig *config) {
assert(config);