summaryrefslogtreecommitdiffstats
path: root/lib/libsqlite3/tool/diffdb.c
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2016-09-23 09:21:58 +0000
committersthen <sthen@openbsd.org>2016-09-23 09:21:58 +0000
commit25e4f8ab5acd0ef40feec6767a572bebbbe294b3 (patch)
tree20197c0e46bb6d260f4a310b6d5dd73b8d826f01 /lib/libsqlite3/tool/diffdb.c
parentremove usr.bin/sqlite3, it has moved back to ports (diff)
downloadwireguard-openbsd-25e4f8ab5acd0ef40feec6767a572bebbbe294b3.tar.xz
wireguard-openbsd-25e4f8ab5acd0ef40feec6767a572bebbbe294b3.zip
remove lib/libsqlite3, it has moved back to ports
Diffstat (limited to 'lib/libsqlite3/tool/diffdb.c')
-rw-r--r--lib/libsqlite3/tool/diffdb.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/lib/libsqlite3/tool/diffdb.c b/lib/libsqlite3/tool/diffdb.c
deleted file mode 100644
index 0537d38723e..00000000000
--- a/lib/libsqlite3/tool/diffdb.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-** A utility for printing the differences between two SQLite database files.
-*/
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-
-#define PAGESIZE 1024
-static int db1 = -1;
-static int db2 = -1;
-
-int main(int argc, char **argv){
- int iPg;
- unsigned char a1[PAGESIZE], a2[PAGESIZE];
- if( argc!=3 ){
- fprintf(stderr,"Usage: %s FILENAME FILENAME\n", argv[0]);
- exit(1);
- }
- db1 = open(argv[1], O_RDONLY);
- if( db1<0 ){
- fprintf(stderr,"%s: can't open %s\n", argv[0], argv[1]);
- exit(1);
- }
- db2 = open(argv[2], O_RDONLY);
- if( db2<0 ){
- fprintf(stderr,"%s: can't open %s\n", argv[0], argv[2]);
- exit(1);
- }
- iPg = 1;
- while( read(db1, a1, PAGESIZE)==PAGESIZE && read(db2,a2,PAGESIZE)==PAGESIZE ){
- if( memcmp(a1,a2,PAGESIZE) ){
- printf("Page %d\n", iPg);
- }
- iPg++;
- }
- printf("%d pages checked\n", iPg-1);
- close(db1);
- close(db2);
-}