Make S_readpipe_override() compile with threads; regenerate perlapi.pod
Rafael Garcia-Suarez [Tue, 31 Oct 2006 13:49:26 +0000 (13:49 +0000)]
p4raw-id: //depot/perl@29169

embed.fnc
embed.h
pod/perlapi.pod
proto.h
toke.c

index d3a1e27..819bf43 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1453,6 +1453,7 @@ s |char*  |force_word     |NN char *start|int token|int check_keyword \
                                |int allow_pack|int allow_tick
 s      |SV*    |tokeq          |NN SV *sv
 s      |int    |pending_ident
+s      |void   |readpipe_override|
 sR     |char*  |scan_const     |NN char *start
 sR     |char*  |scan_formline  |NN char *s
 sR     |char*  |scan_heredoc   |NN char *s
diff --git a/embed.h b/embed.h
index e6b1af3..9241cc6 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define force_word             S_force_word
 #define tokeq                  S_tokeq
 #define pending_ident          S_pending_ident
+#define readpipe_override      S_readpipe_override
 #define scan_const             S_scan_const
 #define scan_formline          S_scan_formline
 #define scan_heredoc           S_scan_heredoc
 #define force_word(a,b,c,d,e)  S_force_word(aTHX_ a,b,c,d,e)
 #define tokeq(a)               S_tokeq(aTHX_ a)
 #define pending_ident()                S_pending_ident(aTHX)
+#define readpipe_override()    S_readpipe_override(aTHX)
 #define scan_const(a)          S_scan_const(aTHX_ a)
 #define scan_formline(a)       S_scan_formline(aTHX_ a)
 #define scan_heredoc(a)                S_scan_heredoc(aTHX_ a)
index 64bb6b8..3ea050e 100644 (file)
@@ -188,9 +188,15 @@ Found in file av.c
 =item av_fill
 X<av_fill>
 
-Ensure than an array has a given number of elements, equivalent to
+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<fill + 1> after
+av_fill() returns.  If the array was previously shorter then the
+additional elements appended are set to C<PL_sv_undef>.  If the array
+was longer, then the excess elements are freed.  C<av_fill(av, -1)> is
+the same as C<av_clear(av)>.
+
        void    av_fill(AV* ar, I32 fill)
 
 =for hackers
@@ -199,8 +205,8 @@ Found in file av.c
 =item av_len
 X<av_len>
 
-Returns the highest index in the array.  Returns -1 if the array is
-empty.
+Returns the highest index in the array.  The number of elements in the
+array is C<av_len(av) + 1>.  Returns -1 if the array is empty.
 
        I32     av_len(const AV* ar)
 
diff --git a/proto.h b/proto.h
index 951ee4d..2e75d90 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -3919,6 +3919,7 @@ STATIC SV*        S_tokeq(pTHX_ SV *sv)
                        __attribute__nonnull__(pTHX_1);
 
 STATIC int     S_pending_ident(pTHX);
+STATIC void    S_readpipe_override(pTHX);
 STATIC char*   S_scan_const(pTHX_ char *start)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
diff --git a/toke.c b/toke.c
index 40b5465..dcc0050 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -2854,7 +2854,7 @@ S_find_in_my_stash(pTHX_ const char *pkgname, I32 len)
  * optree, provided sublex_start() is called afterwards.
  */
 STATIC void
-S_readpipe_override()
+S_readpipe_override(pTHX)
 {
     GV **gvp;
     GV *gv_readpipe = gv_fetchpvs("readpipe", GV_NOTQUAL, SVt_PVCV);
@@ -4987,7 +4987,7 @@ Perl_yylex(pTHX)
            no_op("Backticks",s);
        if (!s)
            missingterm(NULL);
-       S_readpipe_override();
+       readpipe_override(aTHX);
        TERM(sublex_start());
 
     case '\\':
@@ -6306,7 +6306,7 @@ Perl_yylex(pTHX)
            s = scan_str(s,!!PL_madskills,FALSE);
            if (!s)
                missingterm(NULL);
-           S_readpipe_override();
+           readpipe_override(aTHX);
            TERM(sublex_start());
 
        case KEY_return: