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/types.h"
9 
10 /*
11  * Types of dialogs passed to do_dialog().
12  */
13 #define VIM_GENERIC 0
14 #define VIM_ERROR 1
15 #define VIM_WARNING 2
16 #define VIM_INFO 3
17 #define VIM_QUESTION 4
18 #define VIM_LAST_TYPE 4 /* sentinel value */
19 
20 /*
21  * Return values for functions like vim_dialogyesno()
22  */
23 #define VIM_YES 2
24 #define VIM_NO 3
25 #define VIM_CANCEL 4
26 #define VIM_ALL 5
27 #define VIM_DISCARDALL 6
28 
30 #define MSG(s) msg((char_u *)(s))
31 
33 #define MSG_ATTR(s, attr) msg_attr((const char *)(s), (attr))
34 
38 #define EMSG(s) emsg((char_u *)(s))
39 
41 #define EMSG2(s, p) emsgf((const char *) (s), (p))
42 
44 #define EMSG3(s, p, q) emsgf((const char *) (s), (p), (q))
45 
47 #define EMSGN(s, n) emsgf((const char *) (s), (int64_t)(n))
48 
50 #define EMSGU(s, n) emsgf((const char *) (s), (uint64_t)(n))
51 
53 #define IEMSG(s) iemsg((const char *)(s))
54 
56 #define IEMSG2(s, p) iemsgf((const char *)(s), (p))
57 
59 #define IEMSGN(s, n) iemsgf((const char *)(s), (int64_t)(n))
60 
62 #define MSG_PUTS(s) msg_puts((const char *)(s))
63 
65 #define MSG_PUTS_ATTR(s, a) msg_puts_attr((const char *)(s), (a))
66 
68 #define MSG_PUTS_TITLE(s) msg_puts_title((const char *)(s))
69 
71 #define MSG_PUTS_LONG(s) msg_puts_long_attr((char_u *)(s), 0)
72 
74 #define MSG_PUTS_LONG_ATTR(s, a) msg_puts_long_attr((char_u *)(s), (a))
75 
77 typedef struct msg_hist {
78  struct msg_hist *next;
80  int attr;
82 
87 
88 #ifdef INCLUDE_GENERATED_DECLARATIONS
89 # include "message.h.generated.h"
90 #endif
91 #endif // NVIM_MESSAGE_H
int attr
Message highlighting.
Definition: message.h:80
Message history for :messages
Definition: message.h:77
MessageHistoryEntry * last_msg_hist
Last message.
Definition: message.c:69
MessageHistoryEntry * first_msg_hist
First message.
Definition: message.c:68
struct msg_hist MessageHistoryEntry
Message history for :messages
char_u * msg
Message text.
Definition: message.h:79
struct msg_hist * next
Next message.
Definition: message.h:78
unsigned char char_u
Definition: types.h:11