either a pointer to a variable argument list or the address and length of
an array of SVs. The last argument points to a boolean; on return, if that
boolean is true, then locale-specific information has been used to format
-the string, and the string's contents are therefore untrustworty (see
+the string, and the string's contents are therefore untrustworthy (see
L<perlsec>). This pointer may be NULL if that information is not
important. Note that this function requires you to specify the length of
the format.
you can use the following functions:
void sv_catpv(SV*, const char*);
- void sv_catpvn(SV*, const char*, int);
+ void sv_catpvn(SV*, const char*, STRLEN);
void sv_catpvf(SV*, const char*, ...);
void sv_catpvfn(SV*, const char*, STRLEN, va_list *, SV **, I32, bool);
void sv_catsv(SV*, SV*);
Copies string into an SV whose reference is C<rv>. Set length to 0 to let
Perl calculate the string length. SV is blessed if C<classname> is non-null.
- SV* sv_setref_pvn(SV* rv, const char* classname, PV iv, int length);
+ SV* sv_setref_pvn(SV* rv, const char* classname, PV iv, STRLEN length);
Tests whether the SV is blessed into the specified class. It does not
check inheritance relationships.
=item gv_fetchmethod_autoload
Returns the glob which contains the subroutine to call to invoke the
-method on the C<stash>. In fact in the presense of autoloading this may
+method on the C<stash>. In fact in the presence of autoloading this may
be the glob for "AUTOLOAD". In this case the corresponding variable
$AUTOLOAD is already setup.
=item newSVpv
Creates a new SV and copies a string into it. The reference count for the
-SV is set to 1. If C<len> is zero then Perl will compute the length.
+SV is set to 1. If C<len> is zero, Perl will compute the length using
+strlen(). For efficiency, consider using C<newSVpvn> instead.
SV* newSVpv (const char* s, STRLEN len)
Creates a new SV an initialize it with the string formatted like
C<sprintf>.
- SV* newSVpvf(const char* pat, ...);
+ SV* newSVpvf(const char* pat, ...)
=item newSVpvn
Creates a new SV and copies a string into it. The reference count for the
-SV is set to 1. If C<len> is zero then Perl will create a zero length
-string.
+SV is set to 1. Note that if C<len> is zero, Perl will create a zero length
+string. You are responsible for ensuring that the source string is at least
+C<len> bytes long.
SV* newSVpvn (const char* s, STRLEN len)
=item perl_get_cv
-Returns the CV of the specified Perl sub. If C<create> is set and the Perl
-variable does not exist then it will be created. If C<create> is not
-set and the variable does not exist then NULL is returned.
+Returns the CV of the specified Perl subroutine. If C<create> is set and
+the Perl subroutine does not exist then it will be declared (which has
+the same effect as saying C<sub name;>). If C<create> is not
+set and the subroutine does not exist then NULL is returned.
CV* perl_get_cv (const char* name, I32 create)
class. This is the function that implements C<UNIVERSAL::isa>. It works
for class names as well as for objects.
- bool sv_derived_from _((SV* sv, const char* name));
+ bool sv_derived_from (SV* sv, const char* name);
=item SvEND
Returns a pointer to the string in the SV, or a stringified form of the SV
if the SV does not contain a string. Handles 'get' magic.
- char* SvPV (SV* sv, int len)
+ char* SvPV (SV* sv, STRLEN len)
=item SvPV_force
Like <SvPV> but will force the SV into becoming a string (SvPOK). You
want force if you are going to update the SvPVX directly.
- char* SvPV_force(SV* sv, int len)
+ char* SvPV_force(SV* sv, STRLEN len)
=item SvPV_nolen
Returns a pointer to the string in the SV, or a stringified form of the SV
if the SV does not contain a string. Handles 'get' magic.
- char* SvPV (SV* sv)
+ char* SvPV_nolen (SV* sv)
=item SvPVX
to an SV. Uses an array of SVs if the C style variable argument list is
missing (NULL). Indicates if locale information has been used for formatting.
- void sv_catpvfn _((SV* sv, const char* pat, STRLEN patlen,
- va_list *args, SV **svargs, I32 svmax,
- bool *used_locale));
+ void sv_catpvfn (SV* sv, const char* pat, STRLEN patlen,
+ va_list *args, SV **svargs, I32 svmax,
+ bool *used_locale);
=item sv_vsetpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
Works like C<vcatpvfn> but copies the text into the SV instead of
appending it.
- void sv_setpvfn _((SV* sv, const char* pat, STRLEN patlen,
- va_list *args, SV **svargs, I32 svmax,
- bool *used_locale));
+ void sv_setpvfn (SV* sv, const char* pat, STRLEN patlen,
+ va_list *args, SV **svargs, I32 svmax,
+ bool *used_locale);
=item SvUV