-#endif /* POP3_ENABLE */
-
-/** Save string \a str to idlist \a idl with status \a status.
- * \return Pointer to the last element of the list to help the quick,
- * constant-time addition to the list. */
-/*@shared@*/ static
-struct idlist **save_str_quick(/*@shared@*/ struct idlist **idl,
- /*@only@*/ char *str /** caller-allocated string */, flag status)
-/* save a number/UID pair on the given UID list */
-{
- struct idlist **end;
-
- /* do it nonrecursively so the list is in the right order */
- for (end = idl; *end; end = &(*end)->next)
- continue;
-
- *end = (struct idlist *)xmalloc(sizeof(struct idlist));
- (*end)->id = str;
- (*end)->val.status.mark = status;
- (*end)->val.status.num = 0;
- (*end)->next = NULL;
-
- return end;
-}
-
-/** Save string \a str to idlist \a idl with status \a status.
- * \return the end list element for direct modification. */
-struct idlist *save_str(struct idlist **idl, const char *str /** implicitly strdup()ed */, flag status)
-{
- return *save_str_quick(idl, str ? xstrdup(str) : NULL, status);
-}
-
-/** Free string list \a idl and free each of the id members. */
-void free_str_list(struct idlist **idl)
-{
- struct idlist *i = *idl;
-
- while(i) {
- struct idlist *t = i->next;
- free(i->id);
- free(i);
- i = t;
- }
- *idl = 0;
-}
-
-/** Save an ID pair made of \a str1 and \a str2 on the given idlist \a idl. */
-void save_str_pair(struct idlist **idl, const char *str1, const char *str2)
-{
- struct idlist **end;
-
- /* do it nonrecursively so the list is in the right order */
- for (end = idl; *end; end = &(*end)->next)
- continue;
-
- *end = (struct idlist *)xmalloc(sizeof(struct idlist));
- (*end)->id = str1 ? xstrdup(str1) : (char *)NULL;
- if (str2)
- (*end)->val.id2 = xstrdup(str2);
- else
- (*end)->val.id2 = (char *)NULL;
- (*end)->next = (struct idlist *)NULL;
-}
-
-#ifdef __UNUSED__
-void free_str_pair_list(struct idlist **idl)
-/* free the given ID pair list */
-{
- if (*idl == (struct idlist *)NULL)
- return;
-
- free_idpair_list(&(*idl)->next);
- free ((*idl)->id);
- free ((*idl)->val.id2);
- free(*idl);
- *idl = (struct idlist *)NULL;
-}
-#endif
-
-/** Check if ID \a str is in idlist \a idl. \return idlist entry if found,
- * NULL if not found. */
-struct idlist *str_in_list(struct idlist **idl, const char *str,
-const flag caseblind /** if true, use strcasecmp, if false, use strcmp */)
-{
- struct idlist *walk;
- if (caseblind) {
- for( walk = *idl; walk; walk = walk->next )
- if( strcasecmp( str, walk->id) == 0 )
- return walk;
- } else {
- for( walk = *idl; walk; walk = walk->next )
- if( strcmp( str, walk->id) == 0 )
- return walk;
- }
- return NULL;
-}