X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=index%2Ftrav.c;h=4ea6fb65271d8ad96a721e5b76630f2b9991b768;hb=dd5f8f31bc5018a7b4a00accdda256ce1eaef14b;hp=c929e51de2145b9433ec5fcd903e879cc33724ee;hpb=9f9b9eeb79d92c7793ffaba8805537bd401bdfbe;p=idzebra-moved-to-github.git diff --git a/index/trav.c b/index/trav.c index c929e51..4ea6fb6 100644 --- a/index/trav.c +++ b/index/trav.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: trav.c,v $ - * Revision 1.10 1995-11-21 15:01:16 adam + * Revision 1.11 1995-11-22 17:19:19 adam + * Record management uses the bfile system. + * + * Revision 1.10 1995/11/21 15:01:16 adam * New general match criteria implemented. * New feature: document groups. * @@ -56,7 +59,8 @@ static int repComp (const char *a, const char *b, size_t len) return memcmp (a, b, len); } -static void repositoryExtractR (char *rep, struct recordGroup *rGroup) +static void repositoryExtractR (int deleteFlag, char *rep, + struct recordGroup *rGroup) { struct dir_entry *e; int i; @@ -75,10 +79,10 @@ static void repositoryExtractR (char *rep, struct recordGroup *rGroup) switch (e[i].kind) { case dirs_file: - fileExtract (NULL, rep, rGroup, 0); + fileExtract (NULL, rep, rGroup, deleteFlag); break; case dirs_dir: - repositoryExtractR (rep, rGroup); + repositoryExtractR (deleteFlag, rep, rGroup); break; } } @@ -220,11 +224,21 @@ void repositoryUpdate (struct recordGroup *rGroup) dict_close (dict); } -void repositoryExtract (struct recordGroup *rGroup) +void repositoryDelete (struct recordGroup *rGroup) { char src[256]; assert (rGroup->path); strcpy (src, rGroup->path); - repositoryExtractR (src, rGroup); + repositoryExtractR (1, src, rGroup); } + +void repositoryAdd (struct recordGroup *rGroup) +{ + char src[256]; + + assert (rGroup->path); + strcpy (src, rGroup->path); + repositoryExtractR (0, src, rGroup); +} +