diff options
author | Simon Cozens <simon@netthink.co.uk> | 2000-07-24 06:40:52 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-07-25 15:41:15 +0000 |
commit | f3b76584ef7773843ba39a11b8bd91238af59f12 (patch) | |
tree | 9fe51961c6802f7a863938ffd299365128bc772d | |
parent | db22727b1cdf038cfb2d069831d76310ffc4b838 (diff) | |
download | perl-f3b76584ef7773843ba39a11b8bd91238af59f12.tar.gz |
av.c apidoc
Message-ID: <slrn8nnp7k.cgv.simon@justanother.perlhacker.org>
p4raw-id: //depot/perl@6438
-rw-r--r-- | av.c | 27 | ||||
-rwxr-xr-x | embed.pl | 10 | ||||
-rw-r--r-- | global.sym | 2 | ||||
-rw-r--r-- | objXSUB.h | 8 | ||||
-rw-r--r-- | perlapi.c | 14 | ||||
-rw-r--r-- | pod/perlapi.pod | 32 |
6 files changed, 61 insertions, 32 deletions
@@ -661,6 +661,14 @@ Perl_av_len(pTHX_ register AV *av) return AvFILL(av); } +/* +=for apidoc av_fill + +Ensure than an array has a given number of elements, equivalent to +Perl's C<$#array = $fill;>. + +=cut +*/ void Perl_av_fill(pTHX_ register AV *av, I32 fill) { @@ -708,6 +716,14 @@ Perl_av_fill(pTHX_ register AV *av, I32 fill) (void)av_store(av,fill,&PL_sv_undef); } +/* +=for apidoc av_delete + +Deletes the element indexed by C<key> from the array. Returns the +deleted element. C<flags> is currently ignored. + +=cut +*/ SV * Perl_av_delete(pTHX_ AV *av, I32 key, I32 flags) { @@ -758,10 +774,15 @@ Perl_av_delete(pTHX_ AV *av, I32 key, I32 flags) } /* - * This relies on the fact that uninitialized array elements - * are set to &PL_sv_undef. - */ +=for apidoc av_exists + +Returns true if the element indexed by C<key> has been initialized. +This relies on the fact that uninitialized array elements are set to +C<&PL_sv_undef>. + +=cut +*/ bool Perl_av_exists(pTHX_ AV *av, I32 key) { @@ -1388,17 +1388,17 @@ Ap |HE* |avhv_iternext |AV *ar Ap |SV* |avhv_iterval |AV *ar|HE* entry Ap |HV* |avhv_keys |AV *ar Apd |void |av_clear |AV* ar -Ap |SV* |av_delete |AV* ar|I32 key|I32 flags -Ap |bool |av_exists |AV* ar|I32 key +Apd |SV* |av_delete |AV* ar|I32 key|I32 flags +Apd |bool |av_exists |AV* ar|I32 key Apd |void |av_extend |AV* ar|I32 key -Ap |AV* |av_fake |I32 size|SV** svp +p |AV* |av_fake |I32 size|SV** svp Apd |SV** |av_fetch |AV* ar|I32 key|I32 lval -Ap |void |av_fill |AV* ar|I32 fill +Apd |void |av_fill |AV* ar|I32 fill Apd |I32 |av_len |AV* ar Apd |AV* |av_make |I32 size|SV** svp Apd |SV* |av_pop |AV* ar Apd |void |av_push |AV* ar|SV* val -Ap |void |av_reify |AV* ar +p |void |av_reify |AV* ar Apd |SV* |av_shift |AV* ar Apd |SV** |av_store |AV* ar|I32 key|SV* val Apd |void |av_undef |AV* ar diff --git a/global.sym b/global.sym index 6ee8fc4879..89c8824b93 100644 --- a/global.sym +++ b/global.sym @@ -33,14 +33,12 @@ Perl_av_clear Perl_av_delete Perl_av_exists Perl_av_extend -Perl_av_fake Perl_av_fetch Perl_av_fill Perl_av_len Perl_av_make Perl_av_pop Perl_av_push -Perl_av_reify Perl_av_shift Perl_av_store Perl_av_undef @@ -83,10 +83,6 @@ #define Perl_av_extend pPerl->Perl_av_extend #undef av_extend #define av_extend Perl_av_extend -#undef Perl_av_fake -#define Perl_av_fake pPerl->Perl_av_fake -#undef av_fake -#define av_fake Perl_av_fake #undef Perl_av_fetch #define Perl_av_fetch pPerl->Perl_av_fetch #undef av_fetch @@ -111,10 +107,6 @@ #define Perl_av_push pPerl->Perl_av_push #undef av_push #define av_push Perl_av_push -#undef Perl_av_reify -#define Perl_av_reify pPerl->Perl_av_reify -#undef av_reify -#define av_reify Perl_av_reify #undef Perl_av_shift #define Perl_av_shift pPerl->Perl_av_shift #undef av_shift @@ -169,13 +169,6 @@ Perl_av_extend(pTHXo_ AV* ar, I32 key) ((CPerlObj*)pPerl)->Perl_av_extend(ar, key); } -#undef Perl_av_fake -AV* -Perl_av_fake(pTHXo_ I32 size, SV** svp) -{ - return ((CPerlObj*)pPerl)->Perl_av_fake(size, svp); -} - #undef Perl_av_fetch SV** Perl_av_fetch(pTHXo_ AV* ar, I32 key, I32 lval) @@ -218,13 +211,6 @@ Perl_av_push(pTHXo_ AV* ar, SV* val) ((CPerlObj*)pPerl)->Perl_av_push(ar, val); } -#undef Perl_av_reify -void -Perl_av_reify(pTHXo_ AV* ar) -{ - ((CPerlObj*)pPerl)->Perl_av_reify(ar); -} - #undef Perl_av_shift SV* Perl_av_shift(pTHXo_ AV* ar) diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 6bf970a901..c7edea92cc 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -38,6 +38,28 @@ array itself. =for hackers Found in file av.c +=item av_delete + +Deletes the element indexed by C<key> from the array. Returns the +deleted element. C<flags> is currently ignored. + + SV* av_delete(AV* ar, I32 key, I32 flags) + +=for hackers +Found in file av.c + +=item av_exists + +Returns true if the element indexed by C<key> has been initialized. + +This relies on the fact that uninitialized array elements are set to +C<&PL_sv_undef>. + + bool av_exists(AV* ar, I32 key) + +=for hackers +Found in file av.c + =item av_extend Pre-extend an array. The C<key> is the index to which the array should be @@ -62,6 +84,16 @@ more information on how to use this function on tied arrays. =for hackers Found in file av.c +=item av_fill + +Ensure than an array has a given number of elements, equivalent to +Perl's C<$#array = $fill;>. + + void av_fill(AV* ar, I32 fill) + +=for hackers +Found in file av.c + =item av_len Returns the highest index in the array. Returns -1 if the array is |