472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
|
void vfile_aggregate_checksum_disk(int vid, Blob *pOut){
FILE *in;
Stmt q;
char zBuf[4096];
db_must_be_within_tree();
db_prepare(&q,
"SELECT %Q || pathname, pathname, origname, file_is_selected(id), rid"
" FROM vfile"
" WHERE (NOT deleted OR NOT file_is_selected(id)) AND vid=%d"
" ORDER BY pathname /*scan*/",
g.zLocalRoot, vid
);
md5sum_init();
while( db_step(&q)==SQLITE_ROW ){
const char *zFullpath = db_column_text(&q, 0);
const char *zName = db_column_text(&q, 1);
int isSelected = db_column_int(&q, 3);
|
|
|
|
|
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
|
void vfile_aggregate_checksum_disk(int vid, Blob *pOut){
FILE *in;
Stmt q;
char zBuf[4096];
db_must_be_within_tree();
db_prepare(&q,
"SELECT %Q || pathname, pathname, origname, is_selected(id), rid"
" FROM vfile"
" WHERE (NOT deleted OR NOT is_selected(id)) AND vid=%d"
" ORDER BY if_selected(id, pathname, origname) /*scan*/",
g.zLocalRoot, vid
);
md5sum_init();
while( db_step(&q)==SQLITE_ROW ){
const char *zFullpath = db_column_text(&q, 0);
const char *zName = db_column_text(&q, 1);
int isSelected = db_column_int(&q, 3);
|
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
|
Stmt q;
Blob disk, repo;
char *zOut;
db_must_be_within_tree();
db_prepare(&q,
"SELECT %Q || pathname, pathname, rid FROM vfile"
" WHERE NOT deleted AND vid=%d AND file_is_selected(id)",
g.zLocalRoot, vid
);
md5sum_init();
while( db_step(&q)==SQLITE_ROW ){
const char *zFullpath = db_column_text(&q, 0);
const char *zName = db_column_text(&q, 1);
int rid = db_column_int(&q, 2);
|
|
>
|
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
|
Stmt q;
Blob disk, repo;
char *zOut;
db_must_be_within_tree();
db_prepare(&q,
"SELECT %Q || pathname, pathname, rid FROM vfile"
" WHERE NOT deleted AND vid=%d AND is_selected(id)"
" ORDER BY if_selected(id, pathname, origname) /*scan*/",
g.zLocalRoot, vid
);
md5sum_init();
while( db_step(&q)==SQLITE_ROW ){
const char *zFullpath = db_column_text(&q, 0);
const char *zName = db_column_text(&q, 1);
int rid = db_column_int(&q, 2);
|
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
|
void vfile_aggregate_checksum_repository(int vid, Blob *pOut){
Blob file;
Stmt q;
char zBuf[100];
db_must_be_within_tree();
db_prepare(&q, "SELECT pathname, origname, rid, file_is_selected(id)"
" FROM vfile"
" WHERE (NOT deleted OR NOT file_is_selected(id))"
" AND rid>0 AND vid=%d"
" ORDER BY pathname /*scan*/",
vid);
blob_zero(&file);
md5sum_init();
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
const char *zOrigName = db_column_text(&q, 1);
int rid = db_column_int(&q, 2);
|
|
|
|
|
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
|
void vfile_aggregate_checksum_repository(int vid, Blob *pOut){
Blob file;
Stmt q;
char zBuf[100];
db_must_be_within_tree();
db_prepare(&q, "SELECT pathname, origname, rid, is_selected(id)"
" FROM vfile"
" WHERE (NOT deleted OR NOT is_selected(id))"
" AND rid>0 AND vid=%d"
" ORDER BY if_selected(id,pathname,origname) /*scan*/",
vid);
blob_zero(&file);
md5sum_init();
while( db_step(&q)==SQLITE_ROW ){
const char *zName = db_column_text(&q, 0);
const char *zOrigName = db_column_text(&q, 1);
int rid = db_column_int(&q, 2);
|