cmd-sort.c revision 63946971b08cfb1eec698c28569e1c4aa237852d
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "buffer.h"
#include "commands.h"
#include "imap-search.h"
#include "imap-sort.h"
struct sort_name {
enum mail_sort_type type;
const char *name;
};
static struct sort_name sort_names[] = {
{ MAIL_SORT_ARRIVAL, "arrival" },
{ MAIL_SORT_CC, "cc" },
{ MAIL_SORT_DATE, "date" },
{ MAIL_SORT_FROM, "from" },
{ MAIL_SORT_SIZE, "size" },
{ MAIL_SORT_SUBJECT, "subject" },
{ MAIL_SORT_TO, "to" },
{ MAIL_SORT_REVERSE, "reverse" },
{ MAIL_SORT_END, NULL }
};
static enum mail_sort_type *
{
enum mail_sort_type type;
int i;
/* empyty list */
return NULL;
}
32 * sizeof(enum mail_sort_type),
(size_t)-1);
break;
}
return NULL;
}
sizeof(enum mail_sort_type));
args++;
}
"Invalid sort list argument.");
return NULL;
}
return buffer_free_without_data(buf);
}
{
struct mail_search_arg *sargs;
enum mail_sort_type *sorting;
int args_count;
if (args_count == -2)
return FALSE;
if (args_count < 3) {
"Missing or invalid arguments.");
return TRUE;
}
if (!client_verify_open_mailbox(client))
return TRUE;
/* sort program */
return TRUE;
}
return TRUE;
args++;
/* charset */
"Invalid charset argument.");
return TRUE;
}
args++;
/* error in search arguments */
/* NOTE: syncing is allowed when returning UIDs */
else
} else {
}
return TRUE;
}