04869bbec3b00842b2ac6a81584c32ee484a09f3
[sysstatus.git] / include / common.h
1 #ifndef __COMMON_H__
2 #define __COMMON_H__
3
4 #include <sys/types.h>
5
6 typedef struct GlobalData GlobalData;
7
8 typedef struct {
9   char *color;
10   char *text;
11 } StatusItem;
12
13
14 typedef struct GlobalData {
15   char *line;
16   size_t linelen;
17   size_t linemax; /* Buffer size, including NUL */
18 } GlobalData;
19
20
21
22 void line_clear(GlobalData *g);
23 void line_append_strn(GlobalData *g, char *string, size_t len);
24 void line_append_str(GlobalData *g, char *string);
25
26 void line_append_item(GlobalData *g, StatusItem *s);
27
28 void line_print(GlobalData *g);
29
30 void statusitem_init(StatusItem *s);
31
32 #endif