#define sv_2iv Perl_sv_2iv
#define sv_2mortal Perl_sv_2mortal
#define sv_2nv Perl_sv_2nv
+#define sv_2pv Perl_sv_2pv
#define sv_2pvutf8 Perl_sv_2pvutf8
#define sv_2pvbyte Perl_sv_2pvbyte
+#define sv_pvn_nomg Perl_sv_pvn_nomg
#define sv_2uv Perl_sv_2uv
#define sv_iv Perl_sv_iv
#define sv_uv Perl_sv_uv
#define sv_catpvf Perl_sv_catpvf
#define sv_vcatpvf Perl_sv_vcatpvf
#define sv_catpv Perl_sv_catpv
+#define sv_catpvn Perl_sv_catpvn
+#define sv_catsv Perl_sv_catsv
#define sv_chop Perl_sv_chop
#define sv_clean_all Perl_sv_clean_all
#define sv_clean_objs Perl_sv_clean_objs
#define sv_peek Perl_sv_peek
#define sv_pos_u2b Perl_sv_pos_u2b
#define sv_pos_b2u Perl_sv_pos_b2u
+#define sv_pvn_force Perl_sv_pvn_force
#define sv_pvutf8n_force Perl_sv_pvutf8n_force
#define sv_pvbyten_force Perl_sv_pvbyten_force
#define sv_reftype Perl_sv_reftype
#define sv_setref_pvn Perl_sv_setref_pvn
#define sv_setpv Perl_sv_setpv
#define sv_setpvn Perl_sv_setpvn
+#define sv_setsv Perl_sv_setsv
#define sv_taint Perl_sv_taint
#define sv_tainted Perl_sv_tainted
#define sv_unmagic Perl_sv_unmagic
#define sv_pv Perl_sv_pv
#define sv_pvutf8 Perl_sv_pvutf8
#define sv_pvbyte Perl_sv_pvbyte
+#define sv_utf8_upgrade Perl_sv_utf8_upgrade
#define sv_utf8_downgrade Perl_sv_utf8_downgrade
#define sv_utf8_encode Perl_sv_utf8_encode
#define sv_utf8_decode Perl_sv_utf8_decode
#define sv_2iv(a) Perl_sv_2iv(aTHX_ a)
#define sv_2mortal(a) Perl_sv_2mortal(aTHX_ a)
#define sv_2nv(a) Perl_sv_2nv(aTHX_ a)
+#define sv_2pv(a,b) Perl_sv_2pv(aTHX_ a,b)
#define sv_2pvutf8(a,b) Perl_sv_2pvutf8(aTHX_ a,b)
#define sv_2pvbyte(a,b) Perl_sv_2pvbyte(aTHX_ a,b)
+#define sv_pvn_nomg(a,b) Perl_sv_pvn_nomg(aTHX_ a,b)
#define sv_2uv(a) Perl_sv_2uv(aTHX_ a)
#define sv_iv(a) Perl_sv_iv(aTHX_ a)
#define sv_uv(a) Perl_sv_uv(aTHX_ a)
#define sv_bless(a,b) Perl_sv_bless(aTHX_ a,b)
#define sv_vcatpvf(a,b,c) Perl_sv_vcatpvf(aTHX_ a,b,c)
#define sv_catpv(a,b) Perl_sv_catpv(aTHX_ a,b)
+#define sv_catpvn(a,b,c) Perl_sv_catpvn(aTHX_ a,b,c)
+#define sv_catsv(a,b) Perl_sv_catsv(aTHX_ a,b)
#define sv_chop(a,b) Perl_sv_chop(aTHX_ a,b)
#define sv_clean_all() Perl_sv_clean_all(aTHX)
#define sv_clean_objs() Perl_sv_clean_objs(aTHX)
#define sv_peek(a) Perl_sv_peek(aTHX_ a)
#define sv_pos_u2b(a,b,c) Perl_sv_pos_u2b(aTHX_ a,b,c)
#define sv_pos_b2u(a,b) Perl_sv_pos_b2u(aTHX_ a,b)
+#define sv_pvn_force(a,b) Perl_sv_pvn_force(aTHX_ a,b)
#define sv_pvutf8n_force(a,b) Perl_sv_pvutf8n_force(aTHX_ a,b)
#define sv_pvbyten_force(a,b) Perl_sv_pvbyten_force(aTHX_ a,b)
#define sv_reftype(a,b) Perl_sv_reftype(aTHX_ a,b)
#define sv_setref_pvn(a,b,c,d) Perl_sv_setref_pvn(aTHX_ a,b,c,d)
#define sv_setpv(a,b) Perl_sv_setpv(aTHX_ a,b)
#define sv_setpvn(a,b,c) Perl_sv_setpvn(aTHX_ a,b,c)
+#define sv_setsv(a,b) Perl_sv_setsv(aTHX_ a,b)
#define sv_taint(a) Perl_sv_taint(aTHX_ a)
#define sv_tainted(a) Perl_sv_tainted(aTHX_ a)
#define sv_unmagic(a,b) Perl_sv_unmagic(aTHX_ a,b)
#define sv_pv(a) Perl_sv_pv(aTHX_ a)
#define sv_pvutf8(a) Perl_sv_pvutf8(aTHX_ a)
#define sv_pvbyte(a) Perl_sv_pvbyte(aTHX_ a)
+#define sv_utf8_upgrade(a) Perl_sv_utf8_upgrade(aTHX_ a)
#define sv_utf8_downgrade(a,b) Perl_sv_utf8_downgrade(aTHX_ a,b)
#define sv_utf8_encode(a) Perl_sv_utf8_encode(aTHX_ a)
#define sv_utf8_decode(a) Perl_sv_utf8_decode(aTHX_ a)
Apd |IV |sv_2iv |SV* sv
Apd |SV* |sv_2mortal |SV* sv
Apd |NV |sv_2nv |SV* sv
-Aop |char* |sv_2pv |SV* sv|STRLEN* lp
+Ap |char* |sv_2pv |SV* sv|STRLEN* lp
Apd |char* |sv_2pvutf8 |SV* sv|STRLEN* lp
Apd |char* |sv_2pvbyte |SV* sv|STRLEN* lp
+Ap |char* |sv_pvn_nomg |SV* sv|STRLEN* lp
Apd |UV |sv_2uv |SV* sv
Apd |IV |sv_iv |SV* sv
Apd |UV |sv_uv |SV* sv
Afpd |void |sv_catpvf |SV* sv|const char* pat|...
Ap |void |sv_vcatpvf |SV* sv|const char* pat|va_list* args
Apd |void |sv_catpv |SV* sv|const char* ptr
-Aopd |void |sv_catpvn |SV* sv|const char* ptr|STRLEN len
-Aopd |void |sv_catsv |SV* dsv|SV* ssv
+Apd |void |sv_catpvn |SV* sv|const char* ptr|STRLEN len
+Apd |void |sv_catsv |SV* dsv|SV* ssv
Apd |void |sv_chop |SV* sv|char* ptr
pd |I32 |sv_clean_all
pd |void |sv_clean_objs
Ap |char* |sv_peek |SV* sv
Apd |void |sv_pos_u2b |SV* sv|I32* offsetp|I32* lenp
Apd |void |sv_pos_b2u |SV* sv|I32* offsetp
-Aopd |char* |sv_pvn_force |SV* sv|STRLEN* lp
+Apd |char* |sv_pvn_force |SV* sv|STRLEN* lp
Apd |char* |sv_pvutf8n_force|SV* sv|STRLEN* lp
Apd |char* |sv_pvbyten_force|SV* sv|STRLEN* lp
Apd |char* |sv_reftype |SV* sv|int ob
|STRLEN n
Apd |void |sv_setpv |SV* sv|const char* ptr
Apd |void |sv_setpvn |SV* sv|const char* ptr|STRLEN len
-Aopd |void |sv_setsv |SV* dsv|SV* ssv
+Apd |void |sv_setsv |SV* dsv|SV* ssv
Apd |void |sv_taint |SV* sv
Apd |bool |sv_tainted |SV* sv
Apd |int |sv_unmagic |SV* sv|int type
Apd |char* |sv_pv |SV *sv
Apd |char* |sv_pvutf8 |SV *sv
Apd |char* |sv_pvbyte |SV *sv
-Aopd |STRLEN |sv_utf8_upgrade|SV *sv
+Apd |STRLEN |sv_utf8_upgrade|SV *sv
ApdM |bool |sv_utf8_downgrade|SV *sv|bool fail_ok
Apd |void |sv_utf8_encode |SV *sv
ApdM |bool |sv_utf8_decode |SV *sv
Perl_load_module
Perl_vload_module
Perl_looks_like_number
+Perl_grok_bin
+Perl_grok_hex
Perl_grok_number
Perl_grok_numeric_radix
+Perl_grok_oct
Perl_markstack_grow
Perl_mess
Perl_vmess
Perl_sv_2pv
Perl_sv_2pvutf8
Perl_sv_2pvbyte
+Perl_sv_pvn_nomg
Perl_sv_2uv
Perl_sv_iv
Perl_sv_uv
=for hackers
Found in file op.h
+=item grok_bin
+
+converts a string representing a binary number to numeric form.
+
+On entry I<start> and I<*len> give the string to scan, I<*flags> gives
+conversion flags, and I<result> should be NULL or a pointer to an NV.
+The scan stops at the end of the string, or the first invalid character.
+On return I<*len> is set to the length scanned string, and I<*flags> gives
+output flags.
+
+If the value is <= UV_MAX it is returned as a UV, the output flags are clear,
+and nothing is written to I<*result>. If the value is > UV_MAX C<grok_bin>
+returns UV_MAX, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,
+and writes the value to I<*result> (or the value is discarded if I<result>
+is NULL).
+
+The hex number may optinally be prefixed with "0b" or "b". If
+C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> on entry then the binary
+number may use '_' characters to separate digits.
+
+ UV grok_bin(char* start, STRLEN* len, I32* flags, NV *result)
+
+=for hackers
+Found in file numeric.c
+
+=item grok_hex
+
+converts a string representing a hex number to numeric form.
+
+On entry I<start> and I<*len> give the string to scan, I<*flags> gives
+conversion flags, and I<result> should be NULL or a pointer to an NV.
+The scan stops at the end of the string, or the first non-hex-digit character.
+On return I<*len> is set to the length scanned string, and I<*flags> gives
+output flags.
+
+If the value is <= UV_MAX it is returned as a UV, the output flags are clear,
+and nothing is written to I<*result>. If the value is > UV_MAX C<grok_hex>
+returns UV_MAX, sets C<PERL_SCAN_GREATER_THAN_UV_MAX> in the output flags,
+and writes the value to I<*result> (or the value is discarded if I<result>
+is NULL).
+
+The hex number may optinally be prefixed with "0x" or "x". If
+C<PERL_SCAN_ALLOW_UNDERSCORES> is set in I<*flags> on entry then the hex
+number may use '_' characters to separate digits.
+
+ UV grok_hex(char* start, STRLEN* len, I32* flags, NV *result)
+
+=for hackers
+Found in file numeric.c
+
=item grok_number
Recognise (or not) a number. The type of the number is returned
=for hackers
Found in file numeric.c
+=item grok_oct
+
+
+ UV grok_oct(char* start, STRLEN* len, I32* flags, NV *result)
+
+=for hackers
+Found in file numeric.c
+
=item GvSV
Return the SV from the GV.
=for hackers
Found in file scope.h
+=item scan_bin
+
+For backwards compatibility. Use C<grok_bin> instead.
+
+ NV scan_bin(char* start, STRLEN len, STRLEN* retlen)
+
+=for hackers
+Found in file numeric.c
+
+=item scan_hex
+
+For backwards compatibility. Use C<grok_hex> instead.
+
+ NV scan_hex(char* start, STRLEN len, STRLEN* retlen)
+
+=for hackers
+Found in file numeric.c
+
+=item scan_oct
+
+For backwards compatibility. Use C<grok_oct> instead.
+
+ NV scan_oct(char* start, STRLEN len, STRLEN* retlen)
+
+=for hackers
+Found in file numeric.c
+
=item sharedsv_find
Tries to find if a given SV has a shared backend, either by
=for hackers
Found in file sv.h
-=item SvIVx
+=item SvIVX
-Coerces the given SV to an integer and returns it. Guarantees to evaluate
-sv only once. Use the more efficent C<SvIV> otherwise.
+Returns the raw value in the SV's IV slot, without checks or conversions.
+Only use when you are sure SvIOK is true. See also C<SvIV()>.
- IV SvIVx(SV* sv)
+ IV SvIVX(SV* sv)
=for hackers
Found in file sv.h
-=item SvIVX
+=item SvIVx
-Returns the raw value in the SV's IV slot, without checks or conversions.
-Only use when you are sure SvIOK is true. See also C<SvIV()>.
+Coerces the given SV to an integer and returns it. Guarantees to evaluate
+sv only once. Use the more efficent C<SvIV> otherwise.
- IV SvIVX(SV* sv)
+ IV SvIVx(SV* sv)
=for hackers
Found in file sv.h
=for hackers
Found in file sv.h
-=item SvPVx
+=item SvPVX
-A version of C<SvPV> which guarantees to evaluate sv only once.
+Returns a pointer to the physical string in the SV. The SV must contain a
+string.
- char* SvPVx(SV* sv, STRLEN len)
+ char* SvPVX(SV* sv)
=for hackers
Found in file sv.h
-=item SvPVX
+=item SvPVx
-Returns a pointer to the physical string in the SV. The SV must contain a
-string.
+A version of C<SvPV> which guarantees to evaluate sv only once.
- char* SvPVX(SV* sv)
+ char* SvPVx(SV* sv, STRLEN len)
=for hackers
Found in file sv.h
PERL_CALLCONV char* Perl_sv_2pv(pTHX_ SV* sv, STRLEN* lp);
PERL_CALLCONV char* Perl_sv_2pvutf8(pTHX_ SV* sv, STRLEN* lp);
PERL_CALLCONV char* Perl_sv_2pvbyte(pTHX_ SV* sv, STRLEN* lp);
+PERL_CALLCONV char* Perl_sv_pvn_nomg(pTHX_ SV* sv, STRLEN* lp);
PERL_CALLCONV UV Perl_sv_2uv(pTHX_ SV* sv);
PERL_CALLCONV IV Perl_sv_iv(pTHX_ SV* sv);
PERL_CALLCONV UV Perl_sv_uv(pTHX_ SV* sv);
return sv_2pv(sv, lp);
}
+/* For -DCRIPPLED_CC only. See also C<sv_2pv_flags()>.
+ */
+
+char *
+Perl_sv_pvn_nomg(pTHX_ register SV *sv, STRLEN *lp)
+{
+ if (SvPOK(sv)) {
+ *lp = SvCUR(sv);
+ return SvPVX(sv);
+ }
+ return sv_2pv_flags(sv, lp, 0);
+}
+
/*
=for apidoc sv_pvn_force
#define SvPV_force(sv, lp) sv_pvn_force(sv, &lp)
#define SvPV(sv, lp) sv_pvn(sv, &lp)
#define SvPV_nolen(sv) sv_pv(sv)
+#define SvPV_nomg(sv, lp) sv_pvn_nomg(sv, &lp)
+#define SvPV_force_flags(sv, lp, flags) sv_pvn_force_flags(sv, &lp, flags)
#define SvPVutf8_force(sv, lp) sv_pvutf8n_force(sv, &lp)
#define SvPVutf8(sv, lp) sv_pvutf8n(sv, &lp)
#define SvUV(sv) SvUVx(sv)
#define SvTRUE(sv) SvTRUEx(sv)
+/* flag values for sv_*_flags functions */
+#define SV_IMMEDIATE_UNREF 1
+#define SV_GMAGIC 2
+
+#define sv_pvn_force_nomg(sv, lp) sv_pvn_force_flags(sv, lp, 0)
+#define sv_utf8_upgrade_nomg(sv) sv_utf8_upgrade_flags(sv, 0)
+#define sv_catpvn_nomg(dsv, sstr, slen) sv_catpvn_flags(dsv, sstr, slen, 0)
+
#ifndef CRIPPLED_CC
/* redefine some things to more efficient inlined versions */
#undef SvNV
#define SvNV(sv) (SvNOK(sv) ? SvNVX(sv) : sv_2nv(sv))
-/* flag values for sv_*_flags functions */
-#define SV_IMMEDIATE_UNREF 1
-#define SV_GMAGIC 2
-
#define sv_setsv_macro(dsv, ssv) sv_setsv_flags(dsv, ssv, SV_GMAGIC)
#define sv_setsv_nomg(dsv, ssv) sv_setsv_flags(dsv, ssv, 0)
#define sv_catsv_macro(dsv, ssv) sv_catsv_flags(dsv, ssv, SV_GMAGIC)
#define sv_catsv_nomg(dsv, ssv) sv_catsv_flags(dsv, ssv, 0)
#define sv_catpvn_macro(dsv, sstr, slen) sv_catpvn_flags(dsv, sstr, slen, SV_GMAGIC)
-#define sv_catpvn_nomg(dsv, sstr, slen) sv_catpvn_flags(dsv, sstr, slen, 0)
#define sv_2pv_macro(sv, lp) sv_2pv_flags(sv, lp, SV_GMAGIC)
#define sv_2pv_nomg(sv, lp) sv_2pv_flags(sv, lp, 0)
#define sv_pvn_force_macro(sv, lp) sv_pvn_force_flags(sv, lp, SV_GMAGIC)
-#define sv_pvn_force_nomg(sv, lp) sv_pvn_force_flags(sv, lp, 0)
#define sv_utf8_upgrade_macro(sv) sv_utf8_upgrade_flags(sv, SV_GMAGIC)
-#define sv_utf8_upgrade_nomg(sv) sv_utf8_upgrade_flags(sv, 0)
-/* function style also available for bincompat */
+/* function style also available for sourcecompat */
+#undef sv_setsv
#define sv_setsv(dsv, ssv) sv_setsv_macro(dsv, ssv)
+#undef sv_catsv
#define sv_catsv(dsv, ssv) sv_catsv_macro(dsv, ssv)
+#undef sv_catpvn
#define sv_catpvn(dsv, sstr, slen) sv_catpvn_macro(dsv, sstr, slen)
+#undef sv_2pv
#define sv_2pv(sv, lp) sv_2pv_macro(sv, lp)
+#undef sv_pvn_force
#define sv_pvn_force(sv, lp) sv_pvn_force_macro(sv, lp)
+#undef sv_utf8_upgrade
#define sv_utf8_upgrade(sv) sv_utf8_upgrade_macro(sv)
#undef SvPV