dnxCfgParser.h

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------------
00002  
00003    Copyright (c) 2006-2007, Intellectual Reserve, Inc. All rights reserved.
00004  
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License version 2 as 
00007    published by the Free Software Foundation.
00008  
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.
00013  
00014    You should have received a copy of the GNU General Public License
00015    along with this program; if not, write to the Free Software
00016    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  
00018   --------------------------------------------------------------------------*/
00019 
00028 #ifndef _DNXCFGPARSER_H_
00029 #define _DNXCFGPARSER_H_
00030 
00031 #include <stddef.h>
00032 
00054 typedef enum DnxCfgType
00055 {
00056    DNX_CFG_STRING,            
00057    DNX_CFG_STRING_ARRAY,      
00058    DNX_CFG_INT,               
00059    DNX_CFG_INT_ARRAY,         
00060    DNX_CFG_UNSIGNED,          
00061    DNX_CFG_UNSIGNED_ARRAY,    
00062    DNX_CFG_URL,               
00063    DNX_CFG_FSPATH,            
00064    DNX_CFG_BOOL,              
00065 } DnxCfgType;
00066 
00068 typedef struct DnxCfgDict
00069 {
00070    char * varname;            
00071    DnxCfgType type;           
00072    void * valptr;             
00073 } DnxCfgDict;
00074 
00090 typedef int DnxCfgValidator_t(DnxCfgDict * dict, void * ppvals[], void * passthru);
00091 
00093 typedef struct { int unused; } DnxCfgParser;
00094 
00133 int dnxCfgParserCreate(char * cfgdefs, char * cfgfile, char * cmdover, 
00134       DnxCfgDict * dict, DnxCfgValidator_t * vfp, DnxCfgParser ** cpp);
00135 
00153 int dnxCfgParserParse(DnxCfgParser * cp, void * passthru);
00154 
00178 int dnxCfgParserGetCfg(DnxCfgParser * cp, char * buf, size_t * bufszp);
00179 
00184 void dnxCfgParserDestroy(DnxCfgParser * cp);
00185 
00186 #endif   /* _DNXCFGPARSER_H_ */
00187 

Generated on Tue Apr 13 15:48:07 2010 for DNX by  doxygen 1.5.6