This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
av.c apidoc
authorSimon Cozens <simon@netthink.co.uk>
Mon, 24 Jul 2000 06:40:52 +0000 (06:40 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 25 Jul 2000 15:41:15 +0000 (15:41 +0000)
Message-ID: <slrn8nnp7k.cgv.simon@justanother.perlhacker.org>

p4raw-id: //depot/perl@6438

av.c
embed.pl
global.sym
objXSUB.h
perlapi.c
pod/perlapi.pod

diff --git a/av.c b/av.c
index 819887e..ef2c905 100644 (file)
--- 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<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)
 {
index 27d6bce..a3adadc 100755 (executable)
--- 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
+     |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
+     |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
index 6ee8fc4..89c8824 100644 (file)
@@ -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
index 0209fd3..fb501c3 100644 (file)
--- a/objXSUB.h
+++ b/objXSUB.h
 #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
 #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
index 6a54b94..cecc697 100644 (file)
--- 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)
index 6bf970a..c7edea9 100644 (file)
@@ -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