mirror of https://github.com/ipxe/ipxe.git
[settings] Expose parse_setting_name()
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/598/head
parent
77c70ac0cd
commit
5ffcae69c0
|
@ -295,7 +295,7 @@ struct settings * find_child_settings ( struct settings *parent,
|
||||||
* @v name Name within this parent
|
* @v name Name within this parent
|
||||||
* @ret settings Settings block, or NULL
|
* @ret settings Settings block, or NULL
|
||||||
*/
|
*/
|
||||||
static struct settings * autovivify_child_settings ( struct settings *parent,
|
struct settings * autovivify_child_settings ( struct settings *parent,
|
||||||
const char *name ) {
|
const char *name ) {
|
||||||
struct {
|
struct {
|
||||||
struct autovivified_settings autovivified;
|
struct autovivified_settings autovivified;
|
||||||
|
@ -356,9 +356,7 @@ const char * settings_name ( struct settings *settings ) {
|
||||||
* @ret settings Settings block, or NULL
|
* @ret settings Settings block, or NULL
|
||||||
*/
|
*/
|
||||||
static struct settings *
|
static struct settings *
|
||||||
parse_settings_name ( const char *name,
|
parse_settings_name ( const char *name, get_child_settings_t get_child ) {
|
||||||
struct settings * ( * get_child ) ( struct settings *,
|
|
||||||
const char * ) ) {
|
|
||||||
struct settings *settings = &settings_root;
|
struct settings *settings = &settings_root;
|
||||||
char name_copy[ strlen ( name ) + 1 ];
|
char name_copy[ strlen ( name ) + 1 ];
|
||||||
char *subname;
|
char *subname;
|
||||||
|
@ -1205,11 +1203,7 @@ static struct setting_type * find_setting_type ( const char *name ) {
|
||||||
* Note that on success, this function will have modified the original
|
* Note that on success, this function will have modified the original
|
||||||
* setting @c name.
|
* setting @c name.
|
||||||
*/
|
*/
|
||||||
static int
|
int parse_setting_name ( char *name, get_child_settings_t get_child,
|
||||||
parse_setting_name ( char *name,
|
|
||||||
struct settings * ( * get_child )
|
|
||||||
( struct settings *settings,
|
|
||||||
const char *name ),
|
|
||||||
struct settings **settings, struct setting *setting ) {
|
struct settings **settings, struct setting *setting ) {
|
||||||
char *settings_name;
|
char *settings_name;
|
||||||
char *setting_name;
|
char *setting_name;
|
||||||
|
|
|
@ -241,6 +241,9 @@ struct generic_settings {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** A child settings block locator function */
|
||||||
|
typedef struct settings * ( *get_child_settings_t ) ( struct settings *settings,
|
||||||
|
const char *name );
|
||||||
extern struct settings_operations generic_settings_operations;
|
extern struct settings_operations generic_settings_operations;
|
||||||
extern int generic_settings_store ( struct settings *settings,
|
extern int generic_settings_store ( struct settings *settings,
|
||||||
struct setting *setting,
|
struct setting *setting,
|
||||||
|
@ -295,10 +298,14 @@ extern int setting_cmp ( struct setting *a, struct setting *b );
|
||||||
|
|
||||||
extern struct settings * find_child_settings ( struct settings *parent,
|
extern struct settings * find_child_settings ( struct settings *parent,
|
||||||
const char *name );
|
const char *name );
|
||||||
|
extern struct settings * autovivify_child_settings ( struct settings *parent,
|
||||||
|
const char *name );
|
||||||
extern const char * settings_name ( struct settings *settings );
|
extern const char * settings_name ( struct settings *settings );
|
||||||
extern struct settings * find_settings ( const char *name );
|
extern struct settings * find_settings ( const char *name );
|
||||||
extern struct setting * find_setting ( const char *name );
|
extern struct setting * find_setting ( const char *name );
|
||||||
|
extern int parse_setting_name ( char *name, get_child_settings_t get_child,
|
||||||
|
struct settings **settings,
|
||||||
|
struct setting *setting );
|
||||||
extern int setting_name ( struct settings *settings, struct setting *setting,
|
extern int setting_name ( struct settings *settings, struct setting *setting,
|
||||||
char *buf, size_t len );
|
char *buf, size_t len );
|
||||||
extern int fetchf_setting ( struct settings *settings, struct setting *setting,
|
extern int fetchf_setting ( struct settings *settings, struct setting *setting,
|
||||||
|
|
Loading…
Reference in New Issue