patch to 5.004_01 perltrap.pod
[p5sagit/p5-mst-13.2.git] / os2 / os2ish.h
index 44aee84..a1b6db9 100644 (file)
  */
 #undef ACME_MESS       /**/
 
+/* ALTERNATE_SHEBANG:
+ *     This symbol, if defined, contains a "magic" string which may be used
+ *     as the first line of a Perl program designed to be executed directly
+ *     by name, instead of the standard Unix #!.  If ALTERNATE_SHEBANG
+ *     begins with a character other then #, then Perl will only treat
+ *     it as a command line if if finds the string "perl" in the first
+ *     word; otherwise it's treated as the first line of code in the script.
+ *     (IOW, Perl won't hand off to another interpreter via an alternate
+ *     shebang sequence that might be legal Perl code.)
+ */
+#define ALTERNATE_SHEBANG "extproc "
+
 #ifndef SIGABRT
 #    define SIGABRT SIGILL
 #endif
 # undef I_SYS_UN
 #endif 
  
-void Perl_OS2_init();
+void Perl_OS2_init(char **);
+
+/* XXX This code hideously puts env inside: */
 
 #define PERL_SYS_INIT(argcp, argvp) STMT_START {       \
     _response(argcp, argvp);                   \
     _wildcard(argcp, argvp);                   \
-    Perl_OS2_init();   } STMT_END
+    Perl_OS2_init(env);        } STMT_END
 
 #define PERL_SYS_TERM()
 
 /* #define PERL_SYS_TERM() STMT_START {        \
     if (Perl_HAB_set) WinTerminate(Perl_hab);  } STMT_END */
 
-#define dXSUB_SYS int fake = OS2_XS_init()
+#define dXSUB_SYS OS2_XS_init()
 
 #ifdef PERL_IS_AOUT
 /* #  define HAS_FORK */
@@ -128,7 +142,6 @@ void *emx_realloc (void *, size_t);
 /* This guy is needed for quick stdstd  */
 
 #if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE)
-#  define _filbuf _fill
        /* Perl uses ungetc only with successful return */
 #  define ungetc(c,fp) \
        (FILE_ptr(fp) > FILE_base(fp) && c == (int)*(FILE_ptr(fp) - 1) \
@@ -143,6 +156,7 @@ void *emx_realloc (void *, size_t);
 #define Stat(fname,bufptr) os2_stat((fname),(bufptr))
 #define Fstat(fd,bufptr)   fstat((fd),(bufptr))
 #define Fflush(fp)         fflush(fp)
+#define Mkdir(path,mode)   mkdir((path),(mode))
 
 #undef S_IFBLK
 #undef S_ISBLK
@@ -154,6 +168,7 @@ void *emx_realloc (void *, size_t);
 #define Stat(fname,bufptr) stat((fname),(bufptr))
 #define Fstat(fd,bufptr)   fstat((fd),(bufptr))
 #define Fflush(fp)         fflush(fp)
+#define Mkdir(path,mode)   mkdir((path),(mode))
 
 #endif