Permalink
Browse files

perlvariables - iteration N

Later commits reworked a lot of this, but the use of GValue over void*
was kept.
  • Loading branch information...
1 parent 6a20996 commit 06e04a995f32e4c88df08bff7baf37fb5bc8a59c @aglasgall aglasgall committed with davidben Jul 20, 2011
Showing with 1,194 additions and 260 deletions.
  1. +3 −2 Makefile.am
  2. +28 −0 closures.c
  3. +7 −0 configure.ac
  4. +396 −0 gmarshal_funcs.c
  5. +89 −0 gmarshal_funcs.h
  6. +16 −0 marshal_types
  7. +11 −0 owl.c
  8. +52 −7 owl.h
  9. +8 −0 perlconfig.c
  10. +73 −0 perlglue.xs
  11. +511 −251 variable.c
View
@@ -38,13 +38,14 @@ AM_CPPFLAGS = -I$(top_srcdir)/ \
$(GIT_FLAGS)
CODELIST_SRCS=message.c mainwin.c popwin.c zephyr.c messagelist.c \
- commands.c global.c text.c fmtext.c editwin.c util.c logging.c \
+ commands.c global.c text.c fmtext.c gmarshal_funcs.c editwin.c \
+ util.c logging.c \
perlconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
keypress.c keymap.c keybinding.c cmd.c context.c \
aim.c buddy.c buddylist.c style.c errqueue.c \
zbuddylist.c popexec.c select.c wcwidth.c \
- mainpanel.c msgwin.c sepbar.c editcontext.c signal.c
+ mainpanel.c msgwin.c sepbar.c editcontext.c signal.c closures.c
NORMAL_SRCS = filterproc.c window.c windowcb.c
View
@@ -0,0 +1,28 @@
+#define OWL_PERL
+#include "owl.h"
+#include <dlfcn.h>
+#include <gperl.h>
+#include <gperl_marshal.h>
+
+gboolean (*gvalue_from_sv) (GValue * value, SV * sv) = NULL;
+SV * (*sv_from_gvalue) (const GValue * value) = NULL;
+GClosure * (*perl_closure_new) (SV * callback, SV * data, gboolean swap) = NULL;
+
+/* Caller does not own return value */
+const char *owl_closure_init(void)
+{
+ void *handle = NULL;
+ const char *res = "Unable to dlopen self - huh?";
+
+ handle = dlopen(NULL, RTLD_LAZY | RTLD_NOLOAD);
+ if(handle) {
+ gvalue_from_sv = dlsym(handle, "gperl_value_from_sv");
+ sv_from_gvalue = dlsym(handle, "gperl_sv_from_value");
+ perl_closure_new = dlsym(handle, "gperl_closure_new");
+ /* ... */
+ res = dlerror();
+ dlclose(handle);
+ }
+ return res;
+}
+
View
@@ -126,6 +126,8 @@ AX_PROG_PERL_MODULES([Glib],,
[AC_MSG_ERROR([cannot find perl module Glib.])])
AX_PROG_PERL_MODULES([PAR],,
[AC_MSG_WARN([PAR.pm not found. Loadable modules will be disabled.])])
+AX_PROG_PERL_MODULES([ExtUtils::Depends],,
+ [AC_MSG_ERROR([cannot find perl module ExtUtils::Depends])])
dnl Add CFLAGS and LIBS for glib-2.0
PKG_CHECK_MODULES(GLIB,[glib-2.0 >= 2.16 gobject-2.0 gthread-2.0])
@@ -139,6 +141,11 @@ if test "x${prefix}" = "xNONE"; then
prefix="${ac_default_prefix}"
fi
+dnl Add CFLAGS for glib-perl
+GLIB_PERL_CFLAGS=`perl -MExtUtils::Depends -e 'my $e = ExtUtils::Depends->new("BarnOwl","Glib"); my %h = $e->get_makefile_vars; print $h{"INC"}'`
+AC_MSG_NOTICE([Adding glib-perl CFLAGS ${GLIB_PERL_CFLAGS}])
+AM_CFLAGS="${GLIB_PERL_CFLAGS} ${AM_CFLAGS}"
+
dnl Checks for typedefs, structures, and compiler characteristics.
AX_CFLAGS_WARN_ALL([AM_CFLAGS])
Oops, something went wrong.

0 comments on commit 06e04a9

Please sign in to comment.