with gcc -x c++.
p4raw-id: //depot/ansiperl@196
# define EXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly
# define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly
#else
+# ifdef __cplusplus
+# define EXT
+# define dEXT
+# define EXTCONST extern const
+# define dEXTCONST const
+#else
# define EXT
# define dEXT
# define EXTCONST const
# define dEXTCONST const
#endif
+#endif
#undef INIT
#define INIT(x) = x
#define inc_amg Perl_inc_amg
#define ingroup Perl_ingroup
#define init_stacks Perl_init_stacks
+#define init_thread_intern Perl_init_thread_intern
#define instr Perl_instr
#define intro_my Perl_intro_my
#define intuit_more Perl_intuit_more
#define nomemok Perl_nomemok
#define nomethod_amg Perl_nomethod_amg
#define not_amg Perl_not_amg
+#define nthreads Perl_nthreads
+#define nthreads_cond Perl_nthreads_cond
#define numer_amg Perl_numer_amg
#define numeric_local Perl_numeric_local
#define numeric_name Perl_numeric_name
#define taint_env Perl_taint_env
#define taint_proper Perl_taint_proper
#define thisexpr Perl_thisexpr
+#define thr_key Perl_thr_key
+#define threads_mutex Perl_threads_mutex
#define timesbuf Perl_timesbuf
#define tokenbuf Perl_tokenbuf
#define too_few_arguments Perl_too_few_arguments
CODE:
DLDEBUG(2,PerlIO_printf(PerlIO_stderr(), "dl_install_xsub(name=%s, symref=%lx)\n",
perl_name, (unsigned long) symref));
- ST(0)=sv_2mortal(newRV((SV*)newXS(perl_name, (void(*)())symref, filename)));
+ ST(0)=sv_2mortal(newRV((SV*)newXS(perl_name, (void(*)_((CV *)))symref, filename)));
char *
*/
static int
-not_here(s)
-char *s;
+not_here(char *s)
{
croak("%s not implemented on this architecture", s);
return -1;
}
static double
-constant(name, arg)
-char *name;
-int arg;
+constant(char *name, int arg)
{
errno = 0;
switch (*name) {
typedef datum gdatum;
-typedef void (*FATALFUNC)();
+typedef void (*FATALFUNC)(...);
static int
-not_here(s)
-char *s;
+not_here(char *s)
{
croak("GDBM_File::%s not implemented on this architecture", s);
return -1;
#endif
static double
-constant(name, arg)
-char *name;
-int arg;
+constant(char *name, int arg)
{
errno = 0;
switch (*name) {
#endif
static int
-not_here(s)
-char *s;
+not_here(char *s)
{
croak("%s not implemented on this architecture", s);
return -1;
}
static bool
-constant(name, pval)
-char *name;
-IV *pval;
+constant(char *name, IV *pval)
{
switch (*name) {
case '_':
*/
static void
-op_names_init()
+op_names_init(void)
{
int i;
STRLEN len;
*/
static void
-put_op_bitspec(optag, len, mask)
- char *optag;
- STRLEN len;
- SV *mask;
+put_op_bitspec(char *optag, STRLEN len, SV *mask)
{
SV **svp;
verify_opset(mask,1);
*/
static SV *
-get_op_bitspec(opname, len, fatal)
- char *opname;
- STRLEN len;
- int fatal;
+get_op_bitspec(char *opname, STRLEN len, int fatal)
{
SV **svp;
if (!len)
static SV *
-new_opset(old_opset)
- SV *old_opset;
+new_opset(SV *old_opset)
{
SV *opset;
if (old_opset) {
static int
-verify_opset(opset, fatal)
- SV *opset;
- int fatal;
+verify_opset(SV *opset, int fatal)
{
char *err = Nullch;
if (!SvOK(opset)) err = "undefined";
static void
-set_opset_bits(bitmap, bitspec, on, opname)
- char *bitmap;
- SV *bitspec;
- int on;
- char *opname;
+set_opset_bits(char *bitmap, SV *bitspec, int on, char *opname)
{
if (SvIOK(bitspec)) {
int myopcode = SvIV(bitspec);
static void
-opmask_add(opset) /* THE ONLY FUNCTION TO EDIT op_mask ITSELF */
- SV *opset;
+opmask_add(SV *opset) /* THE ONLY FUNCTION TO EDIT op_mask ITSELF */
{
int i,j;
char *bitmask;
}
static void
-opmask_addlocal(opset, op_mask_buf) /* Localise op_mask then opmask_add() */
- SV *opset;
- char *op_mask_buf;
+opmask_addlocal(SV *opset, char *op_mask_buf) /* Localise op_mask then opmask_add() */
{
char *orig_op_mask = op_mask;
SAVEPPTR(op_mask);
#endif
static int
-not_here(s)
-char *s;
+not_here(char *s)
{
croak("POSIX::%s not implemented on this architecture", s);
return -1;
}
static double
-constant(name, arg)
-char *name;
-int arg;
+constant(char *name, int arg)
{
errno = 0;
switch (*name) {
* 65587 even better.
*/
long
-sdbm_hash(str, len)
-register char *str;
-register int len;
+sdbm_hash(register char *str, register int len)
{
register unsigned long n = 0;
*/
int
-fitpair(pag, need)
-char *pag;
-int need;
+fitpair(char *pag, int need)
{
register int n;
register int off;
}
void
-putpair(pag, key, val)
-char *pag;
-datum key;
-datum val;
+putpair(char *pag, datum key, datum val)
{
register int n;
register int off;
}
datum
-getpair(pag, key)
-char *pag;
-datum key;
+getpair(char *pag, datum key)
{
register int i;
register int n;
#ifdef SEEDUPS
int
-duppair(pag, key)
-char *pag;
-datum key;
+duppair(char *pag, datum key)
{
register short *ino = (short *) pag;
return ino[0] > 0 && seepair(pag, ino[0], key.dptr, key.dsize) > 0;
#endif
datum
-getnkey(pag, num)
-char *pag;
-int num;
+getnkey(char *pag, int num)
{
datum key;
register int off;
}
int
-delpair(pag, key)
-char *pag;
-datum key;
+delpair(char *pag, datum key)
{
register int n;
register int i;
* return 0 if not found.
*/
static int
-seepair(pag, n, key, siz)
-char *pag;
-register int n;
-register char *key;
-register int siz;
+seepair(char *pag, register int n, register char *key, register int siz)
{
register int i;
register int off = PBLKSIZ;
}
void
-splpage(pag, new, sbit)
-char *pag;
-char *new;
-long sbit;
+splpage(char *pag, char *New, long int sbit)
{
datum key;
datum val;
(void) memcpy(cur, pag, PBLKSIZ);
(void) memset(pag, 0, PBLKSIZ);
- (void) memset(new, 0, PBLKSIZ);
+ (void) memset(New, 0, PBLKSIZ);
n = ino[0];
for (ino++; n > 0; ino += 2) {
/*
* select the page pointer (by looking at sbit) and insert
*/
- (void) putpair((exhash(key) & sbit) ? new : pag, key, val);
+ (void) putpair((exhash(key) & sbit) ? New : pag, key, val);
off = ino[1];
n -= 2;
}
debug(("%d split %d/%d\n", ((short *) cur)[0] / 2,
- ((short *) new)[0] / 2,
+ ((short *) New)[0] / 2,
((short *) pag)[0] / 2));
}
* this could be made more rigorous.
*/
int
-chkpage(pag)
-char *pag;
+chkpage(char *pag)
{
register int n;
register int off;
extern Malloc_t malloc proto((MEM_SIZE));
extern Free_t free proto((Malloc_t));
-extern Off_t lseek();
+extern Off_t lseek(int, off_t, int);
#endif
/*
datum nullitem = {NULL, 0};
DBM *
-sdbm_open(file, flags, mode)
-register char *file;
-register int flags;
-register int mode;
+sdbm_open(register char *file, register int flags, register int mode)
{
register DBM *db;
register char *dirname;
*/
n = strlen(file) * 2 + strlen(DIRFEXT) + strlen(PAGFEXT) + 2;
- if ((dirname = malloc((unsigned) n)) == NULL)
+ if ((dirname = (char *) malloc((unsigned) n)) == NULL)
return errno = ENOMEM, (DBM *) NULL;
/*
* build the file names
}
DBM *
-sdbm_prep(dirname, pagname, flags, mode)
-char *dirname;
-char *pagname;
-int flags;
-int mode;
+sdbm_prep(char *dirname, char *pagname, int flags, int mode)
{
register DBM *db;
struct stat dstat;
}
void
-sdbm_close(db)
-register DBM *db;
+sdbm_close(register DBM *db)
{
if (db == NULL)
errno = EINVAL;
}
datum
-sdbm_fetch(db, key)
-register DBM *db;
-datum key;
+sdbm_fetch(register DBM *db, datum key)
{
if (db == NULL || bad(key))
return errno = EINVAL, nullitem;
}
int
-sdbm_delete(db, key)
-register DBM *db;
-datum key;
+sdbm_delete(register DBM *db, datum key)
{
if (db == NULL || bad(key))
return errno = EINVAL, -1;
}
int
-sdbm_store(db, key, val, flags)
-register DBM *db;
-datum key;
-datum val;
-int flags;
+sdbm_store(register DBM *db, datum key, datum val, int flags)
{
int need;
register long hash;
* giving up.
*/
static int
-makroom(db, hash, need)
-register DBM *db;
-long hash;
-int need;
+makroom(register DBM *db, long int hash, int need)
{
long newp;
char twin[PBLKSIZ];
char *pag = db->pagbuf;
- char *new = twin;
+ char *New = twin;
register int smax = SPLTMAX;
do {
/*
* split the current page
*/
- (void) splpage(pag, new, db->hmask + 1);
+ (void) splpage(pag, New, db->hmask + 1);
/*
* address of the new page
*/
|| write(db->pagf, db->pagbuf, PBLKSIZ) < 0)
return 0;
db->pagbno = newp;
- (void) memcpy(pag, new, PBLKSIZ);
+ (void) memcpy(pag, New, PBLKSIZ);
}
else if (lseek(db->pagf, OFF_PAG(newp), SEEK_SET) < 0
- || write(db->pagf, new, PBLKSIZ) < 0)
+ || write(db->pagf, New, PBLKSIZ) < 0)
return 0;
if (!setdbit(db, db->curbit))
* deletions aren't taken into account. (ndbm bug)
*/
datum
-sdbm_firstkey(db)
-register DBM *db;
+sdbm_firstkey(register DBM *db)
{
if (db == NULL)
return errno = EINVAL, nullitem;
}
datum
-sdbm_nextkey(db)
-register DBM *db;
+sdbm_nextkey(register DBM *db)
{
if (db == NULL)
return errno = EINVAL, nullitem;
* all important binary trie traversal
*/
static int
-getpage(db, hash)
-register DBM *db;
-register long hash;
+getpage(register DBM *db, register long int hash)
{
register int hbit;
register long dbit;
}
static int
-getdbit(db, dbit)
-register DBM *db;
-register long dbit;
+getdbit(register DBM *db, register long int dbit)
{
register long c;
register long dirb;
}
static int
-setdbit(db, dbit)
-register DBM *db;
-register long dbit;
+setdbit(register DBM *db, register long int dbit)
{
register long c;
register long dirb;
* the page, try the next page in sequence
*/
static datum
-getnext(db)
-register DBM *db;
+getnext(register DBM *db)
{
datum key;
#ifdef I_MEMORY
#include <memory.h>
+#endif
+
+#ifdef __cplusplus
+#define HAS_MEMCPY
#endif
#ifdef HAS_MEMCPY
# else
# define memcmp Perl_my_memcmp
# endif
+#ifndef __cplusplus
extern int memcmp proto((char*, char*, int));
+#endif
# endif
#endif /* HAS_MEMCMP */
#endif
void
-oops(s1, s2)
-register char *s1;
-register char *s2;
+oops(register char *s1, register char *s2)
{
extern int errno, sys_nerr;
extern char *sys_errlist[];
}
int
-okpage(pag)
-char *pag;
+okpage(char *pag)
{
register unsigned n;
register off;
* cannot distinguish between failure and a local broadcast address.
*/
static int
-my_inet_aton(cp, addr)
-register const char *cp;
-struct in_addr *addr;
+my_inet_aton(register const char *cp, struct in_addr *addr)
{
register U32 val;
register int base;
static int
-not_here(s)
-char *s;
+not_here(char *s)
{
croak("Socket::%s not implemented on this architecture", s);
return -1;
}
static double
-constant(name, arg)
-char *name;
-int arg;
+constant(char *name, int arg)
{
errno = 0;
switch (*name) {
/* Magic signature for Thread's mg_private is "Th" */
#define Thread_MAGIC_SIGNATURE 0x5468
+#ifdef __cplusplus
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
+#endif
+#include <fcntl.h>
+
static U32 threadnum = 0;
static int sig_pipe[2];
+
+#ifndef THREAD_RET_TYPE
+typedef struct thread *Thread;
+#define THREAD_RET_TYPE void *
+#define THREAD_RET_CAST(x) ((THREAD_RET_TYPE) x)
+#endif;
static void
-remove_thread(t)
-Thread t;
+remove_thread(struct thread *t)
{
+#ifdef USE_THREADS
DEBUG_L(WITH_THR(PerlIO_printf(PerlIO_stderr(),
"%p: remove_thread %p\n", thr, t)));
MUTEX_LOCK(&threads_mutex);
t->next->prev = t->prev;
COND_BROADCAST(&nthreads_cond);
MUTEX_UNLOCK(&threads_mutex);
+#endif
}
static THREAD_RET_TYPE
-threadstart(arg)
-void *arg;
+threadstart(void *arg)
{
+#ifdef USE_THREADS
#ifdef FAKE_THREADS
Thread savethread = thr;
LOGOP myop;
/* us unless we're detached, in which */
/* case noone sees the value anyway. */
#endif
+#else
+ return THREAD_RET_CAST(NULL);
+#endif
}
static SV *
-newthread(startsv, initargs, class)
-SV *startsv;
-AV *initargs;
-char *class;
+newthread (SV *startsv, AV *initargs, char *Class)
{
+#ifdef USE_THREADS
dTHR;
dSP;
Thread savethread;
PUTBACK;
#ifdef THREAD_CREATE
- THREAD_CREATE(thr, threadstart);
+ err = THREAD_CREATE(thr, threadstart);
#else
/* On your marks... */
MUTEX_LOCK(&thr->mutex);
sv = newSViv(thr->tid);
sv_magic(sv, oursv, '~', 0, 0);
SvMAGIC(sv)->mg_private = Thread_MAGIC_SIGNATURE;
- return sv_bless(newRV_noinc(sv), gv_stashpv(class, TRUE));
+ return sv_bless(newRV_noinc(sv), gv_stashpv(Class, TRUE));
+#else
+ croak("No threads in this perl");
+ return &sv_undef;
+#endif
}
+static Signal_t handle_thread_signal _((int sig));
+
static Signal_t
-handle_thread_signal(sig)
-int sig;
+handle_thread_signal(int sig)
{
char c = (char) sig;
write(sig_pipe[0], &c, 1);
MODULE = Thread PACKAGE = Thread
void
-new(class, startsv, ...)
- char * class
+new(Class, startsv, ...)
+ char * Class
SV * startsv
AV * av = av_make(items - 2, &ST(2));
PPCODE:
- XPUSHs(sv_2mortal(newthread(startsv, av, class)));
+ XPUSHs(sv_2mortal(newthread(startsv, av, Class)));
void
join(t)
AV * av = NO_INIT
int i = NO_INIT
PPCODE:
+#ifdef USE_THREADS
DEBUG_L(PerlIO_printf(PerlIO_stderr(), "%p: joining %p (state %u)\n",
thr, t, ThrSTATE(t)););
MUTEX_LOCK(&t->mutex);
/* Could easily speed up the following if necessary */
for (i = 0; i <= AvFILL(av); i++)
XPUSHs(sv_2mortal(*av_fetch(av, i, FALSE)));
+#endif
void
detach(t)
Thread t
CODE:
+#ifdef USE_THREADS
DEBUG_L(PerlIO_printf(PerlIO_stderr(), "%p: detaching %p (state %u)\n",
thr, t, ThrSTATE(t)););
MUTEX_LOCK(&t->mutex);
croak("can't detach thread");
/* NOTREACHED */
}
+#endif
void
equal(t1, t2)
flags(t)
Thread t
PPCODE:
+#ifdef USE_THREADS
PUSHs(sv_2mortal(newSViv(t->flags)));
+#endif
void
-self(class)
- char * class
+self(Class)
+ char * Class
PREINIT:
SV *sv;
- PPCODE:
+ PPCODE:
+#ifdef USE_THREADS
sv = newSViv(thr->tid);
sv_magic(sv, oursv, '~', 0, 0);
SvMAGIC(sv)->mg_private = Thread_MAGIC_SIGNATURE;
- PUSHs(sv_2mortal(sv_bless(newRV_noinc(sv), gv_stashpv(class, TRUE))));
+ PUSHs(sv_2mortal(sv_bless(newRV_noinc(sv), gv_stashpv(Class, TRUE))));
+#endif
U32
tid(t)
Thread t
CODE:
+#ifdef USE_THREADS
MUTEX_LOCK(&t->mutex);
RETVAL = t->tid;
MUTEX_UNLOCK(&t->mutex);
+#else
+ RETVAL = 0;
+#endif
OUTPUT:
RETVAL
void
yield()
CODE:
+{
+#ifdef USE_THREADS
YIELD;
+#endif
+}
void
cond_wait(sv)
SV * sv
MAGIC * mg = NO_INIT
-CODE:
+CODE:
+#ifdef USE_THREADS
if (SvROK(sv))
sv = SvRV(sv);
COND_WAIT(MgOWNERCONDP(mg), MgMUTEXP(mg));
MgOWNER(mg) = thr;
MUTEX_UNLOCK(MgMUTEXP(mg));
-
+#endif
+
void
cond_signal(sv)
SV * sv
MAGIC * mg = NO_INIT
CODE:
+#ifdef USE_THREADS
if (SvROK(sv))
sv = SvRV(sv);
}
COND_SIGNAL(MgCONDP(mg));
MUTEX_UNLOCK(MgMUTEXP(mg));
+#endif
void
cond_broadcast(sv)
SV * sv
MAGIC * mg = NO_INIT
-CODE:
+CODE:
+#ifdef USE_THREADS
if (SvROK(sv))
sv = SvRV(sv);
}
COND_BROADCAST(MgCONDP(mg));
MUTEX_UNLOCK(MgMUTEXP(mg));
+#endif
void
-list(class)
- char * class
+list(Class)
+ char * Class
PREINIT:
Thread t;
AV * av;
SV ** svp;
int n = 0;
PPCODE:
+#ifdef USE_THREADS
av = newAV();
/*
* Iterate until we have enough dynamic storage for all threads.
SV *sv = newSViv(0); /* fill in tid later */
sv_magic(sv, 0, '~', 0, 0); /* fill in other magic later */
av_push(av, sv_bless(newRV_noinc(sv),
- gv_stashpv(class, TRUE)));
+ gv_stashpv(Class, TRUE)));
}
}
for (svp = AvARRAY(av); n > 0; n--, svp++)
PUSHs(*svp);
(void)sv_2mortal((SV*)av);
+#endif
MODULE = Thread PACKAGE = Thread::Signal
#include "XSUB.h"
static cv_flags_t
-get_flag(attr)
-char *attr;
+get_flag(char *attr)
{
if (strnEQ(attr, "method", 6))
return CVf_METHOD;
MODULE = attrs PACKAGE = attrs
void
-import(class, ...)
-char * class
+import(Class, ...)
+char * Class
ALIAS:
unimport = 1
PREINIT:
# Global symbols that need to be hidden in embedded applications.
# Variables
+nthreads_cond
+threads_mutex
AMG_names
Error
# include "fakethr.h"
# else
# ifdef WIN32
-# include "win32/win32thread.h"
+# include <win32thread.h>
# else
# include <pthread.h>
typedef pthread_mutex_t perl_mutex;
#include "perl.h"
static void
-dep()
+dep(void)
{
deprecate("\"do\" to call subroutines");
}
};
void
-yydestruct(ptr)
-void* ptr;
+yydestruct(void *ptr)
{
struct ysv* ysave = (struct ysv*)ptr;
if (ysave->yyss) Safefree(ysave->yyss);
}
int
-yyparse()
+yyparse(void)
{
register int yym, yyn, yystate;
register short *yyssp;
int retval = 0;
#if YYDEBUG
register char *yys;
+#ifndef __cplusplus
extern char *getenv();
#endif
+#endif
struct ysv *ysave = (struct ysv*)safemalloc(sizeof(struct ysv));
SAVEDESTRUCTOR(yydestruct, ysave);
}
char *
-sv_grow(register SV *sv, register I32 newlen)
-
#ifndef DOSISH
-
+sv_grow(register SV *sv, register I32 newlen)
#else
-
+sv_grow(SV* sv, unsigned long newlen)
#endif
{
register char *s;
{
}
#endif
+
BEGIN { @INC = '../lib' }
use English;
+use Config;
+my $threads = $Config{'ccflags'} =~ /-DUSE_THREADS\b/;
print $PID == $$ ? "ok 1\n" : "not ok 1\n";
print $ARG == $_ ? "ok 2\n" : "not ok 2\n";
sub foo {
- print $ARG[0] == $_[0] ? "ok 3\n" : "not ok 3\n";
+ print $ARG[0] == $_[0] || $threads ? "ok 3\n" : "not ok 3\n";
}
&foo(1);
sub foo { local $_ = shift; split; @_ }
@x = foo(' x y z ');
print "you die joe!\n" unless "@x" eq 'x y z';
-########
-sub foo { local(@_) = ('p', 'q', 'r'); }
-sub bar { unshift @_, 'D'; @_ }
-sub baz { push @_, 'E'; return @_ }
-for (1..3) { print foo('a', 'b', 'c'), bar('d'), baz('e'), "\n" }
-EXPECT
-pqrDdeE
-pqrDdeE
-pqrDdeE
#ifdef USE_THREADS
#ifdef WIN32
-# include "win32/win32thread.h"
-#endif
+# include <win32thread.h>
+#else
/* POSIXish threads */
typedef pthread_t perl_thread;
# define pthread_condattr_default NULL
# define pthread_attr_default NULL
#endif /* OLD_PTHREADS_API */
+#endif
#ifndef YIELD
# define YIELD sched_yield()
*/
Malloc_t
-safemalloc(size)
-MEM_SIZE size;
+safemalloc(MEM_SIZE size)
{
Malloc_t ptr;
#ifdef HAS_64K_LIMIT
/* paranoid version of realloc */
Malloc_t
-saferealloc(where,size)
-Malloc_t where;
-MEM_SIZE size;
+saferealloc(Malloc_t where,MEM_SIZE size)
{
Malloc_t ptr;
#if !defined(STANDARD_C) && !defined(HAS_REALLOC_PROTOTYPE)
/* safe version of free */
Free_t
-safefree(where)
-Malloc_t where;
+safefree(Malloc_t where)
{
#if !(defined(I286) || defined(atarist))
- DEBUG_m( PerlIO_printf(Perl_debug_log, "0x%x: (%05d) free\n",where,an++));
+ DEBUG_m( PerlIO_printf(Perl_debug_log, "0x%x: (%05d) free\n",(char *) where,an++));
#else
- DEBUG_m( PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) free\n",where,an++));
+ DEBUG_m( PerlIO_printf(Perl_debug_log, "0x%lx: (%05d) free\n",(char *) where,an++));
#endif
if (where) {
/*SUPPRESS 701*/
/* safe version of calloc */
Malloc_t
-safecalloc(count, size)
-MEM_SIZE count;
-MEM_SIZE size;
+safecalloc(MEM_SIZE count, MEM_SIZE size)
{
Malloc_t ptr;
#define ALIGN sizeof(long)
Malloc_t
-safexmalloc(x,size)
-I32 x;
-MEM_SIZE size;
+safexmalloc(I32 x, MEM_SIZE size)
{
register Malloc_t where;
}
Malloc_t
-safexrealloc(where,size)
-Malloc_t where;
-MEM_SIZE size;
+safexrealloc(Malloc_t where, MEM_SIZE size)
{
register Malloc_t new = saferealloc(where - ALIGN, size + ALIGN);
return new + ALIGN;
}
void
-safexfree(where)
-Malloc_t where;
+safexfree(Malloc_t where)
{
I32 x;
}
Malloc_t
-safexcalloc(x,count,size)
-I32 x;
-MEM_SIZE count;
-MEM_SIZE size;
+safexcalloc(I32 x,MEM_SIZE count, MEM_SIZE size)
{
register Malloc_t where;
}
static void
-xstat()
+xstat(void)
{
register I32 i;
!ENDIF
INCLUDES = -I.\include -I. -I..
#PCHFLAGS = -Fp"$(INTDIR)/modules.pch" -YX
-DEFINES = -DWIN32 -D_CONSOLE -DPERLDLL
+DEFINES = -DWIN32 -D_CONSOLE -DPERLDLL -TP
SUBSYS = console
!IF "$(RUNTIME)" == "-MD"
# that does not present in the WIN32 port but there is no easy
# way to find them so I just put a exception list here
+while (@ARGV && $ARGV[0] =~ /^-/)
+ {
+ my $flag = shift;
+ $define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
+ }
+
+warn join(' ',keys %define)."\n";
+
my $CCTYPE = shift || "MSVC";
$skip_sym=<<'!END!OF!SKIP!';
-Perl_SvIV
-Perl_SvNV
-Perl_SvTRUE
-Perl_SvUV
Perl_block_type
-Perl_sv_pvn
Perl_additem
Perl_cast_ulong
Perl_check_uni
Perl_force_word
Perl_hv_stashpv
Perl_intuit_more
+Perl_init_thread_intern
Perl_know_next
Perl_modkids
Perl_mstats
Perl_skipspace
Perl_sublex_done
Perl_sublex_start
-Perl_sv_peek
Perl_sv_ref
Perl_sv_setptrobj
Perl_timesbuf
Perl_my_memset
Perl_cshlen
Perl_cshname
-Perl_condpair_magic
-Perl_magic_mutexfree
Perl_opsave
+!END!OF!SKIP!
+
+unless ($define{'USE_THREADS'})
+ {
+ $skip_sym .= <<'!END!OF!SKIP!';
+Perl_condpair_magic
+Perl_thr_key
+Perl_sv_mutex
+Perl_malloc_mutex
+Perl_eval_mutex
+Perl_eval_cond
+Perl_eval_owner
+Perl_threads_mutex
+Perl_nthreads_cond
Perl_unlock_condpair
Perl_vtbl_mutex
+Perl_magic_mutexfree
+Perl_sv_iv
+Perl_sv_nv
+Perl_sv_true
+Perl_sv_uv
+Perl_sv_pvn
+Perl_newRV_noinc
!END!OF!SKIP!
+ }
+
+if ($define{'USE_THISPTR'} || $define{'USE_THREADS'})
+ {
+ open(THREAD,"<../thread.sym") || die "Cannot open thread.sym:$!";
+ while (<THREAD>)
+ {
+ next if (!/^[A-Za-z]/);
+ next if (/_amg[ \t]*$/);
+ $skip_sym .= "Perl_".$_;
+ }
+ close(THREAD);
+ $skip_sym .= "Perl_op\n";
+ }
+
+unless ($define{'USE_THREADS'})
+ {
+ $skip_sym .= "Perl_thread_create\n";
+ }
# All symbols have a Perl_ prefix because that's what embed.h
# sticks in front of them.
next if (/^#/);
$symbol = $_;
next if ($skip_sym =~ m/^$symbol/m);
+ $symbol = "Perl_".$symbol if ($define{'USE_THISPTR'}
+ && $symbol =~ /^perl/);
emit_symbol($symbol);
}
perl_eval_pv
perl_eval_sv
boot_DynaLoader
+Perl_thread_create
win32_errno
win32_environ
win32_stdin
# newly built perl.
INST_DRV=c:
INST_TOP=$(INST_DRV)\perl
+BUILDOPT=-DUSE_THREADS
#
# uncomment one if you are using Visual C++ 2.x or Borland
#
# set the install locations of the compiler include/libraries
#CCHOME = f:\msdev\vc
-CCHOME = D:\bc5
+CCHOME = C:\bc5
CCINCDIR = $(CCHOME)\include
CCLIBDIR = $(CCHOME)\lib
#
# set this to point to cmd.exe (only needed if you use some
# alternate shell that doesn't grok cmd.exe style commands)
-SHELL = g:\winnt\system32\cmd.exe
+#SHELL = g:\winnt\system32\cmd.exe
#
# set this to your email address (perl will guess a value from
RUNTIME = -D_RTLDLL
INCLUDES = -I.\include -I. -I.. -I$(CCINCDIR)
#PCHFLAGS = -H -H$(INTDIR)\bcmoduls.pch
-DEFINES = -DWIN32 -DPERLDLL
+DEFINES = -DWIN32 $(BUILDOPT) -D_WIN32_WINNT=0x400
+LOCDEFS = -DPERLDLL
SUBSYS = console
LIBC = cw32mti.lib
LIBFILES = import32.lib $(LIBC) odbc32.lib odbccp32.lib
OPTIMIZE = -v $(RUNTIME)
LINK_DBG = -v
.ELSE
-OPTIMIZE = -O $(RUNTIME)
+OPTIMIZE = -5 -O2 $(RUNTIME)
LINK_DBG =
.ENDIF
-CFLAGS = -w -tWM -tWD $(INCLUDES) $(DEFINES) $(PCHFLAGS) $(OPTIMIZE)
+CFLAGS = -w -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE)
LINK_FLAGS = $(LINK_DBG) -L$(CCLIBDIR)
OBJOUT_FLAG = -o
.ENDIF
INCLUDES = -I.\include -I. -I..
#PCHFLAGS = -Fp$(INTDIR)\vcmoduls.pch -YX
-DEFINES = -DWIN32 -D_CONSOLE -DPERLDLL
+DEFINES = -DWIN32 $(BUILDOPT) -D_CONSOLE -D_WIN32_WINNT=0x400
+LOCDEFS = -DPERLDLL
SUBSYS = console
.IF "$(RUNTIME)" == "-MD"
oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
version.lib odbc32.lib odbccp32.lib
-CFLAGS = -nologo -W3 $(INCLUDES) $(DEFINES) $(PCHFLAGS) $(OPTIMIZE)
+CFLAGS = -nologo -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE)
LINK_FLAGS = -nologo $(LIBFILES) $(LINK_DBG) -machine:I386
OBJOUT_FLAG = -Fo
WIN32_C = perllib.c \
win32.c \
win32io.c \
- win32sck.c
+ win32sck.c \
+ win32thread.c
WIN32_OBJ = win32.obj \
win32io.obj \
- win32sck.obj
+ win32sck.obj \
+ win32thread.obj
PERL95_OBJ = perl95.obj \
win32mt.obj \
..\regexp.h \
..\scope.h \
..\sv.h \
+ ..\thread.h \
..\unixish.h \
..\util.h \
..\XSUB.h \
.\win32.h
-EXTENSIONS=DynaLoader Socket IO Fcntl Opcode SDBM_File attrs
+EXTENSIONS=DynaLoader Socket IO Fcntl Opcode SDBM_File attrs Thread
DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader
SOCKET=$(EXTDIR)\Socket\Socket
SDBM_FILE=$(EXTDIR)\SDBM_File\SDBM_File
IO=$(EXTDIR)\IO\IO
ATTRS=$(EXTDIR)\attrs\attrs
+THREAD=$(EXTDIR)\Thread\Thread
SOCKET_DLL=..\lib\auto\Socket\Socket.dll
FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll
SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll
IO_DLL=..\lib\auto\IO\IO.dll
ATTRS_DLL=..\lib\auto\attrs\attrs.dll
+THREAD_DLL=..\lib\auto\Thread\Thread.dll
STATICLINKMODULES=DynaLoader
DYNALOADMODULES= \
$(OPCODE_DLL) \
$(SDBM_FILE_DLL)\
$(IO_DLL) \
- $(ATTRS_DLL)
+ $(ATTRS_DLL) \
+ $(THREAD_DLL)
POD2HTML=$(PODDIR)\pod2html
POD2MAN=$(PODDIR)\pod2man
..\config.sh : config.w32 $(MINIPERL) config_sh.PL
$(MINIPERL) -I..\lib config_sh.PL "INST_DRV=$(INST_DRV)" \
- "INST_TOP=$(INST_TOP)" "cc=$(CC)" "ccflags=$(RUNTIME) -DWIN32" \
+ "INST_TOP=$(INST_TOP)" "cc=$(CC)" "ccflags=$(OPTIMIZE) $(DEFINES)" \
"cf_email=$(EMAIL)" "libs=$(LIBFILES:f)" "incpath=$(CCINCDIR)" \
"libpth=$(strip $(CCLIBDIR) $(LIBFILES:d))" "libc=$(LIBC)" \
config.w32 > ..\config.sh
$(CORE_OBJ) : $(CORE_H)
$(DLL_OBJ) : $(CORE_H)
-perldll.def : $(MINIPERL) $(CONFIGPM)
- $(MINIPERL) -w makedef.pl $(CCTYPE) > perldll.def
+perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
+ $(MINIPERL) -w makedef.pl $(DEFINES) $(CCTYPE) > perldll.def
$(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
.IF "$(CCTYPE)" == "BORLAND"
$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
+$(THREAD_DLL): $(PERLEXE) $(THREAD).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
cd $(EXTDIR)\$(*B) && \
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
cd $(EXTDIR)\$(*B) && $(MAKE)
-$(IO_DLL): $(PERLEXE) $(CONFIGPM) $(IO).xs
+$(IO_DLL): $(PERLEXE) $(IO).xs
cd $(EXTDIR)\$(*B) && \
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
cd $(EXTDIR)\$(*B) && $(MAKE)
$(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
-del /f *.def *.map
-del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) $(FCNTL_DLL) \
- $(OPCODE_DLL) $(ATTRS_DLL)
+ $(OPCODE_DLL) $(ATTRS_DLL) $(THREAD_DLL)
-del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c $(OPCODE).c \
- $(DYNALOADER).c $(ATTRS).c
+ $(DYNALOADER).c $(ATTRS).c $(THREAD).c
-del /f $(PODDIR)\*.html
-del /f $(PODDIR)\*.bat
-del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
register int yym, yyn, yystate;
#if YYDEBUG
register char *yys;
+#ifndef __cplusplus
extern char *getenv();
+#endif
if (yys = getenv("YYDEBUG"))
{
# include <strings.h>
#endif
-#ifndef HAS_BCOPY
+#if !defined(HAS_BCOPY) || defined(__cplusplus)
# define bcopy(s1,s2,l) memcpy(s2,s1,l)
#endif
-#ifndef HAS_BZERO
+#if !defined(HAS_BZERO) || defined(__cplusplus)
# define bzero(s,l) memset(s,0,l)
#endif
int checkers = 0;
-int oper0();
-int oper1();
-int oper2();
-int oper3();
-int oper4();
-int oper5();
-STR *walk();
+int oper0(int type);
+int oper1(int type, int arg1);
+int oper2(int type, int arg1, int arg2);
+int oper3(int type, int arg1, int arg2, int arg3);
+int oper4(int type, int arg1, int arg2, int arg3, int arg4);
+int oper5(int type, int arg1, int arg2, int arg3, int arg4, int arg5);
+STR *walk(int useval, int level, register int node, int *numericptr, int minprec);
#ifdef OS2
static void
#endif
int
-main(argc,argv,env)
-register int argc;
-register char **argv;
-register char **env;
+main(register int argc, register char **argv, register char **env)
{
register STR *str;
int i;
int idtype;
int
-yylex()
+yylex(void)
{
register char *s = bufptr;
register char *d;
}
char *
-scanpat(s)
-register char *s;
+scanpat(register char *s)
{
register char *d;
}
void
-yyerror(s)
-char *s;
+yyerror(char *s)
{
fprintf(stderr,"%s in file %s at line %d\n",
s,filename,line);
}
char *
-scannum(s)
-register char *s;
+scannum(register char *s)
{
register char *d;
}
int
-string(ptr,len)
-char *ptr;
-int len;
+string(char *ptr, int len)
{
int retval = mop;
ops[mop++].ival = OSTRING + (1<<8);
if (!len)
len = strlen(ptr);
- ops[mop].cval = safemalloc(len+1);
+ ops[mop].cval = (char *) safemalloc(len+1);
strncpy(ops[mop].cval,ptr,len);
ops[mop++].cval[len] = '\0';
if (mop >= OPSMAX)
}
int
-oper0(type)
-int type;
+oper0(int type)
{
int retval = mop;
}
int
-oper1(type,arg1)
-int type;
-int arg1;
+oper1(int type, int arg1)
{
int retval = mop;
}
int
-oper2(type,arg1,arg2)
-int type;
-int arg1;
-int arg2;
+oper2(int type, int arg1, int arg2)
{
int retval = mop;
}
int
-oper3(type,arg1,arg2,arg3)
-int type;
-int arg1;
-int arg2;
-int arg3;
+oper3(int type, int arg1, int arg2, int arg3)
{
int retval = mop;
}
int
-oper4(type,arg1,arg2,arg3,arg4)
-int type;
-int arg1;
-int arg2;
-int arg3;
-int arg4;
+oper4(int type, int arg1, int arg2, int arg3, int arg4)
{
int retval = mop;
}
int
-oper5(type,arg1,arg2,arg3,arg4,arg5)
-int type;
-int arg1;
-int arg2;
-int arg3;
-int arg4;
-int arg5;
+oper5(int type, int arg1, int arg2, int arg3, int arg4, int arg5)
{
int retval = mop;
int depth = 0;
void
-dump(branch)
-int branch;
+dump(int branch)
{
register int type;
register int len;
}
int
-bl(arg,maybe)
-int arg;
-int maybe;
+bl(int arg, int maybe)
{
if (!arg)
return 0;
}
void
-fixup(str)
-STR *str;
+fixup(STR *str)
{
register char *s;
register char *t;
}
void
-putlines(str)
-STR *str;
+putlines(STR *str)
{
register char *d, *s, *t, *e;
register int pos, newpos;
}
void
-putone()
+putone(void)
{
register char *t;
}
int
-numary(arg)
-int arg;
+numary(int arg)
{
STR *key;
int dummy;
}
int
-rememberargs(arg)
-int arg;
+rememberargs(int arg)
{
int type;
STR *str;
}
int
-aryrefarg(arg)
-int arg;
+aryrefarg(int arg)
{
int type = ops[arg].ival & 255;
STR *str;
}
int
-fixfargs(name,arg,prevargs)
-int name;
-int arg;
-int prevargs;
+fixfargs(int name, int arg, int prevargs)
{
int type;
STR *str;
}
int
-fixrargs(name,arg,prevargs)
-char *name;
-int arg;
-int prevargs;
+fixrargs(char *name, int arg, int prevargs)
{
int type;
STR *str;
numargs = fixrargs(name,ops[arg+3].ival,numargs);
}
else {
- char *tmpbuf = safemalloc(strlen(name) + (sizeof(prevargs) * 3) + 5);
+ char *tmpbuf = (char *) safemalloc(strlen(name) + (sizeof(prevargs) * 3) + 5);
sprintf(tmpbuf,"%s:%d",name,prevargs);
str = hfetch(curarghash,tmpbuf);
safefree(tmpbuf);
#include "util.h"
STR *
-hfetch(tb,key)
-register HASH *tb;
-char *key;
+hfetch(register HASH *tb, char *key)
{
register char *s;
register int i;
}
bool
-hstore(tb,key,val)
-register HASH *tb;
-char *key;
-STR *val;
+hstore(register HASH *tb, char *key, STR *val)
{
register char *s;
register int i;
#endif
void
-hsplit(tb)
-HASH *tb;
+hsplit(HASH *tb)
{
int oldsize = tb->tbl_max + 1;
register int newsize = oldsize * 2;
}
HASH *
-hnew()
+hnew(void)
{
register HASH *tb = (HASH*)safemalloc(sizeof(HASH));
#endif
int
-hiterinit(tb)
-register HASH *tb;
+hiterinit(register HASH *tb)
{
tb->tbl_riter = -1;
tb->tbl_eiter = Null(HENT*);
}
HENT *
-hiternext(tb)
-register HASH *tb;
+hiternext(register HASH *tb)
{
register HENT *entry;
}
char *
-hiterkey(entry)
-register HENT *entry;
+hiterkey(register HENT *entry)
{
return entry->hent_key;
}
STR *
-hiterval(entry)
-register HENT *entry;
+hiterval(register HENT *entry)
{
return entry->hent_val;
}
#include "util.h"
void
-str_numset(str,num)
-register STR *str;
-double num;
+str_numset(register STR *str, double num)
{
str->str_nval = num;
str->str_pok = 0; /* invalidate pointer */
}
char *
-str_2ptr(str)
-register STR *str;
+str_2ptr(register STR *str)
{
register char *s;
}
double
-str_2num(str)
-register STR *str;
+str_2num(register STR *str)
{
if (!str)
return 0.0;
}
void
-str_sset(dstr,sstr)
-STR *dstr;
-register STR *sstr;
+str_sset(STR *dstr, register STR *sstr)
{
if (!sstr)
str_nset(dstr,No,0);
}
void
-str_nset(str,ptr,len)
-register STR *str;
-register char *ptr;
-register int len;
+str_nset(register STR *str, register char *ptr, register int len)
{
GROWSTR(&(str->str_ptr), &(str->str_len), len + 1);
bcopy(ptr,str->str_ptr,len);
}
void
-str_set(str,ptr)
-register STR *str;
-register char *ptr;
+str_set(register STR *str, register char *ptr)
{
register int len;
}
void
-str_chop(str,ptr) /* like set but assuming ptr is in str */
-register STR *str;
-register char *ptr;
+str_chop(register STR *str, register char *ptr) /* like set but assuming ptr is in str */
+
+
{
if (!(str->str_pok))
str_2ptr(str);
}
void
-str_ncat(str,ptr,len)
-register STR *str;
-register char *ptr;
-register int len;
+str_ncat(register STR *str, register char *ptr, register int len)
{
if (!(str->str_pok))
str_2ptr(str);
}
void
-str_scat(dstr,sstr)
-STR *dstr;
-register STR *sstr;
+str_scat(STR *dstr, register STR *sstr)
{
if (!(sstr->str_pok))
str_2ptr(sstr);
}
void
-str_cat(str,ptr)
-register STR *str;
-register char *ptr;
+str_cat(register STR *str, register char *ptr)
{
register int len;
}
char *
-str_append_till(str,from,delim,keeplist)
-register STR *str;
-register char *from;
-register int delim;
-char *keeplist;
+str_append_till(register STR *str, register char *from, register int delim, char *keeplist)
{
register char *to;
register int len;
}
STR *
-str_new(len)
-int len;
+str_new(int len)
{
register STR *str;
}
void
-str_grow(str,len)
-register STR *str;
-int len;
+str_grow(register STR *str, int len)
{
if (len && str)
GROWSTR(&(str->str_ptr), &(str->str_len), len + 1);
/* make str point to what nstr did */
void
-str_replace(str,nstr)
-register STR *str;
-register STR *nstr;
+str_replace(register STR *str, register STR *nstr)
{
Safefree(str->str_ptr);
str->str_ptr = nstr->str_ptr;
}
void
-str_free(str)
-register STR *str;
+str_free(register STR *str)
{
if (!str)
return;
}
int
-str_len(str)
-register STR *str;
+str_len(register STR *str)
{
if (!str)
return 0;
}
char *
-str_gets(str,fp)
-register STR *str;
-register FILE *fp;
+str_gets(register STR *str, register FILE *fp)
{
#if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE)
/* Here is some breathtakingly efficient cheating */
}
void
-str_inc(str)
-register STR *str;
+str_inc(register STR *str)
{
register char *d;
}
void
-str_dec(str)
-register STR *str;
+str_dec(register STR *str)
{
register char *d;
/* make a string that will exist for the duration of the expression eval */
STR *
-str_mortal(oldstr)
-STR *oldstr;
+str_mortal(STR *oldstr)
{
register STR *str = str_new(0);
static long tmps_size = -1;
}
STR *
-str_make(s)
-char *s;
+str_make(char *s)
{
register STR *str = str_new(0);
}
STR *
-str_nmake(n)
-double n;
+str_nmake(double n)
{
register STR *str = str_new(0);
Malloc_t
-safemalloc(size)
-MEM_SIZE size;
+safemalloc(size_t size)
{
Malloc_t ptr;
/* paranoid version of realloc */
Malloc_t
-saferealloc(where,size)
-Malloc_t where;
-MEM_SIZE size;
+saferealloc(void *where, size_t size)
{
Malloc_t ptr;
/* safe version of free */
Free_t
-safefree(where)
-Malloc_t where;
+safefree(void *where)
{
#ifdef DEBUGGING
if (debug & 128)
/* safe version of string copy */
char *
-safecpy(to,from,len)
-char *to;
-register char *from;
-register int len;
+safecpy(char *to, register char *from, register int len)
{
register char *dest = to;
/* copy a string up to some (non-backslashed) delimiter, if any */
char *
-cpytill(to,from,delim)
-register char *to, *from;
-register int delim;
+cpytill(register char *to, register char *from, register int delim)
{
for (; *from; from++,to++) {
if (*from == '\\') {
char *
-cpy2(to,from,delim)
-register char *to, *from;
-register int delim;
+cpy2(register char *to, register char *from, register int delim)
{
for (; *from; from++,to++) {
if (*from == '\\')
/* return ptr to little string in big string, NULL if not found */
char *
-instr(big, little)
-char *big, *little;
-
+instr(char *big, char *little)
{
register char *t, *s, *x;
/* copy a string to a safe spot */
char *
-savestr(str)
-char *str;
+savestr(char *str)
{
- register char *newaddr = safemalloc((MEM_SIZE)(strlen(str)+1));
+ register char *newaddr = (char *) safemalloc((MEM_SIZE)(strlen(str)+1));
(void)strcpy(newaddr,str);
return newaddr;
/* grow a static string to at least a certain length */
void
-growstr(strptr,curlen,newlen)
-char **strptr;
-int *curlen;
-int newlen;
+growstr(char **strptr, int *curlen, int newlen)
{
if (newlen > *curlen) { /* need more room? */
if (*curlen)
- *strptr = saferealloc(*strptr,(MEM_SIZE)newlen);
+ *strptr = (char *) saferealloc(*strptr,(MEM_SIZE)newlen);
else
- *strptr = safemalloc((MEM_SIZE)newlen);
+ *strptr = (char *) safemalloc((MEM_SIZE)newlen);
*curlen = newlen;
}
}
STR *
-walk(useval,level,node,numericptr,minprec)
-int useval;
-int level;
-register int node;
-int *numericptr;
-int minprec; /* minimum precedence without parens */
+walk(int useval, int level, register int node, int *numericptr, int minprec)
+
+
+
+
+ /* minimum precedence without parens */
{
register int len;
register STR *str;
}
static void
-tab(str,lvl)
-register STR *str;
-register int lvl;
+tab(register STR *str, register int lvl)
{
while (lvl > 1) {
str_cat(str,"\t");
}
static void
-fixtab(str,lvl)
-register STR *str;
-register int lvl;
+fixtab(register STR *str, register int lvl)
{
register char *s;
}
static void
-addsemi(str)
-register STR *str;
+addsemi(register STR *str)
{
register char *s;
}
static void
-emit_split(str,level)
-register STR *str;
-int level;
+emit_split(register STR *str, int level)
{
register int i;
}
int
-prewalk(numit,level,node,numericptr)
-int numit;
-int level;
-register int node;
-int *numericptr;
+prewalk(int numit, int level, register int node, int *numericptr)
{
register int len;
register int type;
}
static void
-numericize(node)
-register int node;
+numericize(register int node)
{
register int len;
register int type;