summaryrefslogtreecommitdiff
path: root/src/postprocess/cleanindex.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2014-02-20 02:46:41 +0100
committerDirk Engling <erdgeist@erdgeist.org>2014-02-20 02:46:41 +0100
commit64c85dfc1d3b546dd4b5f84168e9256817f3a741 (patch)
treee3de2e7a99362bfa1dfcde3d4bad3e76af179c61 /src/postprocess/cleanindex.c
parent632c350fcf2021620afd032994e6e32c34c6dbfb (diff)
clean up source directory
Diffstat (limited to 'src/postprocess/cleanindex.c')
-rw-r--r--src/postprocess/cleanindex.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/postprocess/cleanindex.c b/src/postprocess/cleanindex.c
new file mode 100644
index 0000000..fb15bed
--- /dev/null
+++ b/src/postprocess/cleanindex.c
@@ -0,0 +1,23 @@
1#include "mystdlib.h"
2#include <sys/mman.h>
3#include <fcntl.h>
4
5static int indexed = -1;
6
7int main( int argc, char **argv ) {
8 MAP index = NULL;
9 int i;
10
11 if( argc != 2 )
12 { fputs( "Syntax: cleanindex <indexfile>", stderr); exit( 1 ); }
13
14 if( !(index = map_file( argv[1], 0 ) ) ) exit( 1 );
15
16 for( i = 0; i < index->size; i+= 16 )
17 *((unsigned long*)(index->addr + i)) += *((unsigned char*)index->addr + i + 4);
18
19 unmap_file( &index );
20 close( indexed );
21
22 return 0;
23}