]> git.imager.perl.org - imager.git/blob - imio.h
Fixes to the scale function so that edges are handled by extending the edges
[imager.git] / imio.h
1 #ifndef _IO_H_
2 #define _IO_H_
3 #include <stdio.h>
4 #include <sys/stat.h>
5 #ifndef _MSC_VER
6 #include <unistd.h>
7 #include <sys/mman.h>
8 #endif
9
10 #include "log.h"
11
12
13 /* #define MALLOC_DEBUG */
14
15 #ifdef IMAGER_DEBUG_MALLOC
16
17 #define mymalloc(x) (mymalloc_file_line((x), __FILE__, __LINE__))
18 #define myrealloc(x,y) (myrealloc_file_line((x),(y), __FILE__, __LINE__))
19 #define myfree(x) (myfree_file_line((x), __FILE__, __LINE__))
20
21 void  malloc_state       ();
22 void* mymalloc_file_line (size_t size, char* file, int line);
23 void  myfree_file_line   (void *p, char*file, int line);
24 void* myrealloc_file_line(void *p, size_t newsize, char* file,int line);
25 void* mymalloc_comm      (int size, char *comm);
26 void  bndcheck_all       (void);
27
28 #else
29
30 #define malloc_comm(a,b) (mymalloc(a))
31 void  malloc_state(void);
32 void* mymalloc(int size);
33 void  myfree(void *p);
34 void* myrealloc(void *p, size_t newsize);
35
36 #endif /* IMAGER_MALLOC_DEBUG */
37
38
39 #ifdef _MSC_VER
40 #undef min
41 #undef max
42 #endif
43
44 /* XXX Shouldn't these go away? */
45
46 int min(int a,int b);
47 int max(int x,int y);
48
49 #endif