C API Types¶
The interface header nxLibConstants.h defines the following basic types used in all interface functions:
Error codes are represented as 32bit integers:
#define NXLIBERR __int32
Boolean values are encoded in 32bit integers as well, where false and true are represented as zero and non-zero values.
#define NXLIBBOOL __int32 #define NXLIBFALSE 0 // value 'true' #define NXLIBTRUE 1 // value 'false'
Integers are always 32 bits wide, also in the 64bit library versions:
#define NXLIBINT __int32
Floating point values always use the standard IEEE 64bit double type:
#define NXLIBDOUBLE double
Strings are represented as zero-terminated 8bit character strings. For returning string values, the library internally stores a maximum of 16 string results per thread. The maximum number of accessing threads is 1024. Using a pointer to a returned character string after generating 16 other string results in the same thread will thus lead to an access violation in the user application, because the 17th result will free the memory of the 1st string result queried. If you need to use older results, the user application needs to copy the string to its own memory.
#define NXLIBCHAR __int8 // A single character of a string #define NXLIBSTR const NXLIBCHAR* // A pointer to a zero terminated string