home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************************
- Project : MacPerl - Perl for the Macintosh
- File : MacPerl.h - Interface to users of the Perl kernel
- Author : Matthias Neeracher
-
- A lot of this code is borrowed from 7Edit written by
- Apple Developer Support UK
-
- Language : MPW C
-
- $Log: MPMain.c,v $
- *********************************************************************/
-
- #ifndef __MACPERL__
- #define __MACPERL__
-
- #include <StdLib.h>
- #include <Events.h>
- #include <time.h>
-
- #ifndef MP_EXT
- #define MP_EXT extern
- #define MP_INIT(x)
- #endif
-
- int run_perl(int, char **, char **);
- void reenter();
-
- MP_EXT Handle gPerlReply MP_INIT(nil);
- MP_EXT int gPerlQuit MP_INIT(0);
- MP_EXT char * gDebugLogName MP_INIT(0);
- MP_EXT short gAppFile;
- MP_EXT short gAppVol MP_INIT(0);
- MP_EXT long gAppDir MP_INIT(0);
- MP_EXT short gPrefsFile;
- MP_EXT Handle gSacrificialGoat MP_INIT((Handle) -1);
- MP_EXT Boolean gAlwaysExtract MP_INIT(false);
- MP_EXT void (*gExit)(int) MP_INIT(exit);
- MP_EXT int (*gAtExit)(void (*func)(void)) MP_INIT(atexit);
- MP_EXT char *(*gGetEnv)(const char * name) MP_INIT(getenv);
- MP_EXT char gPseudoFileName[256];
- MP_EXT FSSpec gFirstErrorFile;
- MP_EXT long gFirstErrorLine MP_INIT(-1);
- MP_EXT Boolean gSyntaxError;
- MP_EXT void (*gHandleEvent)(EventRecord * ev) MP_INIT(nil);
- MP_EXT clock_t gStartClock;
- #if defined(powerc) || defined(__powerc)
- MP_EXT struct QDGlobals qd;
- MP_EXT void *(*gCAlloc)(size_t nmemb, size_t size) MP_INIT(calloc);
- MP_EXT void (*gFree)(void *ptr) MP_INIT(free);
- MP_EXT void *(*gMalloc)(size_t size) MP_INIT(malloc);
- MP_EXT void *(*gRealloc)(void *ptr, size_t size) MP_INIT(realloc);
- #endif
-
- #if !defined(ORIGINAL_WRAPPER)
- #define exit(status) gExit(status)
- #define atexit(proc) gAtExit(proc)
- #define getenv(name) gGetEnv(name)
- #if defined(powerc) || defined(__powerc)
- #define calloc(nmemb,size) gCAlloc(nmemb,size)
- #define free(ptr) gFree(ptr)
- #define malloc(size) gMalloc(size)
- #define realloc(ptr,size) gRealloc(ptr,size)
- #endif
- #endif
-
- #endif