71
|
1 #ifndef __HBUF_H__
|
|
2 #define __HBUF_H__ 1
|
|
3
|
|
4 #include <glib.h>
|
|
5
|
106
|
6 // With current implementation a message must fit in a hbuf block,
|
|
7 // so we shouldn't choose a too small size.
|
|
8 #define HBB_BLOCKSIZE 2048 // > 20 please
|
71
|
9
|
|
10 // Flags:
|
|
11 // - ALLOC: the ptr data has been allocated, it can be freed
|
|
12 // - PERSISTENT: this is a new history line
|
|
13 #define HBB_FLAG_ALLOC 1
|
|
14 #define HBB_FLAG_PERSISTENT 2
|
|
15 // #define HBB_FLAG_FREE 4
|
|
16
|
75
|
17 void hbuf_add_line(GList **p_hbuf, const char *text, const char *prefix,
|
|
18 unsigned int width);
|
71
|
19 void hbuf_free(GList **p_hbuf);
|
|
20 void hbuf_rebuild(GList **p_hbuf, unsigned int width);
|
|
21
|
|
22 char **hbuf_get_lines(GList *hbuf, unsigned int n);
|
|
23
|
|
24 #endif /* __HBUF_H__ */
|