From: Simon Cozens Date: Mon, 24 Jul 2000 06:40:52 +0000 (+0000) Subject: av.c apidoc X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f3b76584ef7773843ba39a11b8bd91238af59f12;p=p5sagit%2Fp5-mst-13.2.git av.c apidoc Message-ID: p4raw-id: //depot/perl@6438 --- diff --git a/av.c b/av.c index 819887e..ef2c905 100644 --- a/av.c +++ b/av.c @@ -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 from the array. Returns the +deleted element. C 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 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) { diff --git a/embed.pl b/embed.pl index 27d6bce..a3adadc 100755 --- a/embed.pl +++ b/embed.pl @@ -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 6ee8fc4..89c8824 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 diff --git a/objXSUB.h b/objXSUB.h index 0209fd3..fb501c3 100644 --- a/objXSUB.h +++ b/objXSUB.h @@ -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 diff --git a/perlapi.c b/perlapi.c index 6a54b94..cecc697 100644 --- a/perlapi.c +++ b/perlapi.c @@ -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 6bf970a..c7edea9 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 from the array. Returns the +deleted element. C 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 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 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