/* voc 2.1.0 [2025/05/18] for gcc LP64 on slackware xtspaF */

#ifndef ulmStreams__h
#define ulmStreams__h

#include "SYSTEM.h"
#include "ulmEvents.h"
#include "ulmObjects.h"
#include "ulmServices.h"

typedef
	struct ulmStreams_StreamRec *ulmStreams_Stream;

typedef
	INT32 (*ulmStreams_AddrIOProc)(ulmStreams_Stream, INT64, INT32);

typedef
	INT32 (*ulmStreams_BufIOProc)(ulmStreams_Stream, SYSTEM_BYTE*, ADDRESS , INT32, INT32);

typedef
	BOOLEAN (*ulmStreams_CloseProc)(ulmStreams_Stream);

typedef
	struct ulmStreams_EventRec *ulmStreams_Event;

typedef
	struct ulmStreams_EventRec { /* ulmEvents_EventRec */
		ulmEvents_EventType type;
		ulmEvents_Message message;
		char _prvt0[8];
		ulmStreams_Stream stream;
		INT8 errorcode;
	} ulmStreams_EventRec;

typedef
	BOOLEAN (*ulmStreams_FlushProc)(ulmStreams_Stream);

typedef
	struct ulmStreams_Message { /* ulmObjects_ObjectRec */
		char _prvt0[1];
	} ulmStreams_Message;

typedef
	void (*ulmStreams_HandlerProc)(ulmStreams_Stream, ulmStreams_Message*, ADDRESS *);

typedef
	struct ulmStreams_InterfaceRec *ulmStreams_Interface;

typedef
	BOOLEAN (*ulmStreams_ReadProc)(ulmStreams_Stream, SYSTEM_BYTE*);

typedef
	BOOLEAN (*ulmStreams_WriteProc)(ulmStreams_Stream, SYSTEM_BYTE);

typedef
	BOOLEAN (*ulmStreams_SeekProc)(ulmStreams_Stream, INT32, INT8);

typedef
	BOOLEAN (*ulmStreams_TellProc)(ulmStreams_Stream, INT32*);

typedef
	BOOLEAN (*ulmStreams_TruncProc)(ulmStreams_Stream, INT32);

typedef
	struct ulmStreams_InterfaceRec { /* ulmObjects_ObjectRec */
		ulmStreams_AddrIOProc addrread, addrwrite;
		ulmStreams_BufIOProc bufread, bufwrite;
		ulmStreams_ReadProc read;
		ulmStreams_WriteProc write;
		ulmStreams_SeekProc seek;
		ulmStreams_TellProc tell;
		ulmStreams_TruncProc trunc;
		ulmStreams_FlushProc flush;
		ulmStreams_CloseProc close;
		ulmStreams_HandlerProc handler;
	} ulmStreams_InterfaceRec;

typedef
	struct ulmStreams_StreamRec { /* ulmServices_ObjectRec */
		INT64 _prvt0;
		char _prvt1[16];
		INT32 count, errors;
		BOOLEAN error;
		INT8 lasterror;
		BOOLEAN eof;
		char _prvt2[117];
	} ulmStreams_StreamRec;


import ulmStreams_Stream ulmStreams_null, ulmStreams_stdin, ulmStreams_stdout, ulmStreams_stderr;
import ulmEvents_Message ulmStreams_errormsg[18];
import ulmEvents_EventType ulmStreams_error;

import ADDRESS *ulmStreams_Message__typ;
import ADDRESS *ulmStreams_InterfaceRec__typ;
import ADDRESS *ulmStreams_StreamRec__typ;
import ADDRESS *ulmStreams_EventRec__typ;

import BOOLEAN ulmStreams_Back (ulmStreams_Stream s);
import UINT32 ulmStreams_Capabilities (ulmStreams_Stream s);
import BOOLEAN ulmStreams_Close (ulmStreams_Stream s);
import void ulmStreams_CloseAll (void);
import BOOLEAN ulmStreams_Copy (ulmStreams_Stream source, ulmStreams_Stream dest, INT32 maxcnt);
import BOOLEAN ulmStreams_Flush (ulmStreams_Stream s);
import INT8 ulmStreams_GetBufMode (ulmStreams_Stream s);
import void ulmStreams_GetBufferPoolSize (ulmStreams_Stream s, INT32 *nbuf);
import void ulmStreams_GetCloseEvent (ulmStreams_Stream s, ulmEvents_EventType *type);
import void ulmStreams_GetFlushEvent (ulmStreams_Stream s, ulmEvents_EventType *type);
import void ulmStreams_GetPos (ulmStreams_Stream s, INT32 *offset);
import void ulmStreams_Init (ulmStreams_Stream s, ulmStreams_Interface if_, UINT32 caps, INT8 bufmode);
import BOOLEAN ulmStreams_InputInBuffer (ulmStreams_Stream s);
import BOOLEAN ulmStreams_Insert (ulmStreams_Stream s, SYSTEM_BYTE byte);
import void ulmStreams_LineTerm (ulmStreams_Stream s, SYSTEM_BYTE termch);
import BOOLEAN ulmStreams_OutputInBuffer (ulmStreams_Stream s);
import BOOLEAN ulmStreams_OutputWillBeBuffered (ulmStreams_Stream s);
import BOOLEAN ulmStreams_Read (ulmStreams_Stream s, SYSTEM_BYTE *buf, ADDRESS buf__len);
import BOOLEAN ulmStreams_ReadByte (ulmStreams_Stream s, SYSTEM_BYTE *byte);
import INT32 ulmStreams_ReadPacket (ulmStreams_Stream s, SYSTEM_BYTE *buf, ADDRESS buf__len, INT32 off, INT32 maxcnt);
import BOOLEAN ulmStreams_ReadPart (ulmStreams_Stream s, SYSTEM_BYTE *buf, ADDRESS buf__len, INT32 off, INT32 cnt);
import void ulmStreams_Release (ulmStreams_Stream s);
import BOOLEAN ulmStreams_Seek (ulmStreams_Stream s, INT32 offset, INT8 whence);
import void ulmStreams_Send (ulmStreams_Stream s, ulmStreams_Message *message, ADDRESS *message__typ);
import void ulmStreams_SetBufferPoolSize (ulmStreams_Stream s, INT32 nbuf);
import void ulmStreams_SetPos (ulmStreams_Stream s, INT32 offset);
import BOOLEAN ulmStreams_Tell (ulmStreams_Stream s, INT32 *offset);
import void ulmStreams_Tie (ulmStreams_Stream in, ulmStreams_Stream out);
import void ulmStreams_Touch (ulmStreams_Stream s);
import BOOLEAN ulmStreams_Trunc (ulmStreams_Stream s, INT32 length);
import BOOLEAN ulmStreams_Write (ulmStreams_Stream s, SYSTEM_BYTE *buf, ADDRESS buf__len);
import BOOLEAN ulmStreams_WriteByte (ulmStreams_Stream s, SYSTEM_BYTE byte);
import BOOLEAN ulmStreams_WriteC (ulmStreams_Stream s, SYSTEM_BYTE *buf, ADDRESS buf__len);
import BOOLEAN ulmStreams_WritePart (ulmStreams_Stream s, SYSTEM_BYTE *buf, ADDRESS buf__len, INT32 off, INT32 cnt);
import BOOLEAN ulmStreams_WritePartC (ulmStreams_Stream s, SYSTEM_BYTE *buf, ADDRESS buf__len, INT32 off, INT32 cnt);
import void *ulmStreams__init(void);


#endif // ulmStreams
