diff options
author | dan miller | 2007-10-21 08:36:32 +0000 |
---|---|---|
committer | dan miller | 2007-10-21 08:36:32 +0000 |
commit | 2f8d7092bc2c9609fa98d6888106b96f38b22828 (patch) | |
tree | da6c37579258cc965b52a75aee6135fe44237698 /libraries/sqlite/unix/sqlite-3.5.1/tool/diffdb.c | |
parent | * Committing new PolicyManager based on an ACL system. (diff) | |
download | opensim-SC-2f8d7092bc2c9609fa98d6888106b96f38b22828.zip opensim-SC-2f8d7092bc2c9609fa98d6888106b96f38b22828.tar.gz opensim-SC-2f8d7092bc2c9609fa98d6888106b96f38b22828.tar.bz2 opensim-SC-2f8d7092bc2c9609fa98d6888106b96f38b22828.tar.xz |
libraries moved to opensim-libs, a new repository
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/tool/diffdb.c')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/tool/diffdb.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/tool/diffdb.c b/libraries/sqlite/unix/sqlite-3.5.1/tool/diffdb.c deleted file mode 100644 index 0537d38..0000000 --- a/libraries/sqlite/unix/sqlite-3.5.1/tool/diffdb.c +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | /* | ||
2 | ** A utility for printing the differences between two SQLite database files. | ||
3 | */ | ||
4 | #include <stdio.h> | ||
5 | #include <ctype.h> | ||
6 | #include <sys/types.h> | ||
7 | #include <sys/stat.h> | ||
8 | #include <fcntl.h> | ||
9 | #include <unistd.h> | ||
10 | #include <stdlib.h> | ||
11 | |||
12 | |||
13 | #define PAGESIZE 1024 | ||
14 | static int db1 = -1; | ||
15 | static int db2 = -1; | ||
16 | |||
17 | int main(int argc, char **argv){ | ||
18 | int iPg; | ||
19 | unsigned char a1[PAGESIZE], a2[PAGESIZE]; | ||
20 | if( argc!=3 ){ | ||
21 | fprintf(stderr,"Usage: %s FILENAME FILENAME\n", argv[0]); | ||
22 | exit(1); | ||
23 | } | ||
24 | db1 = open(argv[1], O_RDONLY); | ||
25 | if( db1<0 ){ | ||
26 | fprintf(stderr,"%s: can't open %s\n", argv[0], argv[1]); | ||
27 | exit(1); | ||
28 | } | ||
29 | db2 = open(argv[2], O_RDONLY); | ||
30 | if( db2<0 ){ | ||
31 | fprintf(stderr,"%s: can't open %s\n", argv[0], argv[2]); | ||
32 | exit(1); | ||
33 | } | ||
34 | iPg = 1; | ||
35 | while( read(db1, a1, PAGESIZE)==PAGESIZE && read(db2,a2,PAGESIZE)==PAGESIZE ){ | ||
36 | if( memcmp(a1,a2,PAGESIZE) ){ | ||
37 | printf("Page %d\n", iPg); | ||
38 | } | ||
39 | iPg++; | ||
40 | } | ||
41 | printf("%d pages checked\n", iPg-1); | ||
42 | close(db1); | ||
43 | close(db2); | ||
44 | } | ||