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

popts2.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 
00022 #include <stdio.h>
00023 #include <stdlib.h>
00024 #include <string.h>
00025 
00026 #include "cuf-global.h"
00027 #include "array.h"
00028 #include "llist.h"
00029 
00030 #ifndef _POPTS2_H_
00031 # define _POPTS2_H_
00032 
00033 # define DESC_WINDOW_WIDTH              78
00034 # define DESC_COLUMN_START              34
00035 
00036 typedef void (*FuncString2d) (char **);
00037 
00042 typedef enum _OType {
00043         // Regular variables
00044         OBool,                          
00045         OChar,                          
00046         OInt,                           
00047         OLong,                          
00048         OFloat,                         
00049         ODouble,                        
00050         OString,                        
00051 
00052         // Functions
00053         OFuncVoid,                      
00054         OFuncBool,                      
00055         OFuncChar,                      
00056         OFuncInt,                       
00057         OFuncLong,                      
00058         OFuncFloat,                     
00059         OFuncDouble,                    
00060         OFuncString,                    
00061 
00062         // Specialty
00063         OString2d,                      
00064         OFuncString2d,                  
00065         OProgramname                    
00066 } OType;
00067 
00072 typedef enum _OClass {
00073         OCLetter,                       
00074         OCWord,                         
00075         OCSpecial                       
00076 } OClass;
00077 
00082 typedef struct _DescMember {
00083         unsigned int did;               // This descriptions id.
00084         unsigned int num_ids;           // Number of id's assoicated with this option.
00085         unsigned int *ids;              // The array of id's
00086         char *desc;                     // The description
00087 } DescMember;
00088 
00093 typedef struct _DescCatagory {
00094         char *cname;                    // The name of the catagory
00095         char *text;                     // Any extra text about the catagory
00096         Llist *members;                 // a linked list of description memebers
00097 } DescCatagory;
00098 
00103 typedef struct _COption {
00104         unsigned int id;                // Id
00105         int printed;                    // Internal, if it was printed or not.
00106         OClass oc;                      // Option Class
00107         OType ot;                       // Option Type
00108         char *s;                        // search word/letter
00109         void *var;                      // Manipulation variable
00110 } COption;
00111 
00112 unsigned int popts2_add (char *s, OClass oc, OType ot, void *var);
00113 void popts2_desc_cat_add (char *cname, char *text);
00114 int popts2_desc_add (char *cname, char *desc);
00115 void popts2_desc_connect (unsigned int did, unsigned int oid);
00116 void popts2_desc_print (void);
00117 void popts2_help_add (void);
00118 void popts2_parse (int argc, char **argv);
00119 void popts2_done (void);
00120 
00121 #endif /* _POPTS2_H_ */

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