bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenbool imap_arg_get_atom(const struct imap_arg *arg, const char **str_r)
333b1f356e437f17d843fcbe529d6ac5915a64f5Timo Sirainen if (arg->type != IMAP_ARG_ATOM && arg->type != IMAP_ARG_NIL)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenbool imap_arg_get_quoted(const struct imap_arg *arg, const char **str_r)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenbool imap_arg_get_string(const struct imap_arg *arg, const char **str_r)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainen if (arg->type != IMAP_ARG_STRING && arg->type != IMAP_ARG_LITERAL)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenbool imap_arg_get_astring(const struct imap_arg *arg, const char **str_r)
1dc33c503c3de306db4b7cba4e51ea2077b2805dTimo Sirainen /* RFC 3501 4.5. specifies that NIL is the same as "NIL" when
1dc33c503c3de306db4b7cba4e51ea2077b2805dTimo Sirainen reading astring. */
1dc33c503c3de306db4b7cba4e51ea2077b2805dTimo Sirainen if (!IMAP_ARG_IS_ASTRING(arg) && arg->type != IMAP_ARG_NIL)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenbool imap_arg_get_nstring(const struct imap_arg *arg, const char **str_r)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenbool imap_arg_get_literal_size(const struct imap_arg *arg, uoff_t *size_r)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenbool imap_arg_get_list(const struct imap_arg *arg,
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainen return imap_arg_get_list_full(arg, list_r, &count);
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenbool imap_arg_get_list_full(const struct imap_arg *arg,
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainen *list_r = array_get(&arg->_data.list, &count);
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainen /* drop IMAP_ARG_EOL from list size */
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenconst char *imap_arg_as_astring(const struct imap_arg *arg)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenconst char *imap_arg_as_nstring(const struct imap_arg *arg)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenuoff_t imap_arg_as_literal_size(const struct imap_arg *arg)
c2fbbf7515aa419dc8b2d62a3c2bb0471d51a391Timo Sirainenbool imap_arg_atom_equals(const struct imap_arg *arg, const char *str)