perl 3.0 patch #22 patch #19, continued
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index 2f7131f..65738a1 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -1,4 +1,4 @@
-/* $Header: perl.h,v 3.0.1.2 89/11/11 04:39:38 lwall Locked $
+/* $Header: perl.h,v 3.0.1.7 90/03/27 16:12:52 lwall Locked $
  *
  *    Copyright (c) 1989, Larry Wall
  *
@@ -6,6 +6,34 @@
  *    as specified in the README file that comes with the perl 3.0 kit.
  *
  * $Log:       perl.h,v $
+ * Revision 3.0.1.7  90/03/27  16:12:52  lwall
+ * patch16: MSDOS support
+ * patch16: support for machines that can't cast negative floats to unsigned ints
+ * 
+ * Revision 3.0.1.6  90/03/12  16:40:43  lwall
+ * patch13: did some ndir straightening up for Xenix
+ * 
+ * Revision 3.0.1.5  90/02/28  17:52:28  lwall
+ * patch9: Configure now determines whether volatile is supported
+ * patch9: volatilized some more variables for super-optimizing compilers
+ * patch9: unused VREG symbol deleted
+ * patch9: perl can now start up other interpreters scripts  
+ * patch9: you may now undef $/ to have no input record separator
+ * patch9: nested evals clobbered their longjmp environment
+ * 
+ * Revision 3.0.1.4  89/12/21  20:07:35  lwall
+ * patch7: arranged for certain registers to be restored after longjmp()
+ * patch7: Configure now compiles a test program to figure out time.h fiasco
+ * patch7: Configure now detects DG/UX thingies like [sg]etpgrp2 and utime.h
+ * patch7: memcpy() and memset() return void in __STDC__
+ * patch7: errno may now be a macro with an lvalue
+ * patch7: ANSI strerror() is now supported
+ * patch7: Xenix support for sys/ndir.h, cross compilation
+ * 
+ * Revision 3.0.1.3  89/11/17  15:28:57  lwall
+ * patch5: byteorder now is a hex value
+ * patch5: Configure now looks for <time.h> including <sys/time.h>
+ * 
  * Revision 3.0.1.2  89/11/11  04:39:38  lwall
  * patch2: Configure may now set -DDEBUGGING
  * patch2: netinet/in.h needed sys/types.h some places
 #define VOIDUSED 1
 #include "config.h"
 
+#ifdef MSDOS
+/*
+ * BUGGY_MSC:
+ *     This symbol is defined if you are the unfortunate owner of a buggy
+ *     Microsoft C compiler and want to use intrinsic functions.  Versions
+ *     up to 5.1 are known conform to this definition.  This is not needed
+ *     under Unix.
+ */
+#define BUGGY_MSC                      /**/
+/*
+ * BINARY:
+ *     This symbol is defined if you run under an operating system that
+ *     distinguishes between binary and text files.  If so the function
+ *     setmode will be used to set the file into binary mode.  Unix
+ *     doesn't distinguish.
+ */
+#define BINARY                         /**/
+
+#else /* !MSDOS */
+
+/*
+ * The following symbols are defined if your operating system supports
+ * functions by that name.  All Unixes I know of support them, thus they
+ * are not checked by the configuration script, but are directly defined
+ * here.
+ */
+#define CHOWN
+#define CHROOT
+#define FORK
+#define GETLOGIN
+#define GETPPID
+#define KILL
+#define LINK
+#define PIPE
+#define WAIT
+#define UMASK
+/*
+ * The following symbols are defined if your operating system supports
+ * password and group functions in general.  All Unix systems do.
+ */
+#define GROUP
+#define PASSWD
+
+#endif /* !MSDOS */
+
+#if defined(HASVOLATILE) || defined(__STDC__)
+#define VOLATILE volatile
+#else
+#define VOLATILE
+#endif
+
 #ifdef IAMSUID
 #   ifndef TAINT
 #      define TAINT
 #   define vfork fork
 #endif
 
-#if defined(MEMCMP) && defined(mips) && BYTEORDER == 01234
+#ifdef GETPGRP2
+#   ifndef GETPGRP
+#      define GETPGRP
+#   endif
+#   define getpgrp getpgrp2
+#endif
+
+#ifdef SETPGRP2
+#   ifndef SETPGRP
+#      define SETPGRP
+#   endif
+#   define setpgrp setpgrp2
+#endif
+
+#if defined(MEMCMP) && defined(mips) && BYTEORDER == 0x1234
 #undef MEMCMP
 #endif
 
 #ifdef MEMCPY
+#ifndef memcpy
+#ifdef __STDC__
+extern void *memcpy(), *memset();
+#else
 extern char *memcpy(), *memset();
+#endif
+#endif
 #define bcopy(s1,s2,l) memcpy(s2,s1,l)
 #define bzero(s,l) memset(s,0,l)
 #endif
@@ -65,17 +164,39 @@ extern char *memcpy(), *memset();
 
 #include <sys/stat.h>
 
-#if defined(TMINSYS) || defined(I_SYSTIME)
-#include <sys/time.h>
-#ifdef TIMETOO
-#include <time.h>
+#ifdef I_TIME
+#   include <time.h>
 #endif
-#else
-#include <time.h>
+
+#ifdef I_SYSTIME
+#   ifdef SYSTIMEKERNEL
+#      define KERNEL
+#   endif
+#   include <sys/time.h>
+#   ifdef SYSTIMEKERNEL
+#      undef KERNEL
+#   endif
 #endif
 
 #include <sys/times.h>
 
+#if defined(STRERROR) && (!defined(MKDIR) || !defined(RMDIR))
+#undef STRERROR
+#endif
+
+#include <errno.h>
+#ifndef errno
+extern int errno;     /* ANSI allows errno to be an lvalue expr */
+#endif
+
+#ifdef STRERROR
+char *strerror();
+#else
+extern int sys_nerr;
+extern char *sys_errlist[];
+#define strerror(e) ((e) < 0 || (e) >= sys_nerr ? "(unknown)" : sys_errlist[e])
+#endif
+
 #ifdef I_SYSIOCTL
 #ifndef _IOCTL_
 #include <sys/ioctl.h>
@@ -128,18 +249,23 @@ EXT int dbmlen;
 #define ntohi ntohl
 #endif
 
-#ifdef I_DIRENT
-#include <dirent.h>
-#define DIRENT dirent
+#if defined(I_DIRENT) && !defined(M_XENIX)
+#   include <dirent.h>
+#   define DIRENT dirent
 #else
-#ifdef I_SYSDIR
-#ifdef hp9000s500
-#include <ndir.h>      /* may be wrong in the future */
-#else
-#include <sys/dir.h>
-#endif
-#define DIRENT direct
-#endif
+#   ifdef I_SYSNDIR
+#      include <sys/ndir.h>
+#      define DIRENT direct
+#   else
+#      ifdef I_SYSDIR
+#          ifdef hp9000s500
+#              include <ndir.h>        /* may be wrong in the future */
+#          else
+#              include <sys/dir.h>
+#          endif
+#          define DIRENT direct
+#      endif
+#   endif
 #endif
 
 typedef struct arg ARG;
@@ -167,7 +293,7 @@ typedef struct stab STAB;
 #include "array.h"
 #include "hash.h"
 
-#if defined(iAPX286) || defined(M_I286) || defined(I80286)
+#if defined(iAPX286) || defined(M_I286) || defined(I80286) || defined(M_I86)
 #   define I286
 #endif
 
@@ -238,7 +364,7 @@ EXT STR *Str;
 #define STR_GROW(str,len) if ((str)->str_len < (len)) str_grow(str,len)
 
 #ifndef BYTEORDER
-#define BYTEORDER 01234
+#define BYTEORDER 0x1234
 #endif
 
 #if defined(htonl) && !defined(HTONL)
@@ -254,7 +380,7 @@ EXT STR *Str;
 #define NTOHS
 #endif
 #ifndef HTONL
-#if (BYTEORDER != 04321) && (BYTEORDER != 087654321)
+#if (BYTEORDER != 0x4321) && (BYTEORDER != 0x87654321)
 #define HTONS
 #define HTONL
 #define NTOHS
@@ -266,7 +392,7 @@ EXT STR *Str;
 #define ntohl my_ntohl
 #endif
 #else
-#if (BYTEORDER == 04321) || (BYTEORDER == 087654321)
+#if (BYTEORDER == 0x4321) || (BYTEORDER == 0x87654321)
 #undef HTONS
 #undef HTONL
 #undef NTOHS
@@ -274,6 +400,17 @@ EXT STR *Str;
 #endif
 #endif
 
+#ifdef CASTNEGFLOAT
+#define U_S(what) ((unsigned short)(what))
+#define U_I(what) ((unsigned int)(what))
+#define U_L(what) ((unsigned long)(what))
+#else
+unsigned long castulong();
+#define U_S(what) ((unsigned int)castulong(what))
+#define U_I(what) ((unsigned int)castulong(what))
+#define U_L(what) (castulong(what))
+#endif
+
 CMD *add_label();
 CMD *block_head();
 CMD *append_line();
@@ -352,6 +489,7 @@ void stab_clear();
 void do_join();
 void do_sprintf();
 void do_accept();
+void do_pipe();
 void do_vecset();
 void savelist();
 void saveitem();
@@ -360,9 +498,12 @@ void savelong();
 void savesptr();
 void savehptr();
 void restorelist();
+void repeatcpy();
 HASH *savehash();
 ARRAY *saveary();
 
+EXT char **origargv;
+EXT int origargc;
 EXT line_t line INIT(0);
 EXT line_t subline INIT(0);
 EXT STR *subname INIT(Nullstr);
@@ -408,7 +549,7 @@ EXT int lastsize;
 
 EXT char *filename;
 EXT char *origfilename;
-EXT FILE *rsfp;
+EXT FILE * VOLATILE rsfp;
 EXT char buf[1024];
 EXT char *bufptr;
 EXT char *oldbufptr;
@@ -417,7 +558,7 @@ EXT char *bufend;
 
 EXT STR *linestr INIT(Nullstr);
 
-EXT char record_separator INIT('\n');
+EXT int record_separator INIT('\n');
 EXT int rslen INIT(1);
 EXT char *ofs INIT(Nullch);
 EXT int ofslen INIT(0);
@@ -438,6 +579,7 @@ EXT bool sawampersand INIT(FALSE);  /* must save all match strings */
 EXT bool sawstudy INIT(FALSE);         /* do fbminstr on all strings */
 EXT bool sawi INIT(FALSE);             /* study must assume case insensitive */
 EXT bool sawvec INIT(FALSE);
+EXT bool localizing INIT(FALSE);       /* are we processing a local() list? */
 
 #ifdef CSH
 char *cshname INIT(CSH);
@@ -454,7 +596,7 @@ EXT FILE *e_fp INIT(Nullfp);
 
 EXT char tokenbuf[256];
 EXT int expectterm INIT(TRUE);         /* how to interpret ambiguous tokens */
-EXT int in_eval INIT(FALSE);           /* trap fatal errors? */
+EXT VOLATILE int in_eval INIT(FALSE);  /* trap fatal errors? */
 EXT int multiline INIT(0);             /* $*--do strings hold >1 line? */
 EXT int forkprocess;                   /* so do_open |- can return proc# */
 EXT int do_undump INIT(0);             /* -u or dump seen? */
@@ -486,7 +628,7 @@ GIDTYPE getegid();
 EXT int unsafe;
 
 #ifdef DEBUGGING
-EXT int debug INIT(0);
+EXT VOLATILE int debug INIT(0);
 EXT int dlevel INIT(0);
 EXT int dlmax INIT(128);
 EXT char *debname;
@@ -513,13 +655,12 @@ EXT int loop_ptr INIT(-1);
 EXT int loop_max INIT(128);
 
 EXT jmp_buf top_env;
-EXT jmp_buf eval_env;
 
-EXT char *goto_targ INIT(Nullch);      /* cmd_exec gets strange when set */
+EXT char * VOLATILE goto_targ INIT(Nullch); /* cmd_exec gets strange when set */
 
 EXT ARRAY *stack;              /* THE STACK */
 
-EXT ARRAY *savestack;          /* to save non-local values on */
+EXT ARRAY * VOLATILE savestack;                /* to save non-local values on */
 
 EXT ARRAY *tosave;             /* strings to save on recursive subroutine */
 
@@ -527,6 +668,10 @@ EXT ARRAY *lineary;                /* lines of script for debugger */
 
 EXT ARRAY *pidstatary;         /* keep pids and statuses by fd for mypopen */
 
+EXT int *di;                   /* for tmp use in debuggers */
+EXT char *dc;
+EXT short *ds;
+
 double atof();
 long time();
 struct tm *gmtime(), *localtime();