aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-03-13 20:20:19 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-03-13 20:20:19 +0000
commitd3833f31da28808274c6d08804646116be7dabb8 (patch)
tree985ae69fd971dffb43a300f92f3b4867857267ab /fetchmail.h
parent8517cf573fdb368fa69d776bc113cd95c6646edb (diff)
downloadfetchmail-d3833f31da28808274c6d08804646116be7dabb8.tar.gz
fetchmail-d3833f31da28808274c6d08804646116be7dabb8.tar.bz2
fetchmail-d3833f31da28808274c6d08804646116be7dabb8.zip
Re-engineer the UIDL stuff to avoid having the status flag collide
with message numbers. svn path=/trunk/; revision=1699
Diffstat (limited to 'fetchmail.h')
-rw-r--r--fetchmail.h44
1 files changed, 21 insertions, 23 deletions
diff --git a/fetchmail.h b/fetchmail.h
index 259add67..9480ddb0 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -66,6 +66,16 @@
#define SIZETICKER 1024 /* print 1 dot per this many bytes */
+/*
+ * We #ifdef this and use flag rather than bool
+ * to avoid a type clash with curses.h
+ */
+#ifndef TRUE
+#define FALSE 0
+#define TRUE 1
+#endif /* TRUE */
+typedef char flag;
+
/* we need to use zero as a flag-uninitialized value */
#define FLAG_TRUE 2
#define FLAG_FALSE 1
@@ -75,22 +85,21 @@ struct idlist
char *id;
union
{
- int num;
+ struct
+ {
+ short num;
+ flag mark; /* UID-index information */
+#define UID_UNSEEN 0 /* hasn't been seen */
+#define UID_SEEN 1 /* seen, but not deleted */
+#define UID_DELETED 2 /* this message has been deleted */
+#define UID_EXPUNGED 3 /* this message has been expunged */
+ }
+ status;
char *id2;
} val;
struct idlist *next;
};
-/*
- * We #ifdef this and use flag rather than bool
- * to avoid a type clash with curses.h
- */
-#ifndef TRUE
-#define FALSE 0
-#define TRUE 1
-#endif /* TRUE */
-typedef char flag;
-
struct hostdata /* shared among all user connections to given server */
{
/* rc file data */
@@ -175,17 +184,6 @@ struct query
};
/*
- * UID-index information. If the sign bit is on, this means the
- * message UID has been seen or expunged and should be written
- * out to .fetchids at end of run.
- */
-#define UID_KEPT 0 /* remembered from a previous run */
-#define UID_DELETED INT_MIN /* this message has been deleted */
-#define UID_EXPUNGED INT_MAX /* this message has been expunged */
-#define SAVE_UID(n) ((n) <= 0) /* must this UID be saved? */
-#define MARK_SEEN(n) n *= -1 /* mark a UID seen */
-
-/*
* Numeric option handling. Numeric option value of zero actually means
* it's unspecified. Value less than zero is zero.
*/
@@ -299,7 +297,7 @@ char *nxtaddr(const char *);
/* uid.c: UID support */
void initialize_saved_lists(struct query *, const char *);
-struct idlist *save_str(struct idlist **, int, const char *);
+struct idlist *save_str(struct idlist **, const char *, flag);
void free_str_list(struct idlist **);
void save_str_pair(struct idlist **, const char *, const char *);
void free_str_pair_list(struct idlist **);