This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv_utf8_upgrade declares itself to be a mathom, so off it goes.
[perl5.git] / mathoms.c
index d58beb8..4f35282 100644 (file)
--- a/mathoms.c
+++ b/mathoms.c
@@ -36,6 +36,36 @@ Perl_ref(pTHX_ OP *o, I32 type)
     return doref(o, type, TRUE);
 }
 
+/*
+=for apidoc sv_unref
+
+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>.
+
+=cut
+*/
+
+void
+Perl_sv_unref(pTHX_ SV *sv)
+{
+    sv_unref_flags(sv, 0);
+}
+
+/*
+=for apidoc sv_taint
+
+Taint an SV. Use C<SvTAINTED_on> instead.
+=cut
+*/
+
+void
+Perl_sv_taint(pTHX_ SV *sv)
+{
+    sv_magic((sv), Nullsv, PERL_MAGIC_taint, Nullch, 0);
+}
+
 /* sv_2iv() is now a macro using Perl_sv_2iv_flags();
  * this function provided for binary compatibility only
  */
@@ -66,6 +96,21 @@ Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp)
     return sv_2pv_flags(sv, lp, SV_GMAGIC);
 }
 
+/*
+=for apidoc sv_force_normal
+
+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>.
+
+=cut
+*/
+
+void
+Perl_sv_force_normal(pTHX_ register SV *sv)
+{
+    sv_force_normal_flags(sv, 0);
+}
 
 /* sv_setsv() is now a macro using Perl_sv_setsv_flags();
  * this function provided for binary compatibility only
@@ -142,6 +187,16 @@ Perl_sv_pvutf8(pTHX_ SV *sv)
     return sv_pv(sv);
 }
 
+/* sv_utf8_upgrade() is now a macro using sv_utf8_upgrade_flags();
+ * this function provided for binary compatibility only
+ */
+
+STRLEN
+Perl_sv_utf8_upgrade(pTHX_ register SV *sv)
+{
+    return sv_utf8_upgrade_flags(sv, SV_GMAGIC);
+}
+
 /*
 =for apidoc A|U8 *|uvchr_to_utf8|U8 *d|UV uv