#include <lib-lib/ascii.h>
#include <lib-lib/str.h>
#include <lib-lib/buffer.h>
+#include <lib-lib/debug.h>
#include "mutt.h"
#include "mx.h"
#include "message.h"
#include "imap_private.h"
#if defined(USE_SSL) || defined(USE_GNUTLS)
-# include <lib-network/mutt_ssl.h>
+# include <lib-sys/mutt_ssl.h>
#endif
#include "buffy.h"
#include <lib-lib/macros.h>
-#include "lib/debug.h"
#include <unistd.h>
#include <ctype.h>
/* imap forward declarations */
static int imap_get_delim (IMAP_DATA * idata);
-static char *imap_get_flags (LIST ** hflags, char *s);
+static char *imap_get_flags (string_list_t ** hflags, char *s);
static int imap_check_acl (IMAP_DATA * idata);
static int imap_check_capabilities (IMAP_DATA * idata);
static void imap_set_flag (IMAP_DATA * idata, int aclbit, int flag,
* than getting the delim wrong */
idata->delim = '/';
- imap_cmd_start (idata, "LIST \"\" \"\"");
+ imap_cmd_start (idata, "string_list_t \"\" \"\"");
do {
if ((rc = imap_cmd_step (idata)) != IMAP_CMD_CONTINUE)
break;
s = imap_next_word (idata->cmd.buf);
- if (ascii_strncasecmp ("LIST", s, 4) == 0) {
+ if (ascii_strncasecmp ("string_list_t", s, 4) == 0) {
s = imap_next_word (s);
s = imap_next_word (s);
if (s && s[0] == '\"' && s[1] && s[2] == '\"')
/* imap_get_flags: Make a simple list out of a FLAGS response.
* return stream following FLAGS response */
-static char *imap_get_flags (LIST ** hflags, char *s)
+static char *imap_get_flags (string_list_t ** hflags, char *s)
{
- LIST *flags;
+ string_list_t *flags;
char *flag_word;
char ctmp;
}
/* create list, update caller's flags handle */
- flags = mutt_new_list ();
+ flags = string_item_new();
*hflags = flags;
while (*s && *s != ')') {
/* note bad flags response */
if (*s != ')') {
debug_print (1, ("Unterminated FLAGS response: %s\n", s));
- mutt_free_list (hflags);
+ string_list_wipe(hflags);
return NULL;
}
else if (ascii_strncasecmp ("OK [PERMANENTFLAGS", pc, 18) == 0) {
debug_print (2, ("Getting mailbox PERMANENTFLAGS\n"));
/* safe to call on NULL */
- mutt_free_list (&(idata->flags));
+ string_list_wipe(&(idata->flags));
/* skip "OK [PERMANENT" so syntax is the same as FLAGS */
pc += 13;
if ((pc = imap_get_flags (&(idata->flags), pc)) == NULL)
if (!idata->flags)
debug_print (3, ("No folder flags found\n"));
else {
- LIST *t = idata->flags;
+ string_list_t *t = idata->flags;
debug_print (3, ("Mailbox flags:\n"));
idata->reopen &= IMAP_REOPEN_ALLOW;
p_delete(&(idata->mailbox));
- mutt_free_list (&idata->flags);
+ string_list_wipe(&idata->flags);
idata->ctx = NULL;
}
/* all this listing/browsing is a mess. I don't like that name is a pointer
* into idata->buf (used to be a pointer into the passed in buffer, just
* as bad), nor do I like the fact that the fetch is done here. This
- * code can't possibly handle non-LIST untagged responses properly.
+ * code can't possibly handle non-string_list_t untagged responses properly.
* FIXME. ?! */
int imap_parse_list_response (IMAP_DATA * idata, char **name, int *noselect,
int *noinferiors, char *delim)
return -1;
s = imap_next_word (idata->cmd.buf);
- if ((ascii_strncasecmp ("LIST", s, 4) == 0) ||
+ if ((ascii_strncasecmp ("string_list_t", s, 4) == 0) ||
(ascii_strncasecmp ("LSUB", s, 4) == 0)) {
*noselect = 0;
*noinferiors = 0;
/* trim dest to the length of the longest prefix it shares with src,
* returning the length of the trimmed string */
static int longest_common_prefix (char *dest, const char* src,
- int start, size_t dlen) {
+ int start, ssize_t dlen) {
int pos = start;
while (pos < dlen && dest[pos] && dest[pos] == src[pos])
/* look for IMAP URLs to complete from defined mailboxes. Could be extended
* to complete over open connections and account/folder hooks too. */
-static int imap_complete_hosts (char *dest, size_t len) {
+static int imap_complete_hosts (char *dest, ssize_t len) {
BUFFY* mailbox;
CONNECTION* conn;
int rc = -1;
/* fire off command */
snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"",
- option (OPTIMAPLSUB) ? "LSUB" : "LIST", list);
+ option (OPTIMAPLSUB) ? "LSUB" : "string_list_t", list);
imap_cmd_start (idata, buf);