2016-12-22 17:38:55 +01:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* _____ _ */
|
2017-01-17 00:46:42 +01:00
|
|
|
/* p7os/main.h |_ _|__ _ _| |__ ___ _ _ */
|
|
|
|
/* | Project: p7utils | |/ _ \| | | | '_ \ / _ \ | | | */
|
2016-12-22 17:38:55 +01:00
|
|
|
/* | | (_) | |_| | | | | __/ |_| | */
|
|
|
|
/* By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.fr */
|
2017-01-17 00:46:42 +01:00
|
|
|
/* Last updated: 2017/01/16 23:55:55 |___/ */
|
2016-12-22 17:38:55 +01:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef MAIN_H
|
|
|
|
# define MAIN_H
|
|
|
|
# include <stdio.h>
|
|
|
|
# include <libp7.h>
|
|
|
|
# define Q(x) #x
|
|
|
|
# define QUOTE(x) Q(x)
|
|
|
|
# define log(S, ...) fprintf(stderr, S, ##__VA_ARGS__)
|
|
|
|
|
|
|
|
/* ************************************************************************** */
|
|
|
|
/* CLI options */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
/* Menu */
|
2017-01-17 00:55:06 +01:00
|
|
|
# define mn_prepare_only 1
|
|
|
|
# define mn_get 2
|
2016-12-22 17:38:55 +01:00
|
|
|
|
|
|
|
/* Arguments */
|
|
|
|
typedef struct {
|
|
|
|
/* basic things */
|
2017-01-17 00:55:06 +01:00
|
|
|
int menu;
|
2016-12-22 17:38:55 +01:00
|
|
|
|
2017-01-17 00:46:42 +01:00
|
|
|
/* communication and tweaks */
|
2017-02-08 14:04:11 +01:00
|
|
|
const char *com;
|
|
|
|
int noprepare;
|
2017-01-17 00:46:42 +01:00
|
|
|
FILE *uexe;
|
|
|
|
|
2016-12-22 17:38:55 +01:00
|
|
|
/* others */
|
|
|
|
FILE *local; const char *localpath;
|
|
|
|
} args_t;
|
|
|
|
|
|
|
|
/* Parsing function */
|
|
|
|
int parse_args(int ac, char **av, args_t *args);
|
|
|
|
|
|
|
|
/* ************************************************************************** */
|
|
|
|
/* Actual things */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
/* Main functions */
|
2017-02-15 14:22:33 +01:00
|
|
|
int prepare_ops(p7_handle_t *handle, FILE *uexe, p7_disp_t disp);
|
2016-12-22 17:38:55 +01:00
|
|
|
int get_os(p7_handle_t *handle, FILE *dest);
|
|
|
|
|
|
|
|
#endif /* MAIN_H */
|