Copyright: Help file created by SCANHELP


 "Contents"

Contents of UTIL help file

Units:

BTypes	Base2N	BitArray	memh	CompVers	dates	HRTimer	TSC	Mem_Util	MiniStat	sort


 Unit BTypes

Unit BTypes (in UTIL help file)

Common basic type definitions.

Types:

Int8	Int16	Int32	UInt8	UInt16	UInt32	Smallint	Shortstring	pByte	pBoolean	pShortInt	pWord	pSmallInt	pLongint	Str255	Str127	pInt8	pInt16	pInt32	pUInt8	pUInt16	pUInt32	pStr255	pStr127	BString	pBString	char8	pchar8	Ptr2Inc	__P2I


 BTypes.Int8

BTypes.Int8 = ShortInt;

8 bit   signed integer.


 BTypes.Int16

BTypes.Int16 = Integer;

16 bit   signed integer.


 BTypes.Int32

BTypes.Int32 = Longint;

32 bit   signed integer.


 BTypes.UInt8

BTypes.UInt8 = Byte;

8 bit unsigned integer.


 BTypes.UInt16

BTypes.UInt16 = Word;

16 bit unsigned integer.


 BTypes.UInt32

BTypes.UInt32 = Longint;

32 bit unsigned integer.


 BTypes.Smallint

BTypes.Smallint = Integer;


 BTypes.Shortstring

BTypes.Shortstring = string;


 BTypes.pByte

BTypes.pByte = ^Byte;


 BTypes.pBoolean

BTypes.pBoolean = ^Boolean;


 BTypes.pShortInt

BTypes.pShortInt = ^ShortInt;


 BTypes.pWord

BTypes.pWord = ^Word;


 BTypes.pSmallInt

BTypes.pSmallInt = ^SmallInt;


 BTypes.pLongint

BTypes.pLongint = ^Longint;

BIT16.


 BTypes.Str255

BTypes.Str255 = string[255] ;

Handy type to avoid problems with 32 bit and/or unicode.


 BTypes.Str127

BTypes.Str127 = string[127] ;


 BTypes.pInt8

BTypes.pInt8 = ^Int8;


 BTypes.pInt16

BTypes.pInt16 = ^Int16;


 BTypes.pInt32

BTypes.pInt32 = ^Int32;


 BTypes.pUInt8

BTypes.pUInt8 = ^UInt8;


 BTypes.pUInt16

BTypes.pUInt16 = ^UInt16;


 BTypes.pUInt32

BTypes.pUInt32 = ^UInt32;


 BTypes.pStr255

BTypes.pStr255 = ^Str255;


 BTypes.pStr127

BTypes.pStr127 = ^Str127;


 BTypes.BString

BTypes.BString = string[255] ;

String of 8 bit characters.


 BTypes.pBString

BTypes.pBString = ^BString;


 BTypes.char8

BTypes.char8 = char;

8 bit characters.


 BTypes.pchar8

BTypes.pchar8 = pchar;


 BTypes.Ptr2Inc

BTypes.Ptr2Inc = pByte;

Type cast to increment untyped pointer.


 BTypes.__P2I

BTypes.__P2I = longint;

Type cast pointer to integer for masking etc.


 Unit Base2N

Unit Base2N (in UTIL help file)

Base 2**N conversion (1 <= N <= 6), N=0 is treated as Base32-Hex.

Constants:

StrictCase

Functions and Procedures:

EncodeBase2N	EncodeBase64	EncodeBase32	EncodeBase32Hex	EncodeBase16	EncodeBase2NStr	EncodeBase64Str	EncodeBase32Str	EncodeBase32HexStr	EncodeBase16Str	DecodeBase2N	DecodeBase64	DecodeBase32	DecodeBase32Hex	DecodeBase16	DecodeBase2NStr	DecodeBase64Str	DecodeBase32Str	DecodeBase32HexStr	DecodeBase16Str


 Base2N.StrictCase

Const Base2N.StrictCase: boolean = false;

strict case for N=1..5: if true uppercase only, else lowercase allowed


 Base2N.EncodeBase2N

procedure Base2N.EncodeBase2N(psrc, pdest: pointer; lsrc, ldest, N: word; var LA: word);

Base 2**N encode src to dest, LA result length of dest string, Base32-Hex if N=0.


 Base2N.EncodeBase64

procedure Base2N.EncodeBase64(psrc, pdest: pointer; lsrc, ldest: word; var LA: word);

Base64 encode src to dest, LA result length of dest string.


 Base2N.EncodeBase32

procedure Base2N.EncodeBase32(psrc, pdest: pointer; lsrc, ldest: word; var LA: word);

Base32 encode src to dest, LA result length of dest string.


 Base2N.EncodeBase32Hex

procedure Base2N.EncodeBase32Hex(psrc, pdest: pointer; lsrc, ldest: word; var LA: word);

Base32-Hex encode src to dest, LA result length of dest string.


 Base2N.EncodeBase16

procedure Base2N.EncodeBase16(psrc, pdest: pointer; lsrc, ldest: word; var LA: word);

Base16 encode src to dest, LA result length of dest string.


 Base2N.EncodeBase2NStr

function Base2N.EncodeBase2NStr(psrc: pointer; lsrc, N: word): str255;

Base 2**N string of memory block of length lsrc pointed by psrc, Base32-Hex if N=0.


 Base2N.EncodeBase64Str

function Base2N.EncodeBase64Str(psrc: pointer; lsrc: word): str255;

Base64 string of memory block of length lsrc pointed by psrc.


 Base2N.EncodeBase32Str

function Base2N.EncodeBase32Str(psrc: pointer; lsrc: word): str255;

Base32 string of memory block of length lsrc pointed by psrc.


 Base2N.EncodeBase32HexStr

function Base2N.EncodeBase32HexStr(psrc: pointer; lsrc: word): str255;

Base32-Hex string of memory block of length lsrc pointed by psrc.


 Base2N.EncodeBase16Str

function Base2N.EncodeBase16Str(psrc: pointer; lsrc: word): str255;

Base16 string of memory block of length lsrc pointed by psrc.


 Base2N.DecodeBase2N

procedure Base2N.DecodeBase2N(psrc, pdest: pointer; lsrc, ldest, N: word; var LA: word);

Decode Base 2**N src to dest, LA result length of dest string, Base32-Hex if N=0.


 Base2N.DecodeBase64

procedure Base2N.DecodeBase64(psrc, pdest: pointer; lsrc, ldest: word; var LA: word);

Decode Base64 src to dest, LA result length of dest string.


 Base2N.DecodeBase32

procedure Base2N.DecodeBase32(psrc, pdest: pointer; lsrc, ldest: word; var LA: word);

Decode Base32 src to dest, LA result length of dest string.


 Base2N.DecodeBase32Hex

procedure Base2N.DecodeBase32Hex(psrc, pdest: pointer; lsrc, ldest: word; var LA: word);

Decode Base32-Hex src to dest, LA result length of dest string.


 Base2N.DecodeBase16

procedure Base2N.DecodeBase16(psrc, pdest: pointer; lsrc, ldest: word; var LA: word);

Decode Base16 src to dest, LA result length of dest string.


 Base2N.DecodeBase2NStr

procedure Base2N.DecodeBase2NStr(const s: str255; pdest: pointer; ldest, N: word; var LA: word);

Decode Base 2**N string to dest, LA/ldest result/max length of dest, Base32-Hex if N=0.


 Base2N.DecodeBase64Str

procedure Base2N.DecodeBase64Str(const s: str255; pdest: pointer; ldest: word; var LA: word);

Decode Base64 src string to dest, LA/ldest result/max length of dest.


 Base2N.DecodeBase32Str

procedure Base2N.DecodeBase32Str(const s: str255; pdest: pointer; ldest: word; var LA: word);

Decode Base32 src string to dest, LA/ldest result/max length of dest.


 Base2N.DecodeBase32HexStr

procedure Base2N.DecodeBase32HexStr(const s: str255; pdest: pointer; ldest: word; var LA: word);

Decode Base32-Hex src string to dest, LA/ldest result/max length of dest.


 Base2N.DecodeBase16Str

procedure Base2N.DecodeBase16Str(const s: str255; pdest: pointer; ldest: word; var LA: word);

Decode Base16 src string to dest, LA/ldest result/max length of dest.


 Unit BitArray

Unit BitArray (in UTIL help file)

Bit array context with max 524160 bits.

Types:

TBABytes	PBABytes	TBitArray

Functions and Procedures:

BA_ClearBit	BA_ClearAll	BA_Free	BA_Init	BA_SetAll	BA_SetBit	BA_TestBit	BA_ToggleBit


 BitArray.TBABytes

BitArray.TBABytes = array[0..$FFF0 - 1] of byte;

Helper types.


 BitArray.PBABytes

BitArray.PBABytes = ^TBABytes;


 BitArray.TBitArray

BitArray.TBitArray = record

bit array context record.

Fields:

 pbits: PBABytes;

 used: longint;

 alloc: word;


 TBitArray.pbits

TBitArray.pbits: PBABytes;

pointer to allocated bytes.


 TBitArray.used

TBitArray.used: longint;

number of used bits.


 TBitArray.alloc

TBitArray.alloc: word;

number of allocated bytes.


 BitArray.BA_ClearBit

procedure BitArray.BA_ClearBit(var BA: TBitArray; i: longint);

Clear bit i of bit array.


 BitArray.BA_ClearAll

procedure BitArray.BA_ClearAll(var BA: TBitArray);

Clear all bits of bit array.


 BitArray.BA_Free

procedure BitArray.BA_Free(var BA: TBitArray);

Deallocate/free bit array.


 BitArray.BA_Init

procedure BitArray.BA_Init(var BA: TBitArray; NumBits: longint; var OK: boolean);

Allocate/Initalize bit array with NumBits bits.


 BitArray.BA_SetAll

procedure BitArray.BA_SetAll(var BA: TBitArray);

Set all bits of bit array.


 BitArray.BA_SetBit

procedure BitArray.BA_SetBit(var BA: TBitArray; i: longint);

Set bit i of bit array.


 BitArray.BA_TestBit

function BitArray.BA_TestBit(var BA: TBitArray; i: longint): boolean;

Test if bit i of bit array is set.


 BitArray.BA_ToggleBit

procedure BitArray.BA_ToggleBit(var BA: TBitArray; i: longint);

Toggle bit i of bit array.


 Unit memh

Unit memh (in UTIL help file)

Basic portable heap memory allocation functions.

Functions and Procedures:

malloc	calloc	mfree	cfree


 memh.malloc

function memh.malloc(size: longint): pointer;

Allocate heap, return nil if error.


 memh.calloc

function memh.calloc(size: longint): pointer;

Allocate heap, return nil if error, clear allocated memory to 0.


 memh.mfree

procedure memh.mfree(var p; size: longint);

Deallocate heap if p<>nil, p will be set to nil.


 memh.cfree

procedure memh.cfree(var p; size: longint);

Deallocate heap if p<>nil, p will be set to nil, memory set to 0.


 Unit CompVers

Unit CompVers (in UTIL help file)

Return compiler version as string or symbol.

Types:

TCompiler	TCompString

Functions and Procedures:

Compiler_Sym	Compiler_Str


 CompVers.TCompiler

CompVers.TCompiler = (_Unknown,  _TP4, _TP5, _TP55, _TP6, _BP7, _BP7DPMI, _BP7WIN, _TPW10, _TPW15,  _D1, _D2, _D3, _D4, _D5, _D6, _D7, _D9,  _BCB3, _BCB4,  _VP21, _FPC, _FPC10, _FPC19, _FPC20, _FPC202,  _D8, _D10, _D11,  _BCB5, _BCB6, _BCB7,  _FPC204, _FPC214, _FPC220, _FPC222,  _D12,  _FPC224,  _D14,  _FPC240, _FPC242, _FPC244, _FPC260, _FPC262,  _D15, _D16, _D17, _D18, _D19,  _FPC264,  _D20, _D21,  _FPC271, _FPC301, _FPC311,  _D22, _FPC300, _D23, _D24, _FPC302, _D25, _FPC304,  _FPC320, _FPC331, _D26 );


 CompVers.TCompString

CompVers.TCompString = string[15] ;


 CompVers.Compiler_Sym

function CompVers.Compiler_Sym: TCompiler;

Return compiler version as symbol.


 CompVers.Compiler_Str

function CompVers.Compiler_Str: TCompString;

Return compiler version as string.


 Unit dates

Unit dates (in UTIL help file)

Current date/time routines, Julian day numbers, UnixToDMYhms.

Constants:

UseLocal

Functions and Procedures:

GetCurrentDate	GetCurrentTime	msCount	JulianDay	JulianToDMY	CurrentJulianDay	UnixToDMYhms


 dates.UseLocal

Const dates.UseLocal: boolean = true;

Uses local or UTC time, only for WIN32or64 or ARM.


 dates.GetCurrentDate

procedure dates.GetCurrentDate(var y, m, d, w: word);

Returns current date.


 dates.GetCurrentTime

procedure dates.GetCurrentTime(var h, m, s, ms: word);

Returns current time.


 dates.msCount

function dates.msCount: longint;

Returns current time as ms.


 dates.JulianDay

function dates.JulianDay(y, m, d: word): longint;

Converts a date to a Julian day.


 dates.JulianToDMY

procedure dates.JulianToDMY(jd: longint; var y, m, d: word);

Returns the date corresponding to a Julian day.


 dates.CurrentJulianDay

function dates.CurrentJulianDay: longint;

Converts the current date to a Julian day.


 dates.UnixToDMYhms

procedure dates.UnixToDMYhms(ts: longint; var yyyy, mm, dd, h, m, s: word);

Converts unix timestamp ts to yyyy-mm-dd h:m:s, ts<=0: 1970-01-01 00:00:00.


 Unit HRTimer

Unit HRTimer (in UTIL help file)

High resolution timer routines with comp data type and PerformanceCounter routines for WIN32/64

Constants:

CPUFrequency

Types:

THRTimer

Functions and Procedures:

HasRDTSC	ReadTSC	StartTimer	RestartTimer	ReadSeconds	ReadCycles	LastSeconds	LastCycles	StoreLast	CalcCPUFrequency


 Unit TSC

Unit TSC (in UTIL help file)

Access to Time Stamp Counter (RDTSC)

Types:

TCtrRec

Variables:

_HasRDTSC

Functions and Procedures:

_ReadTSC	_ReadCounter	_CheckCPUID	_CheckRDTSC


 TSC.TCtrRec

TSC.TCtrRec = packed record

Fields:

 LDW,

 HDW: longint;

64 bit TSC counter record.


 TCtrRec.LDW

TCtrRec.LDW,

        HDW: longint;


 TSC._HasRDTSC

TSC._HasRDTSC: boolean;

will be true if RDTSC instruction is supported.


 TSC._ReadTSC

procedure TSC._ReadTSC(var Ctr: TCtrRec);

Read Time Stamp Counter.


 TSC._ReadCounter

procedure TSC._ReadCounter(var Ctr: TCtrRec);

Read TSC if present, else GetTickCount/SysTick/milliseconds since midnight.


 TSC._CheckCPUID

function TSC._CheckCPUID: boolean;

check if CPUID supported.


 TSC._CheckRDTSC

function TSC._CheckRDTSC: boolean;

check if RDTSC supported, check CPUID first!!


 HRTimer.CPUFrequency

Const HRTimer.CPUFrequency: double =  - 1;

CPU Frequency in Hz.


 HRTimer.THRTimer

HRTimer.THRTimer = record

Fields:

 Start: comp;

 Diff0: comp;

 Last: comp;


 THRTimer.Start

THRTimer.Start: comp;

First read after calib.


 THRTimer.Diff0

THRTimer.Diff0: comp;

Min diff for two reads.


 THRTimer.Last

THRTimer.Last: comp;

Last read after start.


 HRTimer.HasRDTSC

function HRTimer.HasRDTSC: boolean;

check if rdtsc supported.


 HRTimer.ReadTSC

procedure HRTimer.ReadTSC(var Cnt: Comp);

Read Time Stamp Counter.


 HRTimer.StartTimer

procedure HRTimer.StartTimer(var HR: THRTimer);

Start and calibrates timer.


 HRTimer.RestartTimer

procedure HRTimer.RestartTimer(var HR: THRTimer);

Read TSC into HR.Start.


 HRTimer.ReadSeconds

function HRTimer.ReadSeconds(var HR: THRTimer): double;

Return elapsed (calibrated) seconds since Start.


 HRTimer.ReadCycles

function HRTimer.ReadCycles(var HR: THRTimer): comp;

Return elapsed (calibrated) cycles since Start.


 HRTimer.LastSeconds

function HRTimer.LastSeconds(var HR: THRTimer): double;

Return elapsed (calibrated) seconds since Start using Last.


 HRTimer.LastCycles

function HRTimer.LastCycles(var HR: THRTimer): comp;

Return elapsed (calibrated) cycles since Start using Last.


 HRTimer.StoreLast

procedure HRTimer.StoreLast(var HR: THRTimer);

Read TSC into last.


 HRTimer.CalcCPUFrequency

procedure HRTimer.CalcCPUFrequency;

Calculate CPU frequency, called from initialisation.


 Unit Mem_Util

Unit Mem_Util (in UTIL help file)

Utility procedures for Hex/Base64 and memory compare.

Variables:

HexUpper

Functions and Procedures:

HexByte	HexWord	HexLong	HexStr	Hex2Mem	Base64Str	Base64EncStr	Base64DecStr	CompMem	RandMem	CompMemXL	RandMemXL


 Mem_Util.HexUpper

Mem_Util.HexUpper: boolean;

Hex strings in uppercase.


 Mem_Util.HexByte

function Mem_Util.HexByte(b: byte): BString;

byte as hex string.


 Mem_Util.HexWord

function Mem_Util.HexWord(w: word): BString;

word as hex string.


 Mem_Util.HexLong

function Mem_Util.HexLong(L: longint): BString;

longint as hex string, LSB first.


 Mem_Util.HexStr

function Mem_Util.HexStr(psrc: pointer; L: integer): BString;

hex string of memory block of length L pointed by psrc.


 Mem_Util.Hex2Mem

procedure Mem_Util.Hex2Mem(const s: BString; pdest: pointer; MaxL: word; var L: word);

Convert hex string to mem pointed by pdest, MaxL bytes, actual byte count in L.


 Mem_Util.Base64Str

function Mem_Util.Base64Str(psrc: pointer; L: integer): BString;

Base64 string of memory block of length L pointed by psrc.


 Mem_Util.Base64EncStr

function Mem_Util.Base64EncStr(const s: BString): BString;

Simple Base64 encoder, uses Base64Str.


 Mem_Util.Base64DecStr

function Mem_Util.Base64DecStr(const es: BString): BString;

Simple Base64 decoder, stops conversion on first invalid char.


 Mem_Util.CompMem

function Mem_Util.CompMem(psrc, pdest: pointer; size: word): boolean;

compare memory block.


 Mem_Util.RandMem

procedure Mem_Util.RandMem(pdest: pointer; size: word);

fill memory block with size random bytes.


 Mem_Util.CompMemXL

function Mem_Util.CompMemXL(psrc, pdest: pointer; size: longint): boolean;

compare memory block.


 Mem_Util.RandMemXL

procedure Mem_Util.RandMemXL(pdest: pointer; size: longint);

fill memory block with size random bytes.


 Unit MiniStat

Unit MiniStat (in UTIL help file)

Mini statistics unit: Accurate running values for 1 and 2 variables.

Constants:

MS_Err_SampleCnt	MS_Err_SqrtArg	MS_Err_Undefined

Types:

TStatX	TStatXY

Functions and Procedures:

stat_init	stat_add	stat_sub	stat_result	stat_full	stat1_init	stat1_add	stat1_sub	stat1_result	stat1_full


 MiniStat.MS_Err_SampleCnt

Const MiniStat.MS_Err_SampleCnt = $0001;


 MiniStat.MS_Err_SqrtArg

Const MiniStat.MS_Err_SqrtArg = $0002;


 MiniStat.MS_Err_Undefined

Const MiniStat.MS_Err_Undefined = $0003;


 MiniStat.TStatX

MiniStat.TStatX = record

Fields:

 MXn,

 SXn: double;

 Nn: longint;

 Error: word;


 TStatX.MXn

TStatX.MXn,

       SXn: double;

mean, 'variance'


 TStatX.Nn

TStatX.Nn: longint;

sample counter.


 TStatX.Error

TStatX.Error: word;


 MiniStat.TStatXY

MiniStat.TStatXY = record

Fields:

 MXn,

 MYn: double;

 SXn,

 SYn: double;

 CXYn: double;

 Nn: longint;

 Error: word;


 TStatXY.MXn

TStatXY.MXn,

        MYn: double;

X and Y means.


 TStatXY.SXn

TStatXY.SXn,

        SYn: double;

'variances'


 TStatXY.CXYn

TStatXY.CXYn: double;

'covariance'


 TStatXY.Nn

TStatXY.Nn: longint;

sample counter.


 TStatXY.Error

TStatXY.Error: word;


 MiniStat.stat_init

procedure MiniStat.stat_init(var ctx: TStatXY);

Initialize ctx.


 MiniStat.stat_add

procedure MiniStat.stat_add(var ctx: TStatXY; x, y: double);

Accumulate x,y into ctx.


 MiniStat.stat_sub

procedure MiniStat.stat_sub(var ctx: TStatXY; x, y: double);

Remove x,y from ctx.


 MiniStat.stat_result

procedure MiniStat.stat_result(var ctx: TStatXY; var mx, my, sx, sy, r, m, b: double);

Calculate means mx,my; sdevs sx,sy; correlation r; best fit y=m*x+b.


 MiniStat.stat_full

procedure MiniStat.stat_full(pcx, pcy: pointer; n: word; var mx, my, sx, sy, r, m, b: double; var Err: word);

All in one statistics for n pairs from two double arrays.


 MiniStat.stat1_init

procedure MiniStat.stat1_init(var ctx: TStatX);

Initialize ctx.


 MiniStat.stat1_add

procedure MiniStat.stat1_add(var ctx: TStatX; x: double);

Accumulate x into ctx.


 MiniStat.stat1_sub

procedure MiniStat.stat1_sub(var ctx: TStatX; x: double);

Remove x from ctx.


 MiniStat.stat1_result

procedure MiniStat.stat1_result(var ctx: TStatX; var mx, sx: double);

Calculate mean mx, sdev sx.


 MiniStat.stat1_full

procedure MiniStat.stat1_full(pcx: pointer; n: word; var mx, sx: double; var Err: word);

All in one statistics for n values from double array.


 Unit sort

Unit sort (in UTIL help file)

General QuickSort, HeapSort, CombSort routines using swap/compare functions. In the pointer versions P is a typeless data pointer that is carried through the functions and can be used to access local data etc by the caller.

Constants:

QT_IS	QT_M3

Types:

less_func	swap_proc	less_funcP	swap_procP

Functions and Procedures:

CombSort	CombSortP	QuickSort	QuickSortP	BUHeapSort	BUHeapSortP	HeapSort	HeapSortP	HSort	HSortP	BUHSort	BUHSortP


 sort.QT_IS

Const sort.QT_IS: integer = 8;

Quicksort threshold for insertion sort.


 sort.QT_M3

Const sort.QT_M3: integer = 32;

Quicksort threshold for median of 3.


 sort.less_func

sort.less_func = function(i, j: integer): boolean;

compare function, returns true if item(i) < item(j)


 sort.swap_proc

sort.swap_proc = procedure(i, j: integer);

swap procedure, swaps item(i) and item(j)


 sort.less_funcP

sort.less_funcP = function(i, j: integer; P: pointer): boolean;

compare function (pointer version), returns true if item(i) < item(j)


 sort.swap_procP

sort.swap_procP = procedure(i, j: integer; P: pointer);

swap procedure (pointer version), swaps item(i) and item(j)


 sort.CombSort

procedure sort.CombSort(L, R: integer; less: less_func; swap: swap_proc);

General CombSort routine, sorts items L..R.


 sort.CombSortP

procedure sort.CombSortP(L, R: integer; less: less_funcP; swap: swap_procP; P: pointer);

General CombSort routine (pointer version), sorts items L..R.


 sort.QuickSort

procedure sort.QuickSort(L, R: integer; less: less_func; swap: swap_proc);

General QuickSort routine, sorts items L..R.


 sort.QuickSortP

procedure sort.QuickSortP(L, R: integer; less: less_funcP; swap: swap_procP; P: pointer);

General QuickSort routine (pointer version), sorts items L..R.


 sort.BUHeapSort

procedure sort.BUHeapSort(L, R: integer; less: less_func; swap: swap_proc);

General Bottom-Up HeapSort routine, sorts items L..R.


 sort.BUHeapSortP

procedure sort.BUHeapSortP(L, R: integer; less: less_funcP; swap: swap_procP; P: pointer);

General Bottom-Up HeapSort routine (pointer version), sorts items L..R.


 sort.HeapSort

procedure sort.HeapSort(L, R: integer; less: less_func; swap: swap_proc);

General HeapSort routine, sorts items L..R.


 sort.HeapSortP

procedure sort.HeapSortP(L, R: integer; less: less_funcP; swap: swap_procP; P: pointer);

General HeapSort routine (pointer version), sorts items L..R.


 sort.HSort

procedure sort.HSort(n: integer; less: less_func; swap: swap_proc);

General HeapSort routine, sorts items 1..n.


 sort.HSortP

procedure sort.HSortP(n: integer; less: less_funcP; swap: swap_procP; P: pointer);

General HeapSort routine (pointer version), sorts items 1..n.


 sort.BUHSort

procedure sort.BUHSort(n: integer; less: less_func; swap: swap_proc);

General Bottom-Up HeapSort routine, sorts items 1..n.


 sort.BUHSortP

procedure sort.BUHSortP(n: integer; less: less_funcP; swap: swap_procP; P: pointer);

General Bottom-Up HeapSort routine (pointer version), sorts items 1..n.