2 * alloc - storage allocation and storage debug macros
4 * Copyright (C) 1999-2007 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 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * @(#) $Revision: 30.3 $
21 * @(#) $Id: alloc.h,v 30.3 2013/08/11 08:41:38 chongo Exp $
22 * @(#) $Source: /usr/local/src/bin/calc/RCS/alloc.h,v $
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 "have_newstr.h"
37 # include "have_string.h"
38 # include "have_memmv.h"
40 # include <calc/have_newstr.h>
41 # include <calc/have_string.h>
42 # include <calc/have_memmv.h>
49 #if defined(_WIN32) && defined(NOTCYGWIN)
53 # if defined(HAVE_NEWSTR)
54 E_FUNC
void *memcpy();
55 E_FUNC
void *memset();
56 #if defined(FORCE_STDC) || \
57 (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
58 E_FUNC
size_t strlen();
62 # else /* HAVE_NEWSTR */
66 # endif /* HAVE_NEWSTR */
67 E_FUNC
char *strchr();
68 E_FUNC
char *strcpy();
69 E_FUNC
char *strncpy();
70 E_FUNC
char *strcat();
75 #if !defined(HAVE_NEWSTR)
77 #define memcpy(s1, s2, n) bcopy(s2, s1, n)
79 #define memset(s, c, n) bfill(s, n, c)
81 #define strchr(s, c) index(s, c)
82 #endif /* HAVE_NEWSTR */
84 #if !defined(HAVE_MEMMOVE)
85 # undef MEMMOVE_SIZE_T
86 #if defined(FORCE_STDC) || \
87 (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
88 # define MEMMOVE_SIZE_T size_t
90 # define MEMMOVE_SIZE_T long
92 E_FUNC
void *memmove(void *s1
, CONST
void *s2
, MEMMOVE_SIZE_T n
);
95 #endif /* !__ALLOC_H__ */