summaryrefslogtreecommitdiffstats
path: root/src/guestfs.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-07-10 17:52:09 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-07-10 17:52:09 +0100
commit745f1d9ee8480b3a38f778fcc4506ce86da473a6 (patch)
treebbc56de7c7fc5dd24cedd64c5fdbb65fc8e39b28 /src/guestfs.c
parent2105fabddfdcecca68e20285808b4d8bbe133227 (diff)
downloadlibguestfs-745f1d9ee8480b3a38f778fcc4506ce86da473a6.tar.gz
libguestfs-745f1d9ee8480b3a38f778fcc4506ce86da473a6.tar.xz
libguestfs-745f1d9ee8480b3a38f778fcc4506ce86da473a6.zip
Add 'version' call to get true library version number.
This patch also changes the way that the version is specified in configure.ac. It is now made out of four parts (major, minor, release and extra) and constructed for AC_INIT.
Diffstat (limited to 'src/guestfs.c')
-rw-r--r--src/guestfs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index 7ab72006..f445adab 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -697,6 +697,19 @@ guestfs_get_pid (guestfs_h *g)
}
}
+struct guestfs_version *
+guestfs_version (guestfs_h *g)
+{
+ struct guestfs_version *r;
+
+ r = safe_malloc (g, sizeof *r);
+ r->major = PACKAGE_VERSION_MAJOR;
+ r->minor = PACKAGE_VERSION_MINOR;
+ r->release = PACKAGE_VERSION_RELEASE;
+ r->extra = safe_strdup (g, PACKAGE_VERSION_EXTRA);
+ return r;
+}
+
/* Add a string to the current command line. */
static void
incr_cmdline_size (guestfs_h *g)