source: MondoRescue/branches/3.3/mondo/src/include/mr_mem.h@ 3708

Last change on this file since 3708 was 3708, checked in by Bruno Cornec, 6 years ago

daptation for gcc 5 (inline funcs mngt)

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1/*
2 * $Id$
3 *
4 * Header file of mr_mem: a set of function manipulating memory
5 * Provided under the GPL v2
6 */
7
8#ifndef MR_MEM_H
9#define MR_MEM_H
10
11#ifndef _GNU_SOURCE
12#define _GNU_SOURCE
13#endif
14#include <stdarg.h>
15#include <stdio.h>
16#include "mr_std.h"
17
18/* functions (public methods) */
19
20#define mr_free(x) mr_free_int((void **)&x,__LINE__,__FILE__)
21#define mr_allocstr(x,y) mr_allocstr_int(x,y,__LINE__,__FILE__)
22#define mr_asprintf(x,y,args...) mr_asprintf_int((char **)&x,__LINE__,__FILE__,y,## args)
23#define mr_getline(x,y) mr_getline_int((char **)&x,y,__LINE__,__FILE__)
24#define mr_malloc(x) mr_malloc_int((size_t)x,__LINE__,__FILE__)
25#define mr_setenv(x,y) mr_setenv_int(x,y,__LINE__,__FILE__)
26#define mr_strcat(x,y,args...) mr_strcat_int((char **)&x, __LINE__,__FILE__, y,## args);
27
28/* Internal function bringing debuging info
29 * called indirectly through macros */
30MR_EXTERN void mr_free_int(void **allocated, int line, char *file);
31MR_EXTERN void mr_allocstr_int(char *alloc, const char *orig, int line, char *file);
32MR_EXTERN void mr_asprintf_int(char **alloc, int line, char *file, const char *fmt, ...);
33MR_EXTERN void mr_getline_int(char **lineptr, FILE *stream, int line, char *file);
34MR_EXTERN void *mr_malloc_int(size_t size, int line, char *file);
35MR_EXTERN void mr_setenv_int(const char *name, const char *value, int line, char *file);
36extern void mr_strcat_int(char **in, int line, char *file, const char *fmt, ...);
37
38#endif /* MR_MEM_H */
Note: See TracBrowser for help on using the repository browser.