summaryrefslogtreecommitdiff
path: root/src/postprocess/cleanindex.c
diff options
context:
space:
mode:
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}