Initial revision
[imager.git] / imio.h
... / ...
CommitLineData
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 myfree(x) (myfree_file_line((x), __FILE__, __LINE__))
19
20void malloc_state();
21void* mymalloc_file_line(int size,char* file,int line);
22void* mymalloc_comm(int size,char *comm);
23
24void myfree_file_line(void *p, char*file, int line);
25
26void bndcheck_all(void);
27
28#else
29
30#define malloc_comm(a,b) (mymalloc(a))
31void malloc_state();
32void* mymalloc(int size);
33void myfree(void *p);
34
35#endif /* IMAGER_MALLOC_DEBUG */
36
37
38#ifdef _MSC_VER
39#undef min
40#undef max
41#endif
42int min(int a,int b);
43int max(int x,int y);
44int myread(int fd,void *buf,int len);
45int mywrite(int fd,void *buf,int len);
46void interleave(unsigned char *inbuffer,unsigned char *outbuffer,int rowsize,int channels);
47
48#endif