Please enable JavaScript to view this site.

A-Shell Development History

New parameter type ">" may be used to identify an indirect output string parameter, i.e. one that the underlying function treats as the pointer to the actual output, rather than the output itself. For example, in the following C function, the output parameter pstring will actually receive the address of the output string:

void getstring(char **pstring);

To call such a function with DYNLIB, you would use the following method:

map1 buffer,s,0            ! dynamic ok, or size sufficient for output

dlctl.opcode = DCOP_CALL

xcall DYNLIB, dlctl, "getstring(>)v", buffer

 

The ">" parameter code will cause DYNLIB to copy the actual output string to the buffer parameter rather than copying its address.

Warning: this feature is dangerous in that has to trust both the signature and the underlying library routine to output a valid address pointer; any discrepancy will likely cause a segmentation fault!