Home   Intro   Tutorial   argtable.h   arg_rec   Globals   Release Notes  

argtable.h

Go to the documentation of this file.
00001 /*********************************************************************
00002 This file is part of the argtable library. It contains the declarations
00003 of the argtable library functions.
00004 
00005 Copyright (C) 1998,1999,2001 Stewart Heitmann (sheitmann@users.sourceforge.net)
00006 
00007 The argtable library is free software; you can redistribute it and/or
00008 modify it under the terms of the GNU Library General Public License as
00009 published by the Free Software Foundation; either version 2 of the
00010 License, or (at your option) any later version.
00011 
00012 This software is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 Library General Public License for more details.
00016 
00017 You should have received a copy of the GNU Library General Public
00018 License along with this library; if not, write to the Free Software
00019 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00020 USA.
00021 *********************************************************************/
00022 #ifndef ARGTABLE
00023 #define ARGTABLE
00024 
00025 #include <stdio.h>
00026 #define ARGTABLE_VERSION 1.3
00027 
00028 #ifdef ARGTABLE_COMPATIBILITY_10
00029 #define arg_scanargv(a,b,c,d,e,f,g) arg_scanargv_10(a,b,c,d,e,f,g)
00030 #endif
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00040 typedef enum
00041   {
00042   arg_int=0,    
00043   arg_dbl,      
00044   arg_str,      
00045   arg_bool,     
00046   arg_lit       
00047   } arg_type;
00048 
00062 extern const char* arg_typestr[];
00063 
00093 typedef struct
00094   {
00103   const char *tagstr;
00116   const char *argname;
00142   arg_type    argtype;
00158   void       *valueptr;
00169   const char *defaultstr;
00177   const char *argdescrip;
00178   } arg_rec;
00179 
00212 int arg_scanargv(int argc,          
00213                  char **argv,       
00214                  arg_rec *argtable, 
00215                  int n,             
00216                  char* CmdLine,     
00217                  char* ErrMsg,      
00218                  char* ErrMark      
00219                  );
00220 
00241 int arg_scanstr(char* str,         
00242                 arg_rec *argtable, 
00243                 int n,             
00244                 char* ErrMsg,      
00245                 char* ErrMark      
00246                 );
00247 
00248 
00273 const char* arg_syntax(const arg_rec* argtable,  
00274                        int n                     
00275                        );
00276 
00305 const char* arg_glossary(const arg_rec* argtable,  
00306                          int n,                    
00307                          const char* prefix        
00308                          );
00309 
00324 extern void arg_catargs(int argc,    
00325                         char **argv, 
00326                         char *str    
00327                         );
00328 
00329 
00336 arg_rec arg_record(char *tagstr,      
00337                    char *argname,     
00338                    arg_type argtype,  
00339                    void *valueptr,    
00340                    char *defaultstr,  
00341                    char *argdescrip   
00342                    );
00343 
00351 void arg_dump(FILE* fp,                
00352               const arg_rec* argtable, 
00353               int n                    
00354               );
00355 
00356 #ifdef __cplusplus
00357 }
00358 #endif
00359 
00360 
00361 
00874 #endif
00875 
00876 
00877 
00878 
00879 

Argtable (http://argtable.sourceforge.net)