diff options
author | erdgeist <> | 2004-05-09 14:53:42 +0000 |
---|---|---|
committer | erdgeist <> | 2004-05-09 14:53:42 +0000 |
commit | 73827ba1f4a50107272d6e465b92f356fb9e0abe (patch) | |
tree | f2015abf0f17b7ca80f3ba55eb62b89a2dd7406a /src/cleanindex.c | |
parent | c2011c5def9154c9a48f5e7e17d48d840aad675d (diff) |
initial
Diffstat (limited to 'src/cleanindex.c')
-rw-r--r-- | src/cleanindex.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/cleanindex.c b/src/cleanindex.c new file mode 100644 index 0000000..fb15bed --- /dev/null +++ b/src/cleanindex.c | |||
@@ -0,0 +1,23 @@ | |||
1 | #include "mystdlib.h" | ||
2 | #include <sys/mman.h> | ||
3 | #include <fcntl.h> | ||
4 | |||
5 | static int indexed = -1; | ||
6 | |||
7 | int 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 | } | ||