From a687059cbaf2c6fdccb5e0fae2aee80ec15625a8 Mon Sep 17 00:00:00 2001 From: Larry Wall Date: Wed, 18 Oct 1989 00:00:00 +0000 Subject: perl 3.0: (no announcement message available) A few of the new features: (18 Oct) * Perl can now handle binary data correctly and has functions to pack and unpack binary structures into arrays or lists. You can now do arbitrary ioctl functions. * You can now pass things to subroutines by reference. * Debugger enhancements. * An array or associative array may now appear in a local() list. * Array values may now be interpolated into strings. * Subroutine names are now distinguished by prefixing with &. You can call subroutines without using do, and without passing any argument list at all. * You can use the new -u switch to cause perl to dump core so that you can run undump and produce a binary executable image. Alternately you can use the "dump" operator after initializing any variables and such. * You can now chop lists. * Perl now uses /bin/csh to do filename globbing, if available. This means that filenames with spaces or other strangenesses work right. * New functions: mkdir and rmdir, getppid, getpgrp and setpgrp, getpriority and setpriority, chroot, ioctl and fcntl, flock, readlink, lstat, rindex, pack and unpack, read, warn, dbmopen and dbmclose, dump, reverse, defined, undef. --- handy.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 57 insertions(+), 4 deletions(-) (limited to 'handy.h') diff --git a/handy.h b/handy.h index 6a7c2c785c..37cfef47d9 100644 --- a/handy.h +++ b/handy.h @@ -1,20 +1,33 @@ -/* $Header: handy.h,v 2.0 88/06/05 00:09:03 root Exp $ +/* $Header: handy.h,v 3.0 89/10/18 15:18:24 lwall Locked $ + * + * Copyright (c) 1989, Larry Wall + * + * You may distribute under the terms of the GNU General Public License + * as specified in the README file that comes with the perl 3.0 kit. * * $Log: handy.h,v $ - * Revision 2.0 88/06/05 00:09:03 root - * Baseline version 2.0. + * Revision 3.0 89/10/18 15:18:24 lwall + * 3.0 baseline * */ #ifdef NULL #undef NULL #endif -#define NULL 0 +#ifndef I286 +# define NULL 0 +#else +# define NULL 0L +#endif #define Null(type) ((type)NULL) #define Nullch Null(char*) #define Nullfp Null(FILE*) +#ifdef UTS +#define bool int +#else #define bool char +#endif #define TRUE (1) #define FALSE (0) @@ -39,3 +52,43 @@ typedef unsigned short line_t; #define NOLINE ((line_t) 65535) #endif +#ifndef lint +#ifndef LEAKTEST +char *safemalloc(); +char *saferealloc(); +void safefree(); +#define New(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n) * sizeof(t)))) +#define Newc(x,v,n,t,c) (v = (c*)safemalloc((MEM_SIZE)((n) * sizeof(t)))) +#define Newz(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n) * sizeof(t)))), \ + bzero((char*)(v), (n) * sizeof(t)) +#define Renew(v,n,t) (v = (t*)saferealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t)))) +#define Renewc(v,n,t,c) (v = (c*)saferealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t)))) +#define Safefree(d) safefree((char*)d) +#define Str_new(x,len) str_new(len) +#else /* LEAKTEST */ +char *safexmalloc(); +char *safexrealloc(); +void safexfree(); +#define New(x,v,n,t) (v = (t*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t)))) +#define Newc(x,v,n,t,c) (v = (c*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t)))) +#define Newz(x,v,n,t) (v = (t*)safexmalloc(x,(MEM_SIZE)((n) * sizeof(t)))), \ + bzero((char*)(v), (n) * sizeof(t)) +#define Renew(v,n,t) (v = (t*)safexrealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t)))) +#define Renewc(v,n,t,c) (v = (c*)safexrealloc((char*)(v),(MEM_SIZE)((n)*sizeof(t)))) +#define Safefree(d) safexfree((char*)d) +#define Str_new(x,len) str_new(x,len) +#define MAXXCOUNT 1200 +long xcount[MAXXCOUNT]; +long lastxcount[MAXXCOUNT]; +#endif /* LEAKTEST */ +#define Copy(s,d,n,t) (void)bcopy((char*)(s),(char*)(d), (n) * sizeof(t)) +#define Zero(d,n,t) (void)bzero((char*)(d), (n) * sizeof(t)) +#else /* lint */ +#define New(x,v,n,s) (v = Null(s *)) +#define Newc(x,v,n,s,c) (v = Null(s *)) +#define Newz(x,v,n,s) (v = Null(s *)) +#define Renew(v,n,s) (v = Null(s *)) +#define Copy(s,d,n,t) +#define Zero(d,n,t) +#define Safefree(d) d = d +#endif /* lint */ -- cgit v1.2.1