perl 4.0 patch 14: patch #11, continued
[p5sagit/p5-mst-13.2.git] / stab.h
diff --git a/stab.h b/stab.h
index 2c43ab1..ddb7d38 100644 (file)
--- a/stab.h
+++ b/stab.h
@@ -1,13 +1,17 @@
-/* $Header: stab.h,v 3.0 89/10/18 15:23:30 lwall Locked $
+/* $RCSfile: stab.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:56:35 $
  *
- *    Copyright (c) 1989, Larry Wall
+ *    Copyright (c) 1991, Larry Wall
  *
- *    You may distribute under the terms of the GNU General Public License
- *    as specified in the README file that comes with the perl 3.0 kit.
+ *    You may distribute under the terms of either the GNU General Public
+ *    License or the Artistic License, as specified in the README file.
  *
  * $Log:       stab.h,v $
- * Revision 3.0  89/10/18  15:23:30  lwall
- * 3.0 baseline
+ * Revision 4.0.1.1  91/06/07  11:56:35  lwall
+ * patch4: new copyright notice
+ * patch4: length($`), length($&), length($') now optimized to avoid string copy
+ * 
+ * Revision 4.0  91/03/20  01:39:49  lwall
+ * 4.0 baseline.
  * 
  */
 
@@ -18,24 +22,38 @@ struct stabptrs {
     FCMD       *stbp_form;     /* format value */
     ARRAY      *stbp_array;    /* array value */
     HASH       *stbp_hash;     /* associative array value */
+    HASH       *stbp_stash;    /* symbol table for this stab */
     SUBR       *stbp_sub;      /* subroutine value */
     int                stbp_lastexpr;  /* used by nothing_in_common() */
     line_t     stbp_line;      /* line first declared at (for -w) */
     char       stbp_flags;
 };
 
+#if defined(CRIPPLED_CC) && (defined(iAPX286) || defined(M_I286) || defined(I80286))
+#define MICROPORT
+#endif
+
 #define stab_magic(stab)       (((STBP*)(stab->str_ptr))->stbp_magic)
 #define stab_val(stab)         (((STBP*)(stab->str_ptr))->stbp_val)
 #define stab_io(stab)          (((STBP*)(stab->str_ptr))->stbp_io)
 #define stab_form(stab)                (((STBP*)(stab->str_ptr))->stbp_form)
 #define stab_xarray(stab)      (((STBP*)(stab->str_ptr))->stbp_array)
+#ifdef MICROPORT       /* Microport 2.4 hack */
+ARRAY *stab_array();
+#else
 #define stab_array(stab)       (((STBP*)(stab->str_ptr))->stbp_array ? \
                                 ((STBP*)(stab->str_ptr))->stbp_array : \
                                 ((STBP*)(aadd(stab)->str_ptr))->stbp_array)
+#endif
 #define stab_xhash(stab)       (((STBP*)(stab->str_ptr))->stbp_hash)
+#ifdef MICROPORT       /* Microport 2.4 hack */
+HASH *stab_hash();
+#else
 #define stab_hash(stab)                (((STBP*)(stab->str_ptr))->stbp_hash ? \
                                 ((STBP*)(stab->str_ptr))->stbp_hash : \
                                 ((STBP*)(hadd(stab)->str_ptr))->stbp_hash)
+#endif                 /* Microport 2.4 hack */
+#define stab_stash(stab)       (((STBP*)(stab->str_ptr))->stbp_stash)
 #define stab_sub(stab)         (((STBP*)(stab->str_ptr))->stbp_sub)
 #define stab_lastexpr(stab)    (((STBP*)(stab->str_ptr))->stbp_lastexpr)
 #define stab_line(stab)                (((STBP*)(stab->str_ptr))->stbp_line)
@@ -48,7 +66,7 @@ struct stabptrs {
 struct stio {
     FILE       *ifp;           /* ifp and ofp are normally the same */
     FILE       *ofp;           /* but sockets need separate streams */
-#if defined(I_DIRENT) || defined(I_SYSDIR)
+#ifdef HAS_READDIR
     DIR                *dirp;          /* for opendir, readdir, etc */
 #endif
     long       lines;          /* $. */
@@ -70,14 +88,19 @@ struct stio {
 
 struct sub {
     CMD                *cmd;
-    char       *filename;
+    int                (*usersub)();
+    int                userindex;
+    STAB       *filestab;
     long       depth;  /* >= 2 indicates recursive call */
     ARRAY      *tosave;
 };
 
 #define Nullstab Null(STAB*)
 
+STRLEN stab_len();
+
 #define STAB_STR(s) (tmpstab = (s), stab_flags(tmpstab) & SF_VMAGIC ? stab_str(stab_val(tmpstab)->str_magic) : stab_val(tmpstab))
+#define STAB_LEN(s) (tmpstab = (s), stab_flags(tmpstab) & SF_VMAGIC ? stab_len(stab_val(tmpstab)->str_magic) : stab_val(tmpstab)->str_cur)
 #define STAB_GET(s) (tmpstab = (s), str_get(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab)))
 #define STAB_GNUM(s) (tmpstab = (s), str_gnum(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab)))
 
@@ -94,3 +117,4 @@ EXT int delaymagic INIT(0);
 
 STAB *aadd();
 STAB *hadd();
+STAB *fstab();