added strToTime function and started writing cmd_trim
[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 UserNode;
10
11 struct Table {
12     char ***contents;
13     int length;
14     int width;
15     int flags;
16     int *col_flags;
17     
18     int entrys;
19     int *maxwidth;
20     
21     char **table_lines; //we just store this to free it in table_free
22 };
23
24 int match(const char *mask, const char *name);
25
26 struct Table *table_init(int width, int length, int flags);
27 int table_add(struct Table *table, char **entry);
28 int table_set_bold(struct Table *table, int collum, int bold);
29 char **table_end(struct Table *table);
30 void table_free(struct Table *table);
31
32 char* timeToStr(struct UserNode *user, int seconds, int items, char *buf);
33 int strToTime(struct UserNode *user, char *str);
34
35 void init_tools();
36
37 #endif