![]() |
|
![]() |
| ClearToNil | Trunc32 | Trunc64 |
type
CARD64 = 0 .. high (INT64);
CARD32 = type cardinal;
CARD16 = type word;
CARD8 = type BYTE;
Integer64 = type INT64;
INT32 = type integer;
INT16 = type SmallInt;
INT8 = type ShortInt;
FLOAT32 = type single;
FLOAT64 = type double;
BitSet = type System.longword;
BIT32 = type System.longword;
BIT16 = type System.word;
BIT8 = type System.BYTE;
Card16PtrType = ^CARD16;
Card32PtrType = ^CARD32;
Int32PtrType = ^INT32;
CardinalPtrType = ^cardinal;
Card16ArrayType = array [1 .. 1000] of CARD16;
Card16ArrayPtrType = ^Card16ArrayType;
Card32ArrayType = array [1 .. 1000] of CARD32;
Card32ArrayPtrType = ^Card32ArrayType;
Int32ArrayType = array [1 .. 1000] of INT32;
Int32ArrayPtrType = ^Int32ArrayType;
CardArrayType = array [1 .. 1000] of cardinal;
CardArrayPtrType = ^CardArrayType;
Float32PtrType = ^FLOAT32;
Float64PtrType = ^FLOAT64;
BitSetArrayType = array of BitSet;
WordType = type System.word;
WordPtrType = ^WordType;
DWordType = Windows.DWORD;
DWordPtrType = ^DWordType;
HandleState = (HandleClosed,
HandleOpen);
//
// The following types are useful to convert Ada code to
// Delphi with less conversion of type names.
//
// SAGE OBJECT SIZES:
//
// An S_Integer32 is ALWAYS: 32 bits.
// An S_Integer16 is ALWAYS: 16 bits.
// An S_Integer8 is ALWAYS: 8 bits.
//
// An S_Natural32 is ALWAYS: 32 bits.
// An S_Natural16 is ALWAYS: 16 bits.
// An S_Natural8 is ALWAYS: 8 bits.
//
// An S_Positive32 is ALWAYS: 32 bits.
// An S_Positive16 is ALWAYS: 16 bits.
// An S_Positive8 is ALWAYS: 8 bits.
//
// An S_Float64 is ALWAYS: 64 bits.
// An S_Float32 is ALWAYS: 32 bits.
//
const
Null_Address = nil;
// |
// | Standard sizes
// |
Address_Size = 32;
Access_size = 32;
Boolean_Size = 8;
Byte_Size = 8;
Word_Size = 16;
S_Natural8_Size = 8;
S_Natural16_Size = 16;
S_Natural32_size = 32;
S_Natural_Size = 32;
S_Integer8_Size = 8;
S_Integer16_size = 16;
S_Integer32_size = 32;
S_Integer_Size = 32;
S_Positive8_Size = 8;
S_Positive16_Size = 16;
S_Positive32_Size = 32;
S_Positive_Size = 32;
S_Float32_Size = 32;
S_Float64_Size = 64;
S_Float_Size = 32;
S_FilePosition_Size = 64;
// |
// | Standard object types
// |
type
S_Integer = type integer;
S_Integer8 = type ShortInt;
S_Integer16 = type SmallInt;
S_Integer32 = type integer;
S_Natural = type cardinal;
S_Natural8 = type BYTE;
S_Natural16 = type word;
S_Natural32 = type cardinal;
S_Positive = 1 .. high (INT32);
S_Positive8 = 1 .. high (INT8);
S_Positive16 = 1 .. high (INT16);
S_Positive32 = 1 .. high (INT32);
S_Float = type single;
S_Float32 = type single;
S_Float64 = type double;
// |
// | Standard unconstrained arrays
// |
Byte_U_Array = array of System.BYTE;
Word_U_Array = array of System.word;
// wom DWORD_u_array = array of System.DWORD;
Boolean_U_Array = array of boolean;
Natural_U_Array = array of S_Natural;
Natural8_U_Array = array of S_Natural8;
Natural16_U_Array = array of S_Natural16;
Natural32_U_Array = array of S_Natural32;
Integer_U_Array = array of S_Integer;
Integer8_U_Array = array of S_Integer8;
Integer16_U_Array = array of S_Integer16;
Integer32_U_Array = array of S_Integer32;
Positive_U_Array = array of S_Positive;
Positive8_U_Array = array of S_Positive8;
Positive16_U_Array = array of S_Positive16;
Positive32_U_Array = array of S_Positive32;
Float32_U_Array = array of S_Float32;
Float64_U_Array = array of S_Float64;
Float_U_Array = array of S_Float;
const
WordSize = 32;
NullString : pchar = ASCIIX.nul;
NullCharString : array [0 .. 0] of char = (ASCIIX.nul);
// WOM NullChar : char = ASCIIX.nul;
EmptyBitset = 0;
procedure ClearToNil
(var SomePointer : pointer); stdcall;
exports ClearToNil name 'ModSys_ClearToNil';
//*
// ClearToNil - Clear a variable to a nil value.
//
// This routine sets the passed in value to nil. The only reason
// for this routine currently is that Delphi is throwing out warnings
// in lots of places where we are setting variables to nil after using
// them. It is warning that the value is never used. That may be true
// now but we don't want later code changes to suddenly try to use a
// trashed pointer just because it was never nilled. So its still better
// to nil the variable. The purpose of this routine is simply to quiet
// the warning message.
//
// CALLING SEQUENCE -
//
// ClearToNil (SomePointer);
//
// ENTRY -
//
// SomePointer : pointer
// A pointer that should be set to nil. Typically this will happen
// after it has been used in a 'Dispose' call.
//
// EXIT -
//
// SomePointer : pointer
// The pointer set to nil.
//
function TRUNC
(const Flt : FLOAT32) : integer; overload; stdcall;
exports TRUNC (const Flt : FLOAT32) name 'ModSys_Trunc32';
//*
// Trunc - Truncate a floating point number to its integer value.
//
//
// This procedure returns the truncated (whole number) portion of a
// floating point number.
//
// CALLING SEQUENCE -
//
// Int := Trunc (Flt)
//
// ENTRY -
//
// Flt : Float32
// Floating point number to be truncated
//
// EXIT -
//
// Integer
// Truncated (whole number) portion of the floating point number
//
function TRUNC
(const Flt : FLOAT64) : integer; overload; stdcall;
exports TRUNC (const Flt : FLOAT64) name 'ModSys_Trunc64';
//*
// Trunc - Base Trunc routine overloaded to Float64.
//
//
Send mail to
warren.merrill@inl.gov
with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance