summaryrefslogtreecommitdiff
path: root/libvxi11client/perlbits/perlglue.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvxi11client/perlbits/perlglue.c')
-rw-r--r--libvxi11client/perlbits/perlglue.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libvxi11client/perlbits/perlglue.c b/libvxi11client/perlbits/perlglue.c
new file mode 100644
index 0000000..e870477
--- /dev/null
+++ b/libvxi11client/perlbits/perlglue.c
@@ -0,0 +1,23 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+#include "ppport.h"
+
+#include "perlglue.h"
+
+#define INTERRUPTHANDLE "libvxi11client"
+
+extern int vxi11_enable_srq(bool enable, char* handle, void (*callback)(void));
+
+static SV* perlcallback = NULL;
+
+static void interruptcallback(void) {
+ //PUSHMARK(SP);
+ call_sv(perlcallback, G_DISCARD | G_NOARGS);
+}
+
+int glue_enable_srq(bool enable, SV* callback) {
+ perlcallback = callback;
+ return vxi11_enable_srq(enable, INTERRUPTHANDLE, interruptcallback);
+}