bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainenstatic uint32_t get_next_number(const char **str)
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainen /* FIXME: ugly hack, we're using this number to mean the
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainen last existing message. In reality UIDs should never get
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainen this high, so we can quite safely just drop this one down. */
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainenget_next_seq_range(const char **str, uint32_t *seq1_r, uint32_t *seq2_r)
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainen /* last message */
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainen /* first:last range */
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainen /* swap, as specified by RFC-3501 */
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainenint imap_seq_set_parse(const char *str, ARRAY_TYPE(seq_range) *dest)
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainen if (get_next_seq_range(&str, &seq1, &seq2) < 0)
e12ccf1e6b606d96bd55ff77db3aa873127d6c72Timo Sirainenint imap_seq_set_nostar_parse(const char *str, ARRAY_TYPE(seq_range) *dest)
e12ccf1e6b606d96bd55ff77db3aa873127d6c72Timo Sirainen /* '*' used */
c27245ef934dbf93c8469fd1ae0519e6971ae64fTimo Sirainenint imap_seq_range_parse(const char *str, uint32_t *seq1_r, uint32_t *seq2_r)