Change 18873 by [EMAIL PROTECTED] on 2003/03/10 05:18:02
Bunch of doc patches from Stas; plus regen.
Subject: [doc patch] perl.c's pod api entry
From: Stas Bekman <[EMAIL PROTECTED]>
Date: Mon, 10 Mar 2003 12:35:52 +1100
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: [patch] perlguts.pod
From: Stas Bekman <[EMAIL PROTECTED]>
Date: Mon, 10 Mar 2003 12:38:57 +1100
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: [PATCH ext/DynaLoader/DynaLoader_pm.PL] doc fix:
s/dl_loadflags/dl_load_flags/
From: Stas Bekman <[EMAIL PROTECTED]>
Date: Mon, 10 Mar 2003 12:41:46 +1100
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: [patch] perlapi.pod fix
From: Stas Bekman <[EMAIL PROTECTED]>
Date: Mon, 10 Mar 2003 12:43:33 +1100
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: [docs patch] replace gets() with fgets() in example
From: Stas Bekman <[EMAIL PROTECTED]>
Date: Mon, 10 Mar 2003 12:45:41 +1100
Message-ID: <[EMAIL PROTECTED]>
Subject: [doc patch] perlrun.pod
From: Stas Bekman <[EMAIL PROTECTED]>
Date: Mon, 10 Mar 2003 14:49:59 +1100
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/ext/DynaLoader/DynaLoader_pm.PL#29 edit
... //depot/perl/handy.h#59 edit
... //depot/perl/perl.c#472 edit
... //depot/perl/pod/perlapi.pod#152 edit
... //depot/perl/pod/perlembed.pod#33 edit
... //depot/perl/pod/perlguts.pod#113 edit
... //depot/perl/pod/perlrun.pod#84 edit
Differences ...
==== //depot/perl/ext/DynaLoader/DynaLoader_pm.PL#29 (text) ====
Index: perl/ext/DynaLoader/DynaLoader_pm.PL
--- perl/ext/DynaLoader/DynaLoader_pm.PL#28~17376~ Fri Jun 28 06:15:17 2002
+++ perl/ext/DynaLoader/DynaLoader_pm.PL Sun Mar 9 21:18:02 2003
@@ -769,11 +769,11 @@
Linux, and is a common choice when providing a "wrapper" on other
mechanisms as is done in the OS/2 port.)
-=item dl_loadflags()
+=item dl_load_flags()
Syntax:
- $flags = dl_loadflags $modulename;
+ $flags = dl_load_flags $modulename;
Designed to be a method call, and to be overridden by a derived class
(i.e. a class which has DynaLoader in its @ISA). The definition in
==== //depot/perl/handy.h#59 (text) ====
Index: perl/handy.h
--- perl/handy.h#58~18807~ Sun Mar 2 13:22:56 2003
+++ perl/handy.h Sun Mar 9 21:18:02 2003
@@ -25,6 +25,7 @@
=for apidoc AmU||Nullch
Null character pointer.
+
=for apidoc AmU||Nullsv
Null SV pointer.
==== //depot/perl/perl.c#472 (text) ====
Index: perl/perl.c
--- perl/perl.c#471~18843~ Thu Mar 6 13:59:02 2003
+++ perl/perl.c Sun Mar 9 21:18:02 2003
@@ -2083,7 +2083,7 @@
Tells Perl to C<require> the file named by the string argument. It is
analogous to the Perl code C<eval "require '$file'">. It's even
-implemented that way; consider using Perl_load_module instead.
+implemented that way; consider using load_module instead.
=cut */
==== //depot/perl/pod/perlapi.pod#152 (text+w) ====
Index: perl/pod/perlapi.pod
--- perl/pod/perlapi.pod#151~18781~ Tue Feb 25 17:11:14 2003
+++ perl/pod/perlapi.pod Sun Mar 9 21:18:02 2003
@@ -687,7 +687,7 @@
Tells Perl to C<require> the file named by the string argument. It is
analogous to the Perl code C<eval "require '$file'">. It's even
-implemented that way; consider using Perl_load_module instead.
+implemented that way; consider using load_module instead.
NOTE: the perl_ form of this function is deprecated.
@@ -915,6 +915,7 @@
=item Nullch
Null character pointer.
+
=for hackers
Found in file handy.h
@@ -4233,6 +4234,25 @@
Like C<sv_setpvf>, but also handles 'set' magic.
void sv_setpvf_mg(SV *sv, const char* pat, ...)
+
+=for hackers
+Found in file sv.c
+
+=item sv_setpviv
+
+Copies an integer into the given SV, also updating its string value.
+Does not handle 'set' magic. See C<sv_setpviv_mg>.
+
+ void sv_setpviv(SV* sv, IV num)
+
+=for hackers
+Found in file sv.c
+
+=item sv_setpviv_mg
+
+Like C<sv_setpviv>, but also handles 'set' magic.
+
+ void sv_setpviv_mg(SV *sv, IV iv)
=for hackers
Found in file sv.c
==== //depot/perl/pod/perlembed.pod#33 (text) ====
Index: perl/pod/perlembed.pod
--- perl/pod/perlembed.pod#32~18729~ Sun Feb 16 10:33:05 2003
+++ perl/pod/perlembed.pod Sun Mar 9 21:18:02 2003
@@ -750,6 +750,8 @@
#define DO_CLEAN 0
#endif
+ #define BUFFER_SIZE 1024
+
static PerlInterpreter *my_perl = NULL;
int
@@ -757,7 +759,7 @@
{
char *embedding[] = { "", "persistent.pl" };
char *args[] = { "", DO_CLEAN, NULL };
- char filename [1024];
+ char filename[BUFFER_SIZE];
int exitstatus = 0;
STRLEN n_a;
@@ -772,8 +774,10 @@
if(!exitstatus) {
exitstatus = perl_run(my_perl);
- while(printf("Enter file name: ") && gets(filename)) {
+ while(printf("Enter file name: ") &&
+ fgets(filename, BUFFER_SIZE, stdin)) {
+ filename[strlen(filename)-1] = '\0'; /* strip \n */
/* call the subroutine, passing it the filename as an argument */
args[0] = filename;
call_argv("Embed::Persistent::eval_file",
==== //depot/perl/pod/perlguts.pod#113 (text) ====
Index: perl/pod/perlguts.pod
--- perl/pod/perlguts.pod#112~18598~ Tue Jan 28 12:43:02 2003
+++ perl/pod/perlguts.pod Sun Mar 9 21:18:02 2003
@@ -1799,7 +1799,7 @@
sanctioned for use in extensions) begins like this:
void
- Perl_sv_setsv(pTHX_ SV* dsv, SV* ssv)
+ Perl_sv_setiv(pTHX_ SV* dsv, IV num)
C<pTHX_> is one of a number of macros (in perl.h) that hide the
details of the interpreter's context. THX stands for "thread", "this",
@@ -1818,19 +1818,19 @@
explicit arguments.
When a core function calls another, it must pass the context. This
-is normally hidden via macros. Consider C<sv_setsv>. It expands into
+is normally hidden via macros. Consider C<sv_setiv>. It expands into
something like this:
- ifdef PERL_IMPLICIT_CONTEXT
- define sv_setsv(a,b) Perl_sv_setsv(aTHX_ a, b)
+ #ifdef PERL_IMPLICIT_CONTEXT
+ #define sv_setiv(a,b) Perl_sv_setiv(aTHX_ a, b)
/* can't do this for vararg functions, see below */
- else
- define sv_setsv Perl_sv_setsv
- endif
+ #else
+ #define sv_setiv Perl_sv_setiv
+ #endif
This works well, and means that XS authors can gleefully write:
- sv_setsv(foo, bar);
+ sv_setiv(foo, bar);
and still have it work under all the modes Perl could have been
compiled with.
@@ -1874,16 +1874,16 @@
and aTHX_ macros to call a function that will return the context.
Thus, something like:
- sv_setsv(asv, bsv);
+ sv_setiv(sv, num);
in your extension will translate to this when PERL_IMPLICIT_CONTEXT is
in effect:
- Perl_sv_setsv(Perl_get_context(), asv, bsv);
+ Perl_sv_setiv(Perl_get_context(), sv, num);
or to this otherwise:
- Perl_sv_setsv(asv, bsv);
+ Perl_sv_setiv(sv, num);
You have to do nothing new in your extension to get this; since
the Perl library provides Perl_get_context(), it will all just
==== //depot/perl/pod/perlrun.pod#84 (text) ====
Index: perl/pod/perlrun.pod
--- perl/pod/perlrun.pod#83~18848~ Fri Mar 7 00:40:52 2003
+++ perl/pod/perlrun.pod Sun Mar 9 21:18:02 2003
@@ -311,7 +311,7 @@
The read-only magic variable C<${^UNICODE}> reflects the numeric value
of this setting. This is variable is set during Perl startup and is
thereafter read-only. If you want runtime effects, use the three-arg
-open() (see L<perlfunc/open), the two-arg binmode() (see L<perlfunc/binmode>),
+open() (see L<perlfunc/open>), the two-arg binmode() (see L<perlfunc/binmode>),
and the C<open> pragma (see L<open>).
(In Perls earlier than 5.8.1 the C<-C> switch was a Win32-only switch
End of Patch.