X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fecoli_config.h;h=706af79f398d5b26b81c9da14c613facdc705c80;hb=d8c60a316b5c2a8b959f6191274504d433cf64f0;hp=866a67a8bf0ae302712c03b6211e4e2ba5c287ac;hpb=786e4464e886f4e1485ba2beb6ed74c8a5914fbf;p=protos%2Flibecoli.git diff --git a/lib/ecoli_config.h b/lib/ecoli_config.h index 866a67a..706af79 100644 --- a/lib/ecoli_config.h +++ b/lib/ecoli_config.h @@ -98,6 +98,38 @@ int ec_config_schema_validate(const struct ec_config_schema *schema); */ void ec_config_schema_dump(FILE *out, const struct ec_config_schema *schema); +/** + * Find a schema entry matching the key. + * + * Browse the schema array and lookup for the given key. + * + * @param schema + * Pointer to the first element of the schema array. The array + * must be terminated by a sentinel entry (type == EC_CONFIG_TYPE_NONE). + * @return + * The schema entry if it matches a key, or NULL if not found. + */ +const struct ec_config_schema * +ec_config_schema_lookup(const struct ec_config_schema *schema, + const char *key); + +/** + * Check if a key name is reserved in a config dict. + * + * Some key names are reserved and should not be used in configs. + * + * @param name + * The name of the key to test. + * @return + * True if the key name is reserved and must not be used, else false. + */ +bool ec_config_key_is_reserved(const char *name); + +/** + * Array of reserved key names. + */ +extern const char *ec_config_reserved_keys[]; + /* config */