From 6b74097642353500f965bdc024c76051c090b4f4 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 11 Jan 2013 20:37:30 +0900 Subject: The perl interface is cleaner at least. Need to work out how to get the call back working --- libvxi11client/perlbits/perlglue.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 libvxi11client/perlbits/perlglue.c (limited to 'libvxi11client/perlbits/perlglue.c') 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); +} -- cgit