author | Mikael Berthe <mikael@lilotux.net> |
Sun, 24 Jul 2005 15:13:53 +0100 | |
changeset 364 | 33b8e801ffa6 |
parent 325 | ff6fb51bfd78 |
parent 189 | 4f3975f1b852 |
child 370 | dd9e2eb52916 |
permissions | -rw-r--r-- |
71 | 1 |
#ifndef __HBUF_H__ |
2 |
#define __HBUF_H__ 1 |
|
3 |
||
184 | 4 |
#include <time.h> |
71 | 5 |
#include <glib.h> |
6 |
||
106 | 7 |
// With current implementation a message must fit in a hbuf block, |
8 |
// so we shouldn't choose a too small size. |
|
186 | 9 |
#define HBB_BLOCKSIZE 4096 // > 20 please |
71 | 10 |
|
11 |
// Flags: |
|
12 |
// - ALLOC: the ptr data has been allocated, it can be freed |
|
13 |
// - PERSISTENT: this is a new history line |
|
14 |
#define HBB_FLAG_ALLOC 1 |
|
15 |
#define HBB_FLAG_PERSISTENT 2 |
|
184 | 16 |
|
17 |
#define HBB_PREFIX_IN 1 |
|
18 |
#define HBB_PREFIX_OUT 2 |
|
19 |
#define HBB_PREFIX_STATUS 4 |
|
20 |
#define HBB_PREFIX_AUTH 8 |
|
21 |
#define HBB_PREFIX_INFO 16 |
|
325
ff6fb51bfd78
Handle "error" message type
Mikael Berthe <mikael@lilotux.net>
parents:
189
diff
changeset
|
22 |
#define HBB_PREFIX_ERR 32 |
71 | 23 |
|
184 | 24 |
typedef struct { |
25 |
time_t timestamp; |
|
26 |
guchar flags; |
|
27 |
char *text; |
|
28 |
} hbb_line; |
|
29 |
||
30 |
void hbuf_add_line(GList **p_hbuf, const char *text, time_t timestamp, |
|
31 |
guint prefix_flags, guint width); |
|
71 | 32 |
void hbuf_free(GList **p_hbuf); |
33 |
void hbuf_rebuild(GList **p_hbuf, unsigned int width); |
|
189 | 34 |
GList *hbuf_previous_persistent(GList *l_line); |
71 | 35 |
|
184 | 36 |
hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n); |
71 | 37 |
|
38 |
#endif /* __HBUF_H__ */ |