summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Peacock <jpeacock@rowman.com>2001-12-25 01:02:12 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-25 15:56:49 +0000
commit7c9e965c652c539b7064f0b192c92dbee8a21bcc (patch)
tree8bec7dba8caa94efdcd93023f5c8266ea1dba311
parent763acdb292c461fc4a4211ff9618bbb2633f83b9 (diff)
downloadperl-7c9e965c652c539b7064f0b192c92dbee8a21bcc.tar.gz
Re: Not OK 13881
Message-ID: <3C285CB4.8040006@rowman.com> p4raw-id: //depot/perl@13883
-rw-r--r--embed.h6
-rwxr-xr-xembed.pl2
-rw-r--r--global.sym1
-rw-r--r--pod/perlapi.pod58
-rw-r--r--util.c19
5 files changed, 66 insertions, 20 deletions
diff --git a/embed.h b/embed.h
index 0d0ebe447a..b75a8abaa8 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 bfd8211a1a..515fa11ca4 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 a9fb16aca5..4710ebb225 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 3f82777366..ee5d65abeb 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<SAVETMPS> and
@@ -1420,17 +1440,6 @@ SV is B<not> 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<NEWSV>
-macro.
-
- SV* newSV(STRLEN len)
-
-=for hackers
-Found in file sv.c
-
=item NEWSV
Creates a new SV. A non-zero C<len> parameter indicates the number of
@@ -1444,6 +1453,17 @@ C<id> 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<NEWSV>
+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<SvUV()>.
+Coerces the given SV to an unsigned integer and returns it. Guarantees to
+evaluate sv only once. Use the more efficient C<SvUV> 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<SvUV> 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<SvUV()>.
- UV SvUVx(SV* sv)
+ UV SvUVX(SV* sv)
=for hackers
Found in file sv.h
diff --git a/util.c b/util.c
index 09af1de710..eaf169aa46 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, ...)
{