00001
00002
00003
00004
00005 #ifndef CIO__H
00006 #define CIO__H
00007
00008 #include <stdarg.h>
00009 #include <task.h>
00010
00011 #define CIO_MAX_DEV (20)
00012
00013
00014
00015
00016
00017
00018 typedef struct _iocb{
00019 int ichid;
00020 int devnum;
00021 char *dev_name;
00022 int mode;
00023 void *p;
00024 struct _iocb *next;
00025 }IOCB;
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038
00039 typedef struct {
00040 int (*openv)(IOCB *);
00041 int (*closv)(IOCB *);
00042 int (*getv)(IOCB *);
00043 int (*readv)(IOCB *,char *,int);
00044 int (*putv)(IOCB *,int);
00045 int (*writev)(IOCB *,char *,int);
00046 int (*statv)(IOCB *,int);
00047 int (*specv)(IOCB *,int cmd,void *d);
00048 int (*initv)(void);
00049 }H_JVEC;
00050
00051
00052 #ifdef __cplusplus
00053 }
00054 #endif
00055
00056
00057
00058
00059
00060
00061
00062 #ifdef __cplusplus
00063 extern "C" {
00064 #endif
00065
00066 typedef struct {
00067 const char *dev_name;
00068 H_JVEC *HtabsEntry;
00069 }HTABS;
00070
00071 #ifdef __cplusplus
00072 }
00073 #endif
00074
00075
00076
00077
00078
00079 #define CIO_ERROR_START (-64)
00080 #define CIO_DEVTABLE_FULL (CIO_ERROR_START-0)
00081 #define CIO_NO_DEVICE (CIO_ERROR_START-1)
00082 #define CIO_WRONLY (CIO_ERROR_START-2)
00083 #define CIO_RDONLY (CIO_ERROR_START-3)
00084
00085 #define EOL 0x0a
00086
00087
00088 extern IOCB *PoolList;
00089 extern HTABS htabs[];
00090 extern int last_dev;
00091 extern ECB *IOCBBlocker;
00092
00093 #ifdef __cplusplus
00094 extern "C" {
00095 #endif
00096
00097 extern int CioAddHandler(char * devname,H_JVEC *t);
00098 extern IOCB *CioOpen(char *devname,int mode);
00099 extern int CioClose(IOCB *I);
00100 extern int CioGetC(IOCB *I);
00101 extern int CioRead(IOCB *I,char *b,int n);
00102 extern int CioPutC(IOCB *I,int c);
00103 extern int CioWrite(IOCB *I,char *b,int n);
00104 extern int CioStatus(IOCB *I,int mode);
00105 extern int CioXIO(IOCB *I,int cmd,void *d);
00106
00107
00108 extern void CioInit(void);
00109
00110 #ifdef __cplusplus
00111 }
00112 #endif
00113
00114 #endif