support config in node_or
[protos/libecoli.git] / lib / ecoli_config.h
index 8ceddf5..9d7c628 100644 (file)
@@ -98,6 +98,43 @@ 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);
+
+/**
+ * Get the type of a schema entry.
+ *
+ * @param schema_elt
+ *   Pointer to an element of the schema array.
+ * @return
+ *   The type of the schema entry.
+ */
+enum ec_config_type
+ec_config_schema_type(const struct ec_config_schema *schema_elt);
+
+/**
+ * Get the subschema of a schema entry.
+ *
+ * @param schema_elt
+ *   Pointer to an element of the schema array.
+ * @return
+ *   The subschema if any, or NULL.
+ */
+const struct ec_config_schema *
+ec_config_schema_sub(const struct ec_config_schema *schema_elt);
+
 /**
  * Check if a key name is reserved in a config dict.
  *