[seed] Initial commit of libxml module
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Initial commit of libxml module
- Date: Mon, 11 May 2009 23:58:55 -0400 (EDT)
commit 21d38589febfa4d6007cf7ddf9978d0ee43df05a
Author: Robert Carr <racarr svn gnome org>
Date: Mon May 11 23:08:26 2009 -0400
Initial commit of libxml module
---
configure.ac | 18 ++++++++++++++++++
libseed/seed-builtins.c | 6 +++---
modules/Makefile.am | 2 +-
modules/libxml/Makefile.am | 25 +++++++++++++++++++++++++
modules/libxml/libxml.c | 8 ++++++++
tests/javascript/printprint.js | 2 +-
6 files changed, 56 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 39275d3..f83d33f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,21 @@ AC_ARG_ENABLE(os-module,
AM_CONDITIONAL(BUILD_OS_MODULE, test "x$want_os_module" = "xyes")
AC_SUBST(BUILD_OS_MODULE)
+dnl ==== libxml ====
+AC_ARG_ENABLE(libxml-module,
+ AC_HELP_STRING([--enable-libxml-module],
+ [enable the libxml Seed module. [default=yes]]),
+ [want_libxml_module=$enableval],[want_libxml_module="yes"])
+
+if test x"$want_libxml_module" == x"yes" ; then
+ PKG_CHECK_MODULES(LIBXML, libxml-2.0)
+ AC_SUBST(LIBXML_CFLAGS)
+ AC_SUBST(LIBXML_LDFLAGS)
+fi
+
+AM_CONDITIONAL(BUILD_LIBXML_MODULE, test "x$want_libxml_module" = "xyes")
+AC_SUBST(BUILD_LIBXML_MODULE)
+
dnl =========================turtle example====================================
AC_ARG_ENABLE(turtle-example,
@@ -322,6 +337,7 @@ modules/Multiprocessing/Makefile
modules/sandbox/Makefile
modules/os/Makefile
modules/dbus/Makefile
+modules/libxml/Makefile
])
AC_OUTPUT
@@ -342,6 +358,8 @@ Modules:
multiprocessing............$want_multiprocessing_module
readline...................$want_readline_module
SQLite.....................$want_sqlite_module
+ DBus.......................$want_dbus_module
+ libxml.....................$want_libxml_module
Examples:
Turtle.....................$want_turtle_example
diff --git a/libseed/seed-builtins.c b/libseed/seed-builtins.c
index 9dc5a17..b24cb68 100644
--- a/libseed/seed-builtins.c
+++ b/libseed/seed-builtins.c
@@ -105,7 +105,7 @@ seed_include (JSContextRef ctx,
g_free (import_file);
g_free (walk);
- return JSValueMakeNull (ctx);
+ return JSValueMakeUndefined (ctx);
}
static JSValueRef
@@ -222,7 +222,7 @@ seed_print (JSContextRef ctx,
puts (buf);
g_free (buf);
- return JSValueMakeNull (ctx);
+ return JSValueMakeUndefined (ctx);
}
const gchar *
@@ -418,7 +418,7 @@ seed_breakpoint (JSContextRef ctx,
const JSValueRef arguments[], JSValueRef * exception)
{
G_BREAKPOINT();
- return JSValueMakeNull(ctx);
+ return JSValueMakeUndefined (ctx);
}
diff --git a/modules/Makefile.am b/modules/Makefile.am
index 66623be..d3af447 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -1 +1 @@
-SUBDIRS = example sqlite canvas Multiprocessing readline os sandbox dbus
+SUBDIRS = example sqlite canvas Multiprocessing readline os sandbox dbus libxml
diff --git a/modules/libxml/Makefile.am b/modules/libxml/Makefile.am
new file mode 100644
index 0000000..ba7902b
--- /dev/null
+++ b/modules/libxml/Makefile.am
@@ -0,0 +1,25 @@
+if BUILD_LIBXML_MODULE
+
+seedlibdir = ${exec_prefix}/lib/seed
+
+seedlib_LTLIBRARIES = \
+ liblibxml.la
+
+liblibxml_la_SOURCES = \
+ libxml.c
+
+
+AM_CPPFLAGS = \
+ -I top_srcdir@/libseed/ \
+ $(GOBJECT_INTROSPECTION_CFLAGS)
+ $(SEED_DEBUG_CFLAGS) \
+ $(SEED_PROFILE_CFLAGS)
+
+liblibxml_la_LDFLAGS = \
+ $(GOBJECT_INTROSPECTION_LDFLAGS) \
+ $(SEED_PROFILE_LIBS)
+
+endif
+
+
+
diff --git a/modules/libxml/libxml.c b/modules/libxml/libxml.c
new file mode 100644
index 0000000..97c2d36
--- /dev/null
+++ b/modules/libxml/libxml.c
@@ -0,0 +1,8 @@
+#include <seed.h>
+
+SeedObject
+seed_module_init(SeedEngine * eng)
+{
+ g_printf("Hello Seed Module World \n");
+ return seed_make_object (eng->context, NULL, NULL);
+}
diff --git a/tests/javascript/printprint.js b/tests/javascript/printprint.js
index e8729e4..1fe881d 100755
--- a/tests/javascript/printprint.js
+++ b/tests/javascript/printprint.js
@@ -1,7 +1,7 @@
#!/usr/bin/env seed
// Returns: 0
// STDIN:
-// STDOUT:Hello World!\n\[null\]
+// STDOUT:Hello World!\n\[undefined\]
// STDERR:
Seed.print(Seed.print("Hello World!"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]