This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document various CopFILEfoo functions
authorKarl Williamson <khw@cpan.org>
Sat, 29 Aug 2020 16:55:02 +0000 (10:55 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 29 Nov 2020 16:11:41 +0000 (09:11 -0700)
cop.h
embed.fnc
proto.h

diff --git a/cop.h b/cop.h
index 0ddcd48..96b6739 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -423,6 +423,32 @@ struct cop {
     U32                cop_features;
 };
 
+/*
+=for apidoc Am|const char *|CopFILE|const COP * c
+Returns the name of the file associated with the C<COP> C<c>
+
+=for apidoc Am|STRLEN|CopLINE|const COP * c
+Returns the line number in the source code associated with the C<COP> C<c>
+
+=for apidoc Am|AV *|CopFILEAV|const COP * c
+Returns the AV associated with the C<COP> C<c>
+
+=for apidoc Am|SV *|CopFILESV|const COP * c
+Returns the SV associated with the C<COP> C<c>
+
+=for apidoc Am|void|CopFILE_set|COP * c|const char * pv
+Makes C<pv> the name of the file associated with the C<COP> C<c>
+
+=for apidoc Am|GV *|CopFILEGV|const COP * c
+Returns the GV associated with the C<COP> C<c>
+
+=for apidoc CopFILEGV_set
+Available only on unthreaded perls.  Makes C<pv> the name of the file
+associated with the C<COP> C<c>
+
+=cut
+*/
+
 #ifdef USE_ITHREADS
 #  define CopFILE(c)           ((c)->cop_file)
 #  define CopFILEGV(c)         (CopFILE(c) \
index 3eb6dc7..ff98258 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -3660,4 +3660,8 @@ XEop      |void   |dtrace_probe_phase|enum perl_phase phase
 
 XEop   |STRLEN*|dup_warnings   |NULLOK STRLEN* warnings
 
+#ifndef USE_ITHREADS
+Amd    |void   |CopFILEGV_set  |NN COP * c|NN GV * gv
+#endif
+
 : ex: set ts=8 sts=4 sw=4 noet:
diff --git a/proto.h b/proto.h
index e886261..46ce076 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -4483,6 +4483,10 @@ STATIC void      S_validate_suid(pTHX_ PerlIO *rsfp);
        assert(rsfp)
 #  endif
 #endif
+#if !defined(USE_ITHREADS)
+/* PERL_CALLCONV void  CopFILEGV_set(pTHX_ COP * c, GV * gv); */
+#define PERL_ARGS_ASSERT_COPFILEGV_SET
+#endif
 #if !defined(UV_IS_QUAD)
 #  if defined(PERL_IN_UTF8_C)
 STATIC int     S_is_utf8_cp_above_31_bits(const U8 * const s, const U8 * const e, const bool consider_overlongs)