2
* Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH.
5
* See file LICENSE at the top of this source tree for license information.
11
#include <dmraid/lib_context.h>
13
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*a))
14
#define ARRAY_END(a) (a + ARRAY_SIZE(a))
16
/* Options actions dmraid performs. */
33
# ifdef DMRAID_NATIVE_LOG
37
NOPARTITIONS = 0x1000,
39
RAID_DEVICES = 0x2000,
48
IGNORELOCKING = 0x200000,
51
#define ALL_FLAGS ((enum action) -1)
53
/* Arguments allowed ? */
60
* Action flag definitions for set_action().
62
* 'Early' options can be handled directly in set_action() by calling
63
* the functions registered here (f_set member) handing in arg.
66
int option; /* Option character/value. */
67
enum action action; /* Action flag for this option or UNDEF. */
68
enum action needed; /* Mandatory options or UNDEF if alone */
69
enum action allowed; /* Allowed flags (ie, other options allowed) */
71
enum args args; /* Arguments allowed ? */
73
/* Function to call on hit or NULL */
74
int (*f_set)(struct lib_context *lc, int arg);
75
int arg; /* Argument for above function call */
78
/* Define which metadata is needed before we can call post functions. */
97
* Pre and Post functions to perform for an option.
101
enum metadata_need metadata;
106
int (*post)(struct lib_context *lc, int arg);
109
int handle_args(struct lib_context *lc, int argc, char ***argv);
110
int perform(struct lib_context *lc, char **argv);