## libkmod-config

libkmod-config — retrieve current libkmod configuration

## Functions

struct kmod_config_iter * | kmod_config_get_blacklists ()
struct kmod_config_iter * | kmod_config_get_install_commands ()
struct kmod_config_iter * | kmod_config_get_remove_commands ()
struct kmod_config_iter * | kmod_config_get_aliases ()
struct kmod_config_iter * | kmod_config_get_options ()
struct kmod_config_iter * | kmod_config_get_softdeps ()
struct kmod_config_iter * | kmod_config_get_weakdeps ()
const char * | kmod_config_iter_get_key ()
const char * | kmod_config_iter_get_value ()
bool | kmod_config_iter_next ()
void | kmod_config_iter_free_iter ()

## Types and Values

struct | kmod_config_iter

## Description

Access to configuration lists - it allows to get each configuration's key/value stored by kmod.

## Functions

### kmod_config_get_blacklists ()

    struct kmod_config_iter *
    kmod_config_get_blacklists (const struct kmod_ctx *ctx);

Retrieve an iterator to deal with the blacklist maintained inside the library. See `kmod_config_iter_get_key()`, `kmod_config_iter_get_value()` and `kmod_config_iter_next()`. At least one call to `kmod_config_iter_next()` must be made to initialize the iterator and check if it's valid.

#### Parameters

ctx | kmod library context |

#### Returns

a new iterator over the blacklists or NULL on failure. Free it with `kmod_config_iter_free_iter()`.

Since: 4

### kmod_config_get_install_commands ()

    struct kmod_config_iter *
    kmod_config_get_install_commands (const struct kmod_ctx *ctx);

Retrieve an iterator to deal with the install commands maintained inside the library. See `kmod_config_iter_get_key()`, `kmod_config_iter_get_value()` and `kmod_config_iter_next()`. At least one call to `kmod_config_iter_next()` must be made to initialize the iterator and check if it's valid.

#### Parameters

ctx | kmod library context |

#### Returns

a new iterator over the install commands or NULL on failure. Free it with `kmod_config_iter_free_iter()`.

Since: 4

### kmod_config_get_remove_commands ()

    struct kmod_config_iter *
    kmod_config_get_remove_commands (const struct kmod_ctx *ctx);

Retrieve an iterator to deal with the remove commands maintained inside the library. See `kmod_config_iter_get_key()`, `kmod_config_iter_get_value()` and `kmod_config_iter_next()`. At least one call to `kmod_config_iter_next()` must be made to initialize the iterator and check if it's valid.

#### Parameters

ctx | kmod library context |

#### Returns

a new iterator over the remove commands or NULL on failure. Free it with `kmod_config_iter_free_iter()`.

Since: 4

### kmod_config_get_aliases ()

    struct kmod_config_iter *
    kmod_config_get_aliases (const struct kmod_ctx *ctx);

Retrieve an iterator to deal with the aliases maintained inside the library. See `kmod_config_iter_get_key()`, `kmod_config_iter_get_value()` and `kmod_config_iter_next()`. At least one call to `kmod_config_iter_next()` must be made to initialize the iterator and check if it's valid.

#### Parameters

ctx | kmod library context |

#### Returns

a new iterator over the aliases or NULL on failure. Free it with `kmod_config_iter_free_iter()`.

Since: 4

### kmod_config_get_options ()

    struct kmod_config_iter *
    kmod_config_get_options (const struct kmod_ctx *ctx);

Retrieve an iterator to deal with the options maintained inside the library. See `kmod_config_iter_get_key()`, `kmod_config_iter_get_value()` and `kmod_config_iter_next()`. At least one call to `kmod_config_iter_next()` must be made to initialize the iterator and check if it's valid.

#### Parameters

ctx | kmod library context |

#### Returns

a new iterator over the options or NULL on failure. Free it with `kmod_config_iter_free_iter()`.

Since: 4

### kmod_config_get_softdeps ()

    struct kmod_config_iter *
    kmod_config_get_softdeps (const struct kmod_ctx *ctx);

Retrieve an iterator to deal with the softdeps maintained inside the library. See `kmod_config_iter_get_key()`, `kmod_config_iter_get_value()` and `kmod_config_iter_next()`. At least one call to `kmod_config_iter_next()` must be made to initialize the iterator and check if it's valid.

#### Parameters

ctx | kmod library context |

#### Returns

a new iterator over the softdeps or NULL on failure. Free it with `kmod_config_iter_free_iter()`.

Since: 4

### kmod_config_get_weakdeps ()

    struct kmod_config_iter *
    kmod_config_get_weakdeps (const struct kmod_ctx *ctx);

Retrieve an iterator to deal with the weakdeps maintained inside the library. See `kmod_config_iter_get_key()`, `kmod_config_iter_get_value()` and `kmod_config_iter_next()`. At least one call to `kmod_config_iter_next()` must be made to initialize the iterator and check if it's valid.

#### Parameters

ctx | kmod library context |

#### Returns

a new iterator over the weakdeps or NULL on failure. Free it with `kmod_config_iter_free_iter()`.

Since: 33

### kmod_config_iter_get_key ()

    const char *
    kmod_config_iter_get_key (const struct kmod_config_iter *iter);

When using a new allocated iterator, user must perform a call to `kmod_config_iter_next()` to initialize iterator's position and check if it's valid.

#### Parameters

iter | iterator over a certain configuration |

#### Returns

the key of the current configuration pointed by `iter` .

Since: 4

### kmod_config_iter_get_value ()

    const char *
    kmod_config_iter_get_value (const struct kmod_config_iter *iter);

When using a new allocated iterator, user must perform a call to `kmod_config_iter_next()` to initialize iterator's position and check if it's valid.

#### Parameters

iter | iterator over a certain configuration |

#### Returns

the value of the current configuration pointed by `iter` .

Since: 4

### kmod_config_iter_next ()

    bool
    kmod_config_iter_next (struct kmod_config_iter *iter);

Make `iter` point to the next item of a certain configuration. It's an automatically recycling iterator. When it reaches the end, false is returned; then if user wants to iterate again, it's sufficient to call this function once more.

#### Parameters

iter | iterator over a certain configuration |

#### Returns

true if next position of `iter` is valid or false if its end is reached.

Since: 4

### kmod_config_iter_free_iter ()

    void
    kmod_config_iter_free_iter (struct kmod_config_iter *iter);

Free resources used by the iterator.

#### Parameters

iter | iterator over a certain configuration |

Since: 4

## Types and Values

### struct kmod_config_iter

    struct kmod_config_iter;

Opaque object for iterating and retrieving configuration information.