more work on local variable support
[cparser] / adt / xmalloc.h
1 /**
2  * @file
3  * @brief     More comfortable allocations.
4  * @author    Markus Armbruster
5  * @data      1999 by getting from fiasco
6  * @version   $Id$
7  * Copyright: (c) 1995, 1996 Markus Armbruster
8  * Licence:   This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
9  */
10 #ifndef _XMALLOC_H_
11 #define _XMALLOC_H_
12
13 #include <stdlib.h>
14
15 __attribute__((malloc))
16 void *xmalloc(size_t size);
17
18 __attribute__((malloc))
19 void *xcalloc(size_t num, size_t size);
20
21 void *xrealloc(void *ptr, size_t size);
22
23 __attribute__((malloc))
24 char *xstrdup(const char *str);
25
26 #define xfree(ptr)      free(ptr)
27
28 #endif