summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-03-16 16:22:58 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-03-16 16:22:58 +0000
commitbb13cb927b2b56cd314cd059be1c58034bedcc3b (patch)
treef3f389b2b11d7d56beb3557664f728d7f5d8dcac /pod
parent5476c4332a5540db7fc38bfabed95022b6c04b1b (diff)
parentb7afe3d5943df4dc5b5a482d4e543e4c94d92333 (diff)
downloadperl-bb13cb927b2b56cd314cd059be1c58034bedcc3b.tar.gz
Bump patchlevel.h to 63.
p4raw-id: //depot/perl@822
Diffstat (limited to 'pod')
-rw-r--r--pod/perlcall.pod53
-rw-r--r--pod/perlembed.pod4
-rw-r--r--pod/perlguts.pod10
-rw-r--r--pod/perlxs.pod4
4 files changed, 37 insertions, 34 deletions
diff --git a/pod/perlcall.pod b/pod/perlcall.pod
index f90e09f238..865d3bf88d 100644
--- a/pod/perlcall.pod
+++ b/pod/perlcall.pod
@@ -404,7 +404,7 @@ via this XSUB
void
Call_fred()
CODE:
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
perl_call_pv("fred", G_DISCARD|G_NOARGS) ;
fprintf(stderr, "back in Call_fred\n") ;
@@ -421,7 +421,7 @@ higher, or use the G_EVAL flag with I<perl_call_*> as shown below
void
Call_fred()
CODE:
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
perl_call_pv("fred", G_EVAL|G_DISCARD|G_NOARGS) ;
fprintf(stderr, "back in Call_fred\n") ;
@@ -462,7 +462,7 @@ and here is a C function to call it
{
dSP ;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
perl_call_pv("PrintUID", G_DISCARD|G_NOARGS) ;
}
@@ -474,7 +474,7 @@ A few points to note about this example.
=item 1.
-Ignore C<dSP> and C<PUSHMARK(sp)> for now. They will be discussed in
+Ignore C<dSP> and C<PUSHMARK(SP)> for now. They will be discussed in
the next example.
=item 2.
@@ -526,7 +526,7 @@ The C function required to call I<LeftString> would look like this.
{
dSP ;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSVpv(a, 0)));
XPUSHs(sv_2mortal(newSViv(b)));
PUTBACK ;
@@ -542,8 +542,9 @@ Here are a few notes on the C function I<call_LeftString>.
Parameters are passed to the Perl subroutine using the Perl stack.
This is the purpose of the code beginning with the line C<dSP> and
-ending with the line C<PUTBACK>.
-
+ending with the line C<PUTBACK>. The C<dSP> declares a local copy
+of the stack pointer. This local copy should B<always> be accessed
+as C<SP>.
=item 2.
@@ -630,7 +631,7 @@ function required to call it is now a bit more complex.
ENTER ;
SAVETMPS;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSViv(a)));
XPUSHs(sv_2mortal(newSViv(b)));
PUTBACK ;
@@ -766,7 +767,7 @@ and this is the C function
ENTER ;
SAVETMPS;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSViv(a)));
XPUSHs(sv_2mortal(newSViv(b)));
PUTBACK ;
@@ -829,7 +830,7 @@ context, like this
ENTER ;
SAVETMPS;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSViv(a)));
XPUSHs(sv_2mortal(newSViv(b)));
PUTBACK ;
@@ -897,7 +898,7 @@ and here is a C function to call it.
sva = sv_2mortal(newSViv(a)) ;
svb = sv_2mortal(newSViv(b)) ;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
XPUSHs(sva);
XPUSHs(svb);
PUTBACK ;
@@ -954,7 +955,7 @@ and some C to call it
ENTER ;
SAVETMPS;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSViv(a)));
XPUSHs(sv_2mortal(newSViv(b)));
PUTBACK ;
@@ -1087,7 +1088,7 @@ Here is a snippet of XSUB which defines I<CallSubPV>.
CallSubPV(name)
char * name
CODE:
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
perl_call_pv(name, G_DISCARD|G_NOARGS) ;
That is fine as far as it goes. The thing is, the Perl subroutine
@@ -1103,7 +1104,7 @@ I<perl_call_sv> instead of I<perl_call_pv>.
CallSubSV(name)
SV * name
CODE:
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
perl_call_sv(name, G_DISCARD|G_NOARGS) ;
Because we are using an SV to call I<fred> the following can all be used
@@ -1133,7 +1134,7 @@ pointer to the SV. Say the code above had been like this
void
CallSavedSub1()
CODE:
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
perl_call_sv(rememberSub, G_DISCARD|G_NOARGS) ;
The reason this is wrong is that by the time you come to use the
@@ -1209,7 +1210,7 @@ SV. The code below shows C<SaveSub2> modified to do that
void
CallSavedSub2()
CODE:
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
perl_call_sv(keepSub, G_DISCARD|G_NOARGS) ;
To avoid creating a new SV every time C<SaveSub2> is called,
@@ -1318,7 +1319,7 @@ the C<PrintID> and C<Display> methods from C.
char * method
int index
CODE:
- PUSHMARK(sp);
+ PUSHMARK(SP);
XPUSHs(ref);
XPUSHs(sv_2mortal(newSViv(index))) ;
PUTBACK;
@@ -1330,7 +1331,7 @@ the C<PrintID> and C<Display> methods from C.
char * class
char * method
CODE:
- PUSHMARK(sp);
+ PUSHMARK(SP);
XPUSHs(sv_2mortal(newSVpv(class, 0))) ;
PUTBACK;
@@ -1522,7 +1523,7 @@ Now change that to call a Perl subroutine instead
{
dSP ;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
/* Call the Perl sub to process the callback */
perl_call_sv(callback, G_DISCARD) ;
@@ -1625,7 +1626,7 @@ and C<asynch_read_if> could look like this
if (sv == (SV**)NULL)
croak("Internal error...\n") ;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSViv(fh))) ;
XPUSHs(sv_2mortal(newSVpv(buffer, 0))) ;
PUTBACK ;
@@ -1709,7 +1710,7 @@ series of C functions to act as the interface to Perl, thus
{
dSP ;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSVpv(buffer, 0))) ;
PUTBACK ;
@@ -1863,7 +1864,7 @@ of values> recoded to use C<ST> instead of C<POP*>.
ENTER ;
SAVETMPS;
- PUSHMARK(sp) ;
+ PUSHMARK(SP) ;
XPUSHs(sv_2mortal(newSViv(a)));
XPUSHs(sv_2mortal(newSViv(b)));
PUTBACK ;
@@ -1871,8 +1872,8 @@ of values> recoded to use C<ST> instead of C<POP*>.
count = perl_call_pv("AddSubtract", G_ARRAY);
SPAGAIN ;
- sp -= count ;
- ax = (sp - stack_base) + 1 ;
+ SP -= count ;
+ ax = (SP - stack_base) + 1 ;
if (count != 2)
croak("Big trouble\n") ;
@@ -1901,8 +1902,8 @@ you.
The code
SPAGAIN ;
- sp -= count ;
- ax = (sp - stack_base) + 1 ;
+ SP -= count ;
+ ax = (SP - stack_base) + 1 ;
sets the stack up so that we can use the C<ST> macro.
diff --git a/pod/perlembed.pod b/pod/perlembed.pod
index e7164b58f9..32096789ec 100644
--- a/pod/perlembed.pod
+++ b/pod/perlembed.pod
@@ -370,7 +370,7 @@ been wrapped here):
dSP;
SV* retval;
- PUSHMARK(sp);
+ PUSHMARK(SP);
perl_eval_sv(sv, G_SCALAR);
SPAGAIN;
@@ -563,7 +563,7 @@ deep breath...
dSP; /* initialize stack pointer */
ENTER; /* everything created after here */
SAVETMPS; /* ...is a temporary variable. */
- PUSHMARK(sp); /* remember the stack pointer */
+ PUSHMARK(SP); /* remember the stack pointer */
XPUSHs(sv_2mortal(newSViv(a))); /* push the base onto the stack */
XPUSHs(sv_2mortal(newSViv(b))); /* push the exponent onto stack */
PUTBACK; /* make local stack pointer global */
diff --git a/pod/perlguts.pod b/pod/perlguts.pod
index e84e7e59a0..9b7cab627e 100644
--- a/pod/perlguts.pod
+++ b/pod/perlguts.pod
@@ -1088,10 +1088,10 @@ two, the local time zone's standard and summer time abbreviations.
To handle this situation, the PPCODE directive is used and the stack is
extended using the macro:
- EXTEND(sp, num);
+ EXTEND(SP, num);
-where C<sp> is the stack pointer, and C<num> is the number of elements the
-stack should be extended by.
+where C<SP> is the macro that represents the local copy of the stack pointer,
+and C<num> is the number of elements the stack should be extended by.
Now that there is room on the stack, values can be pushed on it using the
macros to push IVs, doubles, strings, and SV pointers respectively:
@@ -1144,6 +1144,7 @@ must manipulate the Perl stack. These include the following macros and
functions:
dSP
+ SP
PUSHMARK()
PUTBACK
SPAGAIN
@@ -1575,7 +1576,8 @@ The C variable which corresponds to Perl's $^W warning variable.
=item dSP
-Declares a stack pointer variable, C<sp>, for the XSUB. See C<SP>.
+Declares a local copy of perl's stack pointer for the XSUB, available via
+the C<SP> macro. See C<SP>.
=item dXSARGS
diff --git a/pod/perlxs.pod b/pod/perlxs.pod
index 07abd10564..d065b94425 100644
--- a/pod/perlxs.pod
+++ b/pod/perlxs.pod
@@ -558,7 +558,7 @@ Perl as a single list.
bool_t status;
PPCODE:
status = rpcb_gettime( host, &timep );
- EXTEND(sp, 2);
+ EXTEND(SP, 2);
PUSHs(sv_2mortal(newSViv(status)));
PUSHs(sv_2mortal(newSViv(timep)));
@@ -573,7 +573,7 @@ directive.
The EXTEND() macro is used to make room on the argument
stack for 2 return values. The PPCODE: directive causes the
-B<xsubpp> compiler to create a stack pointer called C<sp>, and it
+B<xsubpp> compiler to create a stack pointer available as C<SP>, and it
is this pointer which is being used in the EXTEND() macro.
The values are then pushed onto the stack with the PUSHs()
macro.