-
Notifications
You must be signed in to change notification settings - Fork 0
/
string_table.h
54 lines (40 loc) · 1.14 KB
/
string_table.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "string_array.h"
#include "options.h"
#ifndef TABLE_PRINTER_STRING_TABLE_H
#define TABLE_PRINTER_STRING_TABLE_H
#define TABLE_FRAME_SEPARATOR "|"
typedef struct {
string_array_t **rows;
int length;
int capacity;
int width;
int *max_column_length;
} string_table_t;
string_table_t *string_table_new(int width);
string_table_t *string_table_create(options_t *options);
void string_table_recalculate(string_table_t *string_table, string_array_t *new_row);
void string_table_add_row(string_table_t *string_table, string_array_t *new_row);
void string_table_print(string_table_t *string_table, options_t *option);
void set_console_color(int color, options_t *options);
void string_table_free(string_table_t *table);
void rotate_color(int *color, int color_count, options_t *options);
void reset_console_color(options_t *options);
#define COLOR_COUNT 10
enum COLORS {
BLUE = 0,
GREEN = 1,
CYAN = 2,
RED = 3,
YELLOW = 4,
MAGENTA = 5,
BROWN = 6,
LIGHTBLUE = 7,
LIGHTCYAN = 8,
LIGHTRED = 9,
LIGHTMAGENTA = 10,
WHITE = 14,
BLACK = 15,
BLINK = 128,
RESET = 256,
};
#endif