diff --git a/src/wte.c b/src/wte.c index c353686..42a1a3d 100644 --- a/src/wte.c +++ b/src/wte.c @@ -1,21 +1,6 @@ -#include - -#ifdef DEBUG -#define dbg(format, ...) do { \ - printf("\033[1;35m[DEBUG] (func: %s) msg:\033[0;35m " format "\033[0m\n",__func__, __VA_ARGS__); \ -} while(0) -#else -#define dbg(format, ...) -#endif - -#define c_red "\033[1;31m" -#define c_green "\033[1;32m" -#define c_yellow "\033[1;33m" -#define c_end "\033[0m" - -#define error(format, ...) do {\ - fprintf(stderr, c_red "[ERROR] "format c_end"\n", __VA_ARGS__); \ -} while(0) +#include +#include +#include "wte.h" static int get_proposition() diff --git a/src/wte.h b/src/wte.h new file mode 100644 index 0000000..b11abed --- /dev/null +++ b/src/wte.h @@ -0,0 +1,31 @@ +#include +#define error(format, ...) do {\ + fprintf(stderr, c_red "[ERROR] "format c_end"\n", __VA_ARGS__); \ +} while(0) + +#ifdef DEBUG +#define dbg(format, ...) do { \ + printf("\033[1;35m[DEBUG] (func: %s) msg:\033[0;35m " format "\033[0m\n",__func__, __VA_ARGS__); \ +} while(0) +#else +#define dbg(format, ...) +#endif + +#define c_red "\033[1;31m" +#define c_green "\033[1;32m" +#define c_yellow "\033[1;33m" +#define c_end "\033[0m" + +/* path to data storage */ +#define DATA_DIR "/.local/share/wte" + +/* get full path to data storage (with "/home/$USER/"-prefix) */ +char *get_path(); + +/* data storage creation / deletion */ +int create_data_dir(); +int remove_data_dir(); + +/* operating on data storage */ +int insert_choice(); +int remove_choice();