home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / biblioteki / c_library / easylibs / easylibs.readme next >
Text File  |  1977-12-31  |  3KB  |  76 lines

  1. short: Tools to simplify shared libraries
  2. author: wiedmann@zdv.uni-tuebingen.de
  3.  
  4.  
  5. This is EasyLibs 1.0, a package of tools and sources to create a shared
  6. library.
  7.  
  8. Programming shared libraries is often somewhat nasty: You have to create
  9. the library header which is done in Assembler (until now :-), you
  10. have to maintain FD files, prototypes, pragmas, autodocs and all that
  11. kind of stuff. EasyLibs is my try to do this with less work, even more:
  12. Most parts are created automatically.
  13.  
  14. EasyLibs consists of the following parts:
  15.  
  16.   - LibHeader.c 1.0, a complete and universal library header which can
  17.     be used for any type of library you want. Never again edit the
  18.     header, just change some preprocessor symbols! LibHeader.c is
  19.     written in C completely.
  20.  
  21.     LibHeader.c, however, can be used by the Dice compiler only. To be
  22.     precise: You need a possibility to put the resident structure into
  23.     the code segment.  Dice allows this by declaring the struct as
  24.     "const".
  25.  
  26.   - Xtract 1.1, a small tool which extracts prototypes, FD files and
  27.     Autodocs from source files. (I personally prefer "autodoc" from the
  28.     NDU for the latter purpose, however.)
  29.  
  30.   - fd2pragma 2.2, a program which can read FD files and convert them
  31.     into either pragma files for different compilers (Aztec, SAS, Dice,
  32.     Maxon), LVO files to be read by assemblers or function tables to
  33.     be read by LibHeader.c.
  34.  
  35.   - HelloWorld.library 40.1, a small shared library which shows how to
  36.     use these tools.
  37.  
  38.  
  39. Some notes on using LibHeader.c. (Some of them hold true for any library
  40. regardless of using LibHeader.c)
  41.  
  42.   - You might well use global data; either initialized or uninitialized,
  43.     but keep in mind that this is a *shared* library: Your data will be
  44.     shared by different tasks. In general one uses only things like
  45.     library base pointers or similar stuff in global data.
  46.  
  47.   - The startup code of LibHeader.c does *not* zero the BSS segment.
  48.     Unlike usual C programming you can not expect that variables are
  49.     0 or NULL, respectively, except if you force this by using something
  50.     like
  51.     struct IntuitionBase *IntuitionBase = NULL;
  52.  
  53.   - It is possible to use the small data model. However, you need to
  54.     setup the a4 register when entering the library. Best way to ensure
  55.     this is declaring all library functions which are visible to the
  56.     outside world as SAVEDS. (See HelloWorldLib.c)
  57.  
  58.   - Dice has the peculiarity to precede function names with an '@' instead
  59.     of the usual '_', if they expect arguments in registers. If they don't
  60.     expect arguments, however, Dice will use the '_' too. So always let
  61.     your library functions expect at least one argument, (The library base
  62.     pointer in a6 is a good choice.) even if you don't need it. The linker
  63.     will claim missing symbols otherwise.
  64.  
  65.  
  66. EasyLibs is in the public domain, use it as you want, but WITHOUT ANY
  67. WARRANTY. Bugs, suggestions, notes and beer bottles to
  68.  
  69.     Jochen Wiedmann
  70.     Am Eisteich 9
  71.     72555 Metzingen
  72.     Germany
  73.  
  74.     Phone: 07123 / 14881
  75.     Internet: wiedmann@zdv.uni-tuebingen.de
  76.