message.h
Go to the documentation of this file.
1 #ifndef NVIM_MESSAGE_H
2 #define NVIM_MESSAGE_H
3 
4 #include <stdbool.h>
5 #include <stdarg.h>
6 #include <stddef.h>
7 
8 #include "nvim/macros.h"
9 #include "nvim/types.h"
10 
11 /*
12  * Types of dialogs passed to do_dialog().
13  */
14 #define VIM_GENERIC 0
15 #define VIM_ERROR 1
16 #define VIM_WARNING 2
17 #define VIM_INFO 3
18 #define VIM_QUESTION 4
19 #define VIM_LAST_TYPE 4 /* sentinel value */
20 
21 /*
22  * Return values for functions like vim_dialogyesno()
23  */
24 #define VIM_YES 2
25 #define VIM_NO 3
26 #define VIM_CANCEL 4
27 #define VIM_ALL 5
28 #define VIM_DISCARDALL 6
29 
31 #define MSG(s) msg((char_u *)(s))
32 
34 #define MSG_ATTR(s, attr) msg_attr((const char *)(s), (attr))
35 
39 #define EMSG(s) emsg((char_u *)(s))
40 
42 #define EMSG2(s, p) emsgf((const char *) (s), (p))
43 
45 #define EMSG3(s, p, q) emsgf((const char *) (s), (p), (q))
46 
48 #define EMSGN(s, n) emsgf((const char *) (s), (int64_t)(n))
49 
51 #define EMSGU(s, n) emsgf((const char *) (s), (uint64_t)(n))
52 
54 #define IEMSG(s) iemsg((const char *)(s))
55 
57 #define IEMSG2(s, p) iemsgf((const char *)(s), (p))
58 
60 #define IEMSGN(s, n) iemsgf((const char *)(s), (int64_t)(n))
61 
63 #define MSG_PUTS(s) msg_puts((const char *)(s))
64 
66 #define MSG_PUTS_ATTR(s, a) msg_puts_attr((const char *)(s), (a))
67 
69 #define MSG_PUTS_TITLE(s) msg_puts_title((const char *)(s))
70 
72 #define MSG_PUTS_LONG(s) msg_puts_long_attr((char_u *)(s), 0)
73 
75 #define MSG_PUTS_LONG_ATTR(s, a) msg_puts_long_attr((char_u *)(s), (a))
76 
78 typedef struct msg_hist {
79  struct msg_hist *next;
81  const char *kind;
82  int attr;
83  bool multiline;
85 
90 
91 EXTERN bool msg_ext_need_clear INIT(= false);
92 
93 #ifdef INCLUDE_GENERATED_DECLARATIONS
94 # include "message.h.generated.h"
95 #endif
96 #endif // NVIM_MESSAGE_H
int attr
Message highlighting.
Definition: message.h:82
Message history for :messages
Definition: message.h:78
MessageHistoryEntry * last_msg_hist
Last message.
Definition: message.c:71
#define EXTERN
Definition: macros.h:7
MessageHistoryEntry * first_msg_hist
First message.
Definition: message.c:70
struct msg_hist MessageHistoryEntry
Message history for :messages
char_u * msg
Message text.
Definition: message.h:80
struct msg_hist * next
Next message.
Definition: message.h:79
bool multiline
Multiline message.
Definition: message.h:83
unsigned char char_u
Definition: types.h:11
const char * kind
Message kind (for msg_ext)
Definition: message.h:81
EXTERN bool msg_ext_need_clear INIT(=false)