00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #include <stdio.h>
00024 #include <fcntl.h>
00025 #include <ctype.h>
00026 #include <stdlib.h>
00027 #include <string.h>
00028
00029 #include "cuf-global.h"
00030 #include "llist.h"
00031 #include "mimeproc.h"
00032 #include "strings.h"
00033 #include "win32lacks.h"
00034
00035 #ifndef _IPARSER_H_
00036 # define _IPARSER_H_
00037
00038 # define SAFE_NUM_ALLOC 30
00039 # define SNA SAFE_NUM_ALLOC
00040
00045 typedef enum _IOptType {
00046
00047 IBool,
00048 IChar,
00049 IInt,
00050 ILong,
00051 IFloat,
00052 IDouble,
00053 IString,
00054 IDString,
00055
00056
00057 IFuncVoid,
00058 IFuncBool,
00059 IFuncChar,
00060 IFuncInt,
00061 IFuncLong,
00062 IFuncFloat,
00063 IFuncDouble,
00064 IFuncString,
00065 IFuncDString,
00066
00067
00068 IFuncWVoid,
00069 IFuncWBool,
00070 IFuncWChar,
00071 IFuncWInt,
00072 IFuncWLong,
00073 IFuncWFloat,
00074 IFuncWDouble,
00075 IFuncWString,
00076 IFuncWDString
00077 } IOptType;
00078
00083 typedef struct _IOption {
00084 IOptType iot;
00085 char *sw;
00086 void *var;
00087 } IOption;
00088
00093 typedef struct _IOpts {
00094 Llist *list;
00095 int allowfrees;
00096 } IOpts;
00097
00098
00099
00100 IOpts *ioption_init (void);
00101 void ioption_add (IOpts *opts, char *sw, IOptType iot, void *var);
00102 void ioption_allowfrees_set (IOpts *opts, int allowfrees);
00103 int ioption_parse (IOpts *opts, char *filename);
00104 int ioption_write (IOpts *opts, char *filename);
00105 void ioption_done (IOpts *opts);
00106
00107 #endif