aboutsummaryrefslogtreecommitdiffstats
path: root/uid.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-12-26 14:30:30 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-12-26 14:30:30 +0000
commit17c363ec5e29760a99502afd70769d6a4c7ae63e (patch)
tree8313c91aff4c0e6825327ac9c98f1e78a83a48b4 /uid.c
parent1c34302390ef8d7a3419d1723682a4487796f75c (diff)
downloadfetchmail-17c363ec5e29760a99502afd70769d6a4c7ae63e.tar.gz
fetchmail-17c363ec5e29760a99502afd70769d6a4c7ae63e.tar.bz2
fetchmail-17c363ec5e29760a99502afd70769d6a4c7ae63e.zip
Drastically simplified UIDL code.
svn path=/trunk/; revision=2686
Diffstat (limited to 'uid.c')
-rw-r--r--uid.c32
1 files changed, 9 insertions, 23 deletions
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, " <empty>");
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;