ecoli_config(3)

๐Ÿ“ฆ
version 0.11.3 ยท 4 versions
, in epel 9

ecoli_config(3) โ€” Node configuration ๐ŸŽ€ (Libecoli)

NAME

ecoli_config โ€” Node configuration ๐Ÿฆ‹

  • Configure nodes behavior through generic API.

SYNOPSIS

okay bestie, here's the whole lineup โ€” every single thing this page ships with. ๐Ÿ’…

๐Ÿ“ฆ Data Structures

  • struct ec_config_schema
  • struct ec_config

๐Ÿ”ข Enumerations

enum ec_config_type { EC_CONFIG_TYPE_NONE = 0, EC_CONFIG_TYPE_BOOL,
    EC_CONFIG_TYPE_INT64, EC_CONFIG_TYPE_UINT64, EC_CONFIG_TYPE_STRING,
    EC_CONFIG_TYPE_NODE, EC_CONFIG_TYPE_LIST, EC_CONFIG_TYPE_DICT }
enum ec_config_flags { EC_CONFIG_F_MANDATORY = 1 << 0 }

๐Ÿ› ๏ธ Functions

int ec_config_schema_validate (const struct ec_config_schema *schema)
void ec_config_schema_dump (FILE *out, const struct ec_config_schema
    *schema, const char *name)
const struct ec_config_schema * ec_config_schema_lookup (const struct
    ec_config_schema *schema, const char *key)
enum ec_config_type ec_config_schema_type (const struct ec_config_schema
    *schema_elt)
const struct ec_config_schema * ec_config_schema_sub (const struct
    ec_config_schema *schema_elt)
bool ec_config_key_is_reserved (const char *name)
enum ec_config_type ec_config_get_type (const struct ec_config *config)
struct ec_config * ec_config_bool (bool boolean)
struct ec_config * ec_config_i64 (int64_t i64)
struct ec_config * ec_config_u64 (uint64_t u64)
struct ec_config * ec_config_string (const char *string)
struct ec_config * ec_config_node (struct ec_node *node)
struct ec_config * ec_config_dict (void)
struct ec_config * ec_config_list (void)
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)
ssize_t ec_config_count (const struct ec_config *config)
int ec_config_validate (const struct ec_config *dict, const struct
    ec_config_schema *schema)
int ec_config_dict_set (struct ec_config *dict, const char *key, struct
    ec_config *value)
int ec_config_dict_del (struct ec_config *dict, const char *key)
int ec_config_cmp (const struct ec_config *config1, const struct
    ec_config *config2)
struct ec_config * ec_config_dict_get (const struct ec_config *config,
    const char *key)
struct ec_config * ec_config_list_first (struct ec_config *list)
struct ec_config * ec_config_list_next (struct ec_config *list, struct
    ec_config *config)
void ec_config_free (struct ec_config *config)
struct ec_config * ec_config_dup (const struct ec_config *config)
void ec_config_dump (FILE *out, const struct ec_config *config)
struct ec_node ** ec_node_config_node_list_to_table (const struct
    ec_config *config, size_t *len)
struct ec_config * ec_node_config_node_list_from_vargs (va_list ap)

๐ŸŒธ Variables

  • const char * ec_config_reserved_keys []

DETAILED DESCRIPTION ๐Ÿ’–

okay so the whole vibe here is: configure nodes behavior through generic API. These are helpers that are commonly used in nodes โ€” iykyk. โœจ

ENUMERATION TYPE DOCUMENTATION ๐Ÿ”

enum ec_config_type

this enum is literally the type identifier for a config value. periodt. ๐Ÿ’…

Definition at line 25 of file config.h.

enum ec_config_flags

these are the flags related to a configuration schema. slay. ๐ŸŒˆ

Definition at line 39 of file config.h.

โœจ FUNCTION DOCUMENTATION โœจ

okay so this is the function buffet, bestie โ€” every single one is here, no skipping, no cap. ๐Ÿ’…


๐ŸŒŸ int ec_config_schema_validate (const struct ec_config_schema * schema)

Runs a whole vibe check on a configuration schema array. โœจ

  • Parameters:
    • schema โ€” pointer to the first element of the schema array. The array must be terminated by a sentinel entry {.type = EC_CONFIG_TYPE_NONE}. periodt.
  • Returns: 0 if the schema is valid, or -1 on error (errno is set). ๐Ÿ˜ญ

๐Ÿ’– void ec_config_schema_dump (FILE * out, const struct ec_config_schema * schema, const char * name)

Dumps a configuration schema array. cute.

  • Parameters:
    • out โ€” output stream on which the dump will be sent.
    • schema โ€” pointer to the first element of the schema array. The array must be terminated by a sentinel entry {.type == EC_CONFIG_TYPE_NONE}.
    • name โ€” the name of the schema. ๐Ÿ’ซ

๐Ÿ”Ž const struct ec_config_schema* ec_config_schema_lookup (const struct ec_config_schema * schema, const char * key)

Finds the schema entry that matches the key. It browses the schema array and looks up the given key โ€” lowkey detective energy. ๐Ÿ•ต๏ธโ€โ™€๏ธ

  • Parameters:
    • schema โ€” pointer to the first element of the schema array. The array must be terminated by a sentinel entry {.type == EC_CONFIG_TYPE_NONE}.
    • key โ€” schema key name.
  • Returns: the schema entry if it matches a key, or NULL if not found. ๐Ÿซถ

๐ŸŽ€ enum ec_config_type ec_config_schema_type (const struct ec_config_schema * schema_elt)

Gets the type of a schema entry. slay.

  • Parameters:
    • schema_elt โ€” pointer to an element of the schema array.
  • Returns: the type of the schema entry. ๐ŸŒธ

๐Ÿฆ‹ const struct ec_config_schema* ec_config_schema_sub (const struct ec_config_schema * schema_elt)

Gets the subschema of a schema entry. iykyk.

  • Parameters:
    • schema_elt โ€” pointer to an element of the schema array.
  • Returns: the subschema if any, or NULL. ๐Ÿ’œ

๐Ÿ‘‘ bool ec_config_key_is_reserved (const char * name)

Checks if a key name is reserved in a config dict. Some key names are reserved and should not be used in configs โ€” respect the reserve list, bestie. ๐Ÿšซ

  • Parameters:
    • name โ€” the name of the key to test.
  • Returns: True if the key name is reserved and must not be used, else false. โœจ

๐ŸŒˆ enum ec_config_type ec_config_get_type (const struct ec_config * config)

Gets the type of the configuration. iconic.

  • Parameters:
    • config โ€” the configuration.
  • Returns: the configuration type. ๐Ÿ’…

๐Ÿ“ struct ec_config* ec_config_bool (bool boolean)

Creates a boolean configuration value. yes maโ€™am.

  • Parameters:
    • boolean โ€” the boolean value to be set.
  • Returns: the configuration object, or NULL on error (errno is set). ๐Ÿ˜ญ

๐Ÿงš struct ec_config* ec_config_i64 (int64_t i64)

Creates a signed integer configuration value. signed and sealed. ๐Ÿ’–

  • Parameters:
    • i64 โ€” the signed integer value to be set.
  • Returns: the configuration object, or NULL on error (errno is set). โœจ

๐Ÿฆ‹ struct ec_config* ec_config_u64 (uint64_t u64)

Creates an unsigned configuration value. unsigned rights. ๐Ÿ’…

  • Parameters:
    • u64 โ€” the unsigned integer value to be set.
  • Returns: the configuration object, or NULL on error (errno is set). ๐ŸŒธ

๐ŸŽ€ struct ec_config* ec_config_string (const char * string)

Creates a string configuration value. the string gets copied into the configuration object, so no sharing drama. ๐Ÿซถ

  • Parameters:
    • string โ€” the string value to be set. The string is copied into the configuration object.
  • Returns: the configuration object, or NULL on error (errno is set). ๐Ÿ’œ

๐ŸŒŸ struct ec_config* ec_config_node (struct ec_node * node)

Creates a node configuration value. important bestie: the node is consumed by the function and should not be used by the caller, even on error. if you need to keep a reference, the caller can use ec_node_clone(). no take-backs. ๐Ÿ˜ค

  • Parameters:
    • node โ€” the node pointer to be set. The node is 'consumed' by the function and should not be used by the caller, even on error. The caller can use ec_node_clone() to keep a reference on the node.
  • Returns: the configuration object, or NULL on error (errno is set). โœจ

๐Ÿ”ฅ struct ec_config* ec_config_dict (void)

Creates a hash table configuration value. main character hash table energy. ๐Ÿ‘‘

  • Returns: a configuration object containing an empty hash table, or NULL on error (errno is set). ๐Ÿ’–

๐ŸŒธ struct ec_config* ec_config_list (void)

Creates a list configuration value. empty list, loaded potential. โœจ

  • Returns: the configuration object containing an empty list, or NULL on error (errno is set). ๐ŸŽ€

๐ŸŒˆ int ec_config_list_add (struct ec_config * list, struct ec_config * value)

Adds a config object into a list. yup, thatโ€™s the whole assignment. ๐Ÿ’…

  • Parameters:
    • list โ€” the list configuration in which the value will be added.
    • value โ€” the value configuration to add in the list. The value object will be freed when freeing the list object. On error, the value object is also freed.
  • Returns: 0 on success, else -1 (errno is set). ๐Ÿ˜ญ

๐Ÿฆ‹ int ec_config_list_del (struct ec_config * list, struct ec_config * config)

Removes an element from a list. the element is freed and should not be accessed โ€” do not touch, bestie. ๐Ÿšซ

  • Parameters:
    • list โ€” the list configuration.
    • config โ€” the element to remove from the list.
  • Returns: 0 on success, -1 on error (errno is set). ๐Ÿ’œ

๐Ÿ“ ssize_t ec_config_count (const struct ec_config * config)

Counts the number of elements in a list or dict. math but make it cute. ๐Ÿงฎ

  • Parameters:
    • config โ€” the configuration that must be a list or a dict.
  • Returns: the number of elements, or -1 on error (errno is set). โœจ

๐Ÿงš int ec_config_validate (const struct ec_config * dict, const struct ec_config_schema * schema)

Validates a configuration. the ultimate vibe check for your dict. โœ…

  • Parameters:
    • dict โ€” a hash table configuration to validate.
    • schema โ€” pointer to the first element of the schema array. The array must be terminated by a sentinel entry (type == EC_CONFIG_TYPE_NONE).
  • Returns: 0 on success, -1 on error (errno is set). ๐Ÿ’–

๐Ÿ‘‘ int ec_config_dict_set (struct ec_config * dict, const char * key, struct ec_config * value)

Sets a value in a hash table configuration. put it in the dict, slay. ๐Ÿ’…

  • Parameters:
    • dict โ€” the hash table configuration.
    • key โ€” the key to update.
    • value โ€” the value to set. The value object will be freed when freeing the dict object. On error, the value object is also freed.
  • Returns: 0 on success, -1 on error (errno is set). ๐ŸŒธ

๐ŸŽ€ int ec_config_dict_del (struct ec_config * dict, const char * key)

Removes an element from a hash table configuration. the element is freed and should not be accessed โ€” no peeking after delete. ๐Ÿ™ˆ

  • Parameters:
    • dict โ€” the hash table configuration.
    • key โ€” the key of the configuration to delete.
  • Returns: 0 on success, -1 on error (errno is set). ๐Ÿ’œ

๐Ÿ”ฅ int ec_config_cmp (const struct ec_config * config1, const struct ec_config * config2)

Compare two configurations. And because the page said it twice: compare two configurations. ๐Ÿ’…

  • Returns: 0 if the configurations are equal, else -1. โœจ

๐ŸŒŸ struct ec_config* ec_config_dict_get (const struct ec_config * config, const char * key)

Get configuration value. thatโ€™s the whole description, no extra param or return deets on this one โ€” iykyk. ๐Ÿซถ

๐ŸŒˆ struct ec_config* ec_config_list_first (struct ec_config * list)

Gets the first element of a list. starter energy. โœจ

Example of use:

       for (config = ec_config_list_first(list);
        config != NULL;
        config = ec_config_list_next(list, config)) {
           ...
       }
  • Parameters:
    • list โ€” the list configuration to iterate.
  • Returns: the first configuration element, or NULL on error (errno is set). ๐Ÿ’–

๐Ÿฆ‹ struct ec_config* ec_config_list_next (struct ec_config * list, struct ec_config * config)

Gets the next element in a list. keep it moving, bestie. ๐Ÿ’…

  • Parameters:
    • list โ€” the list configuration being iterated.
    • config โ€” the current configuration element.
  • Returns: the next configuration element, or NULL if there is no more element. ๐ŸŒธ

๐Ÿ“ void ec_config_free (struct ec_config * config)

Frees a configuration. release it, periodt. ๐Ÿ•Š๏ธ

  • Parameters:
    • config โ€” the element to free. ๐Ÿ’œ

๐Ÿงš struct ec_config* ec_config_dup (const struct ec_config * config)

Duplicates a configuration. twin where? ๐Ÿ‘ฏโ€โ™€๏ธ

  • Parameters:
    • config โ€” the configuration to duplicate.
  • Returns: the duplicated configuration, or NULL on error (errno is set). โœจ

๐ŸŽ€ void ec_config_dump (FILE * out, const struct ec_config * config)

Dumps a configuration. show us whatโ€™s inside. ๐Ÿ”

  • Parameters:
    • out โ€” output stream on which the dump will be sent.
    • config โ€” the configuration to dump. ๐Ÿ’–

๐Ÿ‘‘ struct ec_node** ec_node_config_node_list_to_table (const struct ec_config * config, size_t * len)

Builds a node table from a node list in an ec_config. The function takes a node configuration as parameter, which must be a node list. From it, a node table is built. A reference is taken for each node. On error, no reference is taken. no half-done slay. โœจ

  • Parameters:
    • config โ€” the configuration (type must be a list of nodes). If it is NULL, an error is returned.
    • len โ€” the length of the allocated table on success, or 0 on error.
  • Returns: the allocated node table, that must be freed by the caller: each entry must be freed with ec_node_free() and the table with free(). On error, NULL is returned and errno is set. ๐Ÿ˜ญ

๐ŸŒธ struct ec_config* ec_node_config_node_list_from_vargs (va_list ap)

Builds a list of config nodes from variable arguments. The va_list argument is a list of pointer to ec_node structures, terminated with EC_VA_END. This helper is used by nodes that contain a list of nodes, like 'seq', 'or', ... โ€” the group chat of nodes, fr fr. ๐Ÿ’ฌ

  • Parameters:
    • ap โ€” list of pointer to ec_node structures, terminated with EC_VA_END.
  • Returns: a pointer to an ec_config structure. In this case, the nodes will be freed when the config structure will be freed. On error, NULL is returned (and errno is set), and the nodes are freed. ๐Ÿ’œ

๐ŸŽ€ VARIABLE DOCUMENTATION ๐ŸŽ€

  • const char* ec_config_reserved_keys[] [extern] โ€” array of reserved key names. the no-go list, bestie. ๐Ÿšซโœจ

๐Ÿ’… AUTHOR ๐Ÿ’…

Generated automatically by Doxygen for Libecoli from the source code. iconic behavior. ๐Ÿ‘‘

mwah ๐Ÿ’‹ โ€” this cutie came from the Libecoli source code, version 0.11.3, dated Thu Apr 9 2026, and yes itโ€™s ecoli_config(3). periodt โœจ

๐Ÿ“ฆ where this page comes from