Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


EXPORTS

Use the EXPORT statement to define the names and attributes of data and functions exported from the DLL that you are creating, and of functions that run with I/O hardware privilege.

EXPORTS statement syntax
Read syntax diagramSkip visual syntax diagram            .------------------------------------------.  
            V                                          |  
>>-EXPORTS----enm=inm-+--------------------+-+-------+-+-------><
                      |      .-DECORATED-. | '-parms-'    
                      '-@ord-+-----------+-'              
                             '-CONSTANT--'                
 

Provide export definitions for functions and data in your DLL that you want to make available to other .EXE or .DLL files. Data and functions that are not exported can only be accessed within the DLL.

The EXPORTS keyword marks the beginning of the export definitions. Enter each definition on a separate line. You can provide the following information for each export:

enm
The entry name of the data construct or function, which is the name other files use to access it. Always provide an entry name for each export. It is strongly recommended that you decorate each entry name, to ensure that the correct function is linked in.
inm
The internal name of the data construct or function, which is its actual name as it appears within the DLL. If specified, the internal name must be decorated. If you do not specify an internal name, the linker assumes it is the same as enm.
ord
The data construct or function's ordinal position in the module definition table. If you provide the ordinal position, the data construct or function can be referenced either by its entry name or by the ordinal. It is faster to access by ordinal positions, and might save space.

You can specify only one of these two values:

DECORATED
(Default) Indicates that the name should be left as is. No decoration is applied to the function-name.
CONSTANT
Indicates that the export entity is a data item, not a function.
 
parms
The total size of the function's parameters as measured in words (bytes divided by two). This field is required only if the function runs with I/O privilege. When a function with I/O privilege is called, the operating system consults parms to determine how many words to copy from the caller's stack to the stack of the I/O-privileged function.

The following example defines three exported functions:

EXPORTS
  SampleRead = read2bin @8
  StringIn = str1       @4
  CharTest  6

The first two functions can be accessed either by their exported names or by an ordinal number. In the module's source code, these functions are actually defined as read2bin and str1, respectively. The last function runs with I/O privilege and so has parms (the total size of the parameters) defined for it: 6 words.


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)