From 17c363ec5e29760a99502afd70769d6a4c7ae63e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 26 Dec 1999 14:30:30 +0000 Subject: Drastically simplified UIDL code. svn path=/trunk/; revision=2686 --- uid.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'uid.c') diff --git a/uid.c b/uid.c index c7f007e4..6bf4bf10 100644 --- a/uid.c +++ b/uid.c @@ -368,14 +368,21 @@ void expunge_uids(struct query *ctl) idl->val.status.mark = UID_EXPUNGED; } -void update_str_lists(struct query *ctl) -/* perform end-of-query actions on UID lists */ +void write_saved_lists(struct query *hostlist, const char *idfile) +/* perform end-of-run write of seen-messages list */ { + int idcount; + FILE *tmpfp; + struct query *ctl; + struct idlist *idp; + + /* old state of mailbox is now irrelevant */ free_str_list(&ctl->oldsaved); free_str_list(&scratchlist); ctl->oldsaved = ctl->newsaved; ctl->newsaved = (struct idlist *) NULL; + /* debugging code */ if (ctl->server.uidl && outlevel >= O_DEBUG) { struct idlist *idp; @@ -387,27 +394,6 @@ void update_str_lists(struct query *ctl) report_build(stdout, " "); report_complete(stdout, "\n"); } -} - -void uid_expunge(struct query *ctl) -/* transfer seen UIDs from newsaved to oldsaved - to simulate writing anad rereading .fetchids */ -{ - struct idlist *i; - - for (i = ctl->newsaved; i; i = i->next) - if (i->val.status.mark == UID_SEEN && - !str_in_list(&ctl->oldsaved, i->id, FALSE)) - save_str(&ctl->oldsaved, i->id, UID_SEEN); -} - -void write_saved_lists(struct query *hostlist, const char *idfile) -/* perform end-of-run write of seen-messages list */ -{ - int idcount; - FILE *tmpfp; - struct query *ctl; - struct idlist *idp; /* if all lists are empty, nuke the file */ idcount = 0; -- cgit v1.2.3