[Pkg-libvirt-commits] [libguestfs] 70/146: New API: guestfs_c_pointer
Hilko Bengen
bengen at moszumanska.debian.org
Sun Mar 29 17:00:35 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch master
in repository libguestfs.
commit e36239d09f5b5bc807cb073eaab0a2b7f7f9a9ef
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Fri Dec 12 14:44:54 2014 +0000
New API: guestfs_c_pointer
This returns the C pointer to the guestfs_h handle (ie. guestfs_h *).
The purpose of this API is to interwork with other non-C libraries.
See RHBZ#1075164 for the rationale when applied to another library.
(cherry picked from commit d8c43d556b45f4c9676fdbfce0e9fe07b709635a)
---
generator/actions.ml | 13 +++++++++++++
src/handle.c | 6 ++++++
2 files changed, 19 insertions(+)
diff --git a/generator/actions.ml b/generator/actions.ml
index b279ff1..356b01d 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -3291,6 +3291,19 @@ refers to.
This is the same as the C<lstat(2)> system call." };
+ { defaults with
+ name = "c_pointer";
+ style = RInt64 "ptr", [], [];
+ tests = [
+ InitNone, Always, TestRun (
+ [["c_pointer"]]), []
+ ];
+ shortdesc = "return the C pointer to the guestfs_h handle";
+ longdesc = "\
+In non-C language bindings, this allows you to retrieve the underlying
+C pointer to the handle (ie. C<guestfs_h *>). The purpose of this is
+to allow other libraries to interwork with libguestfs." };
+
]
(* daemon_functions are any functions which cause some action
diff --git a/src/handle.c b/src/handle.c
index 141ba7d..337c375 100644
--- a/src/handle.c
+++ b/src/handle.c
@@ -380,6 +380,12 @@ guestfs_close (guestfs_h *g)
free (g);
}
+int64_t
+guestfs__c_pointer (guestfs_h *g)
+{
+ return (int64_t) g;
+}
+
int
guestfs__shutdown (guestfs_h *g)
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list