cake
/
p7utils
Archived
1
0
Fork 0
This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
p7utils/src/p7os/main.h

51 lines
1.8 KiB
C
Raw Normal View History

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 */
typedef enum {
2017-01-17 00:46:42 +01:00
mn_prepare_only,
2016-12-22 17:38:55 +01:00
mn_get
} menu_t;
/* Arguments */
typedef struct {
/* basic things */
menu_t menu;
2017-01-17 00:46:42 +01:00
/* communication and tweaks */
int com, noprepare;
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-01-17 00:46:42 +01:00
int prepare_ops(p7_handle_t *handle, FILE *uexe);
2016-12-22 17:38:55 +01:00
int get_os(p7_handle_t *handle, FILE *dest);
#endif /* MAIN_H */