- 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>
205 lines
5.2 KiB
C++
205 lines
5.2 KiB
C++
/*------------------------------------------------------------------------*/
|
|
/* */
|
|
/* ABSTARRY.H */
|
|
/* */
|
|
/* Copyright Borland International 1991, 1993 */
|
|
/* All Rights Reserved */
|
|
/* */
|
|
/*------------------------------------------------------------------------*/
|
|
|
|
#if !defined( __ABSTARRY_H )
|
|
#define __ABSTARRY_H
|
|
|
|
#define BI_OLDNAMES
|
|
|
|
#if defined( TEMPLATES )
|
|
|
|
#if !defined( __MEM_H )
|
|
#include <Mem.h>
|
|
#endif // __MEM_H
|
|
|
|
#if !defined( __COLLECT_H )
|
|
#include "classlib\obsolete\Collect.h"
|
|
#endif // __COLLECT_H
|
|
|
|
#pragma option -Vo-
|
|
#if defined( __BCOPT__ ) && !defined( __FLAT__ ) && !defined( _ALLOW_po )
|
|
#pragma option -po-
|
|
#endif
|
|
|
|
_CLASSDEF(ostream)
|
|
_CLASSDEF(ContainerIterator)
|
|
_CLASSDEF(AbstractArray)
|
|
_CLASSDEF(ArrayIterator)
|
|
|
|
class _CLASSTYPE AbstractArray: public Collection
|
|
{
|
|
|
|
public:
|
|
|
|
friend class ArrayIterator;
|
|
|
|
virtual Object _FAR & operator []( int loc ) = 0;
|
|
|
|
virtual int lowerBound() const = 0;
|
|
virtual int upperBound() const = 0;
|
|
virtual sizeType arraySize() const = 0;
|
|
|
|
virtual void detach( int loc, DeleteType dt = NoDelete ) = 0;
|
|
virtual void detach( Object _FAR &, DeleteType dt = NoDelete ) = 0;
|
|
void destroy( int i )
|
|
{
|
|
detach( i, Delete );
|
|
}
|
|
|
|
int isEqual( const Object _FAR & ) const;
|
|
void printContentsOn( ostream _FAR & ) const;
|
|
|
|
};
|
|
|
|
#else // TEMPLATES
|
|
|
|
#if !defined( __MEM_H )
|
|
#include <Mem.h>
|
|
#endif // __MEM_H
|
|
|
|
#if !defined( __COLLECT_H )
|
|
#include "classlib\obsolete\Collect.h"
|
|
#endif // __COLLECT_H
|
|
|
|
#if !defined( __CHECKS_H )
|
|
#include <checks.h>
|
|
#endif // __CHECKS_H
|
|
|
|
#pragma option -Vo-
|
|
#if defined( __BCOPT__ ) && !defined( __FLAT__ ) && !defined( _ALLOW_po )
|
|
#pragma option -po-
|
|
#endif
|
|
|
|
_CLASSDEF(ostream)
|
|
_CLASSDEF(ContainerIterator)
|
|
_CLASSDEF(AbstractArray)
|
|
_CLASSDEF(ArrayIterator)
|
|
|
|
class _CLASSTYPE AbstractArray: public Collection
|
|
{
|
|
|
|
public:
|
|
|
|
AbstractArray( int, int = 0, sizeType = 0 );
|
|
virtual ~AbstractArray();
|
|
|
|
Object _FAR & operator []( int ) const;
|
|
|
|
int lowerBound() const
|
|
{
|
|
return lowerbound;
|
|
}
|
|
|
|
int upperBound() const
|
|
{
|
|
return upperbound;
|
|
}
|
|
|
|
sizeType arraySize() const;
|
|
|
|
virtual void detach( Object _FAR &, DeleteType = NoDelete );
|
|
virtual void detach( int, DeleteType = NoDelete );
|
|
void destroy( int i ) { detach( i, DefDelete ); }
|
|
virtual void flush( DeleteType = DefDelete );
|
|
|
|
virtual int isEqual( const Object _FAR & ) const;
|
|
virtual void printContentsOn( ostream _FAR & ) const;
|
|
|
|
virtual ContainerIterator _FAR & initIterator() const;
|
|
|
|
protected:
|
|
|
|
Object _FAR & objectAt( int i ) const
|
|
{
|
|
return *theArray[ zeroBase(i) ];
|
|
}
|
|
|
|
Object _FAR *ptrAt( int i ) const
|
|
{
|
|
return theArray[ zeroBase(i) ];
|
|
}
|
|
|
|
int find( const Object _FAR & );
|
|
|
|
void reallocate( sizeType );
|
|
|
|
void setData( int, Object _FAR * );
|
|
|
|
void insertEntry( int );
|
|
void removeEntry( int );
|
|
void squeezeEntry( int );
|
|
|
|
sizeType delta;
|
|
int lowerbound;
|
|
int upperbound;
|
|
int lastElementIndex;
|
|
|
|
private:
|
|
|
|
Object _FAR * _FAR *theArray;
|
|
|
|
int zeroBase( int loc ) const
|
|
{
|
|
PRECONDITION( loc >= lowerbound && loc <= upperbound );
|
|
return loc - lowerbound;
|
|
}
|
|
|
|
int boundBase( unsigned loc ) const
|
|
{
|
|
PRECONDITION( loc == UINT_MAX || loc <= upperbound - lowerbound );
|
|
return loc == UINT_MAX ? INT_MAX : loc + lowerbound;
|
|
}
|
|
|
|
friend class ArrayIterator;
|
|
|
|
};
|
|
|
|
inline Object _FAR & AbstractArray::operator [] ( int atIndex ) const
|
|
{
|
|
return objectAt( atIndex );
|
|
}
|
|
|
|
inline sizeType AbstractArray::arraySize() const
|
|
{
|
|
return sizeType( upperbound - lowerbound + 1 );
|
|
}
|
|
|
|
class _CLASSTYPE ArrayIterator : public ContainerIterator
|
|
{
|
|
|
|
public:
|
|
|
|
ArrayIterator( const AbstractArray _FAR & );
|
|
virtual ~ArrayIterator();
|
|
|
|
virtual operator int();
|
|
virtual Object _FAR & current();
|
|
virtual Object _FAR & operator ++( int );
|
|
virtual Object _FAR & operator ++();
|
|
virtual void restart();
|
|
|
|
private:
|
|
|
|
int currentIndex;
|
|
const AbstractArray _FAR & beingIterated;
|
|
|
|
void scan();
|
|
|
|
};
|
|
|
|
#endif // TEMPLATES
|
|
|
|
#if defined( __BCOPT__ ) && !defined( __FLAT__ ) && !defined( _ALLOW_po )
|
|
#pragma option -po.
|
|
#endif
|
|
#pragma option -Vo.
|
|
|
|
#endif // __ABSTARRY_H
|
|
|