MGE System Utility Library - API Documentation  v1.1.3
Library of system utility functions.
configfile.h File Reference

Config file processing header file. More...

#include <portability.h>
Include dependency graph for configfile.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  confkey
 Configuration Key / Value Pair. More...
 
struct  confsection
 Configuration section definition. More...
 

Macros

#define MAX_KEYVAL_LENGTH   1000
 Max length of Key and value. More...
 
#define MAX_KEYS_PER_SECTION   1000
 Max number of keys per section. More...
 
#define MAX_LINE_LENGTH   1000
 Max length of line. More...
 

Functions

int parsefile (struct confsection *params, int nparams, char *filename)
 Parse a configuration file. More...
 

Detailed Description

Config file processing header file.

Header file for config file processing in the libmgesysutils shared library.

Author
Copyright (C) 2015-2019 Mark Grant

Released under the GPLv3 only.
SPDX-License-Identifier: GPL-3.0

Version
v1.0.8 ==== 30/10/2019

Macro Definition Documentation

◆ MAX_KEYS_PER_SECTION

#define MAX_KEYS_PER_SECTION   1000

Max number of keys per section.

◆ MAX_KEYVAL_LENGTH

#define MAX_KEYVAL_LENGTH   1000

Max length of Key and value.

◆ MAX_LINE_LENGTH

#define MAX_LINE_LENGTH   1000

Max length of line.

Function Documentation

◆ parsefile()

int parsefile ( struct confsection params,
int  nparams,
char *  filename 
)

Parse a configuration file.

On error mge_errno is set.

Parameters
paramsPointer to a struct confsection array of parameters.
nparamsThe number of parameters.
filenameThe config filename.
Returns
0 for success, -mge_errno on failure.