Loading include/spdk/conf.h +4 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,10 @@ void spdk_conf_free(struct spdk_conf *cp); int spdk_conf_read(struct spdk_conf *cp, const char *file); struct spdk_conf_section *spdk_conf_find_section(struct spdk_conf *cp, const char *name); /* Configuration file iteration */ struct spdk_conf_section *spdk_conf_first_section(struct spdk_conf *cp); struct spdk_conf_section *spdk_conf_next_section(struct spdk_conf_section *sp); bool spdk_conf_section_match_prefix(const struct spdk_conf_section *sp, const char *name_prefix); char *spdk_conf_section_get_nmval(struct spdk_conf_section *sp, const char *key, int idx1, int idx2); Loading lib/conf/conf.c +21 −0 Original line number Diff line number Diff line Loading @@ -215,6 +215,27 @@ spdk_conf_find_section(struct spdk_conf *cp, const char *name) return NULL; } struct spdk_conf_section * spdk_conf_first_section(struct spdk_conf *cp) { cp = CHECK_CP_OR_USE_DEFAULT(cp); if (cp == NULL) { return NULL; } return cp->section; } struct spdk_conf_section * spdk_conf_next_section(struct spdk_conf_section *sp) { if (sp == NULL) { return NULL; } return sp->next; } static void append_cf_section(struct spdk_conf *cp, struct spdk_conf_section *sp) { Loading Loading
include/spdk/conf.h +4 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,10 @@ void spdk_conf_free(struct spdk_conf *cp); int spdk_conf_read(struct spdk_conf *cp, const char *file); struct spdk_conf_section *spdk_conf_find_section(struct spdk_conf *cp, const char *name); /* Configuration file iteration */ struct spdk_conf_section *spdk_conf_first_section(struct spdk_conf *cp); struct spdk_conf_section *spdk_conf_next_section(struct spdk_conf_section *sp); bool spdk_conf_section_match_prefix(const struct spdk_conf_section *sp, const char *name_prefix); char *spdk_conf_section_get_nmval(struct spdk_conf_section *sp, const char *key, int idx1, int idx2); Loading
lib/conf/conf.c +21 −0 Original line number Diff line number Diff line Loading @@ -215,6 +215,27 @@ spdk_conf_find_section(struct spdk_conf *cp, const char *name) return NULL; } struct spdk_conf_section * spdk_conf_first_section(struct spdk_conf *cp) { cp = CHECK_CP_OR_USE_DEFAULT(cp); if (cp == NULL) { return NULL; } return cp->section; } struct spdk_conf_section * spdk_conf_next_section(struct spdk_conf_section *sp) { if (sp == NULL) { return NULL; } return sp->next; } static void append_cf_section(struct spdk_conf *cp, struct spdk_conf_section *sp) { Loading