C Standard Library Extensions: qfits_memory.h Source File

C Standard Library Extensions 6.2.0

- Main Page
- Modules
- Classes
- Files

- File List

qfits_memory.h
1 /* $Id: qfits_memory.h,v 1.1.1.1 2008-11-03 13:40:49 agabasch Exp $
2 *
3 * This file is part of the ESO QFITS Library
4 * Copyright (C) 2001-2004 European Southern Observatory
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 /*
22 * $Author: agabasch $
23 * $Date: 2008-11-03 13:40:49 $
24 * $Revision: 1.1.1.1 $
25 * $Name: not supported by cvs2svn $
26 */
27
28 #ifndef QFITS_MEMORY_H
29 #define QFITS_MEMORY_H
30
31 /*-----------------------------------------------------------------------------
32 Includes
33 -----------------------------------------------------------------------------*/
34
35 #include <stdio.h>
36 #include <stdlib.h>
37 #include <string.h>
38
39 /*-----------------------------------------------------------------------------
40 Defines
41 -----------------------------------------------------------------------------*/
42
43 #define qfits_malloc(s) qfits_memory_malloc(s, __FILE__,__LINE__)
44 #define qfits_calloc(n,s) qfits_memory_calloc(n,s, __FILE__,__LINE__)
45 #define qfits_realloc(p,s) qfits_memory_realloc(p,s, __FILE__,__LINE__)
46 #define qfits_free(p) qfits_memory_free(p, __FILE__,__LINE__)
47 #define qfits_strdup(s) qfits_memory_strdup(s, __FILE__,__LINE__)
48 #define qfits_falloc(f,o,s) qfits_memory_falloc(f,o,s, __FILE__,__LINE__)
49 #define qfits_fdealloc(f,o,s) qfits_memory_fdealloc(f,o,s,__FILE__,__LINE__)
50
51 /*-----------------------------------------------------------------------------
52 Function prototypes
53 -----------------------------------------------------------------------------*/
54
55 /* *********************************************************************** */
56 /* These functions have to be called by the assiciated macro defined above */
57 void * qfits_memory_malloc(size_t, const char *, int) ;
58 void * qfits_memory_calloc(size_t, size_t, const char *, int) ;
59 void * qfits_memory_realloc(void *, size_t, const char *, int) ;
60 void qfits_memory_free(void *, const char *, int) ;
61 char * qfits_memory_strdup(const char *, const char *, int) ;
62 char * qfits_memory_falloc(char *, size_t, size_t *, const char *, int) ;
63 void qfits_memory_fdealloc(void *, size_t, size_t, const char *, int) ;
64 /* *********************************************************************** */
65
66 void qfits_memory_status(void) ;
67 int qfits_memory_is_empty(void) ;
68
69 #endif