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

59 lines
2.0 KiB
C
Raw Normal View History

2017-03-18 12:11:45 +01:00
/* *****************************************************************************
* p7os/main.h -- p7os main header.
* Copyright (C) 2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
*
* This file is part of p7utils.
* p7utils is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2.0 of the License,
* or (at your option) any later version.
*
* p7utils is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with p7utils; if not, see <http://www.gnu.org/licenses/>.
* ************************************************************************** */
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 */
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 */