This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Skip obsoleted interfaces.
[perl5.git] / op.h
diff --git a/op.h b/op.h
index 2bfdced..da59e44 100644 (file)
--- a/op.h
+++ b/op.h
@@ -1,6 +1,6 @@
 /*    op.h
  *
- *    Copyright (c) 1991-2001, Larry Wall
+ *    Copyright (c) 1991-2002, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -104,6 +104,8 @@ Deprecated.  Use C<GIMME_V> instead.
                                /*  On OP_ENTERITER, loop var is per-thread */
                                /*  On pushre, re is /\s+/ imp. by split " " */
                                /*  On regcomp, "use re 'eval'" was in scope */
+                               /*  On OP_READLINE, was <$filehandle> */
+                               /*  On RV2[SG]V, don't create GV--in defined()*/
 
 /* old names; don't use in new code, but don't break them, either */
 #define OPf_LIST       OPf_WANT_LIST
@@ -299,17 +301,21 @@ struct pmop {
 #define PMf_COMPILETIME        (PMf_MULTILINE|PMf_SINGLELINE|PMf_LOCALE|PMf_FOLD|PMf_EXTENDED)
 
 #ifdef USE_ITHREADS
+
 #  define PmopSTASHPV(o)       ((o)->op_pmstashpv)
-#  define PmopSTASHPV_set(o,pv)        ((o)->op_pmstashpv = ((pv) ? savepv(pv) : Nullch))
+#  define PmopSTASHPV_set(o,pv)        (PmopSTASHPV(o) = savesharedpv(pv))
 #  define PmopSTASH(o)         (PmopSTASHPV(o) \
                                 ? gv_stashpv(PmopSTASHPV(o),GV_ADD) : Nullhv)
-#  define PmopSTASH_set(o,hv)  PmopSTASHPV_set(o, (hv) ? HvNAME(hv) : Nullch)
+#  define PmopSTASH_set(o,hv)  PmopSTASHPV_set(o, ((hv) ? HvNAME(hv) : Nullch))
+#  define PmopSTASH_free(o)    PerlMemShared_free(PmopSTASHPV(o))
+
 #else
 #  define PmopSTASH(o)         ((o)->op_pmstash)
 #  define PmopSTASH_set(o,hv)  ((o)->op_pmstash = (hv))
 #  define PmopSTASHPV(o)       (PmopSTASH(o) ? HvNAME(PmopSTASH(o)) : Nullch)
    /* op_pmstash is not refcounted */
 #  define PmopSTASHPV_set(o,pv)        PmopSTASH_set((o), gv_stashpv(pv,GV_ADD))
+#  define PmopSTASH_free(o)    
 #endif
 
 struct svop {
@@ -473,11 +479,11 @@ struct loop {
 #ifdef USE_REENTRANT_API
 
 typedef struct {
-  struct tm* tmbuff;
-} REBUF;
+  struct tm* tmbuf;
+} REENTBUF;
 
-#define localtime(a)       (localtime_r((a),PL_reentrant_buffer->tmbuff) ? PL_reentrant_buffer->tmbuff : NULL)
-#define gmtime(a)          (gmtime_r((a),PL_reentrant_buffer->tmbuff) ?  PL_reentrant_buffer->tmbuff : NULL)
+#define localtime(a)       (localtime_r((a),PL_reentrant_buffer->tmbuf) ? PL_reentrant_buffer->tmbuf : NULL)
+#define gmtime(a)          (gmtime_r((a),PL_reentrant_buffer->tmbuf) ?  PL_reentrant_buffer->tmbuf : NULL)
 
 #ifdef OLD_PTHREADS_API
 
@@ -487,8 +493,8 @@ typedef struct {
 
 #undef localtime
 #undef gmtime
-#define localtime(a)       ((localtime_r((a),PL_reentrant_buffer->tmbuff) == 0) ? PL_reentrant_buffer->tmbuff : NULL)
-#define gmtime(a)          ((gmtime_r((a),PL_reentrant_buffer->tmbuff) == 0) ? PL_reentrant_buffer->tmbuff : NULL)
+#define localtime(a)       ((localtime_r((a),PL_reentrant_buffer->tmbuf) == 0) ? PL_reentrant_buffer->tmbuf : NULL)
+#define gmtime(a)          ((gmtime_r((a),PL_reentrant_buffer->tmbuf) == 0) ? PL_reentrant_buffer->tmbuf : NULL)
 #endif /* HP-UX 10.20 */
 
 #endif