2010-08-08 10:06:34 +02:00
|
|
|
#ifndef H_KRNL_MESSAGE
|
|
|
|
#define H_KRNL_MESSAGE
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-01-15 16:40:19 +01:00
|
|
|
#include <kernel/types.h>
|
2010-08-08 10:06:34 +02:00
|
|
|
#include <util/message.h>
|
|
|
|
|
2014-06-09 18:54:48 +02:00
|
|
|
struct faction;
|
2011-03-07 08:02:35 +01:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
typedef struct mlist {
|
|
|
|
struct mlist *next;
|
|
|
|
struct message *msg;
|
|
|
|
} mlist;
|
2012-05-20 01:54:41 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
typedef struct message_list {
|
|
|
|
struct mlist *begin, **end;
|
|
|
|
} message_list;
|
2011-03-07 08:02:35 +01:00
|
|
|
|
2015-10-14 14:08:50 +02:00
|
|
|
void free_messagelist(struct mlist *msgs);
|
2011-03-07 08:02:35 +01:00
|
|
|
|
2018-01-14 11:25:44 +01:00
|
|
|
#define MESSAGE_MISSING_IGNORE 0
|
|
|
|
#define MESSAGE_MISSING_ERROR 1
|
|
|
|
#define MESSAGE_MISSING_REPLACE 2
|
|
|
|
|
|
|
|
void message_handle_missing(int mode);
|
|
|
|
|
2017-09-17 09:31:43 +02:00
|
|
|
struct message *msg_message(const char *name, const char *sig, ...);
|
|
|
|
struct message *msg_feedback(const struct unit *, struct order *cmd,
|
2015-01-30 20:37:14 +01:00
|
|
|
const char *name, const char *sig, ...);
|
2017-09-17 09:31:43 +02:00
|
|
|
struct message *add_message(struct message_list **pm,
|
2011-03-07 08:02:35 +01:00
|
|
|
struct message *m);
|
2015-01-30 20:37:14 +01:00
|
|
|
void addmessage(struct region *r, struct faction *f, const char *s,
|
|
|
|
msg_t mtype, int level);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2017-12-29 06:13:28 +01:00
|
|
|
struct mlist ** merge_messages(message_list *ml, message_list *append);
|
|
|
|
void split_messages(message_list *ml, struct mlist **split);
|
2015-08-16 11:30:44 +02:00
|
|
|
|
2018-11-04 18:07:42 +01:00
|
|
|
#define ADDMSG(msgs, mcreate) { message * mx = mcreate; if (mx) { add_message(msgs, mx); msg_release(mx); } }
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-05-15 13:32:22 +02:00
|
|
|
void syntax_error(const struct unit *u, struct order *ord);
|
2017-06-25 08:21:14 +02:00
|
|
|
void cmistake(const struct unit *u, struct order *ord, int mno, int mtype);
|
2015-01-30 20:37:14 +01:00
|
|
|
struct message * msg_error(const struct unit * u, struct order *ord, int mno);
|
2010-08-08 10:06:34 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|