added table system
[NeonServV5.git] / tools.h
1 #ifndef _tools_h
2 #define _tools_h
3
4 #include "main.h"
5
6 #define TABLE_FLAG_USE_POINTER 0x01
7 #define TABLE_FLAG_COL_BOLD    0x02
8
9 struct Table {
10     char ***contents;
11     int length;
12     int width;
13     int flags;
14     int *col_flags;
15     
16     int c_entry;
17     int *maxwidth;
18     
19     char **table; //we just store this to free it in table_free
20 };
21
22 int match(const char *mask, const char *name);
23
24 struct Table *table_init(int width, int length, int flags);
25 int table_add(struct Table *table, char **entry);
26 int table_set_bold(struct Table *table, int collum, int bold);
27 char **table_end(struct Table *table);
28 void table_free(struct Table *table);
29
30 #endif