source: trunk/gsdl/packages/yaz/include/yaz/xmalloc.h@ 1343

Last change on this file since 1343 was 1343, checked in by johnmcp, 24 years ago

Added the YAZ toolkit source to the packages directory (for z39.50 stuff)

  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/*
2 * Copyright (c) 1995-2000, Index Data.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation, in whole or in part, for any purpose, is hereby granted,
6 * provided that:
7 *
8 * 1. This copyright and permission notice appear in all copies of the
9 * software and its documentation. Notices of copyright or attribution
10 * which appear at the beginning of any file must remain unchanged.
11 *
12 * 2. The names of Index Data or the individual authors may not be used to
13 * endorse or promote products derived from this software without specific
14 * prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19 * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20 * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22 * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24 * OF THIS SOFTWARE.
25 *
26 * $Log$
27 * Revision 1.1 2000/08/03 03:10:52 johnmcp
28 * Added the YAZ toolkit source to the packages directory (for z39.50 stuff)
29 *
30 * Revision 1.2 2000/02/28 11:20:06 adam
31 * Using autoconf. New definitions: YAZ_BEGIN_CDECL/YAZ_END_CDECL.
32 *
33 * Revision 1.1 1999/11/30 13:47:11 adam
34 * Improved installation. Moved header files to include/yaz.
35 *
36 * Revision 1.6 1999/07/13 13:24:53 adam
37 * Updated memory debugging memory allocatation routines.
38 *
39 * Revision 1.5 1998/07/20 12:36:22 adam
40 * Minor changes.
41 *
42 * Revision 1.4 1997/10/31 12:20:08 adam
43 * Improved memory debugging for xmalloc/nmem.c. References to NMEM
44 * instead of ODR in n ESPEC-1 handling in source d1_espec.c.
45 * Bug fix: missing fclose in data1_read_espec1.
46 *
47 * Revision 1.3 1997/09/01 08:49:54 adam
48 * New windows NT/95 port using MSV5.0. To export DLL functions the
49 * YAZ_EXPORT modifier was added. Defined in yconfig.h.
50 *
51 * Revision 1.2 1997/05/14 06:53:53 adam
52 * C++ support.
53 *
54 * Revision 1.1 1995/11/01 11:55:41 quinn
55 * Added xmalloc.c
56 *
57 * Revision 1.8 1995/10/16 14:03:07 quinn
58 * Changes to support element set names and espec1
59 *
60 * Revision 1.7 1994/10/05 10:15:18 quinn
61 * Added xrealloc.
62 *
63 * Revision 1.6 1994/09/26 16:31:24 adam
64 * Minor changes. xmalloc declares xcalloc now.
65 *
66 * Revision 1.5 1994/09/19 15:46:34 quinn
67 * Added stdlib.h
68 *
69 * Revision 1.4 1994/08/18 08:22:27 adam
70 * Res.h modified. xmalloc now declares xstrdup.
71 *
72 * Revision 1.3 1994/08/17 15:34:15 adam
73 * Initial version of resource manager.
74 *
75 * Revision 1.2 1994/08/17 14:09:48 quinn
76 * Small changes
77 *
78 * Revision 1.1 1994/08/17 13:39:07 adam
79 * Added xmalloc header.
80 *
81 * Revision 1.1 1994/08/16 16:16:02 adam
82 * bfile header created.
83 *
84 */
85
86#ifndef XMALLOC_H
87#define XMALLOC_H
88
89#include <sys/types.h>
90#include <stdlib.h>
91
92#include <yaz/yconfig.h>
93
94YAZ_BEGIN_CDECL
95
96#define xrealloc(o, x) xrealloc_f(o, x, __FILE__, __LINE__)
97#define xmalloc(x) xmalloc_f(x, __FILE__, __LINE__)
98#define xcalloc(x,y) xcalloc_f(x,y, __FILE__, __LINE__)
99#define xfree(x) xfree_f(x, __FILE__, __LINE__)
100#define xstrdup(s) xstrdup_f(s, __FILE__, __LINE__)
101#define xmalloc_trav(s) xmalloc_trav_f(s, __FILE__, __LINE__)
102
103YAZ_EXPORT void *xrealloc_f (void *o, size_t size, const char *file, int line);
104YAZ_EXPORT void *xmalloc_f (size_t size, const char *file, int line);
105YAZ_EXPORT void *xcalloc_f (size_t nmemb, size_t size,
106 const char *file, int line);
107YAZ_EXPORT char *xstrdup_f (const char *p, const char *file, int line);
108YAZ_EXPORT void xfree_f (void *p, const char *file, int line);
109YAZ_EXPORT void xmalloc_trav_f(const char *s, const char *file, int line);
110
111YAZ_END_CDECL
112
113#endif
Note: See TracBrowser for help on using the repository browser.