1 #ifndef __MLPIGLOBAL_H__ 2 #define __MLPIGLOBAL_H__ 63 #error MLPI requires C++ compilation (use a .cpp suffix) 66 #include "targetinfo.h" 79 #if defined(__ACI_MLPI__) && defined(GLOBTYPE_USE_ATOMIC_DOUBLE) 80 #include "AtomicDouble.h" 83 #if defined (TARGET_OS_LINUX) && (_SYS_SYSMACROS_H) 92 #if defined (TARGET_OS_LINUX) && (_SYS_SYSMACROS_H) 105 #if defined (TARGET_OS_VXWORKS_KERNEL) 107 #elif defined (TARGET_OS_VXWORKS_RTP) 109 #elif defined (TARGET_OS_WINNT64) 111 #elif defined (TARGET_OS_WINNT32) 113 #elif defined (TARGET_OS_WINCE32) 115 #elif defined (TARGET_OS_MAC) 117 #elif defined (TARGET_OS_IOS) 119 #elif defined (TARGET_OS_ANDROID) 121 #elif defined (TARGET_OS_LINUX) 124 #pragma warning "unknown operating system" 130 #if defined(TARGET_COMPILER_GCC) 132 #elif defined(TARGET_COMPILER_MSVC) 134 #elif defined(TARGET_COMPILER_INTEL) 136 #elif defined(TARGET_COMPILER_LLVM) 140 #pragma warning "unknown compiler" 163 #if !defined (TARGET_COMPILER_MSVC) && !defined (TARGET_OS_VXWORKS) 168 typedef unsigned long ULONG;
173 #if !defined(MLPI_SERVER_LIB) 174 #if defined(__ACI_MLPI__) && defined(GLOBTYPE_USE_ATOMIC_DOUBLE) 175 typedef AtomicDouble
DOUBLE;
180 #if defined(MLPI_SHORT_WCHAR16) 182 typedef unsigned short WCHAR16;
184 #if (__cplusplus > 201103L) 197 #if !defined (TARGET_COMPILER_MSVC) && !defined (TARGET_OS_VXWORKS) 203 #if defined (TARGET_BITNESS_64BIT) 267 #if defined(TARGET_COMPILER_GCC) 269 #define MLPI_DATA_ALIGN(x) __attribute__ ((aligned(x))) 270 #elif defined(TARGET_COMPILER_MSVC) 272 #define MLPI_DATA_ALIGN(x) __declspec(align(x)) 273 #elif defined(TARGET_COMPILER_INTEL) 275 #define MLPI_DATA_ALIGN(x) __declspec(align(x)) 276 #elif defined(TARGET_COMPILER_LLVM) 278 #define MLPI_DATA_ALIGN(x) __attribute__ ((aligned(x))) 281 #pragma warning "unknown compiler" 287 #define MLPI_STRUCT_ALIGN_BOOL8 MLPI_DATA_ALIGN(1) 289 #define MLPI_STRUCT_ALIGN_CHAR MLPI_DATA_ALIGN(1) 290 #define MLPI_STRUCT_ALIGN_SHORT MLPI_DATA_ALIGN(2) 291 #define MLPI_STRUCT_ALIGN_LONG MLPI_DATA_ALIGN(4) 292 #define MLPI_STRUCT_ALIGN_LLONG MLPI_DATA_ALIGN(8) 294 #define MLPI_STRUCT_ALIGN_UCHAR MLPI_DATA_ALIGN(1) 295 #define MLPI_STRUCT_ALIGN_USHORT MLPI_DATA_ALIGN(2) 296 #define MLPI_STRUCT_ALIGN_ULONG MLPI_DATA_ALIGN(4) 297 #define MLPI_STRUCT_ALIGN_ULLONG MLPI_DATA_ALIGN(8) 299 #define MLPI_STRUCT_ALIGN_FLOAT MLPI_DATA_ALIGN(4) 300 #define MLPI_STRUCT_ALIGN_DOUBLE MLPI_DATA_ALIGN(8) 302 #define MLPI_STRUCT_ALIGN_ENUM MLPI_DATA_ALIGN(4) 304 #define MLPI_STRUCT_ALIGN_WCHAR16 MLPI_DATA_ALIGN(2) 306 #define MLPI_STRUCT_ALIGN_STRUCT 363 #define MLPI_S_OK ((MLPIRESULT) 0x00360000L) 364 #define MLPI_E_FAIL ((MLPIRESULT) 0xF0360001L) 365 #define MLPI_E_NOTSUPPORTED ((MLPIRESULT) 0xF0360002L) 366 #define MLPI_E_INVALIDARG ((MLPIRESULT) 0xF0360003L) 367 #define MLPI_E_OUTOFMEMORY ((MLPIRESULT) 0xF0360004L) 368 #define MLPI_E_TIMEOUT ((MLPIRESULT) 0xF0360005L) 369 #define MLPI_E_SERVEREXCEPTION ((MLPIRESULT) 0xF0360006L) 370 #define MLPI_E_CONNECTFAILED ((MLPIRESULT) 0xF0360007L) 371 #define MLPI_E_CREATEERROR ((MLPIRESULT) 0xF0360008L) 372 #define MLPI_E_SYSTEMERROR ((MLPIRESULT) 0xF0360009L) 373 #define MLPI_E_BUFFERTOOSHORT ((MLPIRESULT) 0xF036000AL) 374 #define MLPI_E_INVALIDSIGNATURE ((MLPIRESULT) 0xF036000BL) 375 #define MLPI_E_STARTERROR ((MLPIRESULT) 0xF036000CL) 376 #define MLPI_E_WATCHDOGWARNING ((MLPIRESULT) 0xF036000DL) 377 #define MLPI_E_WATCHDOGERROR ((MLPIRESULT) 0xF536000EL) 378 #define MLPI_E_UNIMPLEMENTED ((MLPIRESULT) 0xF036000FL) 379 #define MLPI_E_LIMIT_MIN ((MLPIRESULT) 0xF0360010L) 380 #define MLPI_E_LIMIT_MAX ((MLPIRESULT) 0xF0360011L) 381 #define MLPI_E_VERSION ((MLPIRESULT) 0xF0360012L) 382 #define MLPI_E_DEPRECATED ((MLPIRESULT) 0xF0360013L) 383 #define MLPI_E_PERMISSION ((MLPIRESULT) 0xF0360014L) 384 #define MLPI_E_TYPE_MISSMATCH ((MLPIRESULT) 0xF0360015L) 385 #define MLPI_E_SIZE_MISSMATCH ((MLPIRESULT) 0xF0360016L) 386 #define MLPI_E_INVALID_HANDLE ((MLPIRESULT) 0xF0360017L) 387 #define MLPI_E_NOCONNECTION ((MLPIRESULT) 0xF0360018L) 388 #define MLPI_E_RD_WR_PROTECTION ((MLPIRESULT) 0xF0360019L) 389 #define MLPI_E_INVALID_FLOATINGPOINT ((MLPIRESULT) 0xF036001AL) 390 #define MLPI_E_NOTINITIALIZED ((MLPIRESULT) 0xF036001BL) 391 #define MLPI_E_STREAM_OUT_OF_SYNC ((MLPIRESULT) 0xF036001CL) 392 #define MLPI_E_INVALID_PRIVATEKEY_FILE ((MLPIRESULT) 0xF036001DL) 393 #define MLPI_E_INVALID_CERTIFICATE_FILE ((MLPIRESULT) 0xF036001EL) 394 #define MLPI_E_KEYPAIR_MISSMATCH ((MLPIRESULT) 0xF036001FL) 395 #define MLPI_E_TLS_HANDSHAKE_FAILED ((MLPIRESULT) 0xF0360020L) 396 #define MLPI_E_GENERAL_AC_ERROR ((MLPIRESULT) 0xF0360021L) 397 #define MLPI_E_POLICY_VIOLATION_AC ((MLPIRESULT) 0xF0360022L) 398 #define MLPI_E_USER_ALREADY_EXISTS ((MLPIRESULT) 0xF0360023L) 399 #define MLPI_E_GROUP_ALREADY_EXISTS ((MLPIRESULT) 0xF0360024L) 400 #define MLPI_E_MEMBERSHIP_ALREADY_EXISTS ((MLPIRESULT) 0xF0360025L) 401 #define MLPI_E_USER_NOT_EXISTING ((MLPIRESULT) 0xF0360026L) 402 #define MLPI_E_GROUP_NOT_EXISTING ((MLPIRESULT) 0xF0360027L) 403 #define MLPI_E_MEMBERSHIP_NOT_EXISTING ((MLPIRESULT) 0xF0360028L) 404 #define MLPI_E_PERMISSION_NOT_EXISTING ((MLPIRESULT) 0xF0360029L) 406 #define MLPI_SUCCEEDED(hr) ((MLPIRESULT)(hr) >= 0) 407 #define MLPI_FAILED(hr) ((MLPIRESULT)(hr) < 0) 413 #if defined (TARGET_BITNESS_64BIT) 414 #define MLPI_INVALIDHANDLE ((MLPIHANDLE) 0xFFFFFFFFFFFFFFFF) 416 #define MLPI_INVALIDHANDLE ((MLPIHANDLE) 0xFFFFFFFF) 426 #if !defined(TARGET_OS_VXWORKS) 520 #if !defined(TARGET_OS_VXWORKS) 532 #define _countof(x) (sizeof(x)/sizeof(x[0])) 536 #define MLPI_ADAPT_STRING_WCHAR16_(x) L ## x 537 #define MLPI_ADAPT_STRING_WCHAR16(x) MLPI_ADAPT_STRING_WCHAR16_(x) // convert normal string always to WCHAR16 literal 538 #ifndef MLPI_SERVER_LIB 539 #define MLPI_ADAPT_STRING(x) MLPI_ADAPT_STRING_WCHAR16_(x) // convert normal string to WCHAR16 literal on client side 541 #define MLPI_ADAPT_STRING(x) x // convert normal string NOT to WCHAR16 literal on server side 554 MlpiTestFpu(
const FLOAT *in) {
557 MlpiTestFpu(
const DOUBLE *in) {
560 template <
typename T> MlpiTestFpu(
const FLOAT *in, T numElements)
563 for(T i=0; (i<numElements) && (out==TRUE); i++) {
567 template <
typename T> MlpiTestFpu(
const DOUBLE *in, T numElements)
570 for(T i=0; (i<numElements) && (out==TRUE); i++) {
574 inline BOOL8 isValid(
void) {
return out;}
577 inline void test(
const FLOAT *in)
579 ULONG ul = *
reinterpret_cast<const ULONG*
>(in);
580 out = ((ul&0x7fffffff)==0) ? TRUE : ( ((ul&0x7f800000)==0) ? FALSE : ( ((ul&0x7f800000)==0x7f800000) ? FALSE : TRUE ) );
582 inline void test(
const DOUBLE *in)
585 out = ((ull&0x7fffffffffffffffLL)==0) ? TRUE : ( ((ull&0x7ff0000000000000LL)==0) ? FALSE : ( ((ull&0x7ff0000000000000LL)==0x7ff0000000000000LL) ? FALSE : TRUE ) );
591 inline BOOL8 MLPI_TEST_IS_FLOAT(
const FLOAT data) {
return(MlpiTestFpu(&data).isValid()); }
594 inline BOOL8 MLPI_TEST_IS_DOUBLE(
const DOUBLE data) {
return(MlpiTestFpu(&data).isValid()); }
597 template <
typename T>
inline BOOL8 MLPI_TEST_IS_FLOAT_ARRAY(
const FLOAT *data, T numElements) {
return(MlpiTestFpu(data, numElements).isValid()); }
600 template <
typename T>
inline BOOL8 MLPI_TEST_IS_DOUBLE_ARRAY(
const DOUBLE *data, T numElements) {
return(MlpiTestFpu(data, numElements).isValid()); }
603 #endif // endof: #ifndef __MLPIGLOBAL_H__
Initialization of process.
string array with 1 byte per character
unsigned char UCHAR
1 byte unsigned integer
string with 2 bytes per character
invalid or not supported type
struct MlpiVersion MlpiVersion
Describes the API version information. The build number counts continuously within a major release...
4 byte signed integer array
unsigned long long ULLONG
8 byte unsigned integer
int LONG
4 byte signed integer
char CHAR
1 byte signed integer
signed char BOOL8
1 byte boolean
unsigned short USHORT
2 byte unsigned integer
MlpiProcessState
This enumeration defines the state of a process.
unsigned long PROCESSHANDLE
MLPI handle value used for a process.
2 byte unsigned integer array
1 byte signed integer array
short SHORT
2 byte signed integer
string with 1 byte per character
wchar_t WCHAR16
UTF16 string.
unsigned int ULONG
4 byte unsigned integer
unsigned long long MLPITASKHANDLE
MLPI-API handle value used for tasks.
8 byte signed integer array
4 byte floating point array
8 byte floating point array
struct MlpiDateAndTime MlpiDateAndTime
This structure defines the broken date and time information.
4 byte unsigned integer array
MlpiType
This enumeration defines the basic types of as used by the MLPI.
2 byte signed integer array
long long LLONG
8 byte signed integer
float FLOAT
4 byte floating point
double DOUBLE
8 byte floating point
8 byte unsigned integer array
unsigned long MLPIHANDLE
common MLPI-API handle value
BOOL8 MLPI_DATA_ALIGN(1) MLPI_IEC_BOOL
1 byte boolean, aligned to IEC data type BOOL
Process stopped due to internal errors.
int MLPIRESULT
common MLPI-API return value
string array with 2 bytes per character
1 byte unsigned integer array