Main Page | Data Structures | File List | Data Fields | Globals

iparser.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1999-2003 Alex Scott
00003  *
00004  * This library is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU Library General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or (at
00007  * your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this library; if not, write to the Free Software Foundation,
00016  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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         /* Plain variables */
00047         IBool,                          
00048         IChar,                          
00049         IInt,                           
00050         ILong,                          
00051         IFloat,                         
00052         IDouble,                        
00053         IString,                        
00054         IDString,                       
00055 
00056         /* Functions used when reading */
00057         IFuncVoid,                      
00058         IFuncBool,                      
00059         IFuncChar,                      
00060         IFuncInt,                       
00061         IFuncLong,                      
00062         IFuncFloat,                     
00063         IFuncDouble,                    
00064         IFuncString,                    
00065         IFuncDString,                   
00066 
00067         /* Functions used when writing */
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;                   // Iparser Option Type
00085         char *sw;                       // Search Word
00086         void *var;                      // Assoated Variable
00087 } IOption;
00088 
00093 typedef struct _IOpts {
00094         Llist *list;                    // Linked List of Options
00095         int allowfrees;                 // If Allowing Internal Frees.
00096 } IOpts;
00097 
00098 /*** Iparser Public Functions ***/
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 /* _IPARSER_H_ */

Generated on Fri Jun 4 18:35:18 2004 for cuf by doxygen 1.3.6