argparser.h

Go to the documentation of this file.
00001 /* argparser.c  --  Simple argument parser - inspired by getopt, but simpler
00002  *
00003  *  GPLv2 only - Copyright (C) 2008 - 2010
00004  *               David Sommerseth <dazo@users.sourceforge.net>
00005  *
00006  *  This program is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  as published by the Free Software Foundation; version 2
00009  *  of the License.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  *
00020  */
00021 
00031 #ifndef EUREPHIA__ARGPARSE_H
00032 #define EUREPHIA__ARGPARSE_H
00033 
00034 #ifndef ARGPARSER_C
00035 # ifndef MODULE
00036 #  error To use the argparser, you must define MODULE (string)
00037 # endif
00038 #endif
00039 
00040 #define MAX_ARGUMENTS 64        
00046 typedef struct {
00047         char *longarg;          
00048         char *shortarg;         
00049         int param;              
00050 } e_options;                    
00052 extern char *optargs[MAX_ARGUMENTS]; 
00054 int _eurephia_getopt(const char *module, int *curarg, int argc, char **argv, e_options *argopts);
00067 #define eurephia_getopt(ca, ac, av, opts) _eurephia_getopt(MODULE, ca, ac, av, opts)
00068 
00069 size_t eurephia_arraycp(int stidx, int inargc, char **inargv, char **outargv, size_t outsize);
00070 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines