mirror of
git://sourceware.org/git/lvm2.git
synced 2025-08-03 08:22:00 +03:00
Preparation for an LVM2 liblvm - pass cmd_context into each tool and
link some globals that the tools need into that structure.
This commit is contained in:
16
lib/commands/errors.h
Normal file
16
lib/commands/errors.h
Normal file
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2001 Sistina Software (UK) Limited.
|
||||
*
|
||||
* This file is released under the LGPL.
|
||||
*/
|
||||
|
||||
#ifndef _LVM_ERRORS_H
|
||||
#define _LVM_ERRORS_H
|
||||
|
||||
#define EINVALID_CMD_LINE 1
|
||||
#define ENO_SUCH_CMD 3
|
||||
#define ECMD_PROCESSED 4
|
||||
#define ECMD_FAILED 5
|
||||
|
||||
#endif
|
||||
|
33
lib/commands/toolcontext.h
Normal file
33
lib/commands/toolcontext.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2001 Sistina Software (UK) Limited.
|
||||
*
|
||||
* This file is released under the LGPL.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _LVM_TOOLCONTEXT_H
|
||||
#define _LVM_TOOLCONTEXT_H
|
||||
|
||||
#include "dev-cache.h"
|
||||
#include "config.h"
|
||||
#include "pool.h"
|
||||
#include "metadata.h"
|
||||
|
||||
/* command-instance-related variables needed by library */
|
||||
struct cmd_context {
|
||||
/* format handler allocates all objects from here */
|
||||
struct pool *mem;
|
||||
|
||||
struct format_instance *fid;
|
||||
|
||||
char *cmd_line;
|
||||
char *dev_dir;
|
||||
struct dev_filter *filter;
|
||||
struct config_file *cf;
|
||||
|
||||
struct command *command;
|
||||
struct uuid_map *um;
|
||||
struct arg *args;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user