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

50 lines
1.8 KiB
C

/* ************************************************************************** */
/* _____ _ */
/* p7os/main.h |_ _|__ _ _| |__ ___ _ _ */
/* | Project: p7utils | |/ _ \| | | | '_ \ / _ \ | | | */
/* | | (_) | |_| | | | | __/ |_| | */
/* By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.fr */
/* Last updated: 2017/01/16 23:55:55 |___/ */
/* */
/* ************************************************************************** */
#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 */
# define mn_prepare_only 1
# define mn_get 2
/* Arguments */
typedef struct {
/* basic things */
int menu;
/* communication and tweaks */
const char *com;
int noprepare;
FILE *uexe;
/* others */
FILE *local; const char *localpath;
} args_t;
/* Parsing function */
int parse_args(int ac, char **av, args_t *args);
/* ************************************************************************** */
/* Actual things */
/* ************************************************************************** */
/* Main functions */
int prepare_ops(p7_handle_t *handle, FILE *uexe, void (*disp)());
int get_os(p7_handle_t *handle, FILE *dest);
#endif /* MAIN_H */