home *** CD-ROM | disk | FTP | other *** search
- /*
- * Name: MG 2a
- *
- * Very early-on system-specific initialization for whatever's
- * necessary.
- * Last edit: 05-May-88, Stephen Walton, swalton@solar.stanford.edu
- * Created: Stephen Walton, 3-Dec-87.
- *
- */
- #include "no_dir.h"
- #include "use_arp.h"
-
- #include <libraries/dosextens.h>
- #include <exec/types.h>
- #include <functions.h>
- #include "def.h"
- #include "no_dir.h"
- #include "use_arp.h"
- #include "rexx.h"
-
- #undef FALSE
- #undef TRUE
- #define TRUE 1
- #define FALSE 0
-
- #ifdef USE_ARP
- struct Library *ArpBase;
- extern struct Library *OpenLibrary();
- #endif
-
- #ifndef NO_DIR
- extern struct Task *FindTask();
- static BPTR StartLock;
- char MyDirName[MAXPATH];
- extern BPTR DupLock(), CurrentDir();
- #endif /* NO_DIR */
-
- VOID
- sysinit()
- {
- #ifndef NO_DIR
- long len;
- BPTR MyDirLock;
- #endif
-
- #ifdef USE_ARP
- if (!(ArpBase = OpenLibrary("arp.library", 0L)))
- panic("Compiled with USE_ARP, but arp.library not found");
- #endif
- #ifdef REXX
- openrexx() ;
- #endif
- #ifndef NO_DIR
- /*
- * The following attempt to be clever assigns the external StartLock
- * to the lock on the current directory, then switches our CurrentDir
- * to a duplicate of that lock so we can restore the original lock
- * on exit.
- */
-
- StartLock = ((struct Process *)FindTask(0L))->pr_CurrentDir;
- (void) CurrentDir(MyDirLock = DupLock(StartLock));
- len = PathName(MyDirLock, MyDirName, MAXPATH);
- #endif /* NO_DIR */
- }
-
- /*
- * System dependent cleanup for the Amiga.
- */
- VOID
- syscleanup()
- {
- #ifdef REXX
- closerexx() ;
- #endif
- #ifndef NO_DIR
- UnLock(CurrentDir(StartLock)); /* restore startup directory */
- #endif
- #ifdef USE_ARP
- if (ArpBase)
- CloseLibrary(ArpBase);
- #endif
- }
-