diff mcabber/src/hbuf.h @ 184:b5aa2b9c425a

[/trunk] Changeset 196 by mikael * Don't use a char* as prefix, but split it to timestamp + flags. * Don't use a boolean for timestamp, use a time_t (actually we always use a timestamp so the bool made no sense...).
author mikael
date Thu, 05 May 2005 19:38:44 +0000
parents 9a31028e8095
children 888ad9f15346
line wrap: on
line diff
--- a/mcabber/src/hbuf.h	Thu May 05 15:01:48 2005 +0000
+++ b/mcabber/src/hbuf.h	Thu May 05 19:38:44 2005 +0000
@@ -1,6 +1,7 @@
 #ifndef __HBUF_H__
 #define __HBUF_H__ 1
 
+#include <time.h>
 #include <glib.h>
 
 // With current implementation a message must fit in a hbuf block,
@@ -12,13 +13,24 @@
 // - PERSISTENT: this is a new history line
 #define HBB_FLAG_ALLOC      1
 #define HBB_FLAG_PERSISTENT 2
-// #define HBB_FLAG_FREE       4
+
+#define HBB_PREFIX_IN       1
+#define HBB_PREFIX_OUT      2
+#define HBB_PREFIX_STATUS   4
+#define HBB_PREFIX_AUTH     8
+#define HBB_PREFIX_INFO    16
 
-void hbuf_add_line(GList **p_hbuf, const char *text, const char *prefix,
-        unsigned int width);
+typedef struct {
+  time_t timestamp;
+  guchar flags;
+  char *text;
+} hbb_line;
+
+void hbuf_add_line(GList **p_hbuf, const char *text, time_t timestamp,
+        guint prefix_flags, guint width);
 void hbuf_free(GList **p_hbuf);
 void hbuf_rebuild(GList **p_hbuf, unsigned int width);
 
-char **hbuf_get_lines(GList *hbuf, unsigned int n);
+hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n);
 
 #endif /* __HBUF_H__ */