Next: , Previous: Calling convention, Up: Special startups

6.7.2 Shared library startup

This startup gives you one data segment for all possible callers. You will have to use semaphores to share special data between them.

To write a shared library you will have to provide some global variables

     const BYTE LibName[]="simple.library";
     const BYTE LibIdString[]="version 1.0";
     const UWORD LibVersion=1;
     const UWORD LibRevision=0;

as well as some special functions 1

     int __UserLibInit(struct Library *myLib);
     void __UserLibCleanUp();

Please look into the examples directory for more details.


[1] It'll be possible to add an Open() and Close() function, too. But this would be incompatible to libinitr.o and wouldn't give any advantages over this method.