vaseboot/include/VasEBoot/parttool.h

59 lines
1.6 KiB
C

/*
* VasEBoot -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* VasEBoot 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 3 of the License, or
* (at your option) any later version.
*
* VasEBoot 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VasEBoot. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VasEBoot_PARTTOOL_HEADER
#define VasEBoot_PARTTOOL_HEADER 1
struct VasEBoot_parttool_argdesc
{
const char *name;
const char *desc;
enum {VasEBoot_PARTTOOL_ARG_END, VasEBoot_PARTTOOL_ARG_BOOL, VasEBoot_PARTTOOL_ARG_VAL}
type;
};
struct VasEBoot_parttool_args
{
int set;
union
{
int bool;
char *str;
};
};
typedef VasEBoot_err_t (*VasEBoot_parttool_function_t) (const VasEBoot_device_t dev,
const struct VasEBoot_parttool_args *args);
struct VasEBoot_parttool
{
struct VasEBoot_parttool *next;
char *name;
int handle;
int nargs;
struct VasEBoot_parttool_argdesc *args;
VasEBoot_parttool_function_t func;
};
int VasEBoot_parttool_register(const char *part_name,
const VasEBoot_parttool_function_t func,
const struct VasEBoot_parttool_argdesc *args);
void VasEBoot_parttool_unregister (int handle);
#endif /* ! VasEBoot_PARTTOOL_HEADER*/