2 #pragma ident "%Z%%M% %I% %E% SMI"
5 ** A utility for printing the differences between two SQLite database files.
20 int main(int argc
, char **argv
){
22 unsigned char a1
[PAGESIZE
], a2
[PAGESIZE
];
24 fprintf(stderr
,"Usage: %s FILENAME FILENAME\n", argv
[0]);
27 db1
= open(argv
[1], O_RDONLY
);
29 fprintf(stderr
,"%s: can't open %s\n", argv
[0], argv
[1]);
32 db2
= open(argv
[2], O_RDONLY
);
34 fprintf(stderr
,"%s: can't open %s\n", argv
[0], argv
[2]);
38 while( read(db1
, a1
, PAGESIZE
)==PAGESIZE
&& read(db2
,a2
,PAGESIZE
)==PAGESIZE
){
39 if( memcmp(a1
,a2
,PAGESIZE
) ){
40 printf("Page %d\n", iPg
);
44 printf("%d pages checked\n", iPg
-1);