summaryrefslogtreecommitdiff
path: root/include/common.h
blob: 04869bbec3b00842b2ac6a81584c32ee484a09f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef __COMMON_H__
#define __COMMON_H__

#include <sys/types.h>

typedef struct GlobalData GlobalData;

typedef struct {
  char *color;
  char *text;
} StatusItem;


typedef struct GlobalData {
  char *line;
  size_t linelen;
  size_t linemax; /* Buffer size, including NUL */
} GlobalData;



void line_clear(GlobalData *g);
void line_append_strn(GlobalData *g, char *string, size_t len);
void line_append_str(GlobalData *g, char *string);

void line_append_item(GlobalData *g, StatusItem *s);

void line_print(GlobalData *g);

void statusitem_init(StatusItem *s);

#endif