From: John Peacock Date: Tue, 25 Dec 2001 06:02:12 +0000 (-0500) Subject: Re: Not OK 13881 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c9e965c652c539b7064f0b192c92dbee8a21bcc;p=p5sagit%2Fp5-mst-13.2.git Re: Not OK 13881 Message-ID: <3C285CB4.8040006@rowman.com> p4raw-id: //depot/perl@13883 --- diff --git a/embed.h b/embed.h index 0d0ebe4..b75a8ab 100644 --- a/embed.h +++ b/embed.h @@ -1203,6 +1203,9 @@ #define sv_pvn_force_flags Perl_sv_pvn_force_flags #define sv_2pv_flags Perl_sv_2pv_flags #define my_atof2 Perl_my_atof2 +#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) +#define my_socketpair Perl_my_socketpair +#endif #if defined(USE_PERLIO) && !defined(USE_SFIO) #define PerlIO_close Perl_PerlIO_close #define PerlIO_fill Perl_PerlIO_fill @@ -2741,6 +2744,9 @@ #define sv_pvn_force_flags(a,b,c) Perl_sv_pvn_force_flags(aTHX_ a,b,c) #define sv_2pv_flags(a,b,c) Perl_sv_2pv_flags(aTHX_ a,b,c) #define my_atof2(a,b) Perl_my_atof2(aTHX_ a,b) +#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) +#define my_socketpair(a,b,c,d) Perl_my_socketpair(aTHX_ a,b,c,d) +#endif #if defined(USE_PERLIO) && !defined(USE_SFIO) #define PerlIO_close(a) Perl_PerlIO_close(aTHX_ a) #define PerlIO_fill(a) Perl_PerlIO_fill(aTHX_ a) diff --git a/embed.pl b/embed.pl index bfd8211..515fa11 100755 --- a/embed.pl +++ b/embed.pl @@ -1277,7 +1277,7 @@ p |PADOFFSET|find_threadsv|const char *name #endif p |OP* |force_list |OP* arg p |OP* |fold_constants |OP* arg -Afp |char* |form |const char* pat|... +Afpd |char* |form |const char* pat|... Ap |char* |vform |const char* pat|va_list* args Ap |void |free_tmps p |OP* |gen_constant_list|OP* o diff --git a/global.sym b/global.sym index a9fb16a..4710ebb 100644 --- a/global.sym +++ b/global.sym @@ -604,6 +604,7 @@ Perl_sv_utf8_upgrade_flags Perl_sv_pvn_force_flags Perl_sv_2pv_flags Perl_my_atof2 +Perl_my_socketpair Perl_PerlIO_close Perl_PerlIO_fill Perl_PerlIO_fileno diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 3f82777..ee5d65a 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -465,6 +465,26 @@ then. =for hackers Found in file util.c +=item form + +Takes a sprintf-style format pattern and conventional +(non-SV) arguments and returns the formatted string. + + (char *) Perl_form(pTHX_ const char* pat, ...) + +can be used any place a string (char *) is required: + + char * s = Perl_form("%d.%d",major,minor); + +Uses a single private buffer so if you want to format several strings you +must explicitly copy the earlier strings away (and free the copies when you +are done). + + char* form(const char* pat, ...) + +=for hackers +Found in file util.c + =item FREETMPS Closing bracket for temporaries on a callback. See C and @@ -1420,17 +1440,6 @@ SV is B incremented. =for hackers Found in file sv.c -=item newSV - -Create a new null SV, or if len > 0, create a new empty SVt_PV type SV -with an initial PV allocation of len+1. Normally accessed via the C -macro. - - SV* newSV(STRLEN len) - -=for hackers -Found in file sv.c - =item NEWSV Creates a new SV. A non-zero C parameter indicates the number of @@ -1444,6 +1453,17 @@ C is an integer id between 0 and 1299 (used to identify leaks). =for hackers Found in file handy.h +=item newSV + +Create a new null SV, or if len > 0, create a new empty SVt_PV type SV +with an initial PV allocation of len+1. Normally accessed via the C +macro. + + SV* newSV(STRLEN len) + +=for hackers +Found in file sv.c + =item newSViv Creates a new SV and copies an integer into it. The reference count for the @@ -2996,22 +3016,22 @@ for a version which guarantees to evaluate sv only once. =for hackers Found in file sv.h -=item SvUVX +=item SvUVx -Returns the raw value in the SV's UV slot, without checks or conversions. -Only use when you are sure SvIOK is true. See also C. +Coerces the given SV to an unsigned integer and returns it. Guarantees to +evaluate sv only once. Use the more efficient C otherwise. - UV SvUVX(SV* sv) + UV SvUVx(SV* sv) =for hackers Found in file sv.h -=item SvUVx +=item SvUVX -Coerces the given SV to an unsigned integer and returns it. Guarantees to -evaluate sv only once. Use the more efficient C otherwise. +Returns the raw value in the SV's UV slot, without checks or conversions. +Only use when you are sure SvIOK is true. See also C. - UV SvUVx(SV* sv) + UV SvUVX(SV* sv) =for hackers Found in file sv.h diff --git a/util.c b/util.c index 09af1de..eaf169a 100644 --- a/util.c +++ b/util.c @@ -948,6 +948,25 @@ Perl_form_nocontext(const char* pat, ...) } #endif /* PERL_IMPLICIT_CONTEXT */ +/* +=for apidoc form + +Takes a sprintf-style format pattern and conventional +(non-SV) arguments and returns the formatted string. + + (char *) Perl_form(pTHX_ const char* pat, ...) + +can be used any place a string (char *) is required: + + char * s = Perl_form("%d.%d",major,minor); + +Uses a single private buffer so if you want to format several strings you +must explicitly copy the earlier strings away (and free the copies when you +are done). + +=cut +*/ + char * Perl_form(pTHX_ const char* pat, ...) {