This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move the IV, UV, I8, U8, ..., and NV to metaconfig
[perl5.git] / handy.h
CommitLineData
a0d0e21e 1/* handy.h
a687059c 2 *
4eb8286e 3 * Copyright (c) 1991-1999, Larry Wall
a687059c 4 *
6e21c824
LW
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
8d063cd8 7 *
8d063cd8
LW
8 */
9
85e6fe83 10#if !defined(__STDC__)
378cc40b
LW
11#ifdef NULL
12#undef NULL
13#endif
a687059c
LW
14#ifndef I286
15# define NULL 0
16#else
17# define NULL 0L
18#endif
85e6fe83
LW
19#endif
20
378cc40b 21#define Null(type) ((type)NULL)
8d063cd8 22#define Nullch Null(char*)
760ac839 23#define Nullfp Null(PerlIO*)
79072805 24#define Nullsv Null(SV*)
8d063cd8 25
641d3f0b
PP
26#ifdef TRUE
27#undef TRUE
28#endif
29#ifdef FALSE
30#undef FALSE
31#endif
32#define TRUE (1)
33#define FALSE (0)
34
27d4fb96
PP
35
36/* XXX Configure ought to have a test for a boolean type, if I can
37 just figure out all the headers such a test needs.
38 Andy Dougherty August 1996
39*/
232e078e 40/* bool is built-in for g++-2.6.3, which might be used for an extension.
5d94fbed
AD
41 If the extension includes <_G_config.h> before this file then
42 _G_HAVE_BOOL will be properly set. If, however, the extension includes
43 this file first, then you will have to manually set -DHAS_BOOL in
44 your command line to avoid a conflict.
45*/
46#ifdef _G_HAVE_BOOL
47# if _G_HAVE_BOOL
48# ifndef HAS_BOOL
49# define HAS_BOOL 1
50# endif
51# endif
52#endif
53
641d3f0b
PP
54/* The NeXT dynamic loader headers will not build with the bool macro
55 So declare them now to clear confusion.
56*/
8f1f23e8 57#if defined(NeXT) || defined(__NeXT__)
641d3f0b
PP
58# undef FALSE
59# undef TRUE
60 typedef enum bool { FALSE = 0, TRUE = 1 } bool;
61# define ENUM_BOOL 1
62# ifndef HAS_BOOL
63# define HAS_BOOL 1
64# endif /* !HAS_BOOL */
8f1f23e8 65#endif /* NeXT || __NeXT__ */
641d3f0b 66
5d94fbed 67#ifndef HAS_BOOL
61bb5906 68# if defined(UTS) || defined(VMS)
5d94fbed
AD
69# define bool int
70# else
71# define bool char
72# endif
a687059c 73#endif
0d3e774c 74
27d4fb96
PP
75/* XXX A note on the perl source internal type system. The
76 original intent was that I32 be *exactly* 32 bits.
77
78 Currently, we only guarantee that I32 is *at least* 32 bits.
79 Specifically, if int is 64 bits, then so is I32. (This is the case
80 for the Cray.) This has the advantage of meshing nicely with
81 standard library calls (where we pass an I32 and the library is
82 expecting an int), but the disadvantage that an I32 is not 32 bits.
83 Andy Dougherty August 1996
24fef2a7 84
dc45a647
MB
85 There is no guarantee that there is *any* integral type with
86 exactly 32 bits. It is perfectly legal for a system to have
87 sizeof(short) == sizeof(int) == sizeof(long) == 8.
693762b4 88
dc45a647
MB
89 Similarly, there is no guarantee that I16 and U16 have exactly 16
90 bits.
693762b4 91
dc45a647
MB
92 For dealing with issues that may arise from various 32/64-bit
93 systems, we will ask Configure to check out
8175356b 94
dc45a647
MB
95 SHORTSIZE == sizeof(short)
96 INTSIZE == sizeof(int)
97 LONGSIZE == sizeof(long)
98 LONGLONGSIZE == sizeof(long long) (if HAS_LONG_LONG)
99 PTRSIZE == sizeof(void *)
100 DOUBLESIZE == sizeof(double)
101 LONG_DOUBLESIZE == sizeof(long double) (if HAS_LONG_DOUBLE).
8175356b 102
27d4fb96
PP
103*/
104
8175356b
JH
105typedef I8TYPE I8;
106typedef U8TYPE U8;
107typedef I16TYPE I16;
108typedef U16TYPE U16;
109typedef I32TYPE I32;
110typedef U32TYPE U32;
111typedef I32TYPE I32;
112typedef U32TYPE U32;
113#ifdef Quad_t
114typedef I64TYPE I64;
115typedef U64TYPE U64;
116#endif
117
d8668976 118#if defined(UINT8_MAX) && defined(INT16_MAX) && defined(INT32_MAX)
5ff3f7a4 119
5ff3f7a4
GS
120/* I8_MAX and I8_MIN constants are not defined, as I8 is an ambiguous type.
121 Please search CHAR_MAX in perl.h for further details. */
122#define U8_MAX UINT8_MAX
123#define U8_MIN UINT8_MIN
124
5ff3f7a4
GS
125#define I16_MAX INT16_MAX
126#define I16_MIN INT16_MIN
127#define U16_MAX UINT16_MAX
128#define U16_MIN UINT16_MIN
129
5ff3f7a4
GS
130#define I32_MAX INT32_MAX
131#define I32_MIN INT32_MIN
132#define U32_MAX UINT32_MAX
133#define U32_MIN UINT32_MIN
134
135#else
136
5c9fa16e
KA
137/* I8_MAX and I8_MIN constants are not defined, as I8 is an ambiguous type.
138 Please search CHAR_MAX in perl.h for further details. */
27d4fb96
PP
139#define U8_MAX PERL_UCHAR_MAX
140#define U8_MIN PERL_UCHAR_MIN
79072805 141
27d4fb96
PP
142#define I16_MAX PERL_SHORT_MAX
143#define I16_MIN PERL_SHORT_MIN
144#define U16_MAX PERL_USHORT_MAX
145#define U16_MIN PERL_USHORT_MIN
79072805 146
c4f23d77 147#if LONGSIZE > 4
27d4fb96
PP
148# define I32_MAX PERL_INT_MAX
149# define I32_MIN PERL_INT_MIN
150# define U32_MAX PERL_UINT_MAX
151# define U32_MIN PERL_UINT_MIN
79072805 152#else
27d4fb96
PP
153# define I32_MAX PERL_LONG_MAX
154# define I32_MIN PERL_LONG_MIN
155# define U32_MAX PERL_ULONG_MAX
156# define U32_MIN PERL_ULONG_MIN
79072805
LW
157#endif
158
5ff3f7a4
GS
159#endif
160
fc36a67e
PP
161#define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */
162#define TYPE_DIGITS(T) BIT_DIGITS(sizeof(T) * 8)
163#define TYPE_CHARS(T) (TYPE_DIGITS(T) + 2) /* sign, NUL */
164
ff68c719 165#define Ctl(ch) ((ch) & 037)
8d063cd8
LW
166
167#define strNE(s1,s2) (strcmp(s1,s2))
168#define strEQ(s1,s2) (!strcmp(s1,s2))
169#define strLT(s1,s2) (strcmp(s1,s2) < 0)
170#define strLE(s1,s2) (strcmp(s1,s2) <= 0)
171#define strGT(s1,s2) (strcmp(s1,s2) > 0)
172#define strGE(s1,s2) (strcmp(s1,s2) >= 0)
173#define strnNE(s1,s2,l) (strncmp(s1,s2,l))
174#define strnEQ(s1,s2,l) (!strncmp(s1,s2,l))
378cc40b 175
36477c24
PP
176#ifdef HAS_MEMCMP
177# define memNE(s1,s2,l) (memcmp(s1,s2,l))
178# define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
179#else
180# define memNE(s1,s2,l) (bcmp(s1,s2,l))
181# define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
182#endif
183
bbce6d69
PP
184/*
185 * Character classes.
186 *
187 * Unfortunately, the introduction of locales means that we
188 * can't trust isupper(), etc. to tell the truth. And when
189 * it comes to /\w+/ with tainting enabled, we *must* be able
190 * to trust our character classes.
191 *
192 * Therefore, the default tests in the text of Perl will be
193 * independent of locale. Any code that wants to depend on
194 * the current locale will use the tests that begin with "lc".
195 */
196
2304df62
AD
197#ifdef HAS_SETLOCALE /* XXX Is there a better test for this? */
198# ifndef CTYPE256
199# define CTYPE256
200# endif
201#endif
202
bbce6d69
PP
203#define isALNUM(c) (isALPHA(c) || isDIGIT(c) || (c) == '_')
204#define isIDFIRST(c) (isALPHA(c) || (c) == '_')
205#define isALPHA(c) (isUPPER(c) || isLOWER(c))
206#define isSPACE(c) \
207 ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) =='\r' || (c) == '\f')
208#define isDIGIT(c) ((c) >= '0' && (c) <= '9')
9d116dd7
JH
209#ifdef EBCDIC
210 /* In EBCDIC we do not do locales: therefore() isupper() is fine. */
211# define isUPPER(c) isupper(c)
212# define isLOWER(c) islower(c)
b8c5462f
JH
213# define isALNUMC(c) isalnum(c)
214# define isASCII(c) isascii(c)
215# define isCNTRL(c) iscntrl(c)
216# define isGRAPH(c) isgraph(c)
9d116dd7 217# define isPRINT(c) isprint(c)
b8c5462f
JH
218# define isPUNCT(c) ispunct(c)
219# define isXDIGIT(c) isxdigit(c)
9d116dd7
JH
220# define toUPPER(c) toupper(c)
221# define toLOWER(c) tolower(c)
222#else
223# define isUPPER(c) ((c) >= 'A' && (c) <= 'Z')
224# define isLOWER(c) ((c) >= 'a' && (c) <= 'z')
b8c5462f
JH
225# define isALNUMC(c) (isALPHA(c) || isDIGIT(c))
226# define isASCII(c) ((c) <= 127)
227# define isCNTRL(c) ((c) < ' ')
228# define isGRAPH(c) (isALNUM(c) || isPUNCT(c))
9d116dd7 229# define isPRINT(c) (((c) > 32 && (c) < 127) || isSPACE(c))
b8c5462f
JH
230# define isPUNCT(c) (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64) || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
231# define isXDIGIT(c) (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
9d116dd7
JH
232# define toUPPER(c) (isLOWER(c) ? (c) - ('a' - 'A') : (c))
233# define toLOWER(c) (isUPPER(c) ? (c) + ('a' - 'A') : (c))
234#endif
bbce6d69
PP
235
236#ifdef USE_NEXT_CTYPE
237
238# define isALNUM_LC(c) \
37bd1396 239 (NXIsAlNum((unsigned int)(c)) || (char)(c) == '_')
ff68c719
PP
240# define isIDFIRST_LC(c) \
241 (NXIsAlpha((unsigned int)(c)) || (char)(c) == '_')
242# define isALPHA_LC(c) NXIsAlpha((unsigned int)(c))
243# define isSPACE_LC(c) NXIsSpace((unsigned int)(c))
244# define isDIGIT_LC(c) NXIsDigit((unsigned int)(c))
245# define isUPPER_LC(c) NXIsUpper((unsigned int)(c))
246# define isLOWER_LC(c) NXIsLower((unsigned int)(c))
37bd1396 247# define isALNUMC_LC(c) NXIsAlNum((unsigned int)(c))
b8c5462f
JH
248# define isCNTRL_LC(c) NXIsCntrl((unsigned int)(c))
249# define isGRAPH_LC(c) NXIsGraph((unsigned int)(c))
ff68c719 250# define isPRINT_LC(c) NXIsPrint((unsigned int)(c))
b8c5462f 251# define isPUNCT_LC(c) NXIsPunct((unsigned int)(c))
ff68c719
PP
252# define toUPPER_LC(c) NXToUpper((unsigned int)(c))
253# define toLOWER_LC(c) NXToLower((unsigned int)(c))
bbce6d69
PP
254
255#else /* !USE_NEXT_CTYPE */
b8c5462f 256
bbce6d69
PP
257# if defined(CTYPE256) || (!defined(isascii) && !defined(HAS_ISASCII))
258
b8c5462f 259# define isALNUM_LC(c) (isalnum((unsigned char)(c)) || (char)(c) == '_')
ff68c719 260# define isIDFIRST_LC(c) (isalpha((unsigned char)(c)) || (char)(c) == '_')
bbce6d69
PP
261# define isALPHA_LC(c) isalpha((unsigned char)(c))
262# define isSPACE_LC(c) isspace((unsigned char)(c))
263# define isDIGIT_LC(c) isdigit((unsigned char)(c))
264# define isUPPER_LC(c) isupper((unsigned char)(c))
265# define isLOWER_LC(c) islower((unsigned char)(c))
b8c5462f
JH
266# define isALNUMC_LC(c) isalnum((unsigned char)(c))
267# define isCNTRL_LC(c) iscntrl((unsigned char)(c))
268# define isGRAPH_LC(c) isgraph((unsigned char)(c))
bbce6d69 269# define isPRINT_LC(c) isprint((unsigned char)(c))
b8c5462f 270# define isPUNCT_LC(c) ispunct((unsigned char)(c))
bbce6d69
PP
271# define toUPPER_LC(c) toupper((unsigned char)(c))
272# define toLOWER_LC(c) tolower((unsigned char)(c))
273
274# else
275
b8c5462f 276# define isALNUM_LC(c) (isascii(c) && (isalnum(c) || (c) == '_'))
bbce6d69
PP
277# define isIDFIRST_LC(c) (isascii(c) && (isalpha(c) || (c) == '_'))
278# define isALPHA_LC(c) (isascii(c) && isalpha(c))
279# define isSPACE_LC(c) (isascii(c) && isspace(c))
280# define isDIGIT_LC(c) (isascii(c) && isdigit(c))
281# define isUPPER_LC(c) (isascii(c) && isupper(c))
282# define isLOWER_LC(c) (isascii(c) && islower(c))
b8c5462f
JH
283# define isALNUMC_LC(c) (isascii(c) && isalnum(c))
284# define isCNTRL_LC(c) (isascii(c) && iscntrl(c))
285# define isGRAPH_LC(c) (isascii(c) && isgraph(c))
bbce6d69 286# define isPRINT_LC(c) (isascii(c) && isprint(c))
b8c5462f 287# define isPUNCT_LC(c) (isascii(c) && ispunct(c))
bbce6d69
PP
288# define toUPPER_LC(c) toupper(c)
289# define toLOWER_LC(c) tolower(c)
290
291# endif
a0d0e21e 292#endif /* USE_NEXT_CTYPE */
55204971 293
a0ed51b3
LW
294#define isALNUM_uni(c) is_uni_alnum(c)
295#define isIDFIRST_uni(c) is_uni_idfirst(c)
296#define isALPHA_uni(c) is_uni_alpha(c)
297#define isSPACE_uni(c) is_uni_space(c)
298#define isDIGIT_uni(c) is_uni_digit(c)
299#define isUPPER_uni(c) is_uni_upper(c)
300#define isLOWER_uni(c) is_uni_lower(c)
b8c5462f
JH
301#define isALNUMC_uni(c) is_uni_alnumc(c)
302#define isASCII_uni(c) is_uni_ascii(c)
303#define isCNTRL_uni(c) is_uni_cntrl(c)
304#define isGRAPH_uni(c) is_uni_graph(c)
a0ed51b3 305#define isPRINT_uni(c) is_uni_print(c)
b8c5462f
JH
306#define isPUNCT_uni(c) is_uni_punct(c)
307#define isXDIGIT_uni(c) is_uni_xdigit(c)
a0ed51b3
LW
308#define toUPPER_uni(c) to_uni_upper(c)
309#define toTITLE_uni(c) to_uni_title(c)
310#define toLOWER_uni(c) to_uni_lower(c)
311
312#define isALNUM_LC_uni(c) (c < 256 ? isALNUM_LC(c) : is_uni_alnum_lc(c))
313#define isIDFIRST_LC_uni(c) (c < 256 ? isIDFIRST_LC(c) : is_uni_idfirst_lc(c))
314#define isALPHA_LC_uni(c) (c < 256 ? isALPHA_LC(c) : is_uni_alpha_lc(c))
315#define isSPACE_LC_uni(c) (c < 256 ? isSPACE_LC(c) : is_uni_space_lc(c))
316#define isDIGIT_LC_uni(c) (c < 256 ? isDIGIT_LC(c) : is_uni_digit_lc(c))
317#define isUPPER_LC_uni(c) (c < 256 ? isUPPER_LC(c) : is_uni_upper_lc(c))
318#define isLOWER_LC_uni(c) (c < 256 ? isLOWER_LC(c) : is_uni_lower_lc(c))
b8c5462f
JH
319#define isALNUMC_LC_uni(c) (c < 256 ? isALNUMC_LC(c) : is_uni_alnumc_lc(c))
320#define isCNTRL_LC_uni(c) (c < 256 ? isCNTRL_LC(c) : is_uni_cntrl_lc(c))
321#define isGRAPH_LC_uni(c) (c < 256 ? isGRAPH_LC(c) : is_uni_graph_lc(c))
a0ed51b3 322#define isPRINT_LC_uni(c) (c < 256 ? isPRINT_LC(c) : is_uni_print_lc(c))
b8c5462f 323#define isPUNCT_LC_uni(c) (c < 256 ? isPUNCT_LC(c) : is_uni_punct_lc(c))
a0ed51b3
LW
324#define toUPPER_LC_uni(c) (c < 256 ? toUPPER_LC(c) : to_uni_upper_lc(c))
325#define toTITLE_LC_uni(c) (c < 256 ? toUPPER_LC(c) : to_uni_title_lc(c))
326#define toLOWER_LC_uni(c) (c < 256 ? toLOWER_LC(c) : to_uni_lower_lc(c))
327
328#define isALNUM_utf8(p) is_utf8_alnum(p)
329#define isIDFIRST_utf8(p) is_utf8_idfirst(p)
330#define isALPHA_utf8(p) is_utf8_alpha(p)
331#define isSPACE_utf8(p) is_utf8_space(p)
332#define isDIGIT_utf8(p) is_utf8_digit(p)
333#define isUPPER_utf8(p) is_utf8_upper(p)
334#define isLOWER_utf8(p) is_utf8_lower(p)
b8c5462f
JH
335#define isALNUMC_utf8(p) is_utf8_alnumc(p)
336#define isASCII_utf8(p) is_utf8_ascii(p)
337#define isCNTRL_utf8(p) is_utf8_cntrl(p)
338#define isGRAPH_utf8(p) is_utf8_graph(p)
a0ed51b3 339#define isPRINT_utf8(p) is_utf8_print(p)
b8c5462f
JH
340#define isPUNCT_utf8(p) is_utf8_punct(p)
341#define isXDIGIT_utf8(p) is_utf8_xdigit(p)
a0ed51b3
LW
342#define toUPPER_utf8(p) to_utf8_upper(p)
343#define toTITLE_utf8(p) to_utf8_title(p)
344#define toLOWER_utf8(p) to_utf8_lower(p)
345
346#define isALNUM_LC_utf8(p) isALNUM_LC_uni(utf8_to_uv(p, 0))
347#define isIDFIRST_LC_utf8(p) isIDFIRST_LC_uni(utf8_to_uv(p, 0))
348#define isALPHA_LC_utf8(p) isALPHA_LC_uni(utf8_to_uv(p, 0))
349#define isSPACE_LC_utf8(p) isSPACE_LC_uni(utf8_to_uv(p, 0))
350#define isDIGIT_LC_utf8(p) isDIGIT_LC_uni(utf8_to_uv(p, 0))
351#define isUPPER_LC_utf8(p) isUPPER_LC_uni(utf8_to_uv(p, 0))
352#define isLOWER_LC_utf8(p) isLOWER_LC_uni(utf8_to_uv(p, 0))
b8c5462f
JH
353#define isALNUMC_LC_utf8(p) isALNUMC_LC_uni(utf8_to_uv(p, 0))
354#define isCNTRL_LC_utf8(p) isCNTRL_LC_uni(utf8_to_uv(p, 0))
355#define isGRAPH_LC_utf8(p) isGRAPH_LC_uni(utf8_to_uv(p, 0))
a0ed51b3 356#define isPRINT_LC_utf8(p) isPRINT_LC_uni(utf8_to_uv(p, 0))
b8c5462f 357#define isPUNCT_LC_utf8(p) isPUNCT_LC_uni(utf8_to_uv(p, 0))
a0ed51b3
LW
358#define toUPPER_LC_utf8(p) toUPPER_LC_uni(utf8_to_uv(p, 0))
359#define toTITLE_LC_utf8(p) toTITLE_LC_uni(utf8_to_uv(p, 0))
360#define toLOWER_LC_utf8(p) toLOWER_LC_uni(utf8_to_uv(p, 0))
361
9d116dd7 362#ifdef EBCDIC
20ce7b12 363EXT int ebcdic_control (int);
9d116dd7
JH
364# define toCTRL(c) ebcdic_control(c)
365#else
366 /* This conversion works both ways, strangely enough. */
367# define toCTRL(c) (toUPPER(c) ^ 64)
368#endif
bbce6d69 369
378cc40b 370/* Line numbers are unsigned, 16 bits. */
79072805 371typedef U16 line_t;
378cc40b
LW
372#ifdef lint
373#define NOLINE ((line_t)0)
374#else
375#define NOLINE ((line_t) 65535)
376#endif
377
8c52afec
IZ
378
379/* This looks obsolete (IZ):
380
381 XXX LEAKTEST doesn't really work in perl5. There are direct calls to
27d4fb96
PP
382 safemalloc() in the source, so LEAKTEST won't pick them up.
383 Further, if you try LEAKTEST, you'll also end up calling
384 Safefree, which might call safexfree() on some things that weren't
385 malloced with safexmalloc. The correct "fix" to this, if anyone
386 is interested, is to ensure that all calls go through the New and
387 Renew macros.
388 --Andy Dougherty August 1996
389*/
55497cff 390
a687059c 391#ifndef lint
ff06c60c
IZ
392
393#define NEWSV(x,len) newSV(len)
394
a687059c 395#ifndef LEAKTEST
598a3d64 396
ff68c719
PP
397#define New(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n)*sizeof(t))))
398#define Newc(x,v,n,t,c) (v = (c*)safemalloc((MEM_SIZE)((n)*sizeof(t))))
399#define Newz(x,v,n,t) (v = (t*)safemalloc((MEM_SIZE)((n)*sizeof(t)))), \
400 memzero((char*)(v), (n)*sizeof(t))
401#define Renew(v,n,t) \
402 (v = (t*)saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t))))
403#define Renewc(v,n,t,c) \
404 (v = (c*)saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t))))
405#define Safefree(d) safefree((Malloc_t)(d))
55497cff 406
a687059c 407#else /* LEAKTEST */
55497cff 408
ff68c719
PP
409#define New(x,v,n,t) (v = (t*)safexmalloc((x),(MEM_SIZE)((n)*sizeof(t))))
410#define Newc(x,v,n,t,c) (v = (c*)safexmalloc((x),(MEM_SIZE)((n)*sizeof(t))))
411#define Newz(x,v,n,t) (v = (t*)safexmalloc((x),(MEM_SIZE)((n)*sizeof(t)))), \
412 memzero((char*)(v), (n)*sizeof(t))
413#define Renew(v,n,t) \
414 (v = (t*)safexrealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t))))
415#define Renewc(v,n,t,c) \
416 (v = (c*)safexrealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t))))
8c52afec 417#define Safefree(d) safexfree((Malloc_t)(d))
ff68c719 418
fc36a67e 419#define MAXXCOUNT 1400
8c52afec
IZ
420#define MAXY_SIZE 80
421#define MAXYCOUNT 16 /* (MAXY_SIZE/4 + 1) */
422extern long xcount[MAXXCOUNT];
423extern long lastxcount[MAXXCOUNT];
424extern long xycount[MAXXCOUNT][MAXYCOUNT];
425extern long lastxycount[MAXXCOUNT][MAXYCOUNT];
55497cff 426
a687059c 427#endif /* LEAKTEST */
55497cff 428
ff68c719
PP
429#define Move(s,d,n,t) (void)memmove((char*)(d),(char*)(s), (n) * sizeof(t))
430#define Copy(s,d,n,t) (void)memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
431#define Zero(d,n,t) (void)memzero((char*)(d), (n) * sizeof(t))
55497cff 432
a687059c 433#else /* lint */
55497cff 434
ff68c719
PP
435#define New(x,v,n,s) (v = Null(s *))
436#define Newc(x,v,n,s,c) (v = Null(s *))
437#define Newz(x,v,n,s) (v = Null(s *))
438#define Renew(v,n,s) (v = Null(s *))
bee1dbe2 439#define Move(s,d,n,t)
a687059c
LW
440#define Copy(s,d,n,t)
441#define Zero(d,n,t)
ff68c719 442#define Safefree(d) (d) = (d)
55497cff 443
a687059c 444#endif /* lint */
bee1dbe2 445
2304df62 446#ifdef USE_STRUCT_COPY
ff68c719 447#define StructCopy(s,d,t) (*((t*)(d)) = *((t*)(s)))
bee1dbe2
LW
448#else
449#define StructCopy(s,d,t) Copy(s,d,1,t)
450#endif