User`s manual

Dynamic C Users Manual digi.com 47
4.21.1 LIB.DIR
Any library that is to be #use’d in a Dynamic C program must be listed in the file LIB.DIR, or another
*.DIR file specified by the user.
The lib.dir strategy starting with Dynamic C 9.30 allows naming a folder with optional mask(s). No mask
implies *.* and multiple masks are separated by “;” so that “lib” and “lib\*.*” both include all files and
lib\*.lib;*.c;*.h*” includes all files with extensions of .lib, .c and .h. Dynamic C gener-
ated file (e.g., .mdl, .hxl, etc.) are not parsed, which means they are excluded when using the wildcard
mask.
Dynamic C now enforces unique file extension names regardless of path, so that “#use myfile.lib” can not
use an unintended copy of myfile.lib as the list of pathnames included in lib.dir is searched for
the first occurrence of that file extension. An error message naming both full paths will come up when try-
ing to compile ANY program alerting the user of the infraction.
4.22 Headers
The following table describes two kinds of headers used in Dynamic C libraries.
You may also notice some “Library Description” headers at the top of library files. These have no special
meaning to Dynamic C, they are simply comment blocks.
4.23 Modules
A Dynamic C library typically contains several modules. Modules must be understood to write efficient
custom libraries. Modules provide Dynamic C with the names of functions and variables within a library
that may be referenced by files that have a #use directive for the library somewhere in the code.
Modules organize the library contents in such a way as to allow for smaller code size in the compiled
application that uses the library. To create your own libraries, write modules following the guidelines in
this section.
The scope of modules is global, but indeterminate compilation order makes the situation less than straight-
forward. Read this entire section carefully to understand module scope.
Table 4-4. Dynamic C Library Headers
Header Name Description
Module headers
Make functions and global variables in the library known to
Dynamic C.
Function Description headers
Describe functions. Function headers form the basis for function
lookup help.