00001
00002
00003
00004
00005
00006
00007 #ifndef V_option_h
00008 #define V_option_h 1
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "viaio/Vlib.h"
00026
00027
00028 #include <stdio.h>
00029
00030
00031 #include <X11/Xfuncproto.h>
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037
00038
00039
00040
00041
00042
00043 typedef struct {
00044 VStringConst keyword;
00045 VRepnKind repn;
00046 int number;
00047 VPointer value;
00048 VBoolean *found;
00049 VDictEntry *dict;
00050 VStringConst blurb;
00051 } VOptionDescRec;
00052
00053
00054 #define VRequiredOpt (& V_RequiredOpt)
00055 #define VOptionalOpt (& V_OptionalOpt)
00056 extern VBoolean V_RequiredOpt;
00057 extern VBoolean V_OptionalOpt;
00058
00059
00060 typedef struct {
00061 int number;
00062 VPointer vector;
00063 } VArgVector;
00064
00065
00066
00067
00068
00069
00070
00071 void VHistory (
00072 #if NeedFunctionPrototypes
00073 int,
00074 VOptionDescRec*,
00075 char*,
00076 VAttrList*,
00077 VAttrList*
00078 #endif
00079 );
00080
00081 VAttrList VReadHistory(
00082 #if NeedFunctionPrototypes
00083 VAttrList*
00084 #endif
00085 );
00086
00087 void VPrependHistory(
00088 #if NeedFunctionPrototypes
00089 int,
00090 VOptionDescRec *,
00091 char*,
00092 VAttrList*
00093 #endif
00094 );
00095
00096 char * getVersion();
00097
00098
00099
00100
00101 VBoolean VIdentifyFiles (
00102 #if NeedFunctionPrototypes
00103 int ,
00104 VOptionDescRec [] ,
00105 VStringConst ,
00106 int * ,
00107 char ** ,
00108 int
00109 #endif
00110 );
00111
00112 VBoolean VParseCommand (
00113 #if NeedFunctionPrototypes
00114 int ,
00115 VOptionDescRec [] ,
00116 int * ,
00117 char **
00118 #endif
00119 );
00120
00121 VBoolean VParseCommand_nl (
00122 #if NeedFunctionPrototypes
00123 int ,
00124 VOptionDescRec [] ,
00125 int * ,
00126 char **
00127 #endif
00128 );
00129
00130 void VParseFilterCmd (
00131 #if NeedFunctionPrototypes
00132 int ,
00133 VOptionDescRec [] ,
00134 int ,
00135 char ** ,
00136 FILE ** ,
00137 FILE **
00138 #endif
00139 );
00140
00141 void VPrintOptions (
00142 #if NeedFunctionPrototypes
00143 FILE * ,
00144 int ,
00145 VOptionDescRec []
00146 #endif
00147 );
00148
00149 int VPrintOptionValue (
00150 #if NeedFunctionPrototypes
00151 FILE * ,
00152 VOptionDescRec *
00153 #endif
00154 );
00155
00156 void VReportBadArgs (
00157 #if NeedFunctionPrototypes
00158 int ,
00159 char **
00160 #endif
00161 );
00162
00163 void VReportUsage (
00164 #if NeedFunctionPrototypes
00165 VStringConst ,
00166 int ,
00167 VOptionDescRec [] ,
00168 VStringConst
00169 #endif
00170 );
00171
00172 void VReportUsage_nl (
00173 #if NeedFunctionPrototypes
00174 VStringConst ,
00175 int ,
00176 VOptionDescRec [] ,
00177 VStringConst
00178 #endif
00179 );
00180
00181 void VReportValidOptions (
00182 #if NeedFunctionPrototypes
00183 int ,
00184 VOptionDescRec []
00185 #endif
00186 );
00187
00188
00189
00190 VBoolean VLoadParameters (
00191 #if NeedFunctionPrototypes
00192 int ,
00193 VOptionDescRec [] ,
00194 VStringConst ,
00195 VStringConst ,
00196 VPointer ,
00197 VBoolean
00198 #endif
00199 );
00200
00201 VBoolean VParseParamDefn (
00202 #if NeedFunctionPrototypes
00203 VStringConst ,
00204 VString ,
00205 VRepnKind * ,
00206 VString ,
00207 VString
00208 #endif
00209 );
00210
00211 VBoolean VParseParamOptions (
00212 #if NeedFunctionPrototypes
00213 int ,
00214 VOptionDescRec [] ,
00215 int * ,
00216 char ** ,
00217 VPointer
00218 #endif
00219 );
00220
00221 void VPrintParameters (
00222 #if NeedFunctionPrototypes
00223 FILE * ,
00224 int ,
00225 VOptionDescRec [] ,
00226 VPointer
00227 #endif
00228 );
00229
00230 void VReportValidParamOptions (
00231 #if NeedFunctionPrototypes
00232 int ,
00233 VOptionDescRec [] ,
00234 VPointer
00235 #endif
00236 );
00237
00238 #ifdef __cplusplus
00239 }
00240 #endif
00241
00242 #endif