summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1992-06-08 04:52:08 +0000
committerLarry Wall <lwall@netlabs.com>1992-06-08 04:52:08 +0000
commitbee1dbe28446f1b188ddf14e24e7f65771825d8f (patch)
treef86e23246374104de23fe22cee4dfa6a9cca86e1 /handy.h
parent8adcabd8d9cf3c71e660c45cb7165ae4694308d4 (diff)
downloadperl-bee1dbe28446f1b188ddf14e24e7f65771825d8f.tar.gz
perl 4.0 patch 26: patch #20, continued
See patch #20.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/handy.h b/handy.h
index 62cef866ad..999473ab68 100644
--- a/handy.h
+++ b/handy.h
@@ -1,4 +1,4 @@
-/* $RCSfile: handy.h,v $$Revision: 4.0.1.3 $$Date: 91/11/05 22:54:26 $
+/* $RCSfile: handy.h,v $$Revision: 4.0.1.4 $$Date: 92/06/08 13:23:17 $
*
* Copyright (c) 1991, Larry Wall
*
@@ -6,6 +6,10 @@
* License or the Artistic License, as specified in the README file.
*
* $Log: handy.h,v $
+ * Revision 4.0.1.4 92/06/08 13:23:17 lwall
+ * patch20: isascii() may now be supplied by a library routine
+ * patch20: Perl now distinguishes overlapped copies from non-overlapped
+ *
* Revision 4.0.1.3 91/11/05 22:54:26 lwall
* patch11: erratum
*
@@ -58,7 +62,7 @@
#define strnNE(s1,s2,l) (strncmp(s1,s2,l))
#define strnEQ(s1,s2,l) (!strncmp(s1,s2,l))
-#if defined(CTYPE256) || !defined(isascii)
+#if defined(CTYPE256) || (!defined(isascii) && !defined(HAS_ISASCII))
#define isALNUM(c) (isalpha(c) || isdigit(c) || c == '_')
#define isALPHA(c) isalpha(c)
#define isSPACE(c) isspace(c)
@@ -74,8 +78,6 @@
#define isLOWER(c) (isascii(c) && islower(c))
#endif
-#define MEM_SIZE unsigned int
-
/* Line numbers are unsigned, 16 bits. */
typedef unsigned short line_t;
#ifdef lint
@@ -95,14 +97,14 @@ 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))
+ memzero((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))))
#else
#define New(x,v,n,t) (v = (t*)safemalloc(((unsigned long)(n) * sizeof(t))))
#define Newc(x,v,n,t,c) (v = (c*)safemalloc(((unsigned long)(n) * sizeof(t))))
#define Newz(x,v,n,t) (v = (t*)safemalloc(((unsigned long)(n) * sizeof(t)))), \
- bzero((char*)(v), (n) * sizeof(t))
+ memzero((char*)(v), (n) * sizeof(t))
#define Renew(v,n,t) (v = (t*)saferealloc((char*)(v),((unsigned long)(n)*sizeof(t))))
#define Renewc(v,n,t,c) (v = (c*)saferealloc((char*)(v),((unsigned long)(n)*sizeof(t))))
#endif /* MSDOS */
@@ -115,7 +117,7 @@ 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))
+ memzero((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)
@@ -124,14 +126,22 @@ void safexfree();
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))
+#define Move(s,d,n,t) (void)memmove((char*)(d),(char*)(s), (n) * sizeof(t))
+#define Copy(s,d,n,t) (void)memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
+#define Zero(d,n,t) (void)memzero((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 Move(s,d,n,t)
#define Copy(s,d,n,t)
#define Zero(d,n,t)
#define Safefree(d) d = d
#endif /* lint */
+
+#ifdef STRUCTCOPY
+#define StructCopy(s,d,t) *((t*)(d)) = *((t*)(s))
+#else
+#define StructCopy(s,d,t) Copy(s,d,1,t)
+#endif