opsick
Classes | Functions
config.h File Reference

Opsick configuration tools/functions/structures. More...

#include <stdint.h>
#include "opsick/constants.h"
Include dependency graph for config.h:

Go to the source code of this file.

Classes

struct  opsick_config_hostsettings
 
struct  opsick_config_adminsettings
 

Functions

int opsick_config_load ()
 
int opsick_config_get_hostsettings (struct opsick_config_hostsettings *out)
 
int opsick_config_get_adminsettings (struct opsick_config_adminsettings *out)
 

Detailed Description

Opsick configuration tools/functions/structures.

Author
Raphael Beck

Function Documentation

◆ opsick_config_get_adminsettings()

int opsick_config_get_adminsettings ( struct opsick_config_adminsettings out)

Gets the current admin settings from the [admin] section inside the opsick config file (as a copy, so it's read-only).

Parameters
outAn opsick_config_adminsettings instance into which to write the parsed config values. If retrieval fails in any way, this is left untouched!
Returns
1 if retrieval succeeded; 0 if retrieval failed due to invalid arguments (e.g. NULL).

◆ opsick_config_get_hostsettings()

int opsick_config_get_hostsettings ( struct opsick_config_hostsettings out)

Gets the current host settings from the [host] section inside the opsick config file (as a copy, so it's read-only).

Parameters
outAn opsick_config_hostsettings instance into which to write the parsed config values. If retrieval fails in any way, this is left untouched!
Returns
1 if retrieval succeeded; 0 if retrieval failed due to invalid arguments (e.g. NULL).

◆ opsick_config_load()

int opsick_config_load ( )

Opens the opsick config table, reads the user-defined preferences/settings in it and loads them into memory.

Returns
Whether loading the opsick config from db succeeded ( 1 ) or not ( 0 ).