Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Most of the C types are from Carl Barnes' excellent Clarion Magazine article Compiling C with the Clarion IDE, Part 1: It's Easier Than You Think.

C typeClarion type
*pass by address - <omittable>
&pass by address - required
[#]Array, use DIM(#). The name of an array is actually a pointer to the first element of the array. So arrays tend to be passed by address even though you do not see an asterisk.
char, unsigned char, signed charBYTE, but probably a string type
char *, char[]CSTRING or STRING (need RAW). If the array has a dimension number it tends to be a fixed length string e.g. char Digest[16] is a STRING(16). A char * could be a *BYTE, but it is rare.
char **

This is a pointer to a pointer. There's an example of this in John Taylor's ClarionMag article Embedding The SQLite Engine In Clarion Applications. The C parameter is char **errmsg and the Clarion parameter is a Long.

You need to declare two variables, a CString reference and a Long:

CStringRef &CString
CStringRefAddress Long

You pass in the CStringRefAddress variable to the function call. If it comes back as a non-zero value, you obtain the string this way:

CStringRef &= (CStringRefAddress)

structGROUP (need RAW)
unsigned shortUSHORT
signed short, shortSHORT

int, signed int,

long, signed long,

signed

SIGNED or LONG - UNSIGNED is Equate(Long)

unsigned, unsigned long, unsigned int

 ULONG - avoid using the ULONG type in Clarion. The object code created for ULONG math uses the decimal library, which is much slower than the code used for a LONG. The UNSIGNED type is equated to a LONG, which is preferable.
 float SREAL
 double REAL
 void nothing to enter
Void *This is a pointer to something. Use a LONG or UNSIGNED.