]> sourceware.org Git - lvm2.git/blame - tools/lvm2cmd.h
Reinstate accidentally-deleted line.
[lvm2.git] / tools / lvm2cmd.h
CommitLineData
09c14041 1/*
6606c3ae
AK
2 * Copyright (C) 2003-2004 Sistina Software, Inc. All rights reserved.
3 * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
09c14041 4 *
6606c3ae
AK
5 * This file is part of LVM2.
6 *
7 * This copyrighted material is made available to anyone wishing to use,
8 * modify, copy, or redistribute it subject to the terms and conditions
be684599 9 * of the GNU Lesser General Public License v.2.1.
6606c3ae 10 *
be684599 11 * You should have received a copy of the GNU Lesser General Public License
6606c3ae
AK
12 * along with this program; if not, write to the Free Software Foundation,
13 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
09c14041
AK
14 */
15
16#ifndef _LVM_CMDLIB_H
17#define _LVM_CMDLIB_H
18
c9c7d25c
MB
19#ifdef __cplusplus
20extern "C" {
21#endif
22
09c14041
AK
23#ifndef _LVM_LOG_H
24typedef void (*lvm2_log_fn_t) (int level, const char *file, int line,
c9b9c79b
AK
25 int dm_errno, const char *message);
26
09c14041
AK
27#endif
28
29#define LVM2_LOG_SUPPRESS 0
30
31/* Logging levels */
32#define LVM2_LOG_FATAL 2
33#define LVM2_LOG_ERROR 3
34#define LVM2_LOG_PRINT 4
35#define LVM2_LOG_VERBOSE 5
36#define LVM2_LOG_VERY_VERBOSE 6
37#define LVM2_LOG_DEBUG 7
38
39/*
40 * Define external function to replace the built-in logging function.
41 * It receives output line-by-line.
42 *
43 * level is the logging level (see above)
44 * file & line refer to the source code where the message originates.
45 */
46void lvm2_log_fn(lvm2_log_fn_t log_fn);
47
48/*
49 * Initialise library.
50 * Returns a handle so repeated use of lvm2_run is more efficient.
51 */
52void *lvm2_init(void);
53
61cf772e
PR
54/*
55 * Disable any dmeventd calls that the library may otherwise do. Useful to avoid
56 * recursive calls from dmeventd to itself.
57 */
58void lvm2_disable_dmeventd_monitoring(void *handle);
59
09c14041
AK
60/*
61 * Set log level (as above) if using built-in logging function.
62 * Default is LVM2_LOG_PRINT. Use LVM2_LOG_SUPPRESS to suppress output.
63 */
64void lvm2_log_level(void *handle, int level);
65
66/*
67 * Run an LVM2 command.
68 * Use NULL handle if the call is a one-off and you don't want to bother
69 * calling lvm2_init/lvm2_exit.
70 */
71int lvm2_run(void *handle, const char *cmdline);
72
73/* Release handle */
74void lvm2_exit(void *handle);
75
c9c7d25c
MB
76#ifdef __cplusplus
77}
78#endif
09c14041 79#endif
This page took 0.080961 seconds and 5 git commands to generate.