Mass Deface
A backward-compatible version of C which can only return
C or C; in a void context, it returns C.
Deprecated. Use C instead.
U32 GIMME
=for hackers
Found in file op.h
=item GIMME_V
X
The XSUB-writer's equivalent to Perl's C. Returns C,
C or C for void, scalar or list context,
respectively. See L for a usage example.
U32 GIMME_V
=for hackers
Found in file op.h
=item G_ARRAY
X
Used to indicate list context. See C, C and
L.
=for hackers
Found in file cop.h
=item G_DISCARD
X
Indicates that arguments returned from a callback should be discarded. See
L.
=for hackers
Found in file cop.h
=item G_EVAL
X
Used to force a Perl C wrapper around a callback. See
L.
=for hackers
Found in file cop.h
=item G_NOARGS
X
Indicates that no arguments are being sent to a callback. See
L.
=for hackers
Found in file cop.h
=item G_SCALAR
X
Used to indicate scalar context. See C, C, and
L.
=for hackers
Found in file cop.h
=item G_VOID
X
Used to indicate void context. See C and L.
=for hackers
Found in file cop.h
=back
=head1 Array Manipulation Functions
=over 8
=item AvFILL
X
Same as C. Deprecated, use C instead.
int AvFILL(AV* av)
=for hackers
Found in file av.h
=item av_clear
X
Clears an array, making it empty. Does not free the memory the av uses to
store its list of scalars. If any destructors are triggered as a result,
the av itself may be freed when this function returns.
Perl equivalent: C<@myarray = ();>.
void av_clear(AV *av)
=for hackers
Found in file av.c
=item av_create_and_push
X
Push an SV onto the end of the array, creating the array if necessary.
A small internal helper function to remove a commonly duplicated idiom.
NOTE: this function is experimental and may change or be
removed without notice.
void av_create_and_push(AV **const avp,
SV *const val)
=for hackers
Found in file av.c
=item av_create_and_unshift_one
X
Unshifts an SV onto the beginning of the array, creating the array if
necessary.
A small internal helper function to remove a commonly duplicated idiom.
NOTE: this function is experimental and may change or be
removed without notice.
SV** av_create_and_unshift_one(AV **const avp,
SV *const val)
=for hackers
Found in file av.c
=item av_delete
X
Deletes the element indexed by C from the array, makes the element mortal,
and returns it. If C equals C, the element is freed and null
is returned. Perl equivalent: C for the
non-C version and a void-context C for the
C version.
SV* av_delete(AV *av, I32 key, I32 flags)
=for hackers
Found in file av.c
=item av_exists
X
Returns true if the element indexed by C has been initialized.
This relies on the fact that uninitialized array elements are set to
C<&PL_sv_undef>.
Perl equivalent: C.
bool av_exists(AV *av, I32 key)
=for hackers
Found in file av.c
=item av_extend
X
Pre-extend an array. The C is the index to which the array should be
extended.
void av_extend(AV *av, I32 key)
=for hackers
Found in file av.c
=item av_fetch
X
Returns the SV at the specified index in the array. The C is the
index. If lval is true, you are guaranteed to get a real SV back (in case
it wasn't real before), which you can then modify. Check that the return
value is non-null before dereferencing it to a C.
See L for
more information on how to use this function on tied arrays.
The rough perl equivalent is C<$myarray[$idx]>.
SV** av_fetch(AV *av, I32 key, I32 lval)
=for hackers
Found in file av.c
=item av_fill
X
Set the highest index in the array to the given number, equivalent to
Perl's C<$#array = $fill;>.
The number of elements in the an array will be C after
av_fill() returns. If the array was previously shorter, then the
additional elements appended are set to C. If the array
was longer, then the excess elements are freed. C is
the same as C.
void av_fill(AV *av, I32 fill)
=for hackers
Found in file av.c
=item av_len
X
Returns the highest index in the array. The number of elements in the
array is C. Returns -1 if the array is empty.
The Perl equivalent for this is C<$#myarray>.
I32 av_len(AV *av)
=for hackers
Found in file av.c
=item av_make
X
Creates a new AV and populates it with a list of SVs. The SVs are copied
into the array, so they may be freed after the call to av_make. The new AV
will have a reference count of 1.
Perl equivalent: C
AV* av_make(I32 size, SV **strp)
=for hackers
Found in file av.c
=item av_pop
X
Pops an SV off the end of the array. Returns C<&PL_sv_undef> if the array
is empty.
Perl equivalent: C
SV* av_pop(AV *av)
=for hackers
Found in file av.c
=item av_push
X
Pushes an SV onto the end of the array. The array will grow automatically
to accommodate the addition. This takes ownership of one reference count.
Perl equivalent: C.
void av_push(AV *av, SV *val)
=for hackers
Found in file av.c
=item av_shift
X
Shifts an SV off the beginning of the
array. Returns C<&PL_sv_undef> if the
array is empty.
Perl equivalent: C
SV* av_shift(AV *av)
=for hackers
Found in file av.c
=item av_store
X
Stores an SV in an array. The array index is specified as C. The
return value will be NULL if the operation failed or if the value did not
need to be actually stored within the array (as in the case of tied
arrays). Otherwise, it can be dereferenced
to get the C that was stored
there (= C)).
Note that the caller is responsible for suitably incrementing the reference
count of C before the call, and decrementing it if the function
returned NULL.
Approximate Perl equivalent: C<$myarray[$key] = $val;>.
See L for
more information on how to use this function on tied arrays.
SV** av_store(AV *av, I32 key, SV *val)
=for hackers
Found in file av.c
=item av_undef
X
Undefines the array. Frees the memory used by the av to store its list of
scalars. If any destructors are triggered as a result, the av itself may
be freed.
void av_undef(AV *av)
=for hackers
Found in file av.c
=item av_unshift
X
Unshift the given number of C values onto the beginning of the
array. The array will grow automatically to accommodate the addition. You
must then use C to assign values to these new elements.
Perl equivalent: C
void av_unshift(AV *av, I32 num)
=for hackers
Found in file av.c
=item get_av
X
Returns the AV of the specified Perl global or package array with the given
name (so it won't work on lexical variables). C are passed
to C. If C is set and the
Perl variable does not exist then it will be created. If C is zero
and the variable does not exist then NULL is returned.
Perl equivalent: C<@{"$name"}>.
NOTE: the perl_ form of this function is deprecated.
AV* get_av(const char *name, I32 flags)
=for hackers
Found in file perl.c
=item newAV
X
Creates a new AV. The reference count is set to 1.
Perl equivalent: C.
AV* newAV()
=for hackers
Found in file av.h
=item sortsv
X
Sort an array. Here is an example:
sortsv(AvARRAY(av), av_len(av)+1, Perl_sv_cmp_locale);
Currently this always uses mergesort. See sortsv_flags for a more
flexible routine.
void sortsv(SV** array, size_t num_elts,
SVCOMPARE_t cmp)
=for hackers
Found in file pp_sort.c
=item sortsv_flags
X
Sort an array, with various options.
void sortsv_flags(SV** array, size_t num_elts,
SVCOMPARE_t cmp, U32 flags)
=for hackers
Found in file pp_sort.c
=back
=head1 Callback Functions
=over 8
=item call_argv
X
Performs a callback to the specified named and package-scoped Perl subroutine
with C (a NULL-terminated array of strings) as arguments. See L.
Approximate Perl equivalent: C<&{"$sub_name"}(@$argv)>.
NOTE: the perl_ form of this function is deprecated.
I32 call_argv(const char* sub_name, I32 flags,
char** argv)
=for hackers
Found in file perl.c
=item call_method
X
Performs a callback to the specified Perl method. The blessed object must
be on the stack. See L.
NOTE: the perl_ form of this function is deprecated.
I32 call_method(const char* methname, I32 flags)
=for hackers
Found in file perl.c
=item call_pv
X
Performs a callback to the specified Perl sub. See L.
NOTE: the perl_ form of this function is deprecated.
I32 call_pv(const char* sub_name, I32 flags)
=for hackers
Found in file perl.c
=item call_sv
X
Performs a callback to the Perl sub whose name is in the SV. See
L.
NOTE: the perl_ form of this function is deprecated.
I32 call_sv(SV* sv, VOL I32 flags)
=for hackers
Found in file perl.c
=item ENTER
X
Opening bracket on a callback. See C and L.
ENTER;
=for hackers
Found in file scope.h
=item eval_pv
X
Tells Perl to C the given string and return an SV* result.
NOTE: the perl_ form of this function is deprecated.
SV* eval_pv(const char* p, I32 croak_on_error)
=for hackers
Found in file perl.c
=item eval_sv
X
Tells Perl to C the string in the SV. It supports the same flags
as C, with the obvious exception of G_EVAL. See L.
NOTE: the perl_ form of this function is deprecated.
I32 eval_sv(SV* sv, I32 flags)
=for hackers
Found in file perl.c
=item FREETMPS
X
Closing bracket for temporaries on a callback. See C and
L.
FREETMPS;
=for hackers
Found in file scope.h
=item LEAVE
X
Closing bracket on a callback. See C and L.
LEAVE;
=for hackers
Found in file scope.h
=item SAVETMPS
X
Opening bracket for temporaries on a callback. See C and
L.
SAVETMPS;
=for hackers
Found in file scope.h
=back
=head1 Character case changing
=over 8
=item toLOWER
X
Converts the specified character to lowercase in the platform's native
character set, if possible; otherwise returns the input character itself.
char toLOWER(char ch)
=for hackers
Found in file handy.h
=item toUPPER
X
Converts the specified character to uppercase in the platform's native
character set, if possible; otherwise returns the input character itself.
char toUPPER(char ch)
=for hackers
Found in file handy.h
=back
=head1 Character classes
There are three variants for all the functions in this section. The base ones
operate using the character set of the platform Perl is running on. The ones
with an C<_A> suffix operate on the ASCII character set, and the ones with an
C<_L1> suffix operate on the full Latin1 character set. All are unaffected by
locale and by C