Files
TeslaRel410/BORLAND/BC45/SOURCE/RTL/RTLINC/COMMON16/FILESYS.H
T
CydandClaude Fable 5 63312e07f9 source410: literal 4.10 source reconstruction + BC++ 4.52 fleet toolchain archived
- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
  is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
  Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
  (extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
  BT game source (never mixed into CODE/). Round 1-3 state:
  * 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
    (BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
    since 1996.
  * BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
    its binary-recorded line 400 exactly.
  * BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
    (Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
    TeamScore=12 flagged [T4]).
  * MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
    (VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
    the period compiler is the drift detector).
  * Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
    (per-TU verification sweep under authentic OPT.MAK flags).
  * README: corrected roadmap - MECH.HPP is the capstone grown with the mech
    TU reconstructions; BTREG.CPP green = the header-family milestone.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 07:33:26 -05:00

74 lines
2.4 KiB
C++

/*------------------------------------------------------------------------
* filename - filesys.h
*
* interface to file system
*-----------------------------------------------------------------------*/
/*
* C/C++ Run Time Library - Version 6.5
*
* Copyright (c) 1987, 1994 by Borland International
* All Rights Reserved.
*
*/
/*
* The following declarations will need to be adjusted for the
* operating system in use.
*
* We assume a Unix-like model. If yours is very different, additional
* interface functions will be needed, or some rewriting of the
* implementation which uses these functions and data.
*/
#include <fcntl.h>
#include <sys/stat.h>
#include <io.h>
#include <_io.h>
// Assume the following OS routines return this value on error,
// and that this value is NOT ZERO.
// Assume they also set errno when needed.
const int OS_err = -1;
// open file, return fd, open mode 'how', protection 'prot'
//extern "C" int open(const char *name, int how, int prot);
// 'how' bits, these values for SUN OS (like BSD Unix)
const int O_rdonly = O_RDONLY; // read only
const int O_wronly = O_WRONLY; // write only
const int O_rdwr = O_RDWR; // read and write
const int O_append = O_APPEND; // append at each write
const int O_create = O_CREAT; // create file if it does not exist
const int O_trunc = O_TRUNC; // truncate file length to 0 if exists
const int O_excl = O_EXCL; // error if create and file exists
// close file, return 0 on success
//extern "C" int close(int fd);
// read 'count' chars into 'buf', return number read
//extern "C" int read(int fd, void* buf, unsigned count);
// write 'count' chars from 'buf', return number written
//extern "C" int write(int fd, void* buf, unsigned count);
// seek to 'offset' relative to 'whence',
// return new file position, long(OS_err) on error (set errno)
//extern "C" long lseek(int fd, long offset, int whence);
// values for 'whence':
const int L_set = SEEK_SET; // from beginning
const int L_cur = SEEK_CUR; // from current pos
const int L_end = SEEK_END; // from end
// natural size for a file buffer, plus 4 for putback
const int B_size = 516;
// default protection bits
const int P_default = S_IREAD | S_IWRITE;
// fd numbers for standard in, out, error
const int F_stdin = 0;
const int F_stdout = 1;
const int F_stderr = 2;