Difference between revisions of "Unit GlobalConfig"

From Ultibo.org
Jump to: navigation, search
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
----
 
----
 +
 +
The GlobalConfig unit contains variables used throughout Ultibo core to provide configuration and parameters to common modules and sub systems. Many of these variables may also be passed on the command line as [[Environment_Variables|environment variables]] to customize the behavior of Ultibo core without needing to recompile the application. This unit also includes a small number of widely used common functions.
  
 
=== Constants ===
 
=== Constants ===
 
----
 
----
 +
 +
''None defined''
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
 +
 +
''None defined''
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
 +
 +
''To be documented''
 +
 +
: <code>GetLastErrorHandler:TGetLastError;</code> - Registered handler for the global GetLastError function
 +
: <code>SetLastErrorHandler:TSetLastError;</code> - Registered handler for the global SetLastError function
  
 
=== Function declarations ===
 
=== Function declarations ===
 
----
 
----
 +
 +
: <code>function Min(A,B:LongInt):LongInt;</code> - Return the minimum value of A and B
 +
: <code>function Max(A,B:LongInt):LongInt;</code> - Return the maximum value of A and B
 +
 +
: <code>function RoundUp(Value,Multiple:LongWord):LongWord;</code> - Round Value to the next highest multiple of Multiple
 +
: <code>function RoundDown(Value,Multiple:LongWord):LongWord;</code> - Round Value to the next lowest multiple of Multiple
 +
 +
: <code>function HIWORD(L:LongInt):Word;</code> - Return the high word of L
 +
: <code>function LOWORD(L:LongInt):Word;</code> - Return the low word of L
 +
 +
: <code>function HIBYTE(W:LongInt):Byte;</code> - Return the high byte of W
 +
: <code>function LOBYTE(W:LongInt):Byte;</code> - Return the low byte of W
 +
 +
: <code>function MAKELONG(A,B:LongInt):LongInt;</code> - Make a longword value from A and B
 +
: <code>function MAKEWORD(A,B:LongInt):Word;</code> - Make a word value from A and B
 +
 +
: <code>function WordNtoBE(Value:Word):Word;</code> - Convert word Value from native to big endian
 +
: <code>function WordBEtoN(Value:Word):Word;</code> - Convert word Value from big endian to native
 +
 +
: <code>function LongWordNtoBE(Value:LongWord):LongWord;</code> - Convert longword Value from native to big endian
 +
: <code>function LongWordBEtoN(Value:LongWord):LongWord;</code> - Convert longword Value from big endian to native
 +
 +
: <code>function Int64NtoBE(const Value:Int64):Int64;</code> - Convert int64 Value from native to big endian
 +
: <code>function Int64BEtoN(const Value:Int64):Int64;</code> - Convert int64 Value from big endian to native
 +
 +
: <code>function GetLastError:LongWord;</code> - Return the last error code for the current thread
 +
: <code>procedure SetLastError(LastError:LongWord);</code> - Set the last error code for the current thread
 +
 +
 +
: <code>function ErrorToString(Error:LongWord):String;</code> - Convert an error code value to a string
 +
: <code>function SysErrorToString(ErrorCode:Integer):String;</code> - Convert an error code value to a string (RTL)
 +
 +
: <code>function BooleanToString(Value:Boolean):String;</code> - Convert a boolean value to a string
 +
 +
: <code>function CPUTypeToString(CPUType:LongWord):String;</code> - Convert a CPU type constant to a string
 +
: <code>function CPUModelToString(CPUModel:LongWord):String;</code> - Convert a CPU model constant to a string
 +
: <code>function CPUIDToString(CPUID:LongWord):String;</code> - Convert a CPU ID constant to a string
 +
 +
: <code>function FPUTypeToString(FPUType:LongWord):String;</code> - Convert a FPU type constant to a string
 +
: <code>function GPUTypeToString(GPUType:LongWord):String;</code> - Convert a GPU type constant to a string
 +
 +
: <code>function CacheTypeToString(CacheType:LongWord):String;</code> - Convert a filesystem Cache type constant to a string
 +
 +
: <code>function BoardTypeToString(BoardType:LongWord):String;</code> - Convert a Board type constant to a string
 +
: <code>function MachineTypeToString(MachineType:LongWord):String;</code> - Convert a Machine type constant to a string
 +
 +
: <code>function PowerIDToString(PowerID:LongWord):String;</code> - Convert a Power ID constant to a string
 +
: <code>function PowerStateToString(PowerState:LongWord):String;</code> - Convert a Power state constant to a string
 +
 +
: <code>function ClockIDToString(ClockID:LongWord):String;</code> - Convert a Clock ID constant to a string
 +
: <code>function ClockStateToString(ClockState:LongWord):String;</code> - Convert a Clock state constant to a string
 +
 +
: <code>function TurboIDToString(TurboID:LongWord):String;</code> - Convert a Turbo ID constant to a string
 +
 +
: <code>function VoltageIDToString(VoltageID:LongWord):String;</code> - Convert a Voltage ID constant to a string
 +
 +
: <code>function TemperatureIDToString(TemperatureID:LongWord):String;</code> - Convert a Temperature ID constant to a string
 +
 +
: <code>function LogLevelToLoggingSeverity(LogLevel:LongWord):LongWord;</code> - Convert a log level constant to a severity level
  
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Revision as of 00:25, 28 January 2016

Return to Unit Reference


Description


The GlobalConfig unit contains variables used throughout Ultibo core to provide configuration and parameters to common modules and sub systems. Many of these variables may also be passed on the command line as environment variables to customize the behavior of Ultibo core without needing to recompile the application. This unit also includes a small number of widely used common functions.

Constants


None defined

Type definitions


None defined

Public variables


To be documented

GetLastErrorHandler:TGetLastError; - Registered handler for the global GetLastError function
SetLastErrorHandler:TSetLastError; - Registered handler for the global SetLastError function

Function declarations


function Min(A,B:LongInt):LongInt; - Return the minimum value of A and B
function Max(A,B:LongInt):LongInt; - Return the maximum value of A and B
function RoundUp(Value,Multiple:LongWord):LongWord; - Round Value to the next highest multiple of Multiple
function RoundDown(Value,Multiple:LongWord):LongWord; - Round Value to the next lowest multiple of Multiple
function HIWORD(L:LongInt):Word; - Return the high word of L
function LOWORD(L:LongInt):Word; - Return the low word of L
function HIBYTE(W:LongInt):Byte; - Return the high byte of W
function LOBYTE(W:LongInt):Byte; - Return the low byte of W
function MAKELONG(A,B:LongInt):LongInt; - Make a longword value from A and B
function MAKEWORD(A,B:LongInt):Word; - Make a word value from A and B
function WordNtoBE(Value:Word):Word; - Convert word Value from native to big endian
function WordBEtoN(Value:Word):Word; - Convert word Value from big endian to native
function LongWordNtoBE(Value:LongWord):LongWord; - Convert longword Value from native to big endian
function LongWordBEtoN(Value:LongWord):LongWord; - Convert longword Value from big endian to native
function Int64NtoBE(const Value:Int64):Int64; - Convert int64 Value from native to big endian
function Int64BEtoN(const Value:Int64):Int64; - Convert int64 Value from big endian to native
function GetLastError:LongWord; - Return the last error code for the current thread
procedure SetLastError(LastError:LongWord); - Set the last error code for the current thread


function ErrorToString(Error:LongWord):String; - Convert an error code value to a string
function SysErrorToString(ErrorCode:Integer):String; - Convert an error code value to a string (RTL)
function BooleanToString(Value:Boolean):String; - Convert a boolean value to a string
function CPUTypeToString(CPUType:LongWord):String; - Convert a CPU type constant to a string
function CPUModelToString(CPUModel:LongWord):String; - Convert a CPU model constant to a string
function CPUIDToString(CPUID:LongWord):String; - Convert a CPU ID constant to a string
function FPUTypeToString(FPUType:LongWord):String; - Convert a FPU type constant to a string
function GPUTypeToString(GPUType:LongWord):String; - Convert a GPU type constant to a string
function CacheTypeToString(CacheType:LongWord):String; - Convert a filesystem Cache type constant to a string
function BoardTypeToString(BoardType:LongWord):String; - Convert a Board type constant to a string
function MachineTypeToString(MachineType:LongWord):String; - Convert a Machine type constant to a string
function PowerIDToString(PowerID:LongWord):String; - Convert a Power ID constant to a string
function PowerStateToString(PowerState:LongWord):String; - Convert a Power state constant to a string
function ClockIDToString(ClockID:LongWord):String; - Convert a Clock ID constant to a string
function ClockStateToString(ClockState:LongWord):String; - Convert a Clock state constant to a string
function TurboIDToString(TurboID:LongWord):String; - Convert a Turbo ID constant to a string
function VoltageIDToString(VoltageID:LongWord):String; - Convert a Voltage ID constant to a string
function TemperatureIDToString(TemperatureID:LongWord):String; - Convert a Temperature ID constant to a string
function LogLevelToLoggingSeverity(LogLevel:LongWord):LongWord; - Convert a log level constant to a severity level


Return to Unit Reference