Prototypes tab for COBOL External Function
Use the Prototypes tab to automatically build a parameter list for the external function by parsing the source code of the function.
Note:
If you have access to source code, you will probably find it easier to build a parameter list using the Prototypes tab than using the Record tab.
Specify information in these fields only if you do not specify information in the fields on the Record tab.
If the external function does not require any parameters, you can leave the fields on this tab and the fields on the Record tab blank.
Fields
File to Parse
In the File to Parse field, type the name of the file containing the C or COBOL source code for the external function.
If you do not remember the file name, select Find to see a list of files from which you can choose. If you want to view the contents of the file, select View.
When you have specified the file you want to use, select Parse.
Parse
Select Parse to have VA Smalltalk read the contents of the C header file or COBOL copy library file and build the parameter list to use with the external function.
The names of the available functions appear in the list.
The parameters specified in the source code for the selected function appear as attributes on the external function part's public interface, allowing other parts to set or retrieve their values. For a C function, the function's return value also appears as an attribute.
Parameter word size
Under Parameter word size, select the word size used for system dependent data types:
16 bit
32 bit
Note:
This setting does not apply to the COBOL External Function part.
Alignment
Use the Alignment spin button to specify the byte alignment for the record structure.
Set this value to the same value you used when you compiled the DLL. Refer to the appropriate compiler documentation for more information about byte alignment.
Note:
This setting does not apply to the COBOL External Function part.
Available
The Available records list shows a list of all of the record formats, or data types, defined in the file specified in the File to Parse field.
If you are working with a C External Function, for a C header file, these are all of the data types declared with typedef or struct.
If you are working with a COBOL External Function, for a COBOL copybook file, these are the record formats declared by 01-level and 77-level declarations. The items specified in the PROCEDURE DIVISION USING statement or "ENTRY" statement should compose the list of the To be passed.
The Available records list has a pop-up that is useful when building multiple external function parts from the same source file. The two pop-up menu choices are:
Load from file
Allows you to load the records directly from a source file, which can be quicker than parsing the file.
Save to file
Allows you to save parsed information in a saved object table. You can then use the Load from file option to load the records in another external function part.
Working with records
To specify that one of these records is to be passed to the external function, select the record you want and then select Add. The selected record appears as the last item in the To be passed list.
To insert the record currently selected in the Available records list into the To be passed list, select Add after. The new record is inserted immediately after the record currently selected in the To be passed list.
When working with C external functions, to place the record currently selected in the Available records list into the To be returned field, select Return. The To be returned field indicates what type of record is returned by the function.
Function prototypes
The Function prototypes list shows all of the functions identified when VA Smalltalk parsed the source file specified in the File to Parse field.
To specify that the parameter list of the external function needs to be based on one of the functions in the source file, select the correct function name in the list.
Last modified date: 01/29/2015