home *** CD-ROM | disk | FTP | other *** search
- /*
- * Demo library implementation: squareme.c
- */
-
- #include <exec/types.h>
-
- /*
- * The following variables should be declared in ONE of your C
- * files.
- */
-
- struct Library *LibBase;
- struct ExecBase *SysBase;
- struct DosLibrary *DOSBase;
-
- /*
- * If you call functions in your own library, you need to declare your
- * base as well.
- */
- struct Library *DemoBase;
-
- struct Library *__saveds LibInit(void)
- {
-
- /*
- * This function is used to perform library-specific initialization.
- * For a library that uses semaphores, this function could set them
- * up. This function must return the library base, or NULL if
- * something went wrong.
- */
-
- /*
- * If you call yourself, then you must "open" yourself by doing
- * the following:
- */
- DemoBase = LibBase;
-
-
- return LibBase;
- }
-
-
- struct Library *__saveds LibOpen(void)
- {
-
- /*
- * This function does process-specific library initialization
- * for opens. You must at least return the base.
- */
-
- return LibBase;
- }
-
-
- void __saveds LibClose(void)
- {
-
- /*
- * This function is called each time your library is closed. Use
- * it for things like syncing disks or freeing process-specific
- * data. Note: don't sync disks directly - signal another process
- * instead.
- */
-
- return;
- }
-
-
- BOOL __saveds LibExpunge(void)
- {
-
- /*
- * This function frees all resources when your library is expunged.
- */
-
- return TRUE;
- }
-
-
- int __saveds __asm LIBSquareMe(register __d0 int num)
- {
-
- return num * num;
- }
-
-
-