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/p7/main.h

61 lines
1.7 KiB
C
Raw Normal View History

2017-03-18 12:11:45 +01:00
/* *****************************************************************************
* p7/main.h -- p7 main header.
* Copyright (C) 2016-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.
2017-03-18 12:15:46 +01:00
* See the GNU General Public License for more details.
2017-03-18 12:11:45 +01:00
*
2017-03-18 12:15:46 +01:00
* You should have received a copy of the GNU General Public License
2017-03-18 12:11:45 +01:00
* along with p7utils; if not, see <http://www.gnu.org/licenses/>.
* ************************************************************************** */
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 {
2017-02-09 16:47:28 +01:00
mn_send, mn_get, mn_copy, mn_del, mn_list, mn_reset,
mn_optimize, mn_info
2016-12-21 22:56:20 +01:00
} 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);
2017-02-09 18:05:12 +01:00
/* List devices function */
int list_devices(void);
2016-12-21 22:56:20 +01:00
/* Dumping function */
int dump(p7_handle_t *handle);
#endif /* MAIN_H */