mirror of https://github.com/nmlgc/ReC98.git
59 lines
1.7 KiB
PHP
59 lines
1.7 KiB
PHP
; stdio.h
|
|
; Definitions for stream input/output.
|
|
|
|
_NFILE equ 20
|
|
|
|
; Bufferisation type to be used as 3rd argument for "setvbuf" function
|
|
_IOFBF equ 0
|
|
_IOLBF equ 1
|
|
_IONBF equ 2
|
|
|
|
; "flags" bits definitions
|
|
_F_RDWR equ 00003h ; Read/write flag
|
|
_F_READ equ 00001h ; Read only file
|
|
_F_WRIT equ 00002h ; Write only file
|
|
_F_BUF equ 00004h ; Malloc'ed Buffer data
|
|
_F_LBUF equ 00008h ; line-buffered file
|
|
_F_ERR equ 00010h ; Error indicator
|
|
_F_EOF equ 00020h ; EOF indicator
|
|
_F_BIN equ 00040h ; Binary file indicator
|
|
_F_IN equ 00080h ; Data is incoming
|
|
_F_OUT equ 00100h ; Data is outgoing
|
|
_F_TERM equ 00200h ; File is a terminal
|
|
|
|
; End-of-file constant definition
|
|
EOF equ (-1) ; End of file indicator
|
|
|
|
; Default buffer size use by "setbuf" function
|
|
STDIO_BUFSIZ equ 512 ; Buffer size for stdio
|
|
|
|
; Size of an arry large enough to hold a temporary file name string
|
|
L_ctermid equ 5 ; CON: plus null byte
|
|
P_tmpdir equ "" ; temporary directory
|
|
L_tmpnam equ 13 ; tmpnam buffer size
|
|
|
|
; Constants to be used as 3rd argument for "fseek" function
|
|
SEEK_CUR equ 1
|
|
SEEK_END equ 2
|
|
SEEK_SET equ 0
|
|
|
|
; Number of unique file names that shall be generated by "tmpnam" function
|
|
TMP_MAX equ 0FFFFh
|
|
|
|
; Definition of the control structure for streams
|
|
FILE struc
|
|
level dw ? ; fill/empty level of buffer
|
|
flags dw ? ; File status flags
|
|
fd db ? ; File descriptor
|
|
hold db ? ; Ungetc char if no buffer
|
|
_bsize dw ? ; Buffer size. Yes, calling it just "bsize" crashes TASM.
|
|
dPtr@ buffer, ? ; Data transfer buffer
|
|
dPtr@ curp, ? ; Current active pointer
|
|
istemp dw ? ; Temporary file indicator
|
|
token dw ? ; Used for validity checking
|
|
FILE ends
|
|
|
|
FOPEN_MAX equ _NFILE
|
|
SYS_OPEN equ _NFILE
|
|
FILENAME_MAX equ 80
|