command.h revision 1
1N/A/*
1N/A parted - a frontend to libparted
1N/A Copyright (C) 1999-2000, 2007, 2009-2010 Free Software Foundation,
1N/A Inc.
1N/A
1N/A This program is free software; you can redistribute it and/or modify
1N/A it under the terms of the GNU General Public License as published by
1N/A the Free Software Foundation; either version 3 of the License, or
1N/A (at your option) any later version.
1N/A
1N/A This program is distributed in the hope that it will be useful,
1N/A but WITHOUT ANY WARRANTY; without even the implied warranty of
1N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1N/A GNU General Public License for more details.
1N/A
1N/A You should have received a copy of the GNU General Public License
1N/A along with this program. If not, see <http://www.gnu.org/licenses/>.
1N/A*/
1N/A
1N/A#ifndef COMMAND_H_INCLUDED
1N/A#define COMMAND_H_INCLUDED
1N/A
1N/A#include <parted/parted.h>
1N/A#include "strlist.h"
1N/A
1N/Atypedef struct {
1N/A StrList* names;
1N/A int (*method) (PedDevice** dev);
1N/A StrList* summary;
1N/A StrList* help;
1N/A int non_interactive:1;
1N/A} Command;
1N/A
1N/Aextern Command* command_create (const StrList* names,
1N/A int (*method) (PedDevice** dev),
1N/A const StrList* summary,
1N/A const StrList* help,
1N/A int non_interactive);
1N/Aextern void command_destroy (Command* cmd);
1N/Avoid command_register (Command** list, Command* cmd);
1N/A
1N/Aextern Command* command_get (Command** list, char* name);
1N/Aextern StrList* command_get_names (Command** list);
1N/Aextern void command_print_summary (Command* cmd);
1N/Aextern void command_print_help (Command* cmd);
1N/Aextern int command_run (Command* cmd, PedDevice** dev);
1N/A
1N/A#endif /* COMMAND_H_INCLUDED */