=for hackers
Found in file sv.c
-=item new_vstring
+=item new_version
+
+Returns a new version object based on the passed in SV:
+
+ SV *sv = new_version(SV *ver);
+
+Does not alter the passed in ver SV. See "upg_version" if you
+want to upgrade the SV.
+
+ SV* new_version(SV *ver)
+
+=for hackers
+Found in file util.c
+
+=item scan_version
+
+Returns a pointer to the next character after the parsed
+version string, as well as upgrading the passed in SV to
+an RV.
+
+Function must be called with an already existing SV like
+
+ sv = NEWSV(92,0);
+ s = scan_version(s,sv);
+
+Performs some preprocessing to the string to ensure that
+it has the correct characteristics of a version. Flags the
+object if it contains an underscore (which denotes this
+is a beta version).
+
+ char* scan_version(char *vstr, SV *sv)
+
+=for hackers
+Found in file util.c
+
+=item scan_vstring
Returns a pointer to the next character after the parsed
vstring, as well as updating the passed in sv.
Function must be called like
- sv = NEWSV(92,5);
- s = new_vstring(s,sv);
+ sv = NEWSV(92,5);
+ s = scan_vstring(s,sv);
-The sv must already be large enough to store the vstring
-passed in.
+The sv should already be large enough to store the vstring
+passed in, for performance reasons.
- char* new_vstring(char *vstr, SV *sv)
+ char* scan_vstring(char *vstr, SV *sv)
=for hackers
Found in file util.c
=for hackers
Found in file sv.h
+=item SvVOK
+
+Returns a boolean indicating whether the SV contains a v-string.
+
+ bool SvVOK(SV* sv)
+
+=for hackers
+Found in file sv.h
+
=item sv_2bool
This function is only called on magical items, and is only used by
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. The C<flags> parameter gets passed to C<sv_unref_flags()>
-when unrefing. C<sv_force_normal> calls this function with flags set to 0.
+an xpvmg; if we're a copy-on-write scalar, this is the on-write time when
+we do the copy, and is also used locally. If C<SV_COW_DROP_PV> is set
+then a copy-on-write scalar drops its PV buffer (if any) and becomes
+SvPOK_off rather than making a copy. (Used where this scalar is about to be
+set to some other value. In addtion, the C<flags> parameter gets passed to
+C<sv_unref_flags()> when unrefing. C<sv_force_normal> calls this function
+with flags set to 0.
void sv_force_normal_flags(SV *sv, U32 flags)
=for hackers
Found in file sv.c
+=item upg_version
+
+In-place upgrade of the supplied SV to a version object.
+
+ SV *sv = upg_version(SV *sv);
+
+Returns a pointer to the upgraded SV.
+
+ SV* upg_version(SV *ver)
+
+=for hackers
+Found in file util.c
+
+=item vnumify
+
+Accepts a version (or vstring) object and returns the
+normalized floating point representation. Call like:
+
+ sv = vnumify(sv,SvRV(rv));
+
+NOTE: no checking is done to see if the object is of the
+correct type (for speed).
+
+ SV* vnumify(SV *sv, SV *vs)
+
+=for hackers
+Found in file util.c
+
+=item vstringify
+
+Accepts a version (or vstring) object and returns the
+normalized representation. Call like:
+
+ sv = vstringify(sv,SvRV(rv));
+
+NOTE: no checking is done to see if the object is of the
+correct type (for speed).
+
+ SV* vstringify(SV *sv, SV *vs)
+
+=for hackers
+Found in file util.c
+
=back