summaryrefslogtreecommitdiff
path: root/examples/dte/msg.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dte/msg.h')
-rw-r--r--examples/dte/msg.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/dte/msg.h b/examples/dte/msg.h
new file mode 100644
index 0000000..b23fa25
--- /dev/null
+++ b/examples/dte/msg.h
@@ -0,0 +1,30 @@
+#ifndef MSG_H
+#define MSG_H
+
+#include <stdbool.h>
+#include <stddef.h>
+#include "bookmark.h"
+#include "util/macros.h"
+#include "util/ptr-array.h"
+#include "util/string.h"
+
+typedef struct {
+ FileLocation *loc;
+ char msg[];
+} Message;
+
+typedef struct {
+ PointerArray array;
+ size_t pos;
+} MessageArray;
+
+struct EditorState;
+
+Message *new_message(const char *msg, size_t len) RETURNS_NONNULL;
+void add_message(MessageArray *msgs, Message *m) NONNULL_ARGS;
+bool activate_current_message(struct EditorState *e) NONNULL_ARGS;
+bool activate_current_message_save(struct EditorState *e) NONNULL_ARGS;
+void clear_messages(MessageArray *msgs) NONNULL_ARGS;
+String dump_messages(const MessageArray *messages) NONNULL_ARGS;
+
+#endif