In the external functions section of a test script, after the name of a DLL has been declared, any number of prototypes of DLL functions can be defined. Each function that is to be used in a Silk Performer script must be declared; these declarations are case-sensitive. Additionally, identifiers that specify the names of all functions that are to be used in BDL scripts must be defined.
When parameters are passed to external functions, it is necessary to indicate whether they are passed into functions by reference or by value (default). Parameters can be declared with BDL data types or basic C data types (long, short, char, float, double, or pointer).
The following table shows the data-type mapping between formal parameters of native functions exported by DLLs, formal parameters of external functions declared in the DLL sections of BDH files, and actual parameters (BDL data types).
C Data Type | DLL Section (BDH) | BDL Data Type |
---|---|---|
char | char | Number |
unsigned char | unsigned char | Number |
short | short | Number |
unsigned short | unsigned short | Number |
long | long, number, boolean | Number, Boolean |
unsigned long | long, number | Number |
char* | string | String |
*(Pointer) | long, number | Number |
float | float | Float |
double | double | Float |
Ptr (C data type representing a pointer to any data type) | string | String |