Passing arguments to C routines from Synergy DBL
Synergy DBL provides the following data reference operations for use when specifying a subroutine argument. ^DESCR is provided for consistency only, because passing a Synergy DBL argument by descriptor is the default. The ^REF, ^VAL, and ^XTRNL operations are primarily used to pass arguments to non-Synergy DBL subroutines, like C routines.
^DESCR(variable)
Passes an argument by descriptor. Synergy DBL descriptors are memory blocks that contain information about the associated variable or literal.
^REF(variable)
Passes an argument by reference. ^REF passes a “pointer,” or virtual address, to variable’s data as the argument.
^VAL(expression)
Passes an argument by value. ^VAL evaluates the specified expression, converts it to a binary representation, and then passes that value as an argument.
^XTRNL(symbol)
Passes the value associated with the specified symbol, which is resolved when you link the program. (OpenVMS only)
When a non-Synergy DBL routine passes an unsigned integer descriptor to a Synergy DBL routine, the integer is treated as signed during the operation.
Examples
xcall sub(^REF(buffer)) xcall sub(^VAL(d + c))
Since ^DESCR is the default calling mechanism, the following call:
xcall sub(^DESCR(variable))
is the same as
xcall sub(variable)