From: Thomas Woerner <twoerner@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] New lib/lvm2.c for base library functions
Date: Thu, 11 Dec 2008 17:43:41 +0100 [thread overview]
Message-ID: <1229013822-10809-3-git-send-email-twoerner@redhat.com> (raw)
In-Reply-To: <1229013822-10809-2-git-send-email-twoerner@redhat.com>
---
lib/Makefile.in | 3 ++-
lib/lvm2.c | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 1 deletions(-)
create mode 100644 lib/lvm2.c
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 54092cd..c0b58b9 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -86,7 +86,8 @@ SOURCES =\
report/report.c \
striped/striped.c \
uuid/uuid.c \
- zero/zero.c
+ zero/zero.c \
+ lvm2.c
ifeq ("@LVM1@", "internal")
SOURCES +=\
diff --git a/lib/lvm2.c b/lib/lvm2.c
new file mode 100644
index 0000000..daf9a79
--- /dev/null
+++ b/lib/lvm2.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License v.2.1.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "lvm2.h"
+#include "lib.h"
+#include "toolcontext.h"
+
+
+lvm2_handle_t lvm2_create(const char *sys_dir)
+{
+ struct cmd_context *cmd;
+
+ /* use internal version with system_dir */
+ cmd = create_librarycontext(sys_dir);
+ if (! cmd)
+ return NULL;
+
+ /* TODO:
+ * - bind logging to handle
+ */
+
+ return (lvm2_handle_t) cmd;
+}
+
+
+void lvm2_destroy(lvm2_handle_t libh)
+{
+ destroy_toolcontext((struct cmd_context *) libh); /* no error handling here */
+
+ return 1;
+}
--
1.6.0.4
next prev parent reply other threads:[~2008-12-11 16:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-11 16:43 [PATCH] Use struct cmd_context* as type for lvm2_handle_t with hidden cmd_context. Accessors and mutators have to be used. (lib/lvm2.h) Thomas Woerner
2008-12-11 16:43 ` [PATCH] Renamed create_toolcontext function to _create_context and added sys_dir as argument, new functions create_librarycontext and create_toolcontext Thomas Woerner
2008-12-11 16:43 ` Thomas Woerner [this message]
2008-12-11 16:43 ` [PATCH] New public functions lvm2_reload_config, lvm2_set_config_option and lvm2_reset_config_option Thomas Woerner
2008-12-11 21:49 ` Dave Wysochanski
2008-12-12 1:33 ` Alasdair G Kergon
2008-12-12 11:36 ` Thomas Woerner
2008-12-12 12:45 ` Alasdair G Kergon
2008-12-12 13:04 ` Dave Wysochanski
2008-12-12 1:11 ` [PATCH] New lib/lvm2.c for base library functions Alasdair G Kergon
2008-12-12 1:04 ` [PATCH] Renamed create_toolcontext function to _create_context and added sys_dir as argument, new functions create_librarycontext and create_toolcontext Alasdair G Kergon
2008-12-12 3:39 ` Dave Wysochanski
2008-12-11 18:45 ` [PATCH] Use struct cmd_context* as type for lvm2_handle_t with hidden cmd_context. Accessors and mutators have to be used. (lib/lvm2.h) Dave Wysochanski
2008-12-12 0:46 ` Alasdair G Kergon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1229013822-10809-3-git-send-email-twoerner@redhat.com \
--to=twoerner@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.