74 lines
1.8 KiB
C
74 lines
1.8 KiB
C
/*
|
|
* config.h - Config loading for Glacier
|
|
*
|
|
* This file is part of Glacier.
|
|
*
|
|
* Glacier is free software: you can redistribute it and/or modify it under the terms of the
|
|
* GNU Lesser General Public License as published by the Free Software Foundation, either
|
|
* version 3 of the License, or (at your option) any later version.
|
|
*
|
|
* Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License along with Glacier. If
|
|
* not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef GLACIERCONFIG_H_
|
|
#define GLACIERCONFIG_H_
|
|
|
|
#include <libconfig.h>
|
|
|
|
/* Constants */
|
|
#ifndef LG_VERBOSE
|
|
#define LG_VERBOSE 0
|
|
#endif
|
|
|
|
/*
|
|
* gl_init_config
|
|
*
|
|
* DESCRIPTION: Initialize libconfig.
|
|
* PARAMETERS: None.
|
|
* RETURNS: 0 on success, EXIT_FAILURE on error
|
|
*/
|
|
int gl_init_config(void);
|
|
|
|
/*
|
|
* gl_die_config
|
|
*
|
|
* DESCRIPTION: Kill libconfig.
|
|
* PARAMETERS: None.
|
|
* RETURNS: EXIT_SUCCESS on success
|
|
*/
|
|
int gl_die_config(void);
|
|
|
|
/*
|
|
* gl_load_all_from_config
|
|
*
|
|
* DESCRIPTION: Loads all settings from the Glacier config file.
|
|
* PARAMETERS: None.
|
|
* RETURNS: 0 on success, 1 on error
|
|
*/
|
|
int gl_load_all_from_config(void);
|
|
|
|
/*
|
|
* gl_load_all_from_profile
|
|
*
|
|
* DESCRIPTION: Loads all settings from the Glacier system profile.
|
|
* PARAMETERS: None.
|
|
* RETURNS: 0 on success, 1 on error
|
|
*/
|
|
int gl_load_all_from_profile(void);
|
|
|
|
/*
|
|
* gl_load_setting_from_config
|
|
*
|
|
* DESCRIPTION: Load a specified setting from the Glacier config file.
|
|
* PARAMETERS: char SETTING[]
|
|
* RETURNS: 0 on success, 1 on error
|
|
*/
|
|
int gl_load_setting_from_config(char SETTING[]);
|
|
|
|
#endif
|