2 * alloc - storage allocation and storage debug macros
4 * Copyright (C) 1999 David I. Bell
6 * Calc is open software; you can redistribute it and/or modify it under
7 * the terms of the version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
10 * Calc is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 * Public License for more details.
15 * A copy of version 2.1 of the GNU Lesser General Public License is
16 * distributed with calc under the filename COPYING-LGPL. You should have
17 * received a copy with calc; if not, write to Free Software Foundation, Inc.
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
24 * Under source code control: 1990/02/15 01:48:29
25 * File existed as early as: before 1990
27 * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
31 #if !defined(__ALLOC_H__)
35 #if defined(CALC_SRC) /* if we are building from the calc source tree */
36 # include "calc/have_malloc.h"
37 # include "calc/have_newstr.h"
38 # include "calc/have_string.h"
39 # include "calc/have_memmv.h"
41 # include <calc/have_malloc.h>
42 # include <calc/have_newstr.h>
43 # include <calc/have_string.h>
44 # include <calc/have_memmv.h>
50 #if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
51 extern void *malloc();
52 extern void *realloc();
55 extern char *malloc();
56 extern char *realloc();
66 # if defined(HAVE_NEWSTR)
67 extern void *memcpy();
68 extern void *memset();
69 #if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
70 extern size_t strlen();
74 # else /* HAVE_NEWSTR */
78 # endif /* HAVE_NEWSTR */
79 extern char *strchr();
80 extern char *strcpy();
81 extern char *strncpy();
82 extern char *strcat();
87 #if !defined(HAVE_NEWSTR)
89 #define memcpy(s1, s2, n) bcopy(s2, s1, n)
91 #define memset(s, c, n) bfill(s, n, c)
93 #define strchr(s, c) index(s, c)
94 #endif /* HAVE_NEWSTR */
96 #if !defined(HAVE_MEMMOVE)
98 #if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
99 # define CALC_SIZE_T size_t
101 # define CALC_SIZE_T long
103 extern void *memmove(void *s1, const void *s2, CALC_SIZE_T n);
106 #endif /* !__ALLOC_H__ */