imap-search.c revision 278cd60f09503d682977462acb96bfc885337d9c
e59faf65ce864fe95dc00f5d52b8323cdbd0608aTimo Sirainen/* Copyright (C) 2002 Timo Sirainen */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainensearch_arg_new(pool_t pool, enum mail_search_arg_type type)
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenstatic int arg_new(struct search_build_data *data, struct imap_arg **args,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen *next_sarg = sarg = search_arg_new(data->pool, type);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* first arg */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen data->error = "Missing parameter for argument";
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen data->error = "Invalid parameter for argument";
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen sarg->value.str = str_ucase(IMAP_ARG_STR(*args));
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* second arg */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen data->error = "Missing parameter for argument";
e6440616c02bb1404dc35debf45d9741260c7831Timo Sirainen data->error = "Invalid parameter for argument";
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen sarg->value.str = str_ucase(IMAP_ARG_STR(*args));
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainenstatic int search_arg_build(struct search_build_data *data,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* NIL not allowed */
e6440616c02bb1404dc35debf45d9741260c7831Timo Sirainen struct imap_arg *listargs = IMAP_ARG_LIST(arg)->args;
e6440616c02bb1404dc35debf45d9741260c7831Timo Sirainen *next_sarg = search_arg_new(data->pool, SEARCH_SUB);
e6440616c02bb1404dc35debf45d9741260c7831Timo Sirainen if (!search_arg_build(data, &listargs, subargs))
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* string argument - get the name and jump to next */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* <string> */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* <string> */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* <string> */
const char *key;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
return TRUE;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
struct mail_search_arg *
return NULL;
return first_sarg;