* mutt_extract_token - Extract one token from a string
* @param dest Buffer for the result
* @param tok Buffer containing tokens
- * @param flags Flags, e.g. #MUTT_TOKEN_SPACE
+ * @param flags Flags, see #TokenFlags
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, int flags)
+int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
{
if (!dest || !tok)
return -1;
#define MUTT_NM_QUERY (1 << 9) ///< Notmuch query mode.
#define MUTT_NM_TAG (1 << 10) ///< Notmuch tag +/- mode.
-/* flags for mutt_extract_token() */
+typedef uint16_t TokenFlags; ///< Flags for mutt_extract_token(), e.g. #MUTT_TOKEN_EQUAL
+#define MUTT_TOKEN_NO_FLAGS 0 ///< No flags are set
#define MUTT_TOKEN_EQUAL (1 << 0) ///< Treat '=' as a special
#define MUTT_TOKEN_CONDENSE (1 << 1) ///< ^(char) to control chars (macros)
#define MUTT_TOKEN_SPACE (1 << 2) ///< Don't treat whitespace as a term
char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping *items);
-int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, int flags);
+int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags);
void mutt_free_opts(void);
int query_quadoption(int opt, const char *prompt);
int mutt_label_complete(char *buf, size_t buflen, int numtabs);