00001 #ifndef INIFILE_H
00002 #define INIFILE_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "rcs_defs.hh"
00017
00018 #if (!defined(MSDOS) || defined(WIN32)) && !defined(linux)
00019 #ifdef UNDER_CE
00020 #define INIFILE_USE_INET_FILES
00021 #endif
00022 #ifdef INIFILE_USE_INET_FILES
00023 #include "inetfile.hh"
00024 #endif
00025 #endif
00026
00027 #ifdef __cplusplus
00028 extern "C"
00029 {
00030 #endif
00031
00032 #ifndef NO_STDIO
00033 #include <stdio.h>
00034 #endif
00035
00036 #define INIFILE_MAX_LINELEN 256
00037
00038 #define COMMENT_CHAR ';'
00039
00040 typedef struct
00041 {
00042 char tag[INIFILE_MAX_LINELEN];
00043 char rest[INIFILE_MAX_LINELEN];
00044 }
00045 INIFILE_ENTRY;
00046
00047 extern const char *iniFind (void *fp,
00048 const char *tag,
00049 const char *section);
00050
00051 extern int iniSection (void *fp,
00052 const char *section,
00053 INIFILE_ENTRY array[],
00054 int max);
00055
00056 #ifdef __cplusplus
00057 }
00058 #endif
00059
00060 #ifdef __cplusplus
00061
00062 class INIFILE
00063 {
00064 public:
00065 INIFILE ();
00066 INIFILE (const char *path);
00067 ~INIFILE ();
00068
00069 const int open (const char *path);
00070 const int close ();
00071 const char *find (const char *tag, const char *section = NULL);
00072 int section (const char *section, INIFILE_ENTRY array[], int max);
00073 const int valid ();
00074
00075 private:
00076 #ifndef NO_STDIO
00077 FILE * fp;
00078 #endif
00079
00080 #ifdef INIFILE_USE_INET_FILES
00081 INET_FILE *ifp;
00082 #endif
00083 };
00084
00085 #endif
00086
00087 #endif