LINK Help (linker.hlp) (
Table of Contents;
Topic list)
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
◄Up► ◄Contents► ◄Index► ◄Back►
─────LINK───────────────────────────────────────────────────────────────────
Syntax: EXPORTS
exportdefinitions
Defines the names and attributes of the functions and data made
available to other applications and DLLs. An <exportdefinition> is
required for each function or data item being exported.
The EXPORTS keyword marks the beginning of a section of export
definitions. Multiple definitions must be separated by one or more
spaces, tabs, or newline characters. 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
makes a function available from a DLL.
Export-Definition Syntax
entryname [=internalname] [@ord[ nametable]] [NODATA]
<entryname> The function or data-item name as it is known to
other programs. A decorated name is required if
<entryname> is a C++ function.
See: ◄Decorated Names►
<internalname> The actual name of the exported function or data
item as it appears in the exporting program. The
default is <entryname>.
<ord> The function's ordinal position in the module-
definition table as an integer in the range
1-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.
<nametable> Determines what happens to <entryname>. The
<nametable> can be either RESIDENTNAME or NONAME.
The default action with or without <ord> is to
place <entryname> in the nonresident names table.
RESIDENTNAME places <entryname> in the resident
names table. NONAME discards <entryname> from the
DLL, and the item is exported only by ordinal.
NODATA Specifies that there is no static data in the
function.
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.
Example
EXPORTS
SampleRead = read2bin @8
StringIn = str1 @4 RESIDENTNAME
CharTest
This example defines three exported functions. The first two
functions can be called either by their exported names or by an
ordinal number. In the application or DLL where they are defined,
these functions are named read2bin and str1.
-♦-