00001 #ifndef _VAPI_OPTIONS_
00002 #define _VAPI_OPTIONS_
00003 #include "vapiTypes.h"
00004
00017 enum vapiInterfaceType
00018 { vBar = 0, vSpin };
00019
00021 typedef int vInterfaceType;
00022
00024 typedef struct _vOptfloat
00025 {
00027 double min;
00029 double max;
00031 double scale;
00033 double defaultValue;
00035 char *name;
00037 char *description;
00039 vInterfaceType interfaceType;
00040 } vOptfloat;
00041
00043 typedef struct _vOptint
00044 {
00046 int min;
00048 int max;
00050 int scale;
00052 int defaultValue;
00054 char *name;
00056 char *description;
00058 vInterfaceType interfaceType;
00059 } vOptint;
00060
00062 typedef struct _vOptchar
00063 {
00065 char *name;
00067 char *description;
00068 } vOptchar;
00069
00071 typedef struct _vOptBoolean
00072 {
00074 char *name;
00076 char *description;
00078 vBoolean defaultValue;
00079 } vOptBoolean;
00080
00082 typedef struct _vOptChoose
00083 {
00085 char *name;
00087 char *description;
00089 int defaultOption;
00091 int numberOfChoices;
00093 vChar *listOfChoices;
00094 } vOptChoose;
00095
00097 typedef struct _vOptionsSettings
00098 {
00099 vOptfloat *floats;
00100 vOptint *ints;
00101 vOptchar *chars;
00102 vOptChoose *choose;
00103 vOptBoolean *booleans;
00105 int floatsNumber;
00107 int intsNumber;
00109 int charsNumber;
00111 int chooseNumber;
00113 int booleansNumber;
00115 vpointer CustomOptionsSettings;
00116 } vOptionsSettings;
00117
00119 typedef struct _vOptions
00120 {
00122 double *floats;
00123
00125 int *ints;
00126
00128 vChar *chars;
00129
00131 int *choices;
00132
00134 vBoolean *booleans;
00135
00136
00137
00138
00139
00140
00141
00142
00143 int floatsNumber;
00144 int intsNumber;
00145 int charsNumber;
00146 int choicesNumber;
00147 int booleansNumber;
00149 vpointer CustomOptions;
00150 } vOptions;
00151
00153 typedef void (*vOptionsFreeCustom) (vOptions *, vOptionsSettings *);
00154
00156 typedef void (*vOptionsSettingsFreeCustom) (vOptionsSettings *);
00157
00162 int vapiOptionsGetInts (vOptions * Options, int position);
00163
00168 double vapiOptionsGetFloats (vOptions * Options, int position);
00169
00175 char *vapiOptionsGetChars (vOptions * Options, int position);
00180 vBoolean vapiOptionsGetBooleans (vOptions * Options, int position);
00181
00185 int vapiOptionsGetTimes (vOptions * Options);
00186
00191 int vapiOptionsGetChoices (vOptions * Options, int position);
00192
00194 vOptions *vapiOptionsInit (vOptionsSettings * OptionsSettings);
00195
00202 void vOptionsFree (vOptions * Options, vOptionsSettings * OptionsSettings,
00203 vOptionsFreeCustom FreeCustom);
00204
00210 void vOptionsSettingsFree (vOptionsSettings * OptionsSettings,
00211 vOptionsSettingsFreeCustom FreeCustom);
00212
00214 vOptionsSettings *vapiOptionsSettingsInit ();
00215
00217 vBoolean vapiOptionsCheck (vOptionsSettings * OptionsSettings,
00218 vOptions * Options);
00219
00220 #endif