diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2014-02-20 22:42:56 +0100 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2014-02-20 22:42:56 +0100 |
commit | 046857dfb88f05e6b310fe9ef07b9f2d3ac5922d (patch) | |
tree | 9ce854f9572168c3ec1fe6751276430fa4a79cd9 /src/mystdlib.h | |
parent | 64c85dfc1d3b546dd4b5f84168e9256817f3a741 (diff) |
Restructure project, make names more clear
Diffstat (limited to 'src/mystdlib.h')
-rw-r--r-- | src/mystdlib.h | 32 |
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 | |||
4 | typedef 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 | */ | ||
20 | MAP 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 | */ | ||
27 | void unmap_file ( MAP *pMap ); | ||
28 | |||
29 | /* Gets file size of open file | ||
30 | returns != 0 in case of error */ | ||
31 | inline int getfilesize( int fd, unsigned long *size ); | ||
32 | |||