Lely core libraries
2.2.5
|
This file is part of the utilities library; it contains the implementation of the INI parser for configuration structs. More...
#include "util.h"
#include <lely/util/config.h>
#include <lely/util/diag.h>
#include <lely/util/frbuf.h>
#include <lely/util/fwbuf.h>
#include <lely/util/lex.h>
#include <lely/util/membuf.h>
#include <lely/util/print.h>
#include <assert.h>
Go to the source code of this file.
Functions | |
size_t | config_parse_ini_file (config_t *config, const char *filename) |
Parses an INI file and adds the keys to a configuration struct. More... | |
size_t | config_parse_ini_text (config_t *config, const char *begin, const char *end, struct floc *at) |
Parses a string in INI-format and adds the keys to a configuration struct. More... | |
size_t | config_print_ini_file (const config_t *config, const char *filename) |
Prints a configuration struct to an INI file. More... | |
size_t | config_print_ini_text (const config_t *config, char **pbegin, char *end) |
Prints a configuration struct in INI-format to a memory buffer. More... | |
This file is part of the utilities library; it contains the implementation of the INI parser for configuration structs.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file config_ini.c.
size_t config_parse_ini_file | ( | config_t * | config, |
const char * | filename | ||
) |
Parses an INI file and adds the keys to a configuration struct.
Definition at line 47 of file config_ini.c.
size_t config_parse_ini_text | ( | config_t * | config, |
const char * | begin, | ||
const char * | end, | ||
struct floc * | at | ||
) |
Parses a string in INI-format and adds the keys to a configuration struct.
config | a pointer to a configuration struct. |
begin | a pointer to the first character in the string. |
end | a pointer to one past the last character in the string (can be NULL if the string is null-terminated). |
at | an optional pointer to the file location of begin (used for diagnostic purposes). On exit, if at != NULL , *at points to one past the last character parsed. |
Definition at line 75 of file config_ini.c.
size_t config_print_ini_file | ( | const config_t * | config, |
const char * | filename | ||
) |
Prints a configuration struct to an INI file.
Definition at line 179 of file config_ini.c.
size_t config_print_ini_text | ( | const config_t * | config, |
char ** | pbegin, | ||
char * | end | ||
) |
Prints a configuration struct in INI-format to a memory buffer.
Note that the output is not null-terminated.
config | a pointer to a configuration struct. |
pbegin | the address of a pointer to the start of the buffer. If pbegin or *pbegin is NULL, nothing is written; Otherwise, on exit, *pbegin points to one past the last character written. |
end | a pointer to the end of the buffer. If end is not NULL, at most end - *pbegin characters are written, and the output may be truncated. |
Definition at line 213 of file config_ini.c.