Data type compatibilities

For each parameter definition, you must specify a data type that is compatible with the standard C data type of the corresponding DLL routine parameter. Many data types referenced by DLL routines have the same memory size and usage.

The following table lists each supported memory size and usage, examples of corresponding C data types, and the ABL DLL parameter data type you must use for each one.

Table 1. C and DLL parameter data type compatibilities
Example C data type DLL parameter data type Data type size and usage
char BYTE 8-bit unsigned integer
short SHORT 16-bit signed integer
unsigned short UNSIGNED-SHORT 16-bit unsigned integer
int (UNIX; Windows)

long (32-bit UNIX; Windows)

LONG 32-bit signed integer
unsigned int UNSIGNED-LONG 32-bit unsigned integer
_int64 (Windows)

long long (UNIX; Windows)

long (64-bit UNIX)

INT64 64-bit signed integer
float FLOAT 4-byte floating point
double DOUBLE 8-byte floating point
char* CHARACTER Address (32 bits for 32-bit platforms, 64 bits for 64-bit platforms.)
c-data-type1 HANDLE TO parameter-data-type 1 Address (32 bits for 32-bit platforms, 64 bits for 64-bit platforms.)
char*, output-pointer (which can be char**, short**, and so on), or a pointer to a structure MEMPTR Address (32 bits for 32-bit platforms, 64 bits for 64-bit platforms.)

To indicate that the DLL or UNIX shared library parameter is a pointer to a value rather than the value itself, use the HANDLE option. The HANDLE option is required when the DLL routine expects a pointer to the value. Note that the CHARACTER data type implies the HANDLE option, whether or not you specify it. The TO keyword aids readability but has no meaning.

1 You can use the HANDLE TO option to specify a pointer to a scalar type. Therefore, you can use the HANDLE TO option with the parameter data types (that is, BYTE, SHORT, UNSIGNED-SHORT, LONG, FLOAT, and DOUBLE) in order to specify a pointer to the respective C data types (that is, char, short, unsigned short, long, int, float, and double). For CHARACTER and MEMPTR parameters, it is redundant because this data type is always passed using a pointer (char*).