OSDN Git Service

ui: make --help tell where to report bugs
[android-x86/external-parted.git] / parted / command.h
1 /*
2     parted - a frontend to libparted
3     Copyright (C) 1999-2000, 2007, 2009-2010 Free Software Foundation,
4     Inc.
5
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 3 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef COMMAND_H_INCLUDED
21 #define COMMAND_H_INCLUDED
22
23 #include <parted/parted.h>
24 #include "strlist.h"
25
26 typedef struct {
27         StrList*        names;
28         int             (*method) (PedDevice** dev);
29         StrList*        summary;
30         StrList*        help;
31         int             non_interactive:1;
32 } Command;
33
34 extern Command* command_create (const StrList* names,
35                                 int (*method) (PedDevice** dev),
36                                 const StrList* summary,
37                                 const StrList* help,
38                                 int non_interactive);
39 extern void command_destroy (Command* cmd);
40 void command_register (Command** list, Command* cmd);
41
42 extern Command* command_get (Command** list, char* name);
43 extern StrList* command_get_names (Command** list);
44 extern void command_print_summary (Command* cmd);
45 extern void command_print_help (Command* cmd);
46 extern int command_run (Command* cmd, PedDevice** dev);
47
48 #endif /* COMMAND_H_INCLUDED */