node_any: check attribute presence
[protos/libecoli.git] / libecoli / ecoli_config.h
index 9d7c628..7aa427f 100644 (file)
@@ -43,6 +43,8 @@ struct ec_config_schema {
        const char *key;          /**< The key string (NULL for list elts). */
        const char *desc;         /**< A description of the value. */
        enum ec_config_type type; /**< Type of the value */
+       /* XXX flags: mandatory */
+       /* XXX default */
 
        /** If type is dict or list, the schema of the dict or list
         * elements. Else must be NULL. */
@@ -265,6 +267,16 @@ int ec_config_list_add(struct ec_config *list, struct ec_config *value);
  */
 int ec_config_list_del(struct ec_config *list, struct ec_config *config);
 
+/**
+ * Count the number of elements in a list or dict.
+ *
+ * @param config
+ *   The configuration that must be a list or a dict.
+ * @return
+ *   The number of elements, or -1 on error (errno is set).
+ */
+ssize_t ec_config_count(const struct ec_config *config);
+
 /**
  * Validate a configuration.
  *