UNIX Free Pascal


The following fields are used

_IO_write_base:pchar; (* Start of put area. *)

_IO_write_ptr:pchar; (* Current put pointer. *)

_IO_write_end:pchar; (* End of put area. *)

_IO_buf_base:pchar; (* Start of reserve area. *)

_IO_buf_end:pchar; (* End of reserve area. *)

(* The following fields are used to support backing up and undo. *)

_IO_save_base:pchar; (* Pointer to start of non-current get area. *)

_IO_backup_base:pchar; (* Pointer to first valid character of backup area *)

_IO_save_end:pchar; (* Pointer to end of non-current get area. *)





_old_offset:longint; (* This used to be _offset but it's too small. *)



_shortbuf:array[1..1]of char;





function tmpfile:pfile;cdecl;external 'c';

(* Generate a temporary filename. *)

function tmpnam(__s:pchar):pchar;cdecl;external 'c';

(* Close STREAM. *)

function fclose(__stream:pfile):integer;cdecl;external 'c';

(* Flush STREAM, or all streams if STREAM is NULL. *)

function fflush (__stream:pfile):integer;cdecl;external 'c';

(* Close all streams. *)

function fcloseall:integer;cdecl;external 'c';

(* Open a file and create a new stream for it. *)

function fopen(fname:pchar;mode:pchar):pfile;cdecl;external 'c';

(* Open a file by fd and create a new stream for it. *)

function fdopen(fildes:longint;mode:pchar):pfile;cdecl;external 'c';

(* Open a file, replacing an existing stream with it. *)

function freopen (_filename:pchar;__modes:pchar;__stream:pfile):pfile;cdecl;external 'c';

(* Create a new stream that refers to a memory buffer. *)

function fmemopen(__s:pointer;__len:longint;__modes:pchar):pfile;cdecl;external 'c';

(* Open a stream that writes into a malloc'd buffer that is expanded as

necessary. *BUFLOC and *SIZELOC are updated with the buffer's location