This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make deprecated qr//xx fatal
[perl5.git] / mathoms.c
index f9b9462..3187782 100644 (file)
--- a/mathoms.c
+++ b/mathoms.c
@@ -24,6 +24,9 @@
  * versions of Perl.  For binary or source compatibility reasons, though,
  * we cannot completely remove them from the core code.  
  *
+ * REMEMBER to update makedef.pl when adding a function to mathoms.c whose
+ * name doesn't begin with "Perl_".
+ *
  * SMP - Oct. 24, 2005
  *
  * The compilation of this file can be suppressed; see INSTALL
@@ -120,7 +123,7 @@ Perl_ref(pTHX_ OP *o, I32 type)
 Unsets the RV status of the SV, and decrements the reference count of
 whatever was being referenced by the RV.  This can almost be thought of
 as a reversal of C<newSVrv>.  This is C<sv_unref_flags> with the C<flag>
-being zero.  See C<SvROK_off>.
+being zero.  See C<L</SvROK_off>>.
 
 =cut
 */
@@ -255,7 +258,7 @@ Perl_sv_2pvutf8_nolen(pTHX_ SV *sv)
 
 Undo various types of fakery on an SV: if the PV is a shared string, make
 a private copy; if we're a ref, stop refing; if we're a glob, downgrade to
-an xpvmg.  See also C<sv_force_normal_flags>.
+an C<xpvmg>.  See also C<L</sv_force_normal_flags>>.
 
 =cut
 */
@@ -736,10 +739,10 @@ Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **ep)
 =for apidoc sv_nolocking
 
 Dummy routine which "locks" an SV when there is no locking module present.
-Exists to avoid test for a NULL function pointer and because it could
+Exists to avoid test for a C<NULL> function pointer and because it could
 potentially warn under some level of strict-ness.
 
-"Superseded" by sv_nosharing().
+"Superseded" by C<sv_nosharing()>.
 
 =cut
 */
@@ -756,10 +759,10 @@ Perl_sv_nolocking(pTHX_ SV *sv)
 =for apidoc sv_nounlocking
 
 Dummy routine which "unlocks" an SV when there is no locking module present.
-Exists to avoid test for a NULL function pointer and because it could
+Exists to avoid test for a C<NULL> function pointer and because it could
 potentially warn under some level of strict-ness.
 
-"Superseded" by sv_nosharing().
+"Superseded" by C<sv_nosharing()>.
 
 =cut
 */
@@ -843,7 +846,7 @@ Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len)
 
 Tells an SV to use C<ptr> to find its string value.  Implemented by
 calling C<sv_usepvn_flags> with C<flags> of 0, hence does not handle 'set'
-magic.  See C<sv_usepvn_flags>.
+magic.  See C<L</sv_usepvn_flags>>.
 
 =cut
 */
@@ -859,9 +862,9 @@ Perl_sv_usepvn(pTHX_ SV *sv, char *ptr, STRLEN len)
 /*
 =for apidoc unpack_str
 
-The engine implementing unpack() Perl function.  Note: parameters strbeg,
-new_s and ocnt are not used.  This call should not be used, use
-unpackstring instead.
+The engine implementing C<unpack()> Perl function.  Note: parameters C<strbeg>,
+C<new_s> and C<ocnt> are not used.  This call should not be used, use
+C<unpackstring> instead.
 
 =cut */
 
@@ -882,9 +885,9 @@ Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s,
 /*
 =for apidoc pack_cat
 
-The engine implementing pack() Perl function.  Note: parameters
-next_in_list and flags are not used.  This call should not be used; use
-packlist instead.
+The engine implementing C<pack()> Perl function.  Note: parameters
+C<next_in_list> and C<flags> are not used.  This call should not be used; use
+C<packlist> instead.
 
 =cut
 */
@@ -1016,8 +1019,6 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen_i32, I32 flags)
                                NULL, 0));
 }
 
-/* Functions after here were made mathoms post 5.10.0 but pre 5.8.9 */
-
 AV *
 Perl_newAV(pTHX)
 {
@@ -1144,13 +1145,13 @@ Perl_sv_2bool(pTHX_ SV *const sv)
 
 /*
 =for apidoc custom_op_name
-Return the name for a given custom op.  This was once used by the OP_NAME
+Return the name for a given custom op.  This was once used by the C<OP_NAME>
 macro, but is no longer: it has only been kept for compatibility, and
 should not be used.
 
 =for apidoc custom_op_desc
 Return the description of a given custom op.  This was once used by the
-OP_DESC macro, but is no longer: it has only been kept for
+C<OP_DESC> macro, but is no longer: it has only been kept for
 compatibility, and should not be used.
 
 =cut
@@ -1214,6 +1215,14 @@ Perl_sv_mortalcopy(pTHX_ SV *const oldstr)
     return Perl_sv_mortalcopy_flags(aTHX_ oldstr, SV_GMAGIC);
 }
 
+void
+Perl_sv_copypv(pTHX_ SV *const dsv, SV *const ssv)
+{
+    PERL_ARGS_ASSERT_SV_COPYPV;
+
+    sv_copypv_flags(dsv, ssv, 0);
+}
+
 UV      /* Made into a function, so can be deprecated */
 NATIVE_TO_NEED(const UV enc, const UV ch)
 {
@@ -1692,6 +1701,22 @@ Perl_is_utf8_char(const U8 *s)
     return isUTF8_CHAR(s, s + UTF8SKIP(s));
 }
 
+/*
+=for apidoc is_utf8_char_buf
+
+This is identical to the macro L</isUTF8_CHAR>.
+
+=cut */
+
+STRLEN
+Perl_is_utf8_char_buf(const U8 *buf, const U8* buf_end)
+{
+
+    PERL_ARGS_ASSERT_IS_UTF8_CHAR_BUF;
+
+    return isUTF8_CHAR(buf, buf_end);
+}
+
 /* DEPRECATED!
  * Like L</utf8_to_uvuni_buf>(), but should only be called when it is known that
  * there are no malformations in the input UTF-8 string C<s>.  Surrogates,
@@ -1718,7 +1743,7 @@ is why this function is deprecated.  Use L</utf8_to_uvchr_buf> instead.
 
 If C<s> points to one of the detected malformations, and UTF8 warnings are
 enabled, zero is returned and C<*retlen> is set (if C<retlen> isn't
-NULL) to -1.  If those warnings are off, the computed value if well-defined (or
+C<NULL>) to -1.  If those warnings are off, the computed value if well-defined (or
 the Unicode REPLACEMENT CHARACTER, if not) is silently returned, and C<*retlen>
 is set (if C<retlen> isn't NULL) so that (S<C<s> + C<*retlen>>) is the
 next possible position in C<s> that could begin a non-malformed character.
@@ -1767,16 +1792,27 @@ Perl_utf8_to_uvuni(pTHX_ const U8 *s, STRLEN *retlen)
     return NATIVE_TO_UNI(valid_utf8_to_uvchr(s, retlen));
 }
 
+/*
+=for apidoc Am|HV *|pad_compname_type|PADOFFSET po
+
+Looks up the type of the lexical variable at position C<po> in the
+currently-compiling pad.  If the variable is typed, the stash of the
+class to which it is typed is returned.  If not, C<NULL> is returned.
+
+=cut
+*/
+
+HV *
+Perl_pad_compname_type(pTHX_ const PADOFFSET po)
+{
+    return PAD_COMPNAME_TYPE(po);
+}
+
+
 END_EXTERN_C
 
 #endif /* NO_MATHOMS */
 
 /*
- * Local variables:
- * c-indentation-style: bsd
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- *
  * ex: set ts=8 sts=4 sw=4 et:
  */