Added simple queueing to message dialogs.
[pspp-builds.git] / src / libpspp / message.c
index 34ca65ce5598018dc1e10641c0e45eebb6091a9e..6bc8344a4d06bfb40b3b21a8d46fe8057366a9b3 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include <libpspp/alloc.h>
 #include <libpspp/version.h>
@@ -68,6 +69,27 @@ msg_done (void)
 {
 }
 
+
+/* Duplicate a message */
+struct msg * 
+msg_dup(const struct msg *m)
+{
+  struct msg *new_msg = xmalloc (sizeof *m);
+
+  *new_msg = *m;
+  new_msg->text = strdup(m->text);
+
+  return new_msg;
+}
+
+void
+msg_destroy(struct msg *m)
+{
+  free(m->text);
+  free(m);
+}
+
+
 /* Emits M as an error message.
    Frees allocated data in M. */
 void