perl 4.0 patch 14: patch #11, continued
[p5sagit/p5-mst-13.2.git] / str.h
diff --git a/str.h b/str.h
index f4ea90f..15c2c68 100644 (file)
--- a/str.h
+++ b/str.h
@@ -1,18 +1,25 @@
-/* $Header: str.h,v 3.0 89/10/18 15:23:49 lwall Locked $
+/* $RCSfile: str.h,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:58:33 $
  *
- *    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:       str.h,v $
- * Revision 3.0  89/10/18  15:23:49  lwall
- * 3.0 baseline
+ * Revision 4.0.1.2  91/06/07  11:58:33  lwall
+ * patch4: new copyright notice
+ * 
+ * Revision 4.0.1.1  91/04/12  09:16:12  lwall
+ * patch1: you may now use "die" and "caller" in a signal handler
+ * 
+ * Revision 4.0  91/03/20  01:40:04  lwall
+ * 4.0 baseline.
  * 
  */
 
 struct string {
     char *     str_ptr;        /* pointer to malloced string */
+    STRLEN     str_len;        /* allocated size */
     union {
        double  str_nval;       /* numeric value, if any */
        STAB    *str_stab;      /* magic stab for magic "key" string */
@@ -20,10 +27,10 @@ struct string {
        ARG     *str_args;      /* list of args for interpreted string */
        HASH    *str_hash;      /* string represents an assoc array (stab?) */
        ARRAY   *str_array;     /* string represents an array */
+       CMD     *str_cmd;       /* command for this source line */
     } str_u;
-    int                str_len;        /* allocated size */
-    int                str_cur;        /* length of str_ptr as a C string */
-    STR *str_magic;            /* while free, link to next free str */
+    STRLEN     str_cur;        /* length of str_ptr as a C string */
+    STR                *str_magic;     /* while free, link to next free str */
                                /* while in use, ptr to "key" for magic items */
     char       str_pok;        /* state of str_ptr */
     char       str_nok;        /* state of str_nval */
@@ -37,6 +44,7 @@ struct string {
 
 struct stab {  /* should be identical, except for str_ptr */
     STBP *     str_ptr;        /* pointer to malloced string */
+    STRLEN     str_len;        /* allocated size */
     union {
        double  str_nval;       /* numeric value, if any */
        STAB    *str_stab;      /* magic stab for magic "key" string */
@@ -44,10 +52,10 @@ struct stab {       /* should be identical, except for str_ptr */
        ARG     *str_args;      /* list of args for interpreted string */
        HASH    *str_hash;      /* string represents an assoc array (stab?) */
        ARRAY   *str_array;     /* string represents an array */
+       CMD     *str_cmd;       /* command for this source line */
     } str_u;
-    int                str_len;        /* allocated size */
-    int                str_cur;        /* length of str_ptr as a C string */
-    STR *str_magic;            /* while free, link to next free str */
+    STRLEN     str_cur;        /* length of str_ptr as a C string */
+    STR                *str_magic;     /* while free, link to next free str */
                                /* while in use, ptr to "key" for magic items */
     char       str_pok;        /* state of str_ptr */
     char       str_nok;        /* state of str_nval */
@@ -63,8 +71,8 @@ struct stab { /* should be identical, except for str_ptr */
 
 struct lstring {
     struct string lstr;
-    int        lstr_offset;
-    int        lstr_len;
+    STRLEN     lstr_offset;
+    STRLEN     lstr_len;
 };
 
 /* These are the values of str_pok:            */
@@ -75,6 +83,7 @@ struct lstring {
 #define SP_INTRP       16      /* string was compiled for interping */
 #define SP_TAIL                32      /* fbm string is tail anchored: /foo$/  */
 #define SP_MULTI       64      /* symbol table entry probably isn't a typo */
+#define SP_TEMP                128     /* string slated to die, so can be plundered */
 
 #define Nullstr Null(STR*)
 
@@ -88,6 +97,8 @@ struct lstring {
 #define SS_SSTRP       6       /* STR* on save stack */
 #define SS_SHPTR       7       /* HASH* on save stack */
 #define SS_SNSTAB      8       /* non-stab on save stack */
+#define SS_SCSV                9       /* callsave structure on save stack */
+#define SS_SAPTR       10      /* ARRAY* on save stack */
 #define SS_HASH                253     /* carrying an hash */
 #define SS_ARY         254     /* carrying an array */
 #define SS_FREE                255     /* in free list */
@@ -115,8 +126,8 @@ EXT int tmps_base INIT(-1);
 
 char *str_2ptr();
 double str_2num();
-STR *str_static();
-STR *str_2static();
+STR *str_mortal();
+STR *str_2mortal();
 STR *str_make();
 STR *str_nmake();
 STR *str_smake();
@@ -124,3 +135,4 @@ int str_cmp();
 int str_eq();
 void str_magic();
 void str_insert();
+STRLEN str_len();