Go to the documentation of this file.00001
00031 #ifndef _VIO_H_
00032 #define _VIO_H_
00033
00034 #include <maloc/maloc_base.h>
00035
00036 #include <maloc/vnm.h>
00037
00038
00039
00040
00041
00042
00043
00044 #define VPORTNUMBER 14916
00045 #define VIO_MAXBUF 10
00049 typedef enum VIOtype {
00050 VIO_NO_TYPE,
00051 VIO_SDIO,
00052 VIO_BUFF,
00053 VIO_FILE,
00054 VIO_UNIX,
00055 VIO_INET
00056 } VIOtype;
00057
00060 typedef enum VIOfrmt {
00061 VIO_NO_FRMT,
00062 VIO_XDR,
00063 VIO_ASC
00064 } VIOfrmt;
00065
00068 typedef enum VIOrwkey {
00069 VIO_NO_RW,
00070 VIO_R,
00071 VIO_W
00072 } VIOrwkey;
00073
00075 typedef struct Vio {
00076
00077 VIOtype type;
00085 VIOfrmt frmt;
00090 VIOrwkey rwkey;
00095 char file[VMAX_ARGLEN];
00096 char lhost[VMAX_ARGLEN];
00097 char rhost[VMAX_ARGLEN];
00099 int error;
00100 int dirty;
00102 FILE *fp;
00103 int so;
00104 int soc;
00105 void *name;
00106 void *axdr;
00108 char whiteChars[VMAX_ARGNUM];
00109 char commChars[VMAX_ARGNUM];
00111 char ioBuffer[VMAX_BUFSIZE];
00112 int ioBufferLen;
00114 char putBuffer[VMAX_BUFSIZE];
00115 int putBufferLen;
00117 char *VIObuffer;
00118 int VIObufferLen;
00119 int VIObufferPtr;
00121 } Vio;
00122
00123
00124
00125
00126
00127
00128
00129 #if !defined(VINLINE_MALOC)
00130 #else
00131 #endif
00132
00133
00135 VEXTERNC void Vio_start(void);
00137 VEXTERNC void Vio_stop(void);
00138
00140 VEXTERNC Vio* Vio_ctor(const char *socktype, const char *datafrmt,
00141 const char *hostname, const char *filename, const char *rwkey);
00143 VEXTERNC int Vio_ctor2(Vio *thee, const char *socktype, const char *datafrmt,
00144 const char *hostname, const char *filename, const char *rwkey);
00145
00147 VEXTERNC void Vio_dtor(Vio **thee);
00149 VEXTERNC void Vio_dtor2(Vio *thee);
00150
00152 VEXTERNC Vio *Vio_socketOpen(char *key,
00153 const char *iodev, const char *iofmt,
00154 const char *iohost, const char *iofile);
00156 VEXTERNC void Vio_socketClose(Vio **sock);
00157
00159 VEXTERNC void Vio_setWhiteChars(Vio *thee, char *whiteChars);
00161 VEXTERNC void Vio_setCommChars(Vio *thee, char *commChars);
00162
00164 VEXTERNC int Vio_accept(Vio *thee, int nonblock);
00166 VEXTERNC void Vio_acceptFree(Vio *thee);
00167
00169 VEXTERNC int Vio_connect(Vio *thee, int nonblock);
00171 VEXTERNC void Vio_connectFree(Vio *thee);
00172
00174 VEXTERNC int Vio_scanf(Vio *thee, char *parms, ...);
00176 VEXTERNC int Vio_printf(Vio *thee, char *parms, ...);
00177
00179 VEXTERNC int Vio_read(Vio *thee, char *buf, int bufsize);
00181 VEXTERNC int Vio_write(Vio *thee, char *buf, int bufsize);
00182
00184 VEXTERNC int Vio_bufSize(Vio *thee);
00186 VEXTERNC char* Vio_bufGive(Vio *thee);
00188 VEXTERNC void Vio_bufTake(Vio *thee, char *buf, int bufsize);
00189
00190 #endif
00191