rtl433  UNKNOWN
RTL-433 utility
confparse.h File Reference

Light-weight (i.e. More...

Go to the source code of this file.

Data Structures

struct  conf_keywords
 

Functions

int hasconf (char const *path)
 Check if a file exists and can be read. More...
 
char * readconf (char const *path)
 Open a config file, read contents to memory. More...
 
int getconf (char **conf, struct conf_keywords const keywords[], char **arg)
 Return the next keyword token and set the optional argument. More...
 

Detailed Description

Light-weight (i.e.

dumb) config-file parser.

Copyright (C) 2018 Christian W. Zuckschwerdt zany@.nosp@m.triq.nosp@m..net

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Function Documentation

◆ getconf()

int getconf ( char **  conf,
struct conf_keywords const  keywords[],
char **  arg 
)

Return the next keyword token and set the optional argument.

Parameters
confcurrent position in conf
keywordslist of possible keywords
argoptional out pointer to a argument string
Returns
the next keyword token, -1 otherwise.

References conf_keywords::key, and conf_keywords::keyword.

Referenced by parse_conf_text().

◆ hasconf()

int hasconf ( char const *  path)

Check if a file exists and can be read.

Parameters
pathinput file name
Returns
1 if the file exists and is readable, 0 otherwise

Referenced by parse_conf_try_default_files().

◆ readconf()

char* readconf ( char const *  path)

Open a config file, read contents to memory.

Parameters
pathinput file name
Returns
allocated memory containing the config file

References fsize().

Referenced by parse_conf_file().