{
const char *name; /**< User-visible name */
unsigned int type; /**< Variable type, e.g. #DT_STRING */
- intptr_t flags; /**< Notification flags, e.g. #R_PAGER */
+ intptr_t flags; /**< Notification flags, see #ConfigRedrawFlags */
void *var; /**< Pointer to the global variable */
intptr_t initial; /**< Initial value */
cs_validator validator; /**< Validator callback function */
* @param[in] field Prompt
* @param[in] buf Buffer for the result
* @param[in] buflen Length of buffer
- * @param[in] complete Flags for completion, e.g. #MUTT_FILE
+ * @param[in] complete Flags, see #CompletionFlags
* @param[in] multiple Allow multiple selections
* @param[out] files List of files selected
* @param[out] numfiles Number of files selected
* @retval 0 Selection made
* @retval -1 Aborted
*/
-int mutt_get_field_full(const char *field, char *buf, size_t buflen,
- int complete, bool multiple, char ***files, int *numfiles)
+int mutt_get_field_full(const char *field, char *buf, size_t buflen, CompletionFlags complete,
+ bool multiple, char ***files, int *numfiles)
{
int ret;
int x;
* @param msg Prompt
* @param buf Buffer for the result
* @param buflen Length of buffer
- * @param flags Flags for completion, e.g. #MUTT_FILE
+ * @param flags Flags, see #CompletionFlags
* @retval 1 Redraw the screen and call the function again
* @retval 0 Selection made
* @retval -1 Aborted
*/
-int mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, int flags)
+int mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, CompletionFlags flags)
{
int rc;
void mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s);
void mutt_getch_timeout(int delay);
struct Event mutt_getch(void);
-int mutt_get_field_full(const char *field, char *buf, size_t buflen, int complete, bool multiple, char ***files, int *numfiles);
-int mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, int flags);
+int mutt_get_field_full(const char *field, char *buf, size_t buflen, CompletionFlags complete, bool multiple, char ***files, int *numfiles);
+int mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, CompletionFlags flags);
int mutt_multi_choice(const char *prompt, const char *letters);
void mutt_need_hard_redraw(void);
void mutt_paddstr(int n, const char *s);
* @param buf Buffer to store the string
* @param buflen Buffer length
* @param col Initial cursor position
- * @param flags Flags such as MUTT_FILE
+ * @param flags Flags, see #CompletionFlags
* @retval 0 if input was given
* @retval -1 if abort
*
* well, because there is no active menu for the built-in editor.
* Most callers should prefer mutt_get_field() instead.
*/
-int mutt_enter_string(char *buf, size_t buflen, int col, int flags)
+int mutt_enter_string(char *buf, size_t buflen, int col, CompletionFlags flags)
{
int rc;
struct EnterState *es = mutt_enter_state_new();
* @param[in] buf Buffer to store the string
* @param[in] buflen Buffer length
* @param[in] col Initial cursor position
- * @param[in] flags Flags such as MUTT_FILE
+ * @param[in] flags Flags, see #CompletionFlags
* @param[in] multiple Allow multiple matches
* @param[out] files List of files selected
* @param[out] numfiles Number of files selected
* @retval 0 Selection made
* @retval -1 Aborted
*/
-int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, bool multiple,
- char ***files, int *numfiles, struct EnterState *state)
+int mutt_enter_string_full(char *buf, size_t buflen, int col,
+ CompletionFlags flags, bool multiple, char ***files,
+ int *numfiles, struct EnterState *state)
{
int width = MuttMessageWindow->cols - col - 1;
int redraw;
#define fgetc fgetc_unlocked
#endif
-/* flags for mutt_enter_string_full() */
+typedef uint16_t CompletionFlags; ///< Flags for mutt_enter_string_full(), e.g. #MUTT_ALIAS
+#define MUTT_COMP_NO_FLAGS 0 ///< No flags are set
#define MUTT_ALIAS (1 << 0) ///< Do alias "completion" by calling up the alias-menu
#define MUTT_FILE (1 << 1) ///< Do file completion
#define MUTT_EFILE (1 << 2) ///< Do file completion, plus incoming folders
#include <stdio.h>
#include <time.h>
#include "config/lib.h"
+#include "mutt.h"
struct Context;
struct EnterState;
int mutt_complete(char *buf, size_t buflen);
int mutt_prepare_template(FILE *fp, struct Mailbox *m, struct Email *newhdr, struct Email *e, bool resend);
-int mutt_enter_string(char *buf, size_t buflen, int col, int flags);
-int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, bool multiple,
- char ***files, int *numfiles, struct EnterState *state);
+int mutt_enter_string(char *buf, size_t buflen, int col, CompletionFlags flags);
+int mutt_enter_string_full(char *buf, size_t buflen, int col, CompletionFlags flags, bool multiple,
+ char ***files, int *numfiles, struct EnterState *state);
int mutt_get_postponed(struct Context *ctx, struct Email *e, struct Email **cur, char *fcc, size_t fcclen);
int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app);
int mutt_num_postponed(struct Mailbox *m, bool force);