00001 #include "vapiTypes.h"
00002 #include "vapiIO.h"
00003 #include "vapiOptions.h"
00004 #include "vapiIOList.h"
00005
00006 vBoolean
00007 vIOCheckList (int IOindex)
00008 {
00009 int ListSize;
00010
00011 ListSize = v_list_count_elements (GlobalIOListConfigured);
00012 if (IOindex < ListSize)
00013 {
00014 return vFALSE;
00015 }
00016 return vTRUE;
00017
00018 }
00019
00020 vBoolean
00021 vIOCheckIO (vIOConfigured * IO, int IOtype, int InData, int OutData)
00022 {
00023 vapiOptionsCheck (IO->IO->OptionsSettings, IO->Options);
00024 if (IO->IO->IOtype != IOtype)
00025 {
00026 return vTRUE;
00027 }
00028 if (IO->IO->InData == InData && IO->IO->OutData == OutData)
00029 {
00030 return vFALSE;
00031 }
00032
00033 return vTRUE;
00034
00035 }
00036
00037 int *
00038 v_input_str_int (int IOindex, const char *str)
00039 {
00040 vIOConfigured *IO;
00041
00042 if (vIOCheckList (IOindex))
00043 {
00044 return NULL;
00045 }
00046 IO = v_list_get (GlobalIOListConfigured, IOindex);
00047
00048 if (vIOCheckIO (IO, vInput, vStr, vInt))
00049 {
00050 return NULL;
00051 }
00052
00053 return IO->IO->IOFunc (IO->Options, (vpointer) str);
00054 }
00055
00056 vBoolean *
00057 v_input_NULL_boolean (int IOindex)
00058 {
00059 vIOConfigured *IO;
00060
00061 if (vIOCheckList (IOindex))
00062 {
00063 return NULL;
00064 }
00065 IO = v_list_get (GlobalIOListConfigured, IOindex);
00066
00067 if (vIOCheckIO (IO, vInput, vNULL, vBool))
00068 {
00069 return NULL;
00070 }
00071
00072 return IO->IO->IOFunc (IO->Options, NULL);
00073 }