The following table matches EGL primitive types to C primitive types for use in calling C functions with the call statement, as explained in Calling C functions with the call statement.
| EGL primitive | C type |
|---|---|
| INT | int (signed 4-byte integer) |
| SMALLINT | short (signed 2-byte integer) |
| BIGINT | long long (signed 8-byte integer) |
| NUM | COBOL zoned format. For ASCII, the sign bits are x30 for a positive number and x70 for a negative number. For EBCDIC, the sign bits are xF0 for a positive number and xD0 for a negative number |
| NUMC | COBOL zoned format. For ASCII, the sign bits are x30 for a positive number and x70 for a negative number. For EBCDIC, the sign bits are xC0 for a positive number and xD0 for a negative number |
| DECIMAL, MONEY | COBOL packed format. The sign bits are xC for a positive number and xD for a negative number. |
| PACF | COBOL packed format. The sign bits are xF for a positive number and xD for a negative number. |
| FLOAT | double |
| SMALLFLOAT | float |
| BOOLEAN | char, with 1 representing true and 0 representing false |
| HEX | unsigned char |
| CHAR | char |
| MBCHAR, DBCHAR | char; use mbstowcs from stdlib.h to convert to wchar_t |
| UNICODE, STRING | char, with data in the UTF-16 encoding, two bytes per character. Use mbstowcs from stdlib.h to convert to wchar_t. On Windows and Linux, the data is in little-endian order; on other systems, the data is in big-endian order. |
| DATE | char, in yyyMMdd format, with digits stored as "0" through "9" |
| TIME | char, in HHmmss format, with digits stored as "0" through "9" |
| TIMESTAMP | char, with digits stored as "0" through "9" |
| INTERVAL | char, starting with "+" or "-" followed by the digits of the value as "0" through "9" |
The values of the text types (CHAR, MBCHAR, DBCHAR, UNICODE, STRING), data and time types (DATE, TIME, TIMESTAMP, and INTERVAL), and HEX do not end with a null byte. You can use StrLib.setNullTerminator to convert trailing blanks to null, or StrLib.setBlankTerminator to convert trailing nulls to blanks.
For structured records, EGL passes the data of the lowest-level fields. You could define a C struct with the same structure as the record.