server/src/kernel/messages.h

49 lines
1.4 KiB
C
Raw Normal View History

2010-08-08 10:06:34 +02:00
#ifndef H_KRNL_MESSAGE
#define H_KRNL_MESSAGE
#ifdef __cplusplus
extern "C" {
#endif
#include <kernel/types.h>
2010-08-08 10:06:34 +02:00
#include <util/message.h>
struct faction;
2011-03-07 08:02:35 +01:00
typedef struct mlist {
struct mlist *next;
struct message *msg;
} mlist;
typedef struct message_list {
struct mlist *begin, **end;
} message_list;
2011-03-07 08:02:35 +01:00
void free_messagelist(struct mlist *msgs);
2011-03-07 08:02:35 +01:00
#define MESSAGE_MISSING_IGNORE 0
#define MESSAGE_MISSING_ERROR 1
#define MESSAGE_MISSING_REPLACE 2
void message_handle_missing(int mode);
struct message *msg_message(const char *name, const char *sig, ...);
struct message *msg_feedback(const struct unit *, struct order *cmd,
const char *name, const char *sig, ...);
struct message *add_message(struct message_list **pm,
2011-03-07 08:02:35 +01:00
struct message *m);
void addmessage(struct region *r, struct faction *f, const char *s,
msg_t mtype, int level);
2010-08-08 10:06:34 +02:00
struct mlist ** merge_messages(message_list *ml, message_list *append);
void split_messages(message_list *ml, struct mlist **split);
#define ADDMSG(msgs, mcreate) { message * mx = mcreate; if (mx) { add_message(msgs, mx); msg_release(mx); } }
2010-08-08 10:06:34 +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);
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