RC\_CONFIG(3) Library Functions Manual (smm) RC\_CONFIG(3)

# [NAME](#NAME)

`rc_config_list`, `rc_config_load`, `rc_config_value`, `rc_yesno` — functions to query OpenRC service configurations

# [LIBRARY](#LIBRARY)

Run Command library (librc, -lrc)

# [SYNOPSIS](#SYNOPSIS)

`#include <rc.h>`

`RC_STRINGLIST *`  
`rc_config_list`(`const char *file`);

`RC_STRINGLIST *`  
`rc_config_load`(`const char *file`);

`char *`  
`rc_config_value`(`const char *const *list`, `const char *entry`);

`bool`  
`rc_yesno`(`const char *value`);

# [DESCRIPTION](#DESCRIPTION)

These functions provide an easy means of querying OpenRC configuration files.

[`rc_config_list`](#rc_config_list)() returns a list of non comment lines in `file`. [`rc_config_load`](#rc_config_load)() does the same, but attempts to parse the line as if it was a shell assignment. [`rc_config_value`](#rc_config_value)() returns the value of `entry` found in `list`.

Each list should be freed using [`rc_stringlist_free`](#rc_stringlist_free)() when done.

[`rc_yesno`](#rc_yesno)() returns true if `value` is "true", "yes", "y" or "1" regardless of case. Otherwise if `value` is "false", "no", "n" or "0" (regardless of case) returns false. If `value` does not match either, then returns false and sets `errno` to `EINVAL`.

# [SEE ALSO](#SEE_ALSO)

[malloc(3)](/man/os/openrc/malloc.3), [rc\_stringlist\_free(3)](/man/os/openrc/rc_stringlist_free.3), [sh(1)](/man/os/openrc/sh.1)

# [AUTHORS](#AUTHORS)

Roy Marples &lt;roy@marples.name&gt;

March 17, 2008 OpenRC

---

Document: rc_config_load(3) from openrc 0.64.1-r4 (Chainguard OS)
Source: https://github.com/OpenRC/openrc
