mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cmdlib prototypes
This commit is contained in:
parent
79982c59a0
commit
09c1404182
56
tools/lvm2cmd.h
Normal file
56
tools/lvm2cmd.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2003 Sistina Software (UK) Limited.
|
||||
*
|
||||
* This file is released under the GPL.
|
||||
*/
|
||||
|
||||
#ifndef _LVM_CMDLIB_H
|
||||
#define _LVM_CMDLIB_H
|
||||
|
||||
#ifndef _LVM_LOG_H
|
||||
typedef void (*lvm2_log_fn_t) (int level, const char *file, int line,
|
||||
const char *message);
|
||||
#endif
|
||||
|
||||
#define LVM2_LOG_SUPPRESS 0
|
||||
|
||||
/* Logging levels */
|
||||
#define LVM2_LOG_FATAL 2
|
||||
#define LVM2_LOG_ERROR 3
|
||||
#define LVM2_LOG_PRINT 4
|
||||
#define LVM2_LOG_VERBOSE 5
|
||||
#define LVM2_LOG_VERY_VERBOSE 6
|
||||
#define LVM2_LOG_DEBUG 7
|
||||
|
||||
/*
|
||||
* Define external function to replace the built-in logging function.
|
||||
* It receives output line-by-line.
|
||||
*
|
||||
* level is the logging level (see above)
|
||||
* file & line refer to the source code where the message originates.
|
||||
*/
|
||||
void lvm2_log_fn(lvm2_log_fn_t log_fn);
|
||||
|
||||
/*
|
||||
* Initialise library.
|
||||
* Returns a handle so repeated use of lvm2_run is more efficient.
|
||||
*/
|
||||
void *lvm2_init(void);
|
||||
|
||||
/*
|
||||
* Set log level (as above) if using built-in logging function.
|
||||
* Default is LVM2_LOG_PRINT. Use LVM2_LOG_SUPPRESS to suppress output.
|
||||
*/
|
||||
void lvm2_log_level(void *handle, int level);
|
||||
|
||||
/*
|
||||
* Run an LVM2 command.
|
||||
* Use NULL handle if the call is a one-off and you don't want to bother
|
||||
* calling lvm2_init/lvm2_exit.
|
||||
*/
|
||||
int lvm2_run(void *handle, const char *cmdline);
|
||||
|
||||
/* Release handle */
|
||||
void lvm2_exit(void *handle);
|
||||
|
||||
#endif
|
@ -10,6 +10,7 @@
|
||||
#include "version.h"
|
||||
|
||||
#include "stub.h"
|
||||
#include "lvm2cmd.h"
|
||||
|
||||
#include <signal.h>
|
||||
#include <syslog.h>
|
||||
|
Loading…
Reference in New Issue
Block a user