Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
EXPORTS Statement
◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
─────EXPORTS Statement──────────────────────────────────────────────────────
Syntax: EXPORTS
exportdefinitions
This statement defines the names and attributes of the functions
and data items made available to other applications and DLLs, and
of the functions that run with I/O privilege. A definition is
required for each function or data item being exported.
The EXPORTS keyword marks the beginning of the export definitions,
each on its own line. EXPORTS must appear once before the first
definition (on the same or preceding line) and can be repeated
before each additional definition. EXPORTS statements can appear
more than once in the file.
Some languages offer a way to export without using an EXPORTS
statement. For example, in the C language, the _exports keyword
generates an export description in the object file.
Export-Definition Syntax
entryname [=internalname] [@ord[ RESIDENTNAME]] [NODATA] [pwords]
<entryname> The function or data-item name as it is known to
other applications and DLLs.
<internalname> The actual name of the exported function or data
item as it appears in the exporting application
or DLL. The default is <entryname>.
<ord> The function's ordinal position within the
module-definition table as an integer from 1 to
65,535. If <ord> is used, the function can be
called by either <entryname> or <ord>. Use of
ordinal positions is faster and can save space.
RESIDENTNAME Specifies that <entryname> be kept resident in
memory at all times. If <ord> is not used,
<entryname> is always kept in memory.
NODATA Specifies that there is no static data in the
function.
<pwords> Gives the total size of the function's parameters
in words. Required only if the function executes
with I/O privilege. When a function with I/O
privilege is called, OS/2 consults <pwords> to
determine how many words to copy from the
caller's stack to the function's stack.
Internal and External Names
A given symbol (function or data item) has a name for each of
three different contexts in two programs (applications or DLLs):
■ Within the exporting program
■ As an entry point between programs
■ Within the importing program where the symbol is used
If neither program uses an internal name, the symbol has the same
name in all three contexts. If either of the programs uses an
internal name, the symbol may have more than one distinct name.
-♦-