/* ************************************************************************** */ /* _____ _ */ /* main.h |_ _|__ _ _| |__ ___ _ _ */ /* | Project : p7 | |/ _ \| | | | '_ \ / _ \ | | | */ /* | | (_) | |_| | | | | __/ |_| | */ /* By: thomas |_|\___/ \__,_|_| |_|\___|\__, |.fr */ /* Last updated: 2016/08/21 16:50:57 |___/ */ /* */ /* ************************************************************************** */ #ifndef MAIN_H # define MAIN_H # define Q(x) #x # define QUOTE(x) Q(x) # include # include # define log(S, ...) fprintf(stderr, S, ##__VA_ARGS__) /* Menus */ typedef enum { mn_send, mn_get, mn_copy, mn_del, mn_ls, mn_reset, mn_optimize, mn_info } menu_t; /* Arguments */ typedef struct { /* basic things */ menu_t menu; int nicedisp; /* for file transferring menus */ const char *dirname, *filename; const char *newdir, *newname; FILE *local; const char *localpath; int force; /* other options */ const char *device; const char *storage; int noinit; int noexit; } args_t; /* Parsing function */ int parse_args(int ac, char **av, args_t *args); /* Dumping function */ int dump(p7_handle_t *handle); #endif /* MAIN_H */