From 0cc9b20c15460213e488bf5e70963b941482f628 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Tue, 14 Jan 2025 16:06:02 -0600 Subject: Add source. --- sdk/other/config.h | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sdk/other/config.h (limited to 'sdk/other/config.h') diff --git a/sdk/other/config.h b/sdk/other/config.h new file mode 100644 index 0000000..4d76d1a --- /dev/null +++ b/sdk/other/config.h @@ -0,0 +1,67 @@ +/* + * Portable human readable config text file parsing routines. + * $Id: config.h 1.2 Wed, 19 Mar 1997 12:44:53 -0500 dyfet $ + * Copyright (c) 1997 by Tycho Softworks. + * For conditions of distribution and use see product license. + * + * Abstract: + * The config routines allow locating, opening, and parsing of + * human readable .conf files. These .conf files are broken into + * seperate named [] sections, each of which may be individually + * located and examined, and config data. Config data is usually + * in the form of a 'keyword = value' statement. + * + * Data types: + * CONFIG - object line parse buffer for an open config file. + */ + +#ifndef __OTHER_CONFIG_H__ +#define __OTHER_CONFIG_H__ + +#ifndef __OTHER_STRING_H__ +#include +#endif + +#ifndef __OTHER_FILES_H__ +#include +#endif + +typedef struct +{ + bool cfg_flag; + FILE *cfg_fp; + char cfg_test[33]; + char cfg_lbuf[ EMPTY ]; +} CONFIG; + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __NAMESPACE +#define open_config __NAMESPACE(open_config) +#define sys_config __NAMESPACE(sys_config) +#define usr_config __NAMESPACE(usr_config) +#define first_config __NAMESPACE(first_config) +#define next_config __NAMESPACE(next_config) +#define seek_config __NAMESPACE(seek_config) +#define read_config __NAMESPACE(read_config) +#define close_config __NAMESPACE(close_config) +#define get_config __NAMESPACE(get_config) +#endif + +CONFIG *open_config(const char *name); +CONFIG *sys_config(const char *name); +CONFIG *usr_config(const char *name); +char *first_config(CONFIG *cfg); +char *next_config(CONFIG *cfg); +bool seek_config(CONFIG *cfg, const char *name); +char *read_config(CONFIG *cfg); +void close_config(CONFIG *cfg); +char *get_config(CONFIG *cfg, const char *option); + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3-54-g00ecf