summaryrefslogtreecommitdiff
path: root/src/mystdlib.h
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2014-02-20 22:42:56 +0100
committerDirk Engling <erdgeist@erdgeist.org>2014-02-20 22:42:56 +0100
commit046857dfb88f05e6b310fe9ef07b9f2d3ac5922d (patch)
tree9ce854f9572168c3ec1fe6751276430fa4a79cd9 /src/mystdlib.h
parent64c85dfc1d3b546dd4b5f84168e9256817f3a741 (diff)
Restructure project, make names more clear
Diffstat (limited to 'src/mystdlib.h')
-rw-r--r--src/mystdlib.h32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/mystdlib.h b/src/mystdlib.h
deleted file mode 100644
index 2e9499f..0000000
--- a/src/mystdlib.h
+++ /dev/null
@@ -1,32 +0,0 @@
1#include <sys/types.h>
2#include <stdio.h>
3
4typedef struct { int fh; unsigned char *addr; size_t size; } *MAP;
5
6/* Mapps a file into memory
7 returns pointer to the mapping struct,
8 containing the file's size, the mapped
9 address and its file handle.
10
11 If readonly is true, the file will be
12 opened and mapped read only. File is
13 opened and mapped writable, if false.
14
15 Returns NULL if memory could not be
16 allocated, file could not be opened or
17 mapped. Gives out an diagnostic message
18 on stderr
19*/
20MAP map_file( char *filename, int readonly );
21
22/* Unmapps a file from memory. NULL pointer
23 checks are being done, so this is safe
24 to be called from cleanup without knowing
25 whether there actually is a map.
26*/
27void unmap_file ( MAP *pMap );
28
29/* Gets file size of open file
30 returns != 0 in case of error */
31inline int getfilesize( int fd, unsigned long *size );
32