00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
00044 OBool,
00045 OChar,
00046 OInt,
00047 OLong,
00048 OFloat,
00049 ODouble,
00050 OString,
00051
00052
00053 OFuncVoid,
00054 OFuncBool,
00055 OFuncChar,
00056 OFuncInt,
00057 OFuncLong,
00058 OFuncFloat,
00059 OFuncDouble,
00060 OFuncString,
00061
00062
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;
00084 unsigned int num_ids;
00085 unsigned int *ids;
00086 char *desc;
00087 } DescMember;
00088
00093 typedef struct _DescCatagory {
00094 char *cname;
00095 char *text;
00096 Llist *members;
00097 } DescCatagory;
00098
00103 typedef struct _COption {
00104 unsigned int id;
00105 int printed;
00106 OClass oc;
00107 OType ot;
00108 char *s;
00109 void *var;
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