aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--driver.c16
-rw-r--r--fetchmail.c6
-rw-r--r--fetchmail.h24
-rw-r--r--pop3.c8
-rw-r--r--rcfile_y.y16
-rw-r--r--uid.c34
6 files changed, 52 insertions, 52 deletions
diff --git a/driver.c b/driver.c
index d46b6767..70192ac5 100644
--- a/driver.c
+++ b/driver.c
@@ -118,7 +118,7 @@ static int is_host_alias(const char *name, struct query *ctl)
* name doesn't match either is it time to call the bind library.
* If this happens odds are good we're looking at an MX name.
*/
- if (uid_in_list(&ctl->lead_server->servernames, name))
+ if (str_in_list(&ctl->lead_server->servernames, name))
return(TRUE);
else if (strcmp(name, ctl->canonical_name) == 0)
return(TRUE);
@@ -189,7 +189,7 @@ static int is_host_alias(const char *name, struct query *ctl)
match:
/* add this name to relevant server's `also known as' list */
- save_uid(&ctl->lead_server->servernames, -1, name);
+ save_str(&ctl->lead_server->servernames, -1, name);
return(TRUE);
}
@@ -211,7 +211,7 @@ struct idlist **xmit_names; /* list of recipient names parsed out */
fprintf(stderr,
"fetchmail: mapped %s to local %s\n",
name, lname);
- save_uid(xmit_names, -1, lname);
+ save_str(xmit_names, -1, lname);
}
}
@@ -473,7 +473,7 @@ struct query *ctl; /* query control record */
if (!xmit_names)
{
no_local_matches = TRUE;
- save_uid(&xmit_names, -1, user);
+ save_str(&xmit_names, -1, user);
if (outlevel == O_VERBOSE)
fprintf(stderr,
"fetchmail: no local matches, forwarding to %s\n",
@@ -482,7 +482,7 @@ struct query *ctl; /* query control record */
}
else /* it's a single-drop box, use first localname */
#endif /* HAVE_RES_SEARCH */
- save_uid(&xmit_names, -1, ctl->localnames->id);
+ save_str(&xmit_names, -1, ctl->localnames->id);
/* time to address the message */
if (ctl->mda[0]) /* we have a declared MDA */
@@ -535,7 +535,7 @@ struct query *ctl; /* query control record */
/* build a connection to the SMTP listener */
if (ctl->mda[0] == '\0' && ((sinkfp = smtp_open(ctl)) == NULL))
{
- free_uid_list(&xmit_names);
+ free_str_list(&xmit_names);
fprintf(stderr, "fetchmail: SMTP connect failed\n");
return(PS_SMTP);
}
@@ -657,7 +657,7 @@ struct query *ctl; /* query control record */
SockWrite(errmsg, strlen(errmsg), sinkfp);
}
- free_uid_list(&xmit_names);
+ free_str_list(&xmit_names);
}
/* SMTP byte-stuffing */
@@ -983,7 +983,7 @@ const struct method *proto; /* protocol method table */
vtalarm(ctl->timeout);
if (ok != 0)
goto cleanUp;
- delete_uid(&ctl->newsaved, num);
+ delete_str(&ctl->newsaved, num);
}
else if (outlevel > O_SILENT)
fprintf(stderr, " not flushed\n");
diff --git a/fetchmail.c b/fetchmail.c
index c342f73a..59d9cf6e 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -353,7 +353,7 @@ int main (int argc, char **argv)
querystatus = query_host(ctl);
if (!check_only)
- update_uid_lists(ctl);
+ update_str_lists(ctl);
}
}
@@ -456,7 +456,7 @@ static int load_params(int argc, char **argv, int optind)
* record from command line and defaults
*/
for (ctl = querylist; ctl; ctl = ctl->next)
- if (uid_in_list(&ctl->servernames, argv[optind]) == 0)
+ if (str_in_list(&ctl->servernames, argv[optind]) == 0)
goto foundit;
ctl = hostalloc(&cmd_opts);
@@ -505,7 +505,7 @@ static int load_params(int argc, char **argv, int optind)
{
ctl->uid = pw->pw_uid; /* for local delivery via MDA */
if (!ctl->localnames) /* for local delivery via SMTP */
- save_uid(&ctl->localnames, -1, user);
+ save_str(&ctl->localnames, -1, user);
}
#if !defined(HAVE_GETHOSTBYNAME) || !defined(HAVE_RES_SEARCH)
diff --git a/fetchmail.h b/fetchmail.h
index a61744e2..e524e6af 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -61,9 +61,9 @@ struct idlist
struct query
{
/* per-host data */
- struct idlist *servernames; /* servername first, then akas*/
- struct idlist *localnames;
- int wildcard; /* true if unmatched names should be passed through */
+ struct idlist *servernames; /* servername first, then akas */
+ struct idlist *localnames; /* including calling user's name */
+ int wildcard; /* should unmatched names be passed through */
int protocol;
int port;
int authenticate;
@@ -177,16 +177,16 @@ void reply_hack(char *, const char *);
char *nxtaddr(const char *);
void initialize_saved_lists(struct query *, const char *);
-struct idlist *save_uid(struct idlist **, int, const char *);
-void free_uid_list(struct idlist **);
-void save_id_pair(struct idlist **, const char *, const char *);
-void free_idpair_list(struct idlist **);
-int delete_uid(struct idlist **, int);
-int uid_in_list(struct idlist **, const char *);
-char *uid_find(struct idlist **, int);
+struct idlist *save_str(struct idlist **, int, const char *);
+void free_str_list(struct idlist **);
+void save_str_pair(struct idlist **, const char *, const char *);
+void free_str_pair_list(struct idlist **);
+int delete_str(struct idlist **, int);
+int str_in_list(struct idlist **, const char *);
+char *str_find(struct idlist **, int);
char *idpair_find(struct idlist **, const char *);
-void append_uid_list(struct idlist **, struct idlist **);
-void update_uid_lists(struct query *);
+void append_str_list(struct idlist **, struct idlist **);
+void update_str_lists(struct query *);
void write_saved_lists(struct query *, const char *);
struct query *hostalloc(struct query *);
diff --git a/pop3.c b/pop3.c
index f2e46236..8f5a1a16 100644
--- a/pop3.c
+++ b/pop3.c
@@ -173,8 +173,8 @@ static int pop3_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp)
break;
else if (sscanf(buf, "%d %s", &num, id) == 2)
{
- save_uid(&ctl->newsaved, num, id);
- if (!uid_in_list(&ctl->oldsaved, id))
+ save_str(&ctl->newsaved, num, id);
+ if (!str_in_list(&ctl->oldsaved, id))
(*newp)++;
}
}
@@ -220,8 +220,8 @@ static int pop3_is_old(FILE *sockfp, struct query *ctl, int num)
if (!ctl->oldsaved)
return (num <= last);
else
- return (uid_in_list(&ctl->oldsaved,
- uid_find (&ctl->newsaved, num)));
+ return (str_in_list(&ctl->oldsaved,
+ str_find (&ctl->newsaved, num)));
}
static int pop3_fetch(FILE *sockfp, int number, int *lenp)
diff --git a/rcfile_y.y b/rcfile_y.y
index 0aab45fa..725a7587 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -79,21 +79,21 @@ statement : SET BATCHLIMIT MAP NUMBER {batchlimit = $4;}
;
define_server : POLL STRING {current.servernames = (struct idlist *)NULL;
- save_uid(&current.servernames, -1, $2);
+ save_str(&current.servernames, -1, $2);
current.skip = FALSE;}
| SKIP STRING {current.servernames = (struct idlist *)NULL;
- save_uid(&current.servernames, -1, $2);
+ save_str(&current.servernames, -1, $2);
current.skip = TRUE;}
| DEFAULTS {current.servernames = (struct idlist *)NULL;
- save_uid(&current.servernames, -1,"defaults");}
+ save_str(&current.servernames, -1,"defaults");}
;
serverspecs : /* EMPTY */
| serverspecs serv_option
;
-alias_list : STRING {save_uid(&current.servernames, -1, $1);}
- | alias_list STRING {save_uid(&current.servernames, -1, $2);}
+alias_list : STRING {save_str(&current.servernames, -1, $1);}
+ | alias_list STRING {save_str(&current.servernames, -1, $2);}
;
serv_option : AKA alias_list
@@ -149,9 +149,9 @@ mapping_list : mapping
;
mapping : STRING
- {save_id_pair(&current.localnames, $1, NULL);}
+ {save_str_pair(&current.localnames, $1, NULL);}
| STRING MAP STRING
- {save_id_pair(&current.localnames, $1, $3);}
+ {save_str_pair(&current.localnames, $1, $3);}
;
user_option : TO localnames HERE
@@ -336,7 +336,7 @@ static void prc_register(void)
void optmerge(struct query *h2, struct query *h1)
/* merge two options records; empty fields in h2 are filled in from h1 */
{
- append_uid_list(&h2->localnames, &h1->localnames);
+ append_str_list(&h2->localnames, &h1->localnames);
#define STR_MERGE(fld, len) if (*(h2->fld) == '\0') strcpy(h2->fld, h1->fld)
STR_MERGE(remotename, USERNAMELEN);
diff --git a/uid.c b/uid.c
index b40d3e15..84f46267 100644
--- a/uid.c
+++ b/uid.c
@@ -87,21 +87,21 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile)
if (strcmp(host, ctl->servernames->id) == 0
&& strcmp(user, ctl->remotename) == 0)
{
- save_uid(&ctl->oldsaved, -1, id);
+ save_str(&ctl->oldsaved, -1, id);
break;
}
}
/* if it's not in a host we're querying, save it anyway */
if (ctl == (struct query *)NULL)
- save_uid(&scratchlist, -1, buf);
+ save_str(&scratchlist, -1, buf);
}
}
fclose(tmpfp);
}
}
-struct idlist *save_uid(struct idlist **idl, int num, const char *str)
+struct idlist *save_str(struct idlist **idl, int num, const char *str)
/* save a number/UID pair on the given UID list */
{
struct idlist **end;
@@ -118,19 +118,19 @@ struct idlist *save_uid(struct idlist **idl, int num, const char *str)
return(*end);
}
-void free_uid_list(struct idlist **idl)
+void free_str_list(struct idlist **idl)
/* free the given UID list */
{
if (*idl == (struct idlist *)NULL)
return;
- free_uid_list(&(*idl)->next);
+ free_str_list(&(*idl)->next);
free ((*idl)->id);
free(*idl);
*idl = (struct idlist *)NULL;
}
-void save_id_pair(struct idlist **idl, const char *str1, const char *str2)
+void save_str_pair(struct idlist **idl, const char *str1, const char *str2)
/* save an ID pair on the given list */
{
struct idlist **end;
@@ -148,7 +148,7 @@ void save_id_pair(struct idlist **idl, const char *str1, const char *str2)
}
#ifdef __UNUSED__
-void free_idpair_list(struct idlist **idl)
+void free_str_pair_list(struct idlist **idl)
/* free the given ID pair list */
{
if (*idl == (struct idlist *)NULL)
@@ -162,7 +162,7 @@ void free_idpair_list(struct idlist **idl)
}
#endif
-int uid_in_list(struct idlist **idl, const char *str)
+int str_in_list(struct idlist **idl, const char *str)
/* is a given ID in the given list? */
{
if (*idl == (struct idlist *)NULL || str == (char *) NULL)
@@ -170,10 +170,10 @@ int uid_in_list(struct idlist **idl, const char *str)
else if (strcmp(str, (*idl)->id) == 0)
return(1);
else
- return(uid_in_list(&(*idl)->next, str));
+ return(str_in_list(&(*idl)->next, str));
}
-char *uid_find(struct idlist **idl, int number)
+char *str_find(struct idlist **idl, int number)
/* return the id of the given number in the given list. */
{
if (*idl == (struct idlist *) 0)
@@ -181,7 +181,7 @@ char *uid_find(struct idlist **idl, int number)
else if (number == (*idl)->val.num)
return((*idl)->id);
else
- return(uid_find(&(*idl)->next, number));
+ return(str_find(&(*idl)->next, number));
}
char *idpair_find(struct idlist **idl, const char *id)
@@ -195,7 +195,7 @@ char *idpair_find(struct idlist **idl, const char *id)
return(idpair_find(&(*idl)->next, id));
}
-int delete_uid(struct idlist **idl, int num)
+int delete_str(struct idlist **idl, int num)
/* delete given message from given list */
{
if (*idl == (struct idlist *)NULL)
@@ -210,11 +210,11 @@ int delete_uid(struct idlist **idl, int num)
return(1);
}
else
- return(delete_uid(&(*idl)->next, num));
+ return(delete_str(&(*idl)->next, num));
return(0);
}
-void append_uid_list(struct idlist **idl, struct idlist **nidl)
+void append_str_list(struct idlist **idl, struct idlist **nidl)
/* append nidl to idl (does not copy *) */
{
if ((*idl) == (struct idlist *)NULL)
@@ -222,13 +222,13 @@ void append_uid_list(struct idlist **idl, struct idlist **nidl)
else if ((*idl)->next == (struct idlist *)NULL)
(*idl)->next = *nidl;
else
- append_uid_list(&(*idl)->next, nidl);
+ append_str_list(&(*idl)->next, nidl);
}
-void update_uid_lists(struct query *ctl)
+void update_str_lists(struct query *ctl)
/* perform end-of-query actions on UID lists */
{
- free_uid_list(&ctl->oldsaved);
+ free_str_list(&ctl->oldsaved);
ctl->oldsaved = ctl->newsaved;
ctl->newsaved = (struct idlist *) NULL;
}