Skip to contentSkip to conversation

(no subject)

PATCH New Thomas Woerner 1 participant 2 messages Feb 20, 2009 Library code

lore
Share & tools
lore
#1 lore raw

PATCH 3/3 New base files needed for liblvm with doxygen style descriptions.

Added files lib/lvm.h and lib/lvm_base.c:
New structure lvm (used as an alias to cmd_context), new type definition lvm_t for the lvm handle. Added functions lvm_create, lvm_destroy and lvm_reload_config using the new handle.

Modified test/api/test.c:
Use new lvm.h header file and lvm_t handle.

Removed lib/lvm2.h

---
 lib/Makefile.in |    5 ++-
 lib/lvm.h       |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/lvm2.h      |   53 -----------------------------------------------
 lib/lvm_base.c  |   61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 test/api/test.c |   17 +++++++--------
 5 files changed, 129 insertions(+), 64 deletions(-)
 create mode 100644 lib/lvm.h
 delete mode 100644 lib/lvm2.h
 create mode 100644 lib/lvm_base.c
lib/Makefile.in +3 -2
index 54092cd..47786a7 100644
@@ -1,6 +1,6 @@
 #
 # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
-# Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
 #
 # This file is part of LVM2.
 #
@@ -86,7 +86,8 @@ SOURCES =\
 	report/report.c \
 	striped/striped.c \
 	uuid/uuid.c \
-	zero/zero.c
+	zero/zero.c \
+	lvm_base.c
 
 ifeq ("@LVM1@", "internal")
   SOURCES +=\
lib/lvm.h new file +57 -0

57 lines not on this page · raw message

lib/lvm2.h deleted +0 -53

53 lines not on this page · raw message

lib/lvm_base.c new file +61 -0

61 lines not on this page · raw message

test/api/test.c +8 -9
index de53c46..b742976 100644
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.  
- * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
  *
@@ -16,7 +16,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <readline/readline.h>
-#include "lvm2.h"
+#include "lvm.h"
 
 #define MAX_ARGS 64
 
@@ -48,7 +48,7 @@ static int lvm_split(char *str, int *argc, char **argv, int max)
 	return *argc;
 }
 
-static int lvmapi_test_shell(void *h)
+static int lvmapi_test_shell(lvm_t libh)
 {
 	int argc, i;
 	char *input = NULL, *args[MAX_ARGS], **argv;
@@ -99,18 +99,17 @@ static int lvmapi_test_shell(void *h)
 		      
 int main (int argc, char *argv[])
 {
-	void *h;
+	lvm_t libh;
 
-	h = lvm2_create();
-	if (!h) {
+	libh = lvm_create(NULL);
+	if (!libh) {
 		printf("Unable to open lvm library instance\n");
 		return 1;
 	}
 
-	lvmapi_test_shell(h);
+	lvmapi_test_shell(libh);
 
-	if (h)
-		lvm2_destroy(h);
+	lvm_destroy(libh);
 	return 0;
 }
 
Signature · 1 line
1.6.1.3