home *** CD-ROM | disk | FTP | other *** search
- Shared Library Support - Experimental
- -------------------------------------
-
- The included files make up the pieces you need to create and use
- shared libraries on the Atari ST. Note that this is a experimental
- version. I would like your feedback, especially constructive
- comments! :-)
-
- Shared libraries are a useful way of factoring the common code out of
- your programs. If you have a number of programs that use many of the
- same routines then you may want to use a shared library.
-
- In this scheme, shared libraries are installed at boot time. Each
- library maintains an array of pointers to it's externally accessible
- entry points. Programs that use a shared library acquire a pointer to
- the library's entry points. An entry point is called by jumping
- through the array.
-
- The program LIBS.PRG (containing the basic shared library support)
- should be placed in your AUTO folder, followed by the shared libraries
- themselves. An example library XLIB.PRG is included in this
- distribution. At boot time GEM will execute LIBS.PRG, installing the
- needed shared libraries support. As each library is executed it will
- perform any needed initialization and install itself in memory.
-
- Note that the order of the files in the AUTO folder is critical. The
- program LIBS.PRG must preceed any libraries. Also note that if a
- library is dependent on the presence of another library, then the
- library on which it depends must be installed first.
-
- One of the interested possibilities offered by this scheme is the
- ability to easily make incremental changes to existing libraries to
- which you may not have the source. If there is a known bug in a
- library, you could come up with a 'patch' that replaces the offending
- entry in the library's jump table with a pointer to your own routine.
-
- Support routines
- ----------------
-
- -- int InitLibSupport()
-
- Called by any program using shared libraries to initialize the shared
- library support. Returns 0 if the shared library support is NOT
- installed.
-
- -- InstallLibrary(lib_link,keep)
-
- Called by a library to install itself.
-
- -- Library FindLibrary(lib_name,lib_version)
-
- Called by a program to find an installed library. Returns 0 if the
- library is not found, or a pointer to the library's array of entry
- points.
-
- This distribution contains the following:
-
- LIBS.H - included by all code using shared libraries
- LIBS.C - terminate & stay resident library support
- LIB_INIT.C - module linked in by programs using libraries
- LIB_INST.C - module linked in by installable libraries
-
- XLIB.H - interface to example library
- XLIB.C - example library
-
- XTEST.C - program that uses example library
-
- MAKEFILE - to put all of the above together
-
- This code was developed using Mark Williams C.
-