Elves Code Rules | Context |
In order for Elves to function the library source code must follow certain rules as described below. As will be seen these rules do not change the code generated and can easily be followed by the user. Thus the system is useful for libraries supplied by vendors as well as those generated by users.
; C Function prototype: int DacOut(int iChan, int iValue);The start must be exactly "; C Function prototype: " as shown. Then follows the function return type and the function name followed (in brackets) by the parameter types and names and finaly a closing semicolon (;).
The function end is marked by the end of file or a line of the following format:
ENDMOD DacOutThe first word must be ENDMOD which must be followed by the function name.
The information between the two delimiters will be shown to the user when he has selected the function.
;iChan:{0,1,2,3} ;iValue:{} ;iAddr:{0-0xf7ff} ;iFormat:{URT_68|URT_78|URT_STP2|URT_PE|URT_PODD|URT_PS|URT_BR}The lines consist of a semicolon followed by the parameter name followed by a colon.
For these lists to be meaningful, the user must define the items in his source code. Typically this will be done in a header file. For the ADI supplied functions this is done in the file adi7024c.h.
The above scheme is naturally applicable to assembly code but can just as well be used for libraries written in C. Just include the details described above inside comment blocks using the /* */ comment delimiters.
The Elves Dialog description shows a typical example. The exact details will vary depending on the number and types of parameters involved.