summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-06-07 05:18:34 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-06-07 05:18:34 +0000
commit864dbfa3ca8032ef66f7aa86961933b19b962357 (patch)
tree4186157b2fc82346ec83e789b065a908a56c1641 /pp.c
parentfdf134946da249a71c49962435817212b8fa195a (diff)
downloadperl-864dbfa3ca8032ef66f7aa86961933b19b962357.tar.gz
initial stub implementation of implicit thread/this
pointer argument; builds/tests on Solaris, win32 hasn't been fixed up yet; proto.h, global.sym and static function decls are now generated from a common database in proto.pl; some inconsistently named perl_foo() things are now Perl_foo(), compatibility #defines provided; perl_foo() (lowercase 'p') reserved for functions that take an explicit context argument; next step: generate #define foo(a,b) Perl_foo(aTHX_ a,b) p4raw-id: //depot/perl@3522
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/pp.c b/pp.c
index 7a3e3cbcd7..fed72bba70 100644
--- a/pp.c
+++ b/pp.c
@@ -13,6 +13,7 @@
*/
#include "EXTERN.h"
+#define PERL_IN_PP_C
#include "perl.h"
/*
@@ -110,12 +111,6 @@ typedef unsigned UBW;
# define CAT32(sv,p) sv_catpvn(sv, (char*)(p), SIZE32)
#endif
-#ifndef PERL_OBJECT
-static void doencodes (SV* sv, char* s, I32 len);
-static SV* refto (SV* sv);
-static U32 seed (void);
-#endif
-
/* variations on pp_null */
#ifdef I_UNISTD
@@ -521,7 +516,7 @@ PP(pp_refgen)
}
STATIC SV*
-refto(SV *sv)
+refto(pTHX_ SV *sv)
{
SV* rv;
@@ -1707,7 +1702,7 @@ PP(pp_srand)
}
STATIC U32
-seed(void)
+seed(pTHX)
{
/*
* This is really just a quick hack which grabs various garbage
@@ -2895,7 +2890,7 @@ PP(pp_splice)
PUSHMARK(MARK);
PUTBACK;
ENTER;
- perl_call_method("SPLICE",GIMME_V);
+ call_method("SPLICE",GIMME_V);
LEAVE;
SPAGAIN;
RETURN;
@@ -3089,7 +3084,7 @@ PP(pp_push)
PUSHMARK(MARK);
PUTBACK;
ENTER;
- perl_call_method("PUSH",G_SCALAR|G_DISCARD);
+ call_method("PUSH",G_SCALAR|G_DISCARD);
LEAVE;
SPAGAIN;
}
@@ -3145,7 +3140,7 @@ PP(pp_unshift)
PUSHMARK(MARK);
PUTBACK;
ENTER;
- perl_call_method("UNSHIFT",G_SCALAR|G_DISCARD);
+ call_method("UNSHIFT",G_SCALAR|G_DISCARD);
LEAVE;
SPAGAIN;
}
@@ -3229,8 +3224,8 @@ PP(pp_reverse)
RETURN;
}
-STATIC SV *
-mul128(SV *sv, U8 m)
+STATIC SV *
+mul128(pTHX_ SV *sv, U8 m)
{
STRLEN len;
char *s = SvPV(sv, len);
@@ -4215,7 +4210,7 @@ PP(pp_unpack)
}
STATIC void
-doencodes(register SV *sv, register char *s, register I32 len)
+doencodes(pTHX_ register SV *sv, register char *s, register I32 len)
{
char hunk[5];
@@ -4243,7 +4238,7 @@ doencodes(register SV *sv, register char *s, register I32 len)
}
STATIC SV *
-is_an_int(char *s, STRLEN l)
+is_an_int(pTHX_ char *s, STRLEN l)
{
STRLEN n_a;
SV *result = newSVpvn(s, l);
@@ -4291,10 +4286,9 @@ is_an_int(char *s, STRLEN l)
return (result);
}
+/* pnum must be '\0' terminated */
STATIC int
-div128(SV *pnum, bool *done)
- /* must be '\0' terminated */
-
+div128(pTHX_ SV *pnum, bool *done)
{
STRLEN len;
char *s = SvPV(pnum, len);
@@ -5115,7 +5109,7 @@ PP(pp_split)
else {
PUTBACK;
ENTER;
- perl_call_method("PUSH",G_SCALAR|G_DISCARD);
+ call_method("PUSH",G_SCALAR|G_DISCARD);
LEAVE;
SPAGAIN;
if (gimme == G_ARRAY) {
@@ -5143,7 +5137,7 @@ PP(pp_split)
#ifdef USE_THREADS
void
-unlock_condpair(void *svv)
+Perl_unlock_condpair(pTHX_ void *svv)
{
dTHR;
MAGIC *mg = mg_find((SV*)svv, 'm');