00001 /* 00002 * This small and usefull library has been included into Mimotera++ 00003 * more or less without any relevant change. The only thing I did was 00004 * to add a couple of line of documentation. 00005 * 00006 * Thanks to Micheal for having release this under LGPL. 00007 */ 00008 00009 /*************************************************************************** 00010 * Command Line Option Parser 00011 * 00012 * File : optlist.h 00013 * Purpose : Header for getopt style command line option parsing 00014 * Author : Michael Dipperstein 00015 * Date : August 1, 2007 00016 * 00017 **************************************************************************** 00018 * HISTORY 00019 * 00020 * $Id: optlist.h,v 1.1.1.2 2007/09/04 04:45:42 michael Exp $ 00021 * $Log: optlist.h,v $ 00022 * Revision 1.1.1.2 2007/09/04 04:45:42 michael 00023 * Added FreeOptList. 00024 * 00025 * Revision 1.1.1.1 2007/08/07 05:01:48 michael 00026 * Initial Release 00027 * 00028 **************************************************************************** 00029 * 00030 * OptList: A command line option parsing library 00031 * Copyright (C) 2007 by Michael Dipperstein (mdipper@alumni.engr.ucsb.edu) 00032 * 00033 * This file is part of the OptList library. 00034 * 00035 * OptList is free software; you can redistribute it and/or modify it 00036 * under the terms of the GNU Lesser General Public License as published by 00037 * the Free Software Foundation; either version 3 of the License, or (at 00038 * your option) any later version. 00039 * 00040 * OptList is distributed in the hope that it will be useful, but 00041 * WITHOUT ANY WARRANTY; without even the implied warranty of 00042 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 00043 * General Public License for more details. 00044 * 00045 * You should have received a copy of the GNU Lesser General Public License 00046 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00047 * 00048 ***************************************************************************/ 00049 #ifndef OPTLIST_H 00050 #define OPTLIST_H 00051 00052 /*************************************************************************** 00053 * INCLUDED FILES 00054 ***************************************************************************/ 00055 00056 /*************************************************************************** 00057 * MACROS 00058 ***************************************************************************/ 00059 00060 /*************************************************************************** 00061 * CONSTANTS 00062 ***************************************************************************/ 00063 #define OL_NOINDEX -1 /* this option has no arguement */ 00064 00065 /*************************************************************************** 00066 * TYPE DEFINITIONS 00067 ***************************************************************************/ 00071 typedef struct option_t 00072 { 00073 char option; 00074 char *argument; 00075 int argIndex; 00076 struct option_t *next; 00077 } option_t; 00078 00079 /*************************************************************************** 00080 * PROTOTYPES 00081 ***************************************************************************/ 00082 00096 option_t *GetOptList(int argc, char *const argv[], char *const options); 00097 00102 void FreeOptList(option_t *list); 00103 00104 #endif /* ndef OPTLIST_H */