2016-12-21 22:56:20 +01:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* _____ _ */
|
2016-12-22 01:22:29 +01:00
|
|
|
/* p7/main.h |_ _|__ _ _| |__ ___ _ _ */
|
|
|
|
/* | Project: p7utils | |/ _ \| | | | '_ \ / _ \ | | | */
|
2016-12-21 22:56:20 +01:00
|
|
|
/* | | (_) | |_| | | | | __/ |_| | */
|
|
|
|
/* By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.fr */
|
2017-01-17 00:46:42 +01:00
|
|
|
/* Last updated: 2017/01/16 23:55:54 |___/ */
|
2016-12-21 22:56:20 +01:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef MAIN_H
|
|
|
|
# define MAIN_H
|
|
|
|
# define Q(x) #x
|
|
|
|
# define QUOTE(x) Q(x)
|
|
|
|
# include <stdio.h>
|
|
|
|
# include <libp7.h>
|
|
|
|
# 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 */
|
2017-01-27 00:10:39 +01:00
|
|
|
unsigned int initflags;
|
2017-02-08 14:04:11 +01:00
|
|
|
const char *com;
|
|
|
|
const char *storage;
|
2016-12-21 22:56:20 +01:00
|
|
|
} 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 */
|