home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
SAMPLES
/
COMPILER
/
SAMPLE03
/
READ.ME
< prev
next >
Wrap
Text File
|
1993-03-15
|
3KB
|
58 lines
The sample program SAMPLE03 can be built as a DLL with its own initialization/
termination function. Furthermore, it is written such that it can be linked to
the compiler libraries either statically or dynamically.
The files for the sample program are:
SAMPLE03.C The source file for the functions in the DLL. It contains
the code for:
- Three sorting functions: bubble, insertion, and selection
- Two static functions, swap and compare, that are called
by the sorting functions
- a function, list, that lists the contents of an array
INITTERM.C The _DLL_InitTerm function. When called to perform
initialization, this function gets storage for an array of
integers, and initializes its elements with random integers.
At termination time, it frees the array.
SAMPLE03.H The file to be included by another source file which calls
the functions in the SAMPLE03 DLL, or which references the
external variables defined in the DLL. For example, MAIN03.C
uses it.
SAMPLE03.DEF The module definition file for the DLL.
SAMPLE3R.DEF An alternate module definition file for the statically linked
DLL. This definition file exports the compiler runtime
functions so that all external references from MAIN03.C can
be resolved by dynamically linking to the SAMPLE03 DLL.
MAIN03.C The main program, which copies the unsorted array, and sorts
it using each of the sort functions in the SAMPLE03 DLL.
MAIN03.DEF The module definition file for the main program.
To build the sample program, use the supplied make files:
MAKE03S Builds SAMPLE03.DLL and MAIN03.EXE. The compiler libraries
are linked statically.
MAKE03D Builds SAMPLE03.DLL and MAIN03.EXE. The compiler libraries
are linked dynamically.
MAKE03R Builds SAMPLE03.DLL and MAIN03.EXE. The compiler runtime
functions are included in SAMPLE03.DLL and exported so that
all external references from MAIN03.C can be resolved by
dynamically linking to the DLL.
For example:
nmake all -f make03d
To clean up after the sample program has been built and run, type the following
command:
nmake clean -f make03d