MGE System Utility Library - Full Internal Documentation v1.6.2
Library of system utility functions.
mge-configfile.h File Reference

Config file processing header file. More...

#include <libmgec/mge-portability.h>
Include dependency graph for mge-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, const 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, 2021-2023 Mark Grant

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

Version
v1.2.1 ==== 25/11/2023

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,
const 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.