/* XDS v2.51: Copyright (c) 1999-2003 Excelsior, LLC. All Rights Reserved. */
/* Generated by XDS Modula-2 to ANSI C v4.20 translator */

#ifndef IOLink_H_
#define IOLink_H_
#ifndef X2C_H_
#include "X2C.h"
#endif
#ifndef IOChan_H_
#include "IOChan.h"
#endif
#ifndef IOConsts_H_
#include "IOConsts.h"
#endif

typedef void *IOLink_DeviceId;

extern void IOLink_AllocateDeviceId(IOLink_DeviceId *);

extern void IOLink_MakeChan(IOLink_DeviceId, IOChan_ChanId *);

extern void IOLink_UnMakeChan(IOLink_DeviceId, IOChan_ChanId *);

struct IOLink_DeviceTable;

typedef struct IOLink_DeviceTable * IOLink_DeviceTablePtr;

typedef void ( *IOLink_LookProc)(IOLink_DeviceTablePtr, X2C_CHAR *,
                X2C_CARD8 *);

typedef void ( *IOLink_SkipProc)(IOLink_DeviceTablePtr);

typedef void ( *IOLink_SkipLookProc)(IOLink_DeviceTablePtr, X2C_CHAR *,
                X2C_CARD8 *);

typedef void ( *IOLink_WriteLnProc)(IOLink_DeviceTablePtr);

typedef void ( *IOLink_TextReadProc)(IOLink_DeviceTablePtr, X2C_ADDRESS,
                X2C_CARD32, X2C_CARD32 *);

typedef void ( *IOLink_TextWriteProc)(IOLink_DeviceTablePtr, X2C_ADDRESS,
                X2C_CARD32);

typedef void ( *IOLink_RawReadProc)(IOLink_DeviceTablePtr, X2C_ADDRESS,
                X2C_CARD32, X2C_CARD32 *);

typedef void ( *IOLink_RawWriteProc)(IOLink_DeviceTablePtr, X2C_ADDRESS,
                X2C_CARD32);

typedef void ( *IOLink_GetNameProc)(IOLink_DeviceTablePtr, X2C_CHAR [],
                X2C_CARD32);

typedef void ( *IOLink_ResetProc)(IOLink_DeviceTablePtr);

typedef void ( *IOLink_FlushProc)(IOLink_DeviceTablePtr);

typedef void ( *IOLink_FreeProc)(IOLink_DeviceTablePtr);

typedef X2C_ADDRESS IOLink_DeviceData;


struct IOLink_DeviceTable {
   X2C_ADDRESS cd;
   IOLink_DeviceId did;
   IOChan_ChanId cid;
   X2C_CARD8 result;
   X2C_INT32 errNum;
   X2C_CARD8 flags;
   IOLink_LookProc doLook;
   IOLink_SkipProc doSkip;
   IOLink_SkipLookProc doSkipLook;
   IOLink_WriteLnProc doLnWrite;
   IOLink_TextReadProc doTextRead;
   IOLink_TextWriteProc doTextWrite;
   IOLink_RawReadProc doRawRead;
   IOLink_RawWriteProc doRawWrite;
   IOLink_GetNameProc doGetName;
   IOLink_ResetProc doReset;
   IOLink_FlushProc doFlush;
   IOLink_FreeProc doFree;
};

typedef X2C_CARD8 IOLink_DevExceptionRange;

extern IOLink_DeviceTablePtr IOLink_DeviceTablePtrValue(IOChan_ChanId,
                IOLink_DeviceId, IOLink_DevExceptionRange, X2C_CHAR [],
                X2C_CARD32);

extern X2C_BOOLEAN IOLink_IsDevice(IOChan_ChanId, IOLink_DeviceId);

extern void IOLink_RAISEdevException(IOChan_ChanId, IOLink_DeviceId,
                IOLink_DevExceptionRange, X2C_CHAR [], X2C_CARD32);

extern X2C_BOOLEAN IOLink_IsIOException(void);

extern X2C_CARD8 IOLink_IOException(void);


extern void IOLink_BEGIN(void);


#endif /* IOLink_H_ */
