ebdl-commits Mailing List for Extension Beans Data Library (Page 20)
Status: Beta
Brought to you by:
inean
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(120) |
Apr
(49) |
May
(138) |
Jun
(68) |
Jul
(23) |
Aug
(6) |
Sep
(1) |
Oct
(31) |
Nov
(8) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
|
Mar
(3) |
Apr
(8) |
May
(5) |
Jun
|
Jul
(1) |
Aug
(6) |
Sep
(18) |
Oct
|
Nov
|
Dec
|
From: Carlos MartÃn <in...@us...> - 2007-03-13 22:35:00
|
Update of /cvsroot/ebdl/ebdl-bonobo In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5563 Modified Files: Makefile.am acinclude.m4 configure.in Log Message: * Initial import of rewrite code Index: configure.in =================================================================== RCS file: /cvsroot/ebdl/ebdl-bonobo/configure.in,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** configure.in 3 Nov 2006 18:40:11 -0000 1.13 --- configure.in 13 Mar 2007 22:34:56 -0000 1.14 *************** *** 9,13 **** --- 9,15 ---- AC_INIT([ebdl-bonobo],[ebdl_bonobo_version], [http://gmodulo.sf.net/bugs.php?package=ebdl-bonobo]) + AM_INIT_AUTOMAKE([no-define]) + AC_CONFIG_SRCDIR([src/eb-main.c]) AM_MAINTAINER_MODE *************** *** 57,71 **** dnl ================= Arguments =================================================== AS_SET_DEBUG_MODE([minimum]) AS_SET_COMPILE_WARNINGS([minimum]) AS_SET_COMPONENT_DIR([auto]) - AS_SET_CCACHE_STUFF([yes]) - AS_SET_COVERAGE([no]) dnl ====================== Optional Code ========================================== ! AS_ENABLE_TESTS([yes]) AS_ENABLE_BACKENDS([yes]) - AS_ENABLE_EBAS([yes],[libavahi_required_version]) dnl ====================== Check headers ========================================== --- 59,80 ---- dnl ================= Arguments =================================================== + AS_SET_CCACHE_STUFF([no]) AS_SET_DEBUG_MODE([minimum]) AS_SET_COMPILE_WARNINGS([minimum]) AS_SET_COMPONENT_DIR([auto]) dnl ====================== Optional Code ========================================== ! dnl enable tests cases ! AS_ENABLE_TESTS([auto]) ! dnl enable coverage analysis ! AS_SET_COVERAGE([auto]) ! dnl enable test kernel modules ! AS_ENABLE_KERNEL_MODULES([auto]) ! dnl build forked activation server ! AS_ENABLE_EBAS([auto],[libavahi_required_version]) ! ! dnl Backends support AS_ENABLE_BACKENDS([yes]) dnl ====================== Check headers ========================================== *************** *** 89,97 **** dnl ================= Set compile flags =========================================== ! AS_CHECK_MODULES(EBDL_GOBJECT, [gobject-2.0]) ! AS_CHECK_MODULES(EBDL_BONOBO, [libbonobo-2.0 ORBit-2.0]) ! AS_CHECK_MODULES(EBDL_CORE, [libbonobo-2.0 ORBit-2.0 ebdl-1]) ! AS_CHECK_MODULES(EBDL_EBAS, [libbonobo-2.0 ORBit-2.0], $AVAHI_FLAGS, $AVAHI_LIBS -lpopt) ! AS_CHECK_MODULES(EBDL_TEST, [libbonobo-2.0 bonobo-activation-2.0 ORBit-2.0 ebdl-1], $AVAHI_FLAGS $CHECK_FLAGS, $AVAHI_LIBS $CHECK_LIBS -lpopt) ORBIT_IDL=`$PKG_CONFIG --variable=orbit_idl ORBit-2.0` --- 98,106 ---- dnl ================= Set compile flags =========================================== ! AS_CHECK_MODULES(EBDL_GOBJECT, [gobject-2.0],, $GCOV_LIBS) ! AS_CHECK_MODULES(EBDL_BONOBO, [libbonobo-2.0 ORBit-2.0],,$GCOV_LIBS) ! AS_CHECK_MODULES(EBDL_CORE, [libbonobo-2.0 ORBit-2.0 ebdl-1],,$GCOV_LIBS) ! AS_CHECK_MODULES(EBDL_EBAS, [libbonobo-2.0 ORBit-2.0], $AVAHI_FLAGS, $GCOV_LIBS $AVAHI_LIBS -lpopt) ! AS_CHECK_MODULES(EBDL_TEST, [libbonobo-2.0 bonobo-activation-2.0 ORBit-2.0 ebdl-1], $AVAHI_FLAGS $CHECK_FLAGS, $GCOV_LIBS $AVAHI_LIBS $CHECK_LIBS -lpopt) ORBIT_IDL=`$PKG_CONFIG --variable=orbit_idl ORBit-2.0` *************** *** 116,120 **** AC_SUBST(ORBIT_IDL) ! AC_OUTPUT([ Makefile packing/Makefile --- 125,129 ---- AC_SUBST(ORBIT_IDL) ! AC_CONFIG_FILES([ Makefile packing/Makefile *************** *** 128,131 **** --- 137,143 ---- src/ebas/Makefile tests/Makefile + tests/Linux/Makefile + tests/Linux/modules/Makefile + tests/Linux/modules/test01/Makefile ]) AC_OUTPUT Index: acinclude.m4 =================================================================== RCS file: /cvsroot/ebdl/ebdl-bonobo/acinclude.m4,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** acinclude.m4 30 Oct 2006 20:09:53 -0000 1.8 --- acinclude.m4 13 Mar 2007 22:34:56 -0000 1.9 *************** *** 96,99 **** --- 96,203 ---- ]) + #EBDL_ARG_KERNEL_PATH + # let the user over-ride the kernel source path + AC_DEFUN([AS_ENABLE_KERNEL_MODULES],[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AS_ENABLE_TESTS]) + + KSRC=/lib/modules/`uname -r`/build/ + KCONFIG=/boot/config-`uname -r` + + AC_ARG_WITH(linux, + AC_HELP_STRING([--with-linux=dir], + [Path to Linux source tree]), + KSRC=$withval) + AC_ARG_WITH(kconfig, + AC_HELP_STRING([--with-kconfig=file], + [Path to Kernel config file]), + KCONFIG=$withval) + AC_ARG_ENABLE(build-test-modules, + AC_HELP_STRING([--enable-build-test-modules], + [Enable build of test modules [default=$1]]),, + enable_build_test_modules=$1) + + dnl sanity checks + if ! test -f $KCONFIG; then + if test -f $KSRC/.config; then + KCONFIG=$KSRC/.config + fi + fi + + KBUILD=no + if test -f $KSRC/Makefile; then + KBUILD=24; + if ! test -f $KSRC/Rules.make; then + KBUILD=26 + fi + if test "x$enable_build_test_modules" = "xauto"; then + enable_build_test_modules=yes; + fi + else + enable_build_test_modules=no + fi + + AC_MSG_CHECKING([for kernel version]) + if test -e $KSRC; then + KVERSION=`echo $KSRC | sed 's%\(\(\(.*[[/]]\(.*\)\)/\(.*\)\)[[^/]]\)\([[/]]$\)*%\4%'` + AC_MSG_RESULT([$KVERSION]) + else + KVERSION=`uname -r` + AC_MSG_RESULT([Default]) + fi + + AC_MSG_CHECKING([for kernel compiler]) + kcc_default=yes + + if test -f $KSRC/Makefile; then + KCC=`sed -n 's%HOSTCC.*=\ \(.*\)%\1%p' $KSRC/Makefile` + if test "x$KCC" != "x"; then + kcc_default=no + AC_MSG_RESULT([$KCC]) + else + AC_MSG_RESULT([Unknown]) + KCC=$CC + fi + else + AC_MSG_RESULT([Unknown]) + KCC=$CC + fi + + if test "x$kcc_default" != "xyes"; then + KCC_VER=`$KCC -dumpversion 2>/dev/null` + else + KCC_VER=`cat /proc/version | sed -re 's/^.*gcc version (\(egcs\-\))?//' | awk '{print $[]1}'` + fi + if test "x$KCC_VER" = "x"; then + AC_MSG_ERROR([Unable to determine kernel compiler]) + fi + + SCONFIG_SMP=no + SCONFIG_MODVERSIONS=no + + if test -f $KCONFIG -a "`sed -ne s/CONFIG_SMP.//p $KCONFIG | tail -n 1`" = "y"; then + SCONFIG_SMP=yes + fi + if test -f $KCONFIG -a "`sed -ne s/CONFIG_MODVERSIONS.//p $KCONFIG | tail -n 1`" = "y"; then + SCONFIG_MODVERSIONS=yes + fi + + AC_SUBST(SOBJDUMP) + AC_SUBST(SCONFIG_SMP) + AC_SUBST(SCONFIG_MODVERSIONS) + AC_SUBST(KSRC) + AC_SUBST(KCONFIG) + AC_SUBST(KBUILD) + AC_SUBST(KVERSION) + AC_SUBST(KCC) + AC_SUBST(KCC_VER) + + BUILD_TEST_MODULES=0 + if test "x$enable_build_test_modules" = "xyes" -a -d $KSRC; then + BUILD_TEST_MODULES=1 + fi + AC_SUBST(BUILD_TEST_MODULES) + ]) + # AS_CHECK_VALGRIND #try to check for VALGRIND library Index: Makefile.am =================================================================== RCS file: /cvsroot/ebdl/ebdl-bonobo/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 3 Nov 2006 18:40:11 -0000 1.5 --- Makefile.am 13 Mar 2007 22:34:56 -0000 1.6 *************** *** 33,37 **** gcov-coverage: @current=$$PWD; \ ! for dir in src tests; do \ tmp="$$(basename $$dir-data)";cd $$dir; \ unused=0; files=`find . -name \*.gcno`; \ --- 33,37 ---- gcov-coverage: @current=$$PWD; \ ! for dir in src src/ebas tests; do \ tmp="$$(basename $$dir-data)";cd $$dir; \ unused=0; files=`find . -name \*.gcno`; \ *************** *** 65,69 **** if ENABLE_LCOVERAGE clean-coverage: ! find -name "*.gcda" -o -name "*.gcov" | xargs rm || true rm -rf $(top_builddir)/coverage --- 65,69 ---- if ENABLE_LCOVERAGE clean-coverage: ! find -name "*.gcda" -o -name "*.gcov" | xargs rm -f {} || true rm -rf $(top_builddir)/coverage *************** *** 71,78 **** @mkdir -p $(top_builddir)/coverage $(LCOV) --directory $(srcdir) --zerocounters ! -$(MAKE) check @for file in `find . -name "*.gcno" -o -name "*.gcda" | grep ".libs"`; do \ mv $$file `echo $$file | sed -e 's/\/\.libs//'`; \ done $(LCOV) --directory $(srcdir) --capture --output-file $(top_builddir)/coverage/$(PACKAGE).info $(LCOV) --output-file $(top_builddir)/coverage/$(PACKAGE).info -r $(top_builddir)/coverage/$(PACKAGE).info /usr/include/\* --- 71,81 ---- @mkdir -p $(top_builddir)/coverage $(LCOV) --directory $(srcdir) --zerocounters ! export ENABLE_COVERAGE="1"; $(MAKE) check @for file in `find . -name "*.gcno" -o -name "*.gcda" | grep ".libs"`; do \ mv $$file `echo $$file | sed -e 's/\/\.libs//'`; \ done + @for file in `find . -name "*Ebdl*.gcno" -o -name "*Ebdl*.gcda"`; do \ + rm -f $$file; \ + done $(LCOV) --directory $(srcdir) --capture --output-file $(top_builddir)/coverage/$(PACKAGE).info $(LCOV) --output-file $(top_builddir)/coverage/$(PACKAGE).info -r $(top_builddir)/coverage/$(PACKAGE).info /usr/include/\* *************** *** 86,90 **** endif - dist-hook: dist-hook-tests dist-hook-backends --- 89,92 ---- |
From: Carlos MartÃn <in...@us...> - 2007-03-13 21:02:30
|
Update of /cvsroot/ebdl/ebdl/src In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv32412/src Modified Files: e-factory.c e-part-set.h e-registry.c e-rule-simple.c lk-module26.c lk-part-set.c lkfss-source-extension.c Log Message: * src/e-registry.c (e_registry_tree_mach_node_by_keyq), (e_registry_peek_object_by_value): Minor fixes. * src/e-rule-simple.c (e_rule_simple_do_is_strv_satisfied_by), (e_rule_simple_get_property): Minor fixes. * src/lk-module26.c (e_worker_running_load_cb): Fix handle of E_PART_SET_MODE_INVALID * src/lk-part-set.c: Fix handle of E_PART_SET_MODE_INVALID * src/lkfss-source-extension.c: Minor fixes Index: e-part-set.h =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-part-set.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** e-part-set.h 27 Feb 2007 17:52:46 -0000 1.6 --- e-part-set.h 13 Mar 2007 21:02:25 -0000 1.7 *************** *** 44,52 **** **/ typedef enum { ! E_PART_SET_MODE_VALUE = 0, ! E_PART_SET_MODE_REFERENCE = 1, ! E_PART_SET_MODE_LAST_PART = 2, } EPartSetMode; typedef struct _EPartSet EPartSet; /* dummy */ typedef struct _EPartSetIface EPartSetIface; --- 44,54 ---- **/ typedef enum { ! E_PART_SET_MODE_INVALID = 0, ! E_PART_SET_MODE_VALUE = 1, ! E_PART_SET_MODE_REFERENCE = 2, } EPartSetMode; + #define E_PART_SET_MODE_LAST_PART (3) + typedef struct _EPartSet EPartSet; /* dummy */ typedef struct _EPartSetIface EPartSetIface; Index: lkfss-source-extension.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/lkfss-source-extension.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** lkfss-source-extension.c 13 Mar 2007 18:25:34 -0000 1.2 --- lkfss-source-extension.c 13 Mar 2007 21:02:25 -0000 1.3 *************** *** 498,502 **** { gint i; ! EData *data; gchar *options_name; ERule *rules[] = {NULL, NULL, NULL}; --- 498,502 ---- { gint i; ! EData *data = NULL; gchar *options_name; ERule *rules[] = {NULL, NULL, NULL}; *************** *** 563,567 **** { gint i; ! EData *data; gchar buffer[2][HUGE_BUFFER]; ERule *rules[] = {NULL, NULL, NULL}; --- 563,567 ---- { gint i; ! EData *data = NULL; gchar buffer[2][HUGE_BUFFER]; ERule *rules[] = {NULL, NULL, NULL}; *************** *** 631,635 **** { gint i; ! EData *data; gchar buffer[2][HUGE_BUFFER]; LkfssSourceExtensionPrivate *priv; --- 631,635 ---- { gint i; ! EData *data = NULL; gchar buffer[2][HUGE_BUFFER]; LkfssSourceExtensionPrivate *priv; *************** *** 1045,1049 **** if (E_IS_RULE_SIMPLE (rule)) { ! e_object_peek (rule, "key", &key, NULL); g_assert (key); --- 1045,1049 ---- if (E_IS_RULE_SIMPLE (rule)) { ! key = e_object_peek_string (rule, "key"); g_assert (key); *************** *** 1114,1119 **** { GValue *value; - GObject *data; const gchar *key; LkfssSourceExtensionPrivate *priv; --- 1114,1119 ---- { GValue *value; const gchar *key; + GObject *data = NULL; LkfssSourceExtensionPrivate *priv; Index: lk-module26.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/lk-module26.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** lk-module26.c 27 Feb 2007 17:52:46 -0000 1.47 --- lk-module26.c 13 Mar 2007 21:02:25 -0000 1.48 *************** *** 192,196 **** g_assert (kernel); ! e_part_set_add_part ((EPartSet *)extension, kernel, 0, error); g_object_unref (factory); } --- 192,196 ---- g_assert (kernel); ! e_part_set_add_part ((EPartSet *)extension, kernel, E_PART_SET_MODE_VALUE, error); g_object_unref (factory); } Index: e-rule-simple.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-rule-simple.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** e-rule-simple.c 13 Mar 2007 18:25:34 -0000 1.21 --- e-rule-simple.c 13 Mar 2007 21:02:25 -0000 1.22 *************** *** 65,69 **** static gint ! tree_fnmatch (gconstpointer s1, gconstpointer s2, gpointer data) { return (fnmatch (s2, s1, 0) == 0 ? 0 : strcmp (s1, s2)); --- 65,69 ---- static gint ! tree_fnmatch (const gchar *s1, const gchar *s2) { return (fnmatch (s2, s1, 0) == 0 ? 0 : strcmp (s1, s2)); *************** *** 132,140 **** return FALSE; } cache = g_tree_new_full ( \ ! (rule->flags & \ ! (E_RULE_SIMPLE_MATCH_PATTERN | \ ! E_RULE_SIMPLE_MATCH_PATTERN_VALUE) ? \ ! tree_fnmatch : strcmp), \ NULL, g_free, NULL); --- 132,141 ---- return FALSE; } + cache = g_tree_new_full ( \ ! (GCompareDataFunc) ( \ ! rule->flags & \ ! (E_RULE_SIMPLE_MATCH_PATTERN | E_RULE_SIMPLE_MATCH_PATTERN) ? \ ! tree_fnmatch : strcmp), \ NULL, g_free, NULL); *************** *** 153,157 **** G_CALLBACK (destroy_cache_cb), NULL); ! } g_assert (cache); --- 154,158 ---- G_CALLBACK (destroy_cache_cb), NULL); ! } g_assert (cache); *************** *** 280,284 **** case PROP_KEY: ! g_value_set_string (value, priv->key); break; --- 281,285 ---- case PROP_KEY: ! g_value_set_static_string (value, priv->key); break; Index: e-factory.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-factory.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** e-factory.c 8 Mar 2007 19:07:16 -0000 1.11 --- e-factory.c 13 Mar 2007 21:02:25 -0000 1.12 *************** *** 419,423 **** e_factory_register_backend (factory, l->data); } - g_object_unref (manager); } --- 419,423 ---- e_factory_register_backend (factory, l->data); } g_object_unref (manager); + g_list_free (factories); } Index: lk-part-set.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/lk-part-set.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lk-part-set.c 8 Mar 2007 19:07:16 -0000 1.1 --- lk-part-set.c 13 Mar 2007 21:02:25 -0000 1.2 *************** *** 118,121 **** --- 118,123 ---- for (i = 0; i < E_PART_SET_MODE_LAST_PART; i++) { + if (i == E_PART_SET_MODE_INVALID) + continue; if (g_hash_table_remove (priv->parts[i], key)) return E_SUCESS; *************** *** 130,137 **** LkPartSetPrivate *priv; ! g_assert (LK_IS_PART (part)); ! g_assert (LK_IS_PART_SET (part_set)); ! g_return_val_if_fail (key != NULL && key[0] != '\0', E_ERROR); ! g_assert (mode < E_PART_SET_MODE_LAST_PART); priv = LK_PART_SET_GET_PRIVATE (part_set); --- 132,139 ---- LkPartSetPrivate *priv; ! g_assert (LK_IS_PART (part)); ! g_assert (LK_IS_PART_SET (part_set)); ! g_assert (key != NULL && key[0] != '\0'); ! g_assert (mode != E_PART_SET_MODE_INVALID); priv = LK_PART_SET_GET_PRIVATE (part_set); *************** *** 183,186 **** --- 185,190 ---- for (i = 0; i < E_PART_SET_MODE_LAST_PART; i++) { + if (i == E_PART_SET_MODE_INVALID) + continue; if ((object = g_hash_table_lookup (priv->parts[i], key))) return g_object_ref (object); *************** *** 322,325 **** --- 326,331 ---- for (i = 0; i < E_PART_SET_MODE_LAST_PART; i++) { + if (i == E_PART_SET_MODE_INVALID) + continue; g_hash_table_destroy (priv->parts[i]); priv->parts[i] = NULL; Index: e-registry.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-registry.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** e-registry.c 13 Mar 2007 18:25:34 -0000 1.30 --- e-registry.c 13 Mar 2007 21:02:25 -0000 1.31 *************** *** 197,203 **** gpointer data) { ! if (G_UNLIKELY ((ERNode *)data)->keyq == ((ERNode *)value)->keyq) { ! (((ERNode *)data)->data) = (GList *)g_list_append ( \ ! (GList *)(((ERNode *)data)->data), (gpointer)key); } return FALSE; --- 197,203 ---- gpointer data) { ! if (G_UNLIKELY (((ERNode *)data)->keyq == ((ERNode *)value)->keyq)) { ! ((ERNode *)data)->data = (GList *)g_list_append ( \ ! (GList *)(((ERNode *)data)->data), (gpointer)key); \ } return FALSE; *************** *** 968,972 **** /* try strcmp match */ ! if (G_LIKELY (node = g_tree_lookup (tree, value))) { return node->value; } --- 968,972 ---- /* try strcmp match */ ! if (G_LIKELY ((node = g_tree_lookup (tree, value)))) { return node->value; } |
From: Carlos MartÃn <in...@us...> - 2007-03-13 21:02:29
|
Update of /cvsroot/ebdl/ebdl/tests In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv32412/tests Modified Files: tc-data.c tc-elf.c tc-handler.c tc-pickler.c tc-section.c Log Message: * src/e-registry.c (e_registry_tree_mach_node_by_keyq), (e_registry_peek_object_by_value): Minor fixes. * src/e-rule-simple.c (e_rule_simple_do_is_strv_satisfied_by), (e_rule_simple_get_property): Minor fixes. * src/lk-module26.c (e_worker_running_load_cb): Fix handle of E_PART_SET_MODE_INVALID * src/lk-part-set.c: Fix handle of E_PART_SET_MODE_INVALID * src/lkfss-source-extension.c: Minor fixes Index: tc-data.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/tc-data.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tc-data.c 27 Feb 2007 17:51:51 -0000 1.16 --- tc-data.c 13 Mar 2007 21:02:25 -0000 1.17 *************** *** 55,59 **** { EData *data; - EPart *part; const gchar *s; EDataFactory *factory; --- 55,58 ---- Index: tc-pickler.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/tc-pickler.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tc-pickler.c 27 Feb 2007 17:51:52 -0000 1.22 --- tc-pickler.c 13 Mar 2007 21:02:25 -0000 1.23 *************** *** 96,101 **** /* Object registration: FIXME: Use FFI if available */ #ifndef HAVE_FFI_H ! TC_TYPE_A; ! TC_TYPE_C; #endif fail_unless (e_pickler_load ((gpointer)tc_pickler, &objects, NULL) == E_SUCESS); --- 96,102 ---- /* Object registration: FIXME: Use FFI if available */ #ifndef HAVE_FFI_H ! GType type; ! type = TC_TYPE_A; ! type = TC_TYPE_C; #endif fail_unless (e_pickler_load ((gpointer)tc_pickler, &objects, NULL) == E_SUCESS); Index: tc-elf.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/tc-elf.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tc-elf.c 27 Feb 2007 17:51:51 -0000 1.15 --- tc-elf.c 13 Mar 2007 21:02:25 -0000 1.16 *************** *** 12,19 **** #include <check.h> - #include <elf.h> #include <e-error.h> #include <e-handler.h> #include <e-section.h> #include <tc-class-elf.h> --- 12,21 ---- #include <check.h> #include <e-error.h> + + #include <e-object.h> #include <e-handler.h> #include <e-section.h> + #include <tc-class-elf.h> Index: tc-section.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/tc-section.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tc-section.c 27 Feb 2007 17:51:52 -0000 1.22 --- tc-section.c 13 Mar 2007 21:02:25 -0000 1.23 *************** *** 216,226 **** EElf *elf; EURL *url; EElfSection *section,*next; ElfPERBIT(Addr) old_content; const ElfPERBIT(Shdr) *tmp_shdr; - ElfPERBIT(Shdr) old_shdr; - ElfPERBIT(Word) size, new_size; const gchar *old_name,* new_name="foo1"; - const gchar new_content[10] = "123456789\0"; url = e_url_new_from_path (BUILDDIR"/tests/Linux/modules/test01/test01.ko", NULL); --- 216,225 ---- EElf *elf; EURL *url; + ElfPERBIT(Word) size; + ElfPERBIT(Shdr) old_shdr; EElfSection *section,*next; ElfPERBIT(Addr) old_content; const ElfPERBIT(Shdr) *tmp_shdr; const gchar *old_name,* new_name="foo1"; url = e_url_new_from_path (BUILDDIR"/tests/Linux/modules/test01/test01.ko", NULL); Index: tc-handler.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/tc-handler.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tc-handler.c 27 Feb 2007 17:51:51 -0000 1.16 --- tc-handler.c 13 Mar 2007 21:02:25 -0000 1.17 *************** *** 38,42 **** END_TEST ! G_GNUC_UNUSED START_TEST(test_e_handler_url) { EURL *url = e_url_new ("file://a/b/c", NULL); --- 38,43 ---- END_TEST ! G_GNUC_UNUSED ! START_TEST(test_e_handler_url) { EURL *url = e_url_new ("file://a/b/c", NULL); *************** *** 73,76 **** --- 74,78 ---- END_TEST + G_GNUC_UNUSED START_TEST(test_e_handler_start_stop) { *************** *** 142,149 **** { TCase* t = tcase_create ("EHandler TCase Case"); ! #if 1 tcase_add_test (t, test_e_handler_new); ! // tcase_add_test (t, test_e_handler_url); ! // tcase_add_test (t, test_e_handler_start_stop); #endif return t; --- 144,152 ---- { TCase* t = tcase_create ("EHandler TCase Case"); ! tcase_add_test (t, test_e_handler_new); ! #if 0 ! tcase_add_test (t, test_e_handler_url); ! tcase_add_test (t, test_e_handler_start_stop); #endif return t; |
From: Carlos MartÃn <in...@us...> - 2007-03-13 21:02:28
|
Update of /cvsroot/ebdl/ebdl In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv32412 Modified Files: ChangeLog configure.in Log Message: * src/e-registry.c (e_registry_tree_mach_node_by_keyq), (e_registry_peek_object_by_value): Minor fixes. * src/e-rule-simple.c (e_rule_simple_do_is_strv_satisfied_by), (e_rule_simple_get_property): Minor fixes. * src/lk-module26.c (e_worker_running_load_cb): Fix handle of E_PART_SET_MODE_INVALID * src/lk-part-set.c: Fix handle of E_PART_SET_MODE_INVALID * src/lkfss-source-extension.c: Minor fixes Index: ChangeLog =================================================================== RCS file: /cvsroot/ebdl/ebdl/ChangeLog,v retrieving revision 1.405 retrieving revision 1.406 diff -C2 -d -r1.405 -r1.406 *** ChangeLog 13 Mar 2007 18:25:33 -0000 1.405 --- ChangeLog 13 Mar 2007 21:02:24 -0000 1.406 *************** *** 1,4 **** --- 1,20 ---- 2007-03-13 Carlos Martin <in...@us...> + * src/e-registry.c (e_registry_tree_mach_node_by_keyq), + (e_registry_peek_object_by_value): Minor fixes. + + * src/e-rule-simple.c + (e_rule_simple_do_is_strv_satisfied_by), + (e_rule_simple_get_property): Minor fixes. + + * src/lk-module26.c (e_worker_running_load_cb): Fix handle of + E_PART_SET_MODE_INVALID + + * src/lk-part-set.c: Fix handle of E_PART_SET_MODE_INVALID + + * src/lkfss-source-extension.c: Minor fixes + + 2007-03-13 Carlos Martin <in...@us...> + * src/e-registry.c: Add a Hash of Balanced Trees to allow lookup of registry objects by keys. Probably we should move internal Index: configure.in =================================================================== RCS file: /cvsroot/ebdl/ebdl/configure.in,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** configure.in 28 Feb 2007 16:11:51 -0000 1.53 --- configure.in 13 Mar 2007 21:02:24 -0000 1.54 *************** *** 63,67 **** dnl enable coverage analysis EBDL_ENABLE_COVERAGE([auto]) ! dnl enable kernel modules EBDL_ENABLE_KERNEL_MODULES([auto]) --- 63,67 ---- dnl enable coverage analysis EBDL_ENABLE_COVERAGE([auto]) ! dnl enable test kernel modules EBDL_ENABLE_KERNEL_MODULES([auto]) |
From: Carlos MartÃn <in...@us...> - 2007-03-13 18:26:21
|
Update of /cvsroot/ebdl/ebdl/tests In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv1338/tests Modified Files: tc-registry.c Log Message: * src/e-registry.c: Add a Hash of Balanced Trees to allow lookup of registry objects by keys. Probably we should move internal implementation to this approach and deprecate g_node * src/lkfss-finder.c (lkfss_finder_peek_iterator): Added. Alos reuse Source Iterator to allow finder reutilization. * src/lkfss-modconf.c (lkfss_modconf_do_parse): Fix error. * src/lkfss-source-extension.c: Implement some sugar optimizations to be binded to LkfssFinder so commos lookups will be boosted about a 700% !! Index: tc-registry.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/tc-registry.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tc-registry.c 19 Mar 2006 14:29:54 -0000 1.9 --- tc-registry.c 13 Mar 2007 18:25:34 -0000 1.10 *************** *** 76,80 **** /* get keys, currently no one */ ! fail_unless (e_registry_get_keys (registry, NULL) == NULL); /* well formed add a nully key */ --- 76,80 ---- /* get keys, currently no one */ ! fail_unless (e_registry_get_keys (registry, "*") == NULL); /* well formed add a nully key */ *************** *** 83,87 **** /* add a valid key */ fail_unless (e_registry_add_object (registry, "/foo/bar.o", (gpointer)foo) != NULL); ! fail_unless ((keyv = e_registry_get_keys (registry, NULL)) != NULL); g_assert (keyv); fail_unless (keyv[0] && keyv[1] == NULL && strcmp (keyv[0], "/foo/bar.o") == 0); --- 83,87 ---- /* add a valid key */ fail_unless (e_registry_add_object (registry, "/foo/bar.o", (gpointer)foo) != NULL); ! fail_unless ((keyv = e_registry_get_keys (registry, "*")) != NULL); g_assert (keyv); fail_unless (keyv[0] && keyv[1] == NULL && strcmp (keyv[0], "/foo/bar.o") == 0); *************** *** 90,94 **** /* remove value */ fail_unless (e_registry_add_object (registry, "/foo/bar.o", NULL) != NULL); ! fail_unless (e_registry_get_keys (registry, NULL) == NULL); e_registry_unlock (registry); --- 90,94 ---- /* remove value */ fail_unless (e_registry_add_object (registry, "/foo/bar.o", NULL) != NULL); ! fail_unless (e_registry_get_keys (registry, "*") == NULL); e_registry_unlock (registry); |
From: Carlos MartÃn <in...@us...> - 2007-03-13 18:26:12
|
Update of /cvsroot/ebdl/ebdl In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv1338 Modified Files: ChangeLog Log Message: * src/e-registry.c: Add a Hash of Balanced Trees to allow lookup of registry objects by keys. Probably we should move internal implementation to this approach and deprecate g_node * src/lkfss-finder.c (lkfss_finder_peek_iterator): Added. Alos reuse Source Iterator to allow finder reutilization. * src/lkfss-modconf.c (lkfss_modconf_do_parse): Fix error. * src/lkfss-source-extension.c: Implement some sugar optimizations to be binded to LkfssFinder so commos lookups will be boosted about a 700% !! Index: ChangeLog =================================================================== RCS file: /cvsroot/ebdl/ebdl/ChangeLog,v retrieving revision 1.404 retrieving revision 1.405 diff -C2 -d -r1.404 -r1.405 *** ChangeLog 11 Mar 2007 21:27:36 -0000 1.404 --- ChangeLog 13 Mar 2007 18:25:33 -0000 1.405 *************** *** 1,2 **** --- 1,17 ---- + 2007-03-13 Carlos Martin <in...@us...> + + * src/e-registry.c: Add a Hash of Balanced Trees to allow lookup + of registry objects by keys. Probably we should move internal + implementation to this approach and deprecate g_node + + * src/lkfss-finder.c (lkfss_finder_peek_iterator): Added. Alos + reuse Source Iterator to allow finder reutilization. + + * src/lkfss-modconf.c (lkfss_modconf_do_parse): Fix error. + + * src/lkfss-source-extension.c: Implement some sugar optimizations + to be binded to LkfssFinder so commos lookups will be boosted + about a 700% !! + 2007-03-11 Carlos Martin <in...@us...> |
From: Carlos MartÃn <in...@us...> - 2007-03-13 18:26:12
|
Update of /cvsroot/ebdl/ebdl/src In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv1338/src Modified Files: e-elf-section.c e-registry.c e-registry.h e-rule-simple.c e-rule-simple.h lkfss-finder.c lkfss-finder.h lkfss-modconf.c lkfss-source-extension.c Log Message: * src/e-registry.c: Add a Hash of Balanced Trees to allow lookup of registry objects by keys. Probably we should move internal implementation to this approach and deprecate g_node * src/lkfss-finder.c (lkfss_finder_peek_iterator): Added. Alos reuse Source Iterator to allow finder reutilization. * src/lkfss-modconf.c (lkfss_modconf_do_parse): Fix error. * src/lkfss-source-extension.c: Implement some sugar optimizations to be binded to LkfssFinder so commos lookups will be boosted about a 700% !! Index: lkfss-finder.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/lkfss-finder.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lkfss-finder.c 8 Mar 2007 19:07:16 -0000 1.1 --- lkfss-finder.c 13 Mar 2007 18:25:34 -0000 1.2 *************** *** 75,84 **** struct _LkfssFinderPrivate { ! EIterable *source; /* finder's source */ ! EFinderType type; /* finder's containers type */ ! ESet *set; /* holds last selection */ }; static inline gboolean lkfss_finder_container_has_valid_type (LkfssFinder *finder, EData *data) --- 75,103 ---- struct _LkfssFinderPrivate { ! EIterable *source; /* finder's source */ ! EIterator *iterator; /* source's iterator */ ! EFinderType type; /* finder's containers type */ ! ESet *set; /* holds last selection */ }; + static void + lkfss_finder_timestamp_changed_cb (LkfssFinder *finder) + { + LkfssFinderPrivate *priv; + + priv = LKFSS_FINDER_GET_PRIVATE (finder); + + if (G_LIKELY (priv->iterator)) { + g_object_unref (priv->iterator); + + priv->iterator = e_iterable_get_iterator (priv->source, NULL); + g_assert (priv->iterator); + return; + } + g_assert_not_reached (); + } + + static inline gboolean lkfss_finder_container_has_valid_type (LkfssFinder *finder, EData *data) *************** *** 107,131 **** { EData *data; - EIterator *iterator; LkfssFinderPrivate *priv; ! g_return_val_if_fail (E_IS_RULE (rule), NULL); priv = LKFSS_FINDER_GET_PRIVATE (finder); ! /* check source */ ! if (G_UNLIKELY (! priv->source || ! E_IS_ITERABLE (priv->source))) { ! return NULL; ! } ! /* get itetrator */ ! iterator = e_iterable_get_iterator ((EIterable *)priv->source, NULL); ! if (G_UNLIKELY (! iterator)) { return NULL; } /* do lookup */ ! while ((data = (EData *)e_iterator_get_next (iterator, NULL))) { ! ! if (lkfss_finder_container_has_valid_type ((LkfssFinder *)finder, data) \ ! && e_rule_is_satisfied_by (rule, data)) { e_debug (E_DEBUG_LEVEL_DEBUG, \ "Lookup of rule %p satisfied by" \ --- 126,146 ---- { EData *data; LkfssFinderPrivate *priv; ! g_return_val_if_fail (E_IS_RULE (rule), NULL); priv = LKFSS_FINDER_GET_PRIVATE (finder); ! /* lazy load */ ! lkfss_finder_peek_iterator ((LkfssFinder *)finder); ! if (G_UNLIKELY (! E_IS_ITERATOR (priv->iterator))) { return NULL; } + /* do lookup */ ! e_iterator_reset (priv->iterator, NULL); ! while ((data = (EData *)e_iterator_get_next (priv->iterator, NULL))) { ! if (lkfss_finder_container_has_valid_type ((LkfssFinder *)finder, data) && \ ! e_rule_is_satisfied_by (rule, data)) { e_debug (E_DEBUG_LEVEL_DEBUG, \ "Lookup of rule %p satisfied by" \ *************** *** 135,139 **** g_object_unref (data); } - g_object_unref (iterator); return data; } --- 150,153 ---- *************** *** 144,148 **** ESet *set; EData *data; - EIterator *iterator = NULL; LkfssFinderPrivate *priv; --- 158,161 ---- *************** *** 151,169 **** priv = LKFSS_FINDER_GET_PRIVATE (finder); ! /* check source */ ! if (G_UNLIKELY (! priv->source || ! E_IS_ITERABLE (priv->source))) { ! return E_ERROR; ! } ! /* get itetrator */ ! iterator = e_iterable_get_iterator ((EIterable *)priv->source, NULL); ! if (G_UNLIKELY (! iterator)) { return E_ERROR; } /* do selection */ set = g_object_new (E_TYPE_SET, NULL); ! while ((data = (EData *)e_iterator_get_next (iterator, NULL))) { ! ! if (lkfss_finder_container_has_valid_type ((LkfssFinder *)finder, data) \ ! && e_rule_is_satisfied_by (rule, data)) { e_set_insert (set, (GObject *)data); --- 164,179 ---- priv = LKFSS_FINDER_GET_PRIVATE (finder); ! /* lazy load */ ! lkfss_finder_peek_iterator ((LkfssFinder *)finder); ! if (G_UNLIKELY (! E_IS_ITERATOR (priv->iterator))) { return E_ERROR; } + /* do selection */ + e_iterator_reset (priv->iterator, NULL); set = g_object_new (E_TYPE_SET, NULL); ! while ((data = (EData *)e_iterator_get_next (priv->iterator, NULL))) { ! if (lkfss_finder_container_has_valid_type ((LkfssFinder *)finder, data) && \ ! e_rule_is_satisfied_by (rule, data)) { e_set_insert (set, (GObject *)data); *************** *** 174,179 **** g_object_unref (data); } ! g_object_unref (iterator); ! /* unref set if exist. Clients must * ref this so they don't be leaked --- 184,188 ---- g_object_unref (data); } ! /* unref set if exist. Clients must * ref this so they don't be leaked *************** *** 293,302 **** priv->set = NULL; } ! if (G_LIKELY (priv->source)) { ! g_object_unref (priv->source); ! priv->source = NULL; ! } ! G_OBJECT_CLASS (lkfss_finder_parent_class)-> \ finalize (gobject); } --- 302,310 ---- priv->set = NULL; } ! ! /* unref source and iterator */ ! lkfss_finder_set_source ((LkfssFinder *)gobject, NULL); ! G_OBJECT_CLASS (lkfss_finder_parent_class)-> \ finalize (gobject); } *************** *** 321,328 **** object_class->get_property = lkfss_finder_get_property; ! g_object_class_override_property ( \ object_class, PROP_SOURCE, "source"); ! g_object_class_override_property ( \ object_class, PROP_SELECTION, "selection"); --- 329,336 ---- object_class->get_property = lkfss_finder_get_property; ! g_object_class_override_property ( \ object_class, PROP_SOURCE, "source"); ! g_object_class_override_property ( \ object_class, PROP_SELECTION, "selection"); *************** *** 339,343 **** } - void lkfss_finder_set_source (LkfssFinder *finder, ESource *source) --- 347,350 ---- *************** *** 345,349 **** LkfssFinderPrivate *priv; - g_return_if_fail (E_IS_SOURCE (source)); g_return_if_fail (LKFSS_IS_FINDER (finder)); --- 352,355 ---- *************** *** 351,357 **** if (G_UNLIKELY (priv->source)) { g_object_unref (priv->source); } ! priv->source = g_object_ref (source); } --- 357,403 ---- if (G_UNLIKELY (priv->source)) { + g_signal_handlers_disconnect_by_func ( \ + priv->source, \ + lkfss_finder_timestamp_changed_cb, \ + finder); + + if (G_LIKELY (priv->iterator)) { + g_object_unref (priv->iterator); + priv->iterator = NULL; + } + g_object_unref (priv->source); + priv->source = NULL; } ! if (G_LIKELY (source)) { ! priv->source = g_object_ref (source); ! } ! } ! ! EIterator * ! lkfss_finder_peek_iterator (LkfssFinder *finder) ! { ! LkfssFinderPrivate *priv; ! ! g_return_val_if_fail (LKFSS_IS_FINDER (finder), NULL); ! ! priv = LKFSS_FINDER_GET_PRIVATE (finder); ! ! if (G_LIKELY (priv->iterator)) { ! return priv->iterator; ! } ! ! if (G_LIKELY (priv->source)) { ! priv->iterator = e_iterable_get_iterator (priv->source, NULL); ! ! if (G_LIKELY (priv->iterator)) { ! g_signal_connect_swapped ( \ ! priv->source, \ ! "notify::timestamp", \ ! G_CALLBACK (lkfss_finder_timestamp_changed_cb), \ ! finder); ! } ! } ! return priv->iterator; } Index: e-elf-section.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-elf-section.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** e-elf-section.c 27 Feb 2007 17:52:46 -0000 1.5 --- e-elf-section.c 13 Mar 2007 18:25:34 -0000 1.6 *************** *** 212,223 **** if (G_UNLIKELY (iterator->content == NULL)) { ! if (G_UNLIKELY (iterator->content == NULL)) { ! g_set_error (error, ! E_ITERATOR_ERROR, ! E_ITERATOR_ERROR_ILLEGAL_STATE, ! "Unable to get contents of section " ! "for iterator %p", iterator); ! return NULL; ! } } --- 212,221 ---- if (G_UNLIKELY (iterator->content == NULL)) { ! g_set_error (error, ! E_ITERATOR_ERROR, ! E_ITERATOR_ERROR_ILLEGAL_STATE, ! "Unable to get contents of section " ! "for iterator %p", iterator); ! return NULL; } Index: lkfss-finder.h =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/lkfss-finder.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lkfss-finder.h 8 Mar 2007 19:07:16 -0000 1.1 --- lkfss-finder.h 13 Mar 2007 18:25:34 -0000 1.2 *************** *** 57,65 **** #include <e-source.h> ! GType lkfss_finder_get_type (void); ! void lkfss_finder_set_source (LkfssFinder *finder, ! ESource *source); G_END_DECLS --- 57,68 ---- #include <e-source.h> + #include <e-iterator.h> ! GType lkfss_finder_get_type (void); ! EIterator *lkfss_finder_peek_iterator (LkfssFinder *finder); ! ! void lkfss_finder_set_source (LkfssFinder *finder, ! ESource *source); G_END_DECLS Index: e-rule-simple.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-rule-simple.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** e-rule-simple.c 27 Feb 2007 17:52:46 -0000 1.20 --- e-rule-simple.c 13 Mar 2007 18:25:34 -0000 1.21 *************** *** 63,68 **** }; static gint ! my_strcmp (gconstpointer s1, gconstpointer s2, gpointer data) { return (fnmatch (s2, s1, 0) == 0 ? 0 : strcmp (s1, s2)); --- 63,69 ---- }; + static gint ! tree_fnmatch (gconstpointer s1, gconstpointer s2, gpointer data) { return (fnmatch (s2, s1, 0) == 0 ? 0 : strcmp (s1, s2)); *************** *** 88,92 **** const gchar *data; const gchar *rdata; ! value = e_rule_leaf_peek_value ((ERuleLeaf *)rule); g_assert (value); --- 89,93 ---- const gchar *data; const gchar *rdata; ! value = e_rule_leaf_peek_value ((ERuleLeaf *)rule); g_assert (value); *************** *** 98,101 **** --- 99,103 ---- return FALSE; } + if (rule->flags & E_RULE_SIMPLE_MATCH_PATTERN) { return (fnmatch (data, rdata, 0) == 0); *************** *** 130,134 **** return FALSE; } ! cache = g_tree_new_full (my_strcmp, NULL, g_free, NULL); for (i = 0; tmp[i] != NULL; i++) { g_tree_insert (cache, g_strdup (tmp[i]), NULL); --- 132,142 ---- return FALSE; } ! cache = g_tree_new_full ( \ ! (rule->flags & \ ! (E_RULE_SIMPLE_MATCH_PATTERN | \ ! E_RULE_SIMPLE_MATCH_PATTERN_VALUE) ? \ ! tree_fnmatch : strcmp), \ ! NULL, g_free, NULL); ! for (i = 0; tmp[i] != NULL; i++) { g_tree_insert (cache, g_strdup (tmp[i]), NULL); *************** *** 344,348 **** P_("Flags associated to this rule determine mode operation"), E_TYPE_RULE_SIMPLE_FLAGS, ! E_RULE_SIMPLE_MATCH_PATTERN, G_PARAM_READWRITE | G_PARAM_USE_STATIC_STRINGS)); --- 352,356 ---- P_("Flags associated to this rule determine mode operation"), E_TYPE_RULE_SIMPLE_FLAGS, ! 0, G_PARAM_READWRITE | G_PARAM_USE_STATIC_STRINGS)); Index: lkfss-modconf.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/lkfss-modconf.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** lkfss-modconf.c 27 Feb 2007 17:52:46 -0000 1.10 --- lkfss-modconf.c 13 Mar 2007 18:25:34 -0000 1.11 *************** *** 83,87 **** gint retval; gchar **tokens; - gboolean out = FALSE; gchar *line, signal[1024]; EStream *stream, *mstream; --- 83,86 ---- *************** *** 132,137 **** } else { - out = TRUE; - priv->amount = priv->total; e_debug (E_DEBUG_LEVEL_WARNING, "Ignoring bad line '%s'\n", line); } --- 131,134 ---- *************** *** 140,145 **** priv->amount++, priv->total, priv->text, NULL); - - if (G_UNLIKELY (out == TRUE)) break; } g_object_unref (mstream); --- 137,140 ---- Index: e-registry.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-registry.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** e-registry.c 27 Feb 2007 17:52:46 -0000 1.29 --- e-registry.c 13 Mar 2007 18:25:34 -0000 1.30 *************** *** 56,65 **** struct _ERegistryPrivate { ! GNode *tree; /* main EData tree */ ! GMutex *lock; /* lock */ GMutex *tree_lock; /* tree lock */ ! gulong timestamp; /* iterator's timestamp */ }; --- 56,66 ---- struct _ERegistryPrivate { ! GNode *tree; /* main EData tree */ ! GHashTable *trees; /* auxiliary trees */ ! GMutex *lock; /* lock */ GMutex *tree_lock; /* tree lock */ ! gulong timestamp; /* iterator's timestamp */ }; *************** *** 181,184 **** --- 182,209 ---- static gboolean + e_registry_tree_peek_node_by_id (gconstpointer key, + gconstpointer value, gpointer data) + { + if (G_UNLIKELY (fnmatch (key, ((ERNode *)data)->data, 0) == 0)) { + ((ERNode *)data)->value = ((ERNode *)value)->value; + return TRUE; + } + return FALSE; + } + + static gboolean + e_registry_tree_mach_node_by_keyq (gconstpointer key, + gconstpointer value, + gpointer data) + { + if (G_UNLIKELY ((ERNode *)data)->keyq == ((ERNode *)value)->keyq) { + (((ERNode *)data)->data) = (GList *)g_list_append ( \ + (GList *)(((ERNode *)data)->data), (gpointer)key); + } + return FALSE; + } + + + static gboolean e_registry_key_well_formed (const gchar *key) { *************** *** 367,378 **** priv = E_REGISTRY_GET_PRIVATE (gobject); ! g_mutex_lock (priv->tree_lock); ! g_node_traverse (priv->tree, ! G_POST_ORDER, ! G_TRAVERSE_ALL, ! -1, ! (GNodeTraverseFunc)e_registry_node_destroy, ! NULL); g_node_destroy (priv->tree); --- 392,406 ---- priv = E_REGISTRY_GET_PRIVATE (gobject); ! ! if (G_LIKELY (priv->trees)) { ! g_hash_table_destroy (priv->trees); ! priv->trees = NULL; ! } ! g_mutex_lock (priv->tree_lock); ! g_node_traverse ( \ ! priv->tree, G_POST_ORDER,G_TRAVERSE_ALL, \ ! -1, (GNodeTraverseFunc)e_registry_node_destroy, \ ! NULL); g_node_destroy (priv->tree); *************** *** 398,409 **** priv->lock = g_mutex_new (); priv->tree_lock = g_mutex_new (); node = g_new0 (ERNode, 1); node->idq = g_quark_from_string (G_DIR_SEPARATOR_S); /* make copy */ node->keyq = g_quark_from_string (G_DIR_SEPARATOR_S); /* make copy */ ! priv->tree = g_node_new (node); node->data = priv->tree; ! priv->timestamp = 1; /* cache priv */ --- 426,441 ---- priv->lock = g_mutex_new (); priv->tree_lock = g_mutex_new (); + priv->timestamp = 1; node = g_new0 (ERNode, 1); node->idq = g_quark_from_string (G_DIR_SEPARATOR_S); /* make copy */ node->keyq = g_quark_from_string (G_DIR_SEPARATOR_S); /* make copy */ ! priv->tree = g_node_new (node); node->data = priv->tree; ! ! priv->trees = g_hash_table_new_full ( \ ! g_str_hash, g_str_equal, ! (GDestroyNotify) g_free, (GDestroyNotify)g_tree_destroy); /* cache priv */ *************** *** 563,566 **** --- 595,599 ---- g_return_val_if_fail (E_IS_REGISTRY (registry), NULL); + g_return_val_if_fail (filter && filter[0] != '\0', NULL); if (G_UNLIKELY (! (node = e_registry_get_filtered_node (registry, filter)))) { *************** *** 570,574 **** dummy [0] = array; ! dummy [1] = (gpointer) (filter == NULL || g_str_has_suffix (filter, "*") ? NULL : filter); /* G_IN_ORDER get us ordered keys ? */ --- 603,609 ---- dummy [0] = array; ! dummy [1] = (gpointer) (((filter[0]== '*' && filter[1] == '\0') || \ ! (strcspn (filter, "[?*") == strlen (filter))) ? \ ! NULL : filter); /* G_IN_ORDER get us ordered keys ? */ *************** *** 667,675 **** /* notify change */ priv->timestamp ++; - g_signal_emit (registry, signals[REGISTRY], - g_quark_from_static_string ("updated"), - node, NULL); - g_mutex_unlock (priv->tree_lock); return node; --- 702,711 ---- /* notify change */ priv->timestamp ++; + g_signal_emit (registry, \ + signals[REGISTRY], \ + g_quark_from_static_string ("updated"), node, NULL); + + g_object_notify ((GObject *)registry, "timestamp"); g_mutex_unlock (priv->tree_lock); return node; *************** *** 712,715 **** --- 748,753 ---- node, NULL); + g_object_notify ((GObject *)registry, "timestamp"); + return node; } *************** *** 827,831 **** dummy [0] = array; ! dummy [1] = (gpointer) (strcspn (filter, "[?*") == strlen (filter) ? NULL : filter); /* G_IN_ORDER get us ordered keys ? */ --- 865,871 ---- dummy [0] = array; ! dummy [1] = (gpointer) (((filter[0]== '*' && filter[1] == '\0') || \ ! (strcspn (filter, "[?*") == strlen (filter))) ? \ ! NULL : filter); /* G_IN_ORDER get us ordered keys ? */ *************** *** 846,849 **** --- 886,979 ---- } + void + e_registry_add_node_value (ERegistry *registry, + ERNode *node, + const gchar *key, + const gchar *value) + { + GTree *tree; + ERegistryPrivate *priv; + + g_return_if_fail (E_IS_REGISTRY (registry)); + g_return_if_fail (node != NULL && node->keyq != 0); + g_return_if_fail (key != NULL && key[0] != '\0'); + g_return_if_fail (value != NULL && value[0] != '\0'); + + priv = E_REGISTRY_GET_PRIVATE (registry); + + tree = g_hash_table_lookup (priv->trees, key); + + if (G_UNLIKELY (tree == NULL)) { + tree = g_tree_new_full ((GCompareDataFunc)strcmp, NULL, g_free, NULL); + g_hash_table_insert (priv->trees, g_strdup (key), tree); + } + g_tree_insert (tree, g_strdup (value), node); + } + + void + e_registry_remove_node_value (ERegistry *registry, ERNode *node, + const gchar *key) + { + GList *l; + GTree *tree; + ERegistryPrivate *priv; + ERNode new_node = {0, node->keyq, NULL, NULL}; + + g_return_if_fail (E_IS_REGISTRY (registry)); + g_return_if_fail (node != NULL && node->keyq != 0); + g_return_if_fail (key != NULL && key[0] != '\0'); + + priv = E_REGISTRY_GET_PRIVATE (registry); + + tree = g_hash_table_lookup (priv->trees, key); + if (G_UNLIKELY (tree == NULL)) { + return; + } + g_tree_foreach (tree, (GTraverseFunc)e_registry_tree_mach_node_by_keyq, & new_node); + for (l = new_node.data; l != NULL; l = l->next) { + g_tree_remove (tree, l->data); + } + g_list_free (l); + } + + /** + * e_registry_peek_object_by_value: + * @registry: a #ERegistry object + * @key: a key string + * @value: value to match + * + * Gets the #GObject whose @key value is @value. + * + * Return value: a #GObject or %NULL if not found + * + * Since: 1.0 + **/ + GObject * + e_registry_peek_object_by_value (ERegistry *registry, const gchar *key, const gchar *value) + { + GTree *tree; + ERegistryPrivate *priv; + ERNode *node, new_node = {0, 0, (gpointer)value, NULL}; + + g_return_val_if_fail (E_IS_REGISTRY (registry), NULL); + g_return_val_if_fail (key != NULL && key[0] != '\0', NULL); + g_return_val_if_fail (value != NULL && value[0] != '\0', NULL); + + priv = E_REGISTRY_GET_PRIVATE (registry); + + tree = g_hash_table_lookup (priv->trees, key); + if (G_UNLIKELY (tree == NULL)) { + return NULL; + } + + /* try strcmp match */ + if (G_LIKELY (node = g_tree_lookup (tree, value))) { + return node->value; + } + + /* try a fnmatch */ + g_tree_foreach (tree, (GTraverseFunc)e_registry_tree_peek_node_by_id, & new_node); + return new_node.value; + } /* This is a Private Class, as usually is used in Java ... */ *************** *** 878,886 **** enum { PROP_NONE, - PROP_SOURCE, - PROP_TIMESTAMP, PROP_PATH, PROP_CURRENT, - PROP_TYPE }; --- 1008,1016 ---- enum { PROP_NONE, PROP_PATH, + PROP_TIMESTAMP, + PROP_SOURCE, + PROP_TYPE, PROP_CURRENT, }; *************** *** 894,899 **** priv = E_REGISTRY_GET_PRIVATE (iterator->source); ! g_assert (priv); ! if (G_UNLIKELY (priv->timestamp != iterator->timestamp)) { return FALSE; --- 1024,1028 ---- priv = E_REGISTRY_GET_PRIVATE (iterator->source); ! if (G_UNLIKELY (priv->timestamp != iterator->timestamp)) { return FALSE; *************** *** 938,941 **** --- 1067,1079 ---- } + static void + e_registry_iterator_do_reset (ERegistryIterator *iterator, GError **error) + { + g_assert (E_IS_REGISTRY_ITERATOR (iterator)); + g_assert (((ERegistryIterator *) (iterator))->source); + + iterator->index = 0; + } + static void e_registry_iterator_iface_init (EIteratorIface *klass, gpointer udata) *************** *** 943,946 **** --- 1081,1085 ---- klass->has_next = (gpointer)e_registry_iterator_do_has_next; klass->get_next = (gpointer)e_registry_iterator_do_get_next; + klass->reset = (gpointer)e_registry_iterator_do_reset; } *************** *** 979,990 **** GValue *value, GParamSpec *pspec) { ! G_GNUC_UNUSED ERegistryIterator *iterator; - iterator = (ERegistryIterator *)object; - switch (prop_id) { case PROP_CURRENT: ! g_assert_not_reached (); break; --- 1118,1130 ---- GValue *value, GParamSpec *pspec) { ! ERegistryIterator *iterator = (ERegistryIterator *)object; switch (prop_id) { case PROP_CURRENT: ! g_value_set_pointer ( \ ! value, \ ! & g_array_index ( \ ! iterator->nodes, ERNode, iterator->index )); break; *************** *** 1000,1004 **** ! G_DEFINE_TYPE_WITH_CODE (ERegistryIterator, e_registry_iterator, G_TYPE_OBJECT, \ G_IMPLEMENT_INTERFACE (E_TYPE_ITERATOR, e_registry_iterator_iface_init)); --- 1140,1146 ---- ! G_DEFINE_TYPE_WITH_CODE (ERegistryIterator, \ ! e_registry_iterator, \ ! G_TYPE_OBJECT, \ G_IMPLEMENT_INTERFACE (E_TYPE_ITERATOR, e_registry_iterator_iface_init)); *************** *** 1009,1018 **** gint i; ERNodeSet *set; ERegistryIterator *registry; ! registry = E_REGISTRY_ITERATOR (G_OBJECT_CLASS \ ! (e_registry_iterator_parent_class)->constructor (type, n_props, props)); ! ! g_assert (registry->source); registry->nodes = g_array_new (TRUE, FALSE, sizeof (ERNode)); --- 1151,1162 ---- gint i; ERNodeSet *set; + ERegistryPrivate *priv; ERegistryIterator *registry; ! registry = E_REGISTRY_ITERATOR ( \ ! G_OBJECT_CLASS (e_registry_iterator_parent_class)-> \ ! constructor (type, n_props, props)); ! ! /* restart */ registry->nodes = g_array_new (TRUE, FALSE, sizeof (ERNode)); *************** *** 1024,1029 **** } } ! } ! return (GObject *)registry; } --- 1168,1175 ---- } } ! } ! ! priv = E_REGISTRY_GET_PRIVATE (registry->source); ! registry->timestamp = priv->timestamp; return (GObject *)registry; } *************** *** 1051,1055 **** } ! G_OBJECT_CLASS (e_registry_iterator_parent_class)->finalize (gobject); } --- 1197,1202 ---- } ! G_OBJECT_CLASS (e_registry_iterator_parent_class)-> \ ! finalize (gobject); } Index: lkfss-source-extension.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/lkfss-source-extension.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lkfss-source-extension.c 8 Mar 2007 19:07:16 -0000 1.1 --- lkfss-source-extension.c 13 Mar 2007 18:25:34 -0000 1.2 *************** *** 88,94 **** gchar *release; - /* iterator stuff */ - gulong timestamp; - /* paths */ GHashTable *uris; --- 88,91 ---- *************** *** 97,107 **** [...1049 lines suppressed...] ! if (G_LIKELY (priv->uris)) { g_hash_table_destroy (priv->uris); priv->uris = NULL; *************** *** 1605,1612 **** priv->nullable->value = lk_data_dummy_create (); ! g_signal_connect (source, \ ! "uri::added", \ ! G_CALLBACK (lkfss_uri_updated_dispatch_cb), \ ! NULL); } --- 1771,1776 ---- priv->nullable->value = lk_data_dummy_create (); ! priv->registry_finder = e_source_get_finder ( \ ! (ESource *)source, E_FINDER_TYPE_EXTENSION, NULL); } Index: e-rule-simple.h =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-rule-simple.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** e-rule-simple.h 5 Apr 2006 15:04:44 -0000 1.9 --- e-rule-simple.h 13 Mar 2007 18:25:34 -0000 1.10 *************** *** 3,7 **** * e-rule-simple.h: * ! * Copyright (C) 2004, 2005 Carlos MartÃn * Copyright (C) 2004 Universidad de Salamanca. * --- 3,7 ---- * e-rule-simple.h: * ! * Copyright (C) 2004, 2005, 2007 Carlos MartÃn * Copyright (C) 2004 Universidad de Salamanca. * Index: e-registry.h =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-registry.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** e-registry.h 5 Apr 2006 15:04:44 -0000 1.10 --- e-registry.h 13 Mar 2007 18:25:34 -0000 1.11 *************** *** 3,7 **** * e-registry.h: * ! * Copyright (C) 2004, 2005, 2006 Carlos MartÃn * Copyright (C) 2004 Universidad de Salamanca. * --- 3,7 ---- * e-registry.h: * ! * Copyright (C) 2004, 2005, 2006, 2007 Carlos MartÃn * Copyright (C) 2004 Universidad de Salamanca. * *************** *** 62,95 **** /* signals */ ! void (*registry) (ERegistry *registry, ! ERNode *node); }; #include <e-iterator.h> ! GType e_registry_get_type (void); /* lock mechanism */ ! void e_registry_lock (ERegistry *registry); ! void e_registry_unlock (ERegistry *registry); ! EIterator *e_registry_get_iterator (ERegistry *registry, ! const gchar **filter, ! GError **error); /* gobject methods */ ! GObject *e_registry_peek_object (ERegistry *registry, ! const gchar *key); ! ERNodeSet *e_registry_peek_objects (ERegistry *registry, ! const gchar *filter); ! ERNode *e_registry_add_object (ERegistry *registry, ! const gchar *key, ! GObject *object); ! ERNode *e_registry_peek_node (ERegistry *registry, ! const gchar *key); ! ERNode *e_registry_peek_parent_node (ERegistry *registry, ! const gchar *key); ! gchar **e_registry_get_keys (ERegistry *registry, ! const gchar *filter); ! gint e_registry_len (ERegistry *registry); G_END_DECLS --- 62,107 ---- /* signals */ ! void (*registry) (ERegistry *registry, ! ERNode *node); }; #include <e-iterator.h> ! GType e_registry_get_type (void); /* lock mechanism */ ! void e_registry_lock (ERegistry *registry); ! void e_registry_unlock (ERegistry *registry); ! EIterator *e_registry_get_iterator (ERegistry *registry, ! const gchar **filter, ! GError **error); /* gobject methods */ ! GObject *e_registry_peek_object (ERegistry *registry, ! const gchar *key); ! GObject *e_registry_peek_object_by_value (ERegistry *registry, ! const gchar *key, ! const gchar *value); ! ERNodeSet *e_registry_peek_objects (ERegistry *registry, ! const gchar *filter); ! ERNode *e_registry_add_object (ERegistry *registry, ! const gchar *key, ! GObject *object); ! ERNode *e_registry_peek_node (ERegistry *registry, ! const gchar *key); ! void e_registry_add_node_value (ERegistry *registry, ! ERNode *node, ! const gchar *key, ! const gchar *value); ! void e_registry_remove_node_value (ERegistry *registry, ! ERNode *node, ! const gchar *key); ! ERNode *e_registry_peek_parent_node (ERegistry *registry, ! const gchar *key); ! gchar **e_registry_get_keys (ERegistry *registry, ! const gchar *filter); ! gchar **e_registry_get_values (ERegistry *registry, ! const gchar *key); ! gint e_registry_len (ERegistry *registry); G_END_DECLS |
From: Carlos MartÃn <in...@us...> - 2007-03-11 21:27:43
|
Update of /cvsroot/ebdl/ebdl In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv31223 Modified Files: ChangeLog Log Message: * src/e-function.c: (e_function_class_init): Fix prop. * src/e-internal-loader.[ch]: Added. * src/e-monitor.[ch]: Add E_MONITOR_EVENT_TYPE so clients willbe notified about events * src/e-plugin.c: (e_plugin_class_init), (e_plugin_get_name), (_plugin_get_loader): Beutify how a name is obtained. * src/e-plugins-manager.c: Fix some bugs. * src/e-worker-c.[ch]: Removed Index: ChangeLog =================================================================== RCS file: /cvsroot/ebdl/ebdl/ChangeLog,v retrieving revision 1.403 retrieving revision 1.404 diff -C2 -d -r1.403 -r1.404 *** ChangeLog 8 Mar 2007 19:07:15 -0000 1.403 --- ChangeLog 11 Mar 2007 21:27:36 -0000 1.404 *************** *** 1,2 **** --- 1,18 ---- + 2007-03-11 Carlos Martin <in...@us...> + + * src/e-function.c: (e_function_class_init): Fix prop. + + * src/e-internal-loader.[ch]: Added. + + * src/e-monitor.[ch]: Add E_MONITOR_EVENT_TYPE so clients willbe + notified about events + + * src/e-plugin.c: (e_plugin_class_init), (e_plugin_get_name), + (_plugin_get_loader): Beutify how a name is obtained. + + * src/e-plugins-manager.c: Fix some bugs. + + * src/e-worker-c.[ch]: Removed + 2007-03-08 Carlos Martin <in...@us...> |
From: Carlos MartÃn <in...@us...> - 2007-03-11 21:27:43
|
Update of /cvsroot/ebdl/ebdl/tests In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv31223/tests Modified Files: Makefile.am tc-source.c tc-worker.c ts-ebdl.c ts-plugin.c Log Message: * src/e-function.c: (e_function_class_init): Fix prop. * src/e-internal-loader.[ch]: Added. * src/e-monitor.[ch]: Add E_MONITOR_EVENT_TYPE so clients willbe notified about events * src/e-plugin.c: (e_plugin_class_init), (e_plugin_get_name), (_plugin_get_loader): Beutify how a name is obtained. * src/e-plugins-manager.c: Fix some bugs. * src/e-worker-c.[ch]: Removed Index: tc-worker.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/tc-worker.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tc-worker.c 8 Mar 2007 19:07:16 -0000 1.3 --- tc-worker.c 11 Mar 2007 21:27:37 -0000 1.4 *************** *** 36,40 **** fail_unless (E_IS_WORKER (worker)); fail_unless (E_IS_SHLIB_WORKER (worker)); ! fail_unless (strcmp ("ECWorker", g_type_name (E_TYPE_SHLIB_WORKER)) == 0); g_object_unref ((GObject *)worker); --- 36,40 ---- fail_unless (E_IS_WORKER (worker)); fail_unless (E_IS_SHLIB_WORKER (worker)); ! fail_unless (strcmp ("EShlibWorker", g_type_name (E_TYPE_SHLIB_WORKER)) == 0); g_object_unref ((GObject *)worker); Index: ts-ebdl.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/ts-ebdl.c,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** ts-ebdl.c 8 Mar 2007 19:07:17 -0000 1.73 --- ts-ebdl.c 11 Mar 2007 21:27:37 -0000 1.74 *************** *** 20,24 **** extern TCase *create_test_e_extension (); extern TCase *create_test_e_file_handler (); - extern TCase *create_test_e_function (); extern TCase *create_test_e_handler (); extern TCase *create_test_e_host (); --- 20,23 ---- *************** *** 40,43 **** --- 39,46 ---- extern TCase *create_test_e_worker (); + #ifdef HAVE_FFI_H + extern TCase *create_test_e_function (); + #endif + #ifdef BACKEND_LKFSS extern TCase *create_test_lkfss_modconf (); *************** *** 62,71 **** { Suite *suite; - gchar *prgname; SRunner *runner; guint handler, failed; gboolean in_proc = FALSE; ! g_setenv ("EBDL_AGENTS_PATH" ,BUILDDIR"/src/.libs" ,0); /* init glib stuff */ --- 65,73 ---- { Suite *suite; SRunner *runner; guint handler, failed; gboolean in_proc = FALSE; ! g_setenv ("EBDL_AGENTS_PATH" , BUILDDIR"/src/.libs" ,0); /* init glib stuff */ *************** *** 74,85 **** /* debug stuff */ ! g_set_prgname (((prgname = strrchr(argv[0], G_DIR_SEPARATOR)) != NULL) ? prgname + 1 : argv[0]); ! handler = e_debug_add_handler (e_debug_default_log_handler, E_DEBUG_LEVEL_WARNING, NULL, NULL); ! e_debug_default_log_levels (E_DEBUG_LEVEL_ALWAYS, E_DEBUG_LEVEL_WARNING, E_DEBUG_LEVEL_ALWAYS); ! g_assert ((runner = srunner_create (NULL))); - /* TDA ts */ #if 1 g_assert ((suite = suite_create ("TDAs"))); suite_add_tcase (suite, create_test_e_handler ()); --- 76,92 ---- /* debug stuff */ ! handler = e_debug_add_handler ( \ ! e_debug_default_log_handler, \ ! E_DEBUG_LEVEL_WARNING, NULL, NULL); ! ! e_debug_default_log_levels ( \ ! E_DEBUG_LEVEL_ALWAYS, E_DEBUG_LEVEL_WARNING, E_DEBUG_LEVEL_ALWAYS); ! ! g_set_prgname ("EbdlSuite"); ! g_assert ((runner = srunner_create (NULL))); #if 1 + /* TDA ts */ g_assert ((suite = suite_create ("TDAs"))); suite_add_tcase (suite, create_test_e_handler ()); *************** *** 92,96 **** } #endif - /* Streams ts */ g_assert ((suite = suite_create ("Streams"))); --- 99,102 ---- *************** *** 113,116 **** --- 119,127 ---- srunner_add_suite (runner, suite); + /* serialization stuff ts */ + g_assert ((suite = suite_create ("Serialization"))); + suite_add_tcase (suite, create_test_e_pickler ()); + srunner_add_suite (runner, suite); + /* xpcall like stuff ts */ #ifdef HAVE_FFI_H *************** *** 127,147 **** srunner_add_suite (runner, suite); #endif - /* serialization stuff ts */ - g_assert ((suite = suite_create ("Serialization"))); - suite_add_tcase (suite, create_test_e_pickler ()); - srunner_add_suite (runner, suite); /* Business domain test cases ts */ g_assert ((suite = suite_create ("BusinessDomain"))); suite_add_tcase (suite, create_test_e_module ()); ! // suite_add_tcase (suite, create_test_e_extension ()); suite_add_tcase (suite, create_test_e_kernel ()); suite_add_tcase (suite, create_test_e_host ()); suite_add_tcase (suite, create_test_e_data ()); ! // suite_add_tcase (suite, create_test_e_worker ()); suite_add_tcase (suite, create_test_e_source ()); srunner_add_suite (runner, suite); - #endif /* no fork ts */ srunner_set_fork_status(runner, CK_NOFORK); --- 138,154 ---- srunner_add_suite (runner, suite); #endif /* Business domain test cases ts */ g_assert ((suite = suite_create ("BusinessDomain"))); suite_add_tcase (suite, create_test_e_module ()); ! suite_add_tcase (suite, create_test_e_extension ()); suite_add_tcase (suite, create_test_e_kernel ()); suite_add_tcase (suite, create_test_e_host ()); suite_add_tcase (suite, create_test_e_data ()); ! suite_add_tcase (suite, create_test_e_worker ()); suite_add_tcase (suite, create_test_e_source ()); srunner_add_suite (runner, suite); + #endif /* no fork ts */ srunner_set_fork_status(runner, CK_NOFORK); Index: tc-source.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/tc-source.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tc-source.c 27 Feb 2007 17:51:52 -0000 1.23 --- tc-source.c 11 Mar 2007 21:27:37 -0000 1.24 *************** *** 127,131 **** source = e_source_factory_create_source_extension (factory, NULL, NULL); - fail_unless (source != NULL); fail_unless (E_IS_SOURCE (source)); --- 127,130 ---- Index: Makefile.am =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/Makefile.am,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Makefile.am 27 Feb 2007 17:51:50 -0000 1.35 --- Makefile.am 11 Mar 2007 21:27:37 -0000 1.36 *************** *** 18,22 **** top_srcdir=$(top_srcdir) \ builddir=$(top_builddir)/$(subdir) \ ! CK_VERBOSITY=minimal \ EBDL_AGENTS_DIR=$(top_builddir)/src/.libs --- 18,22 ---- top_srcdir=$(top_srcdir) \ builddir=$(top_builddir)/$(subdir) \ ! CK_VERBOSITY=verbose \ EBDL_AGENTS_DIR=$(top_builddir)/src/.libs Index: ts-plugin.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/tests/ts-plugin.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ts-plugin.c 8 Mar 2007 19:07:17 -0000 1.1 --- ts-plugin.c 11 Mar 2007 21:27:37 -0000 1.2 *************** *** 73,76 **** --- 73,77 ---- /* init glib stuff */ + g_thread_init (NULL); g_type_init_with_debug_flags (G_TYPE_DEBUG_OBJECTS); *************** *** 80,83 **** --- 81,86 ---- E_DEBUG_LEVEL_DEBUG, NULL, NULL); + g_set_prgname ("PluginSuite"); + g_assert ((runner = srunner_create (NULL))); #if 1 |
From: Carlos MartÃn <in...@us...> - 2007-03-11 21:27:43
|
Update of /cvsroot/ebdl/ebdl/src In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv31223/src Modified Files: Makefile.am e-function.c e-monitor-fam.c e-monitor.c e-monitor.h e-plugin.c e-plugins-manager.c e-shlib-loader.c e-stream.h e-worker-factory.c ebdl-marshal.list Added Files: e-internal-loader.c e-internal-loader.h Removed Files: e-worker-c.c e-worker-c.h Log Message: * src/e-function.c: (e_function_class_init): Fix prop. * src/e-internal-loader.[ch]: Added. * src/e-monitor.[ch]: Add E_MONITOR_EVENT_TYPE so clients willbe notified about events * src/e-plugin.c: (e_plugin_class_init), (e_plugin_get_name), (_plugin_get_loader): Beutify how a name is obtained. * src/e-plugins-manager.c: Fix some bugs. * src/e-worker-c.[ch]: Removed Index: e-monitor.h =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-monitor.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** e-monitor.h 12 Apr 2006 21:13:39 -0000 1.7 --- e-monitor.h 11 Mar 2007 21:27:36 -0000 1.8 *************** *** 43,47 **** --- 43,56 ---- } EMonitorState; + typedef enum { + E_MONITOR_EVENT_INVALID = 0, + E_MONITOR_EVENT_CHANGED = 1, + E_MONITOR_EVENT_DELETED = 2, + E_MONITOR_EVENT_CREATED = 3, + E_MONITOR_EVENT_MOVED = 4, + } EMonitorEvent; + #define E_MONITOR_USER_SHIFT (8) + #define E_MONITOR_EVENT_RESERVED (8) struct _EMonitorIface { *************** *** 50,53 **** --- 59,63 ---- /* <signals> */ void (* event) (EMonitor *monitor, + EMonitorEvent state, gpointer event, gpointer closure); Index: e-function.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-function.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** e-function.c 12 Apr 2006 21:13:39 -0000 1.8 --- e-function.c 11 Mar 2007 21:27:36 -0000 1.9 *************** *** 251,255 **** g_object_class_install_property ( object_class, ! PROP_NULLABLE, g_param_spec_string ("name", P_("Function's name"), --- 251,255 ---- g_object_class_install_property ( object_class, ! PROP_NAME, g_param_spec_string ("name", P_("Function's name"), Index: Makefile.am =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/Makefile.am,v retrieving revision 1.131 retrieving revision 1.132 diff -C2 -d -r1.131 -r1.132 *** Makefile.am 8 Mar 2007 19:07:16 -0000 1.131 --- Makefile.am 11 Mar 2007 21:27:36 -0000 1.132 *************** *** 125,128 **** --- 125,129 ---- e-iterable.h \ e-iterator.h \ + e-internal-loader.h \ e-kernel.h \ e-bag.h \ *************** *** 235,238 **** --- 236,240 ---- e-iterable.c \ e-iterator.c \ + e-internal-loader.c \ e-monitor.c \ e-monitor-factory.c \ Index: e-monitor.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-monitor.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** e-monitor.c 8 Mar 2007 19:07:16 -0000 1.8 --- e-monitor.c 11 Mar 2007 21:27:36 -0000 1.9 *************** *** 3,7 **** * e-monitor.h: * ! * Copyright (c) 2004, 2005, 2006 Carlos MartÃn * * This program is free software; you can redistribute it and/or --- 3,7 ---- * e-monitor.h: * ! * Copyright (c) 2004, 2005, 2006, 2007 Carlos MartÃn * * This program is free software; you can redistribute it and/or *************** *** 27,33 **** #include <e-error.h> - #include <e-monitor.h> #include <e-object.h> #include <ebdl-marshal.h> /** --- 27,35 ---- #include <e-error.h> #include <e-object.h> + #include <e-monitor.h> + #include <ebdl-marshal.h> + #include <ebdl-type-builtins.h> /** *************** *** 97,101 **** * EMonitor::monitor-event: * @monitor: the object which received the signal ! * @event: a pointer to a event struct, propietary to #EMonitor <!-- -->s implementation * @closure: closure associated to this event. Probably, it may be %NULL * --- 99,104 ---- * EMonitor::monitor-event: * @monitor: the object which received the signal ! * @sate: a #EMonitorEvent which identifies event type ! * @event: a pointer to a event struct, propietary to #EMonitor <!-- -->s implementation * @closure: closure associated to this event. Probably, it may be %NULL * *************** *** 115,121 **** NULL, NULL, ! _e_marshal_VOID__POINTER_POINTER, G_TYPE_NONE, ! 2, G_TYPE_POINTER, G_TYPE_POINTER); --- 118,125 ---- NULL, NULL, ! _e_marshal_VOID__ENUM_POINTER_POINTER, G_TYPE_NONE, ! 3, ! E_TYPE_MONITOR_EVENT, G_TYPE_POINTER, G_TYPE_POINTER); Index: e-monitor-fam.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-monitor-fam.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** e-monitor-fam.c 27 Feb 2007 17:52:46 -0000 1.6 --- e-monitor-fam.c 11 Mar 2007 21:27:36 -0000 1.7 *************** *** 80,87 **** --- 80,91 ---- + #define _FAM_MAP(e, code, f_c, m_c) if (code == FAM##f_c) e = E_MONITOR_EVENT_##m_c; + static gboolean e_monitor_fam_event_cb (GIOChannel *source, GIOCondition condition, gpointer data) { FAMEvent *fe; + EMonitor *monitor; + EMonitorEvent e = E_MONITOR_EVENT_INVALID; if (FAMPending ((FAMConnection *)data)) { *************** *** 94,102 **** } ! /* prevents a race condition */ ! if (G_LIKELY (fe->code != FAMAcknowledge && fe->userdata && E_IS_MONITOR (fe->userdata))) { ! /* if suspended , don't throw signal */ ! if (e_monitor_get_state ((EMonitor *)fe->userdata) & E_MONITOR_STATE_STARTED) { ! g_signal_emit_by_name (G_OBJECT (fe->userdata), "monitor-event", fe, NULL); } } --- 98,111 ---- } ! _FAM_MAP (e, fe->code, Moved, MOVED); ! _FAM_MAP (e, fe->code, Changed, CHANGED); ! _FAM_MAP (e, fe->code, Created, CREATED); ! _FAM_MAP (e, fe->code, Deleted, DELETED); ! ! monitor = fe->userdata; ! ! if ((e != E_MONITOR_EVENT_INVALID && E_IS_MONITOR (monitor))) { ! if (e_monitor_get_state (monitor) == E_MONITOR_STATE_STARTED) { ! g_signal_emit_by_name (monitor, "monitor-event", e, fe, NULL); } } *************** *** 108,111 **** --- 117,121 ---- return TRUE; } + #undef _FAM_MAP static void Index: e-stream.h =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-stream.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** e-stream.h 12 Apr 2006 21:13:39 -0000 1.12 --- e-stream.h 11 Mar 2007 21:27:36 -0000 1.13 *************** *** 5,9 **** * Bertrand Guiheneuf <ber...@he...> * ! * Copyright (C) 1999-2000, 2005, 2006 Ximian, Inc. (www.ximian.com) * Copyright (C) 2003-2004 Carlos MartÃn <in...@us...> * --- 5,9 ---- * Bertrand Guiheneuf <ber...@he...> * ! * Copyright (C) 1999-2000, 2005, 2006, 2007 Ximian, Inc. (www.ximian.com) * Copyright (C) 2003-2004 Carlos MartÃn <in...@us...> * *************** *** 66,84 **** ! GType e_stream_get_type (void); ! gssize e_stream_read (EStream *stream, gchar *buffer, gsize n, GError **error); ! gssize e_stream_write (EStream *stream, const gchar *buffer, gsize n, GError **error); ! gint e_stream_close (EStream *stream, GError **error); ! gint e_stream_flush (EStream *stream, GError **error); ! gint e_stream_reset (EStream *stream, GError **error); gboolean e_stream_eos (EStream *stream); --- 66,84 ---- ! GType e_stream_get_type (void); ! gssize e_stream_read (EStream *stream, gchar *buffer, gsize n, GError **error); ! gssize e_stream_write (EStream *stream, const gchar *buffer, gsize n, GError **error); ! gint e_stream_close (EStream *stream, GError **error); ! gint e_stream_flush (EStream *stream, GError **error); ! gint e_stream_reset (EStream *stream, GError **error); gboolean e_stream_eos (EStream *stream); Index: e-worker-factory.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-worker-factory.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** e-worker-factory.c 8 Mar 2007 19:07:16 -0000 1.12 --- e-worker-factory.c 11 Mar 2007 21:27:37 -0000 1.13 *************** *** 60,64 **** } ! #define E_LOADER_ITSELF "intself" static void --- 60,64 ---- } ! #define E_LOADER_INTERNAL "internal" static void *************** *** 66,69 **** --- 66,70 ---- { EPlugin *plugin; + const gchar *worker; EPluginsManager *manager; *************** *** 71,76 **** g_assert (manager); ! plugin = g_object_new (E_TYPE_PLUGIN, "loader", E_LOADER_ITSELF, NULL); ! _e_plugin_set_name (plugin, g_strdup (g_type_name (E_TYPE_WORKER_FACTORY_INTERNAL_BACKEND))); e_plugins_manager_register (manager, plugin); --- 72,80 ---- g_assert (manager); ! worker = g_type_name (E_TYPE_WORKER_FACTORY_INTERNAL_BACKEND); ! ! plugin = g_object_new (E_TYPE_PLUGIN, \ ! "type", E_LOADER_INTERNAL, \ ! "path", worker, NULL); e_plugins_manager_register (manager, plugin); --- e-worker-c.c DELETED --- --- NEW FILE: e-internal-loader.h --- (This appears to be a binary file; contents omitted.) Index: ebdl-marshal.list =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/ebdl-marshal.list,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ebdl-marshal.list 26 Mar 2006 20:13:47 -0000 1.17 --- ebdl-marshal.list 11 Mar 2007 21:27:37 -0000 1.18 *************** *** 37,38 **** --- 37,39 ---- VOID:PARAM,BOXED,BOXED,POINTER VOID:POINTER,UINT,UINT,POINTER + VOID:ENUM,POINTER,POINTER Index: e-plugin.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-plugin.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** e-plugin.c 8 Mar 2007 19:07:16 -0000 1.20 --- e-plugin.c 11 Mar 2007 21:27:36 -0000 1.21 *************** *** 210,214 **** g_object_class_install_property ( \ object_class, \ ! PROP_PATH, \ g_param_spec_string ("type", "Type", --- 210,214 ---- g_object_class_install_property ( \ object_class, \ ! PROP_LOADER, \ g_param_spec_string ("type", "Type", *************** *** 338,360 **** } ! #define _get_name_from_location(_n, _l) \ ! { \ ! _n = strrchr (_l, G_DIR_SEPARATOR) ?: _l; \ ! _n = strstr (_n, "lib") ? _n + 4 : _n; \ ! _n = g_ascii_strdown (_n, -1); \ ! _n = g_strdelimit (_n, ".", '\0'); \ ! _n[0] = g_ascii_toupper (_n[0]); \ ! } \ ! const gchar * e_plugin_get_name (EPlugin *plugin) { ! gchar *name; ! GQuark quark; EPluginPrivate *priv; priv = E_PLUGIN_GET_PRIVATE (plugin); ! if (priv->name != NULL) { return priv->name; } --- 338,374 ---- } ! #define _get_name_from_location(_n, _l) \ ! { \ ! gint p; \ ! gchar *_name; \ ! \ ! _name = strrchr (_l, G_DIR_SEPARATOR) ?: _l; \ ! _name = strstr (_name, "lib") ? _name + 4 : _name; \ ! _n = g_string_new (_name); \ ! \ ! for (p = _n->len - 2; p >= 0; p--) { \ ! if (_n->str[p] == '.') { \ ! _n->str[p] = '\0'; \ ! continue; \ ! } \ ! if ((_n->str[p] == '_') || (_n->str[p] == '-')) { \ ! g_string_erase (_n, p, 1); \ ! _n->str[p] = g_ascii_toupper (_n->str[p]); \ ! } \ ! if (p == 0) { \ ! _n->str[p] = g_ascii_toupper (_n->str[p]); \ ! } \ ! } \ ! } \ ! const gchar * e_plugin_get_name (EPlugin *plugin) { ! GString *name = NULL; EPluginPrivate *priv; priv = E_PLUGIN_GET_PRIVATE (plugin); ! if (G_LIKELY (priv->name != NULL)) { return priv->name; } *************** *** 365,372 **** /* store as quark */ ! quark = g_quark_from_string (name); ! g_free (name); ! ! return g_quark_to_string (quark); } --- 379,384 ---- /* store as quark */ ! priv->name = g_string_free (name, FALSE); ! return priv->name; } *************** *** 379,383 **** if (G_LIKELY (priv->loader != NULL)) { ! return g_object_ref (priv->name); } --- 391,395 ---- if (G_LIKELY (priv->loader != NULL)) { ! return g_object_ref (priv->loader); } --- NEW FILE: e-internal-loader.c --- (This appears to be a binary file; contents omitted.) Index: e-shlib-loader.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-shlib-loader.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** e-shlib-loader.c 8 Mar 2007 19:07:16 -0000 1.1 --- e-shlib-loader.c 11 Mar 2007 21:27:36 -0000 1.2 *************** *** 95,99 **** priv = E_SHLIB_LOADER_GET_PRIVATE (loader); ! l = (LoaderData *)g_slist_find_custom ( \ priv->data, library, \ (GCompareFunc) e_shlib_loader_data_find_library); --- 95,99 ---- priv = E_SHLIB_LOADER_GET_PRIVATE (loader); ! l = g_slist_find_custom ( \ priv->data, library, \ (GCompareFunc) e_shlib_loader_data_find_library); --- e-worker-c.h DELETED --- Index: e-plugins-manager.c =================================================================== RCS file: /cvsroot/ebdl/ebdl/src/e-plugins-manager.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** e-plugins-manager.c 8 Mar 2007 19:07:16 -0000 1.1 --- e-plugins-manager.c 11 Mar 2007 21:27:36 -0000 1.2 *************** *** 34,37 **** --- 34,38 ---- #include <stdlib.h> #include <string.h> + #include <unistd.h> #include <e-debug.h> *************** *** 42,52 **** #include <e-loader.h> #include <e-shlib-loader.h> ! #include <e-loader-factory.h> ! #include <e-plugin.h> #include <e-plugins-manager.h> #include <e-uri.h> #include <e-monitor-factory.h> /** * SECTION:e-plugins-manager --- 43,58 ---- #include <e-loader.h> #include <e-shlib-loader.h> ! #include <e-internal-loader.h> ! #include <e-loader-factory.h> #include <e-plugins-manager.h> #include <e-uri.h> + #include <e-plugin.h> #include <e-monitor-factory.h> + + #include <e-stream.h> + #include <e-stream-fs.h> + /** * SECTION:e-plugins-manager *************** *** 101,105 **** static void ! e_plugins_manager_activation_cb (EPluginsManager *manager) { GList *l; --- 107,152 ---- static void ! e_plugins_manager_load_conf (EPluginsManager *manager) ! { ! GKeyFile *tmp, *key = NULL; ! EPluginsManagerPrivate *priv; ! ! priv = E_PLUGINS_MANAGER_GET_PRIVATE (manager); ! ! if (G_UNLIKELY (! g_file_test (priv->session_id, G_FILE_TEST_IS_REGULAR))) { ! return; ! } ! ! key = g_key_file_new (); ! if ((g_key_file_load_from_file (key, priv->session_id, 0, NULL))) { ! tmp = priv->session; ! priv->session = key; ! key = tmp; ! } ! g_key_file_free (key); ! } ! ! G_GNUC_UNUSED static void ! e_plugins_manager_save_conf (EPluginsManager *manager) ! { ! gchar *data; ! EStream *stream; ! EPluginsManagerPrivate *priv; ! ! priv = E_PLUGINS_MANAGER_GET_PRIVATE (manager); ! ! if (G_LIKELY ((data = g_key_file_to_data (priv->session, NULL, NULL)))) { ! stream = e_stream_fs_new_with_name (priv->session_id, O_CREAT | O_TRUNC, S_IRWXU); ! g_assert (stream); ! ! e_stream_write_string (stream, data, NULL); ! e_stream_close (stream, NULL); ! ! g_object_unref (stream); ! } ! } ! ! static void ! e_plugins_manager_activation_cb (EPluginsManager *manager, EMonitorEvent event) { GList *l; *************** *** 114,149 **** g_assert (E_IS_PLUGINS_MANAGER (manager)); priv = E_PLUGINS_MANAGER_GET_PRIVATE (manager); if (G_UNLIKELY (priv->active == NULL)) { ! ! /* load all and store key */ ! g_signal_handler_block (priv->monitor, priv->active_id); for (l = priv->plugins; l != NULL; l = l->next) { e_plugins_manager_activate (manager, l->data); } - g_signal_handler_unblock (priv->monitor, priv->active_id); - - return; } - g_signal_handler_block (priv->monitor, priv->active_id); for (l = priv->plugins; l != NULL; l = l->next) { ! ! is_active = e_plugin_get_is_active (l->data); to_activate = g_slist_find_custom ( \ priv->active, \ ! e_plugin_get_location (l->data), \ (GCompareFunc)strcmp) ? TRUE : FALSE; ! if (! is_active && to_activate) { e_plugins_manager_activate (manager, l->data); ! } ! if ( is_active && ! to_activate) { e_plugins_manager_deactivate (manager, l->data); - } } - g_signal_handler_unblock (priv->monitor, priv->active_id); return; } --- 161,197 ---- g_assert (E_IS_PLUGINS_MANAGER (manager)); + /* ignore all events which doesn't implies a change */ + if (event != E_MONITOR_EVENT_CHANGED) { + return; + } + priv = E_PLUGINS_MANAGER_GET_PRIVATE (manager); + g_signal_handler_block (priv->monitor, priv->active_id); + + /* reload session conf */ + e_plugins_manager_load_conf (manager); + if (G_UNLIKELY (priv->active == NULL)) { ! /* load all and store key */ for (l = priv->plugins; l != NULL; l = l->next) { e_plugins_manager_activate (manager, l->data); } } for (l = priv->plugins; l != NULL; l = l->next) { ! is_active = e_plugin_get_is_active (l->data); to_activate = g_slist_find_custom ( \ priv->active, \ ! e_plugin_get_name (l->data), \ (GCompareFunc)strcmp) ? TRUE : FALSE; ! if (! is_active && to_activate) e_plugins_manager_activate (manager, l->data); ! if ( is_active && ! to_activate) e_plugins_manager_deactivate (manager, l->data); } + g_signal_handler_unblock (priv->monitor, priv->active_id); return; } *************** *** 189,194 **** GError **error) { ! g_printerr ("%s\n", __FUNCTION__); ! return FALSE; } --- 237,266 ---- GError **error) { ! gint i, len; ! gchar **active; ! GSList *l = NULL; ! EPluginsManagerPrivate *priv; ! ! g_assert (E_IS_PLUGINS_MANAGER (manager)); ! g_assert (list != NULL); ! g_assert (group != NULL && group[0] != '\0'); ! g_assert (key != NULL && key[0] != '\0'); ! ! priv = E_PLUGINS_MANAGER_GET_PRIVATE (manager); ! ! if (G_UNLIKELY (priv->session == NULL)) { ! return FALSE; ! } ! ! len = g_slist_length ((GSList *)list); ! active = g_new0 (gchar *, len); ! for (i = 0, l = (GSList *)list; l != NULL; i++, l = g_slist_next (l)) { ! active[i] = l->data; ! } ! ! g_key_file_set_string_list (priv->session, group, key, (const gchar **)active, len); ! g_free (active); ! ! return TRUE; } *************** *** 250,260 **** if (G_UNLIKELY (! priv->loaders)) { /* FIXME: Load loaders as plugins which * must be implemented in C, of course :) * This must be done at Object instantiation time */ - priv->loaders = g_list_append ( \ - priv->loaders, \ - g_object_new (E_TYPE_SHLIB_LOADER, NULL)); } --- 322,337 ---- if (G_UNLIKELY (! priv->loaders)) { + priv->loaders = g_list_append ( \ + priv->loaders, \ + g_object_new (E_TYPE_SHLIB_LOADER, NULL)); + + priv->loaders = g_list_append ( \ + priv->loaders, \ + g_object_new (E_TYPE_INTERNAL_LOADER, NULL)); + /* FIXME: Load loaders as plugins which * must be implemented in C, of course :) * This must be done at Object instantiation time */ } *************** *** 291,294 **** --- 368,372 ---- return NULL; } + static void e_plugins_manager_iface_loader_factory_init (ELoaderFactoryIface *klass, gpointer data) *************** *** 296,300 **** klass->peek_loader = e_plugins_manager_peek_loader; } - --- 374,377 ---- *************** *** 327,331 **** GObjectConstructParam *props) { ! gint i; gchar *pdir; gchar **temp; --- 404,408 ---- GObjectConstructParam *props) { ! gint i, fd; gchar *pdir; gchar **temp; *************** *** 377,381 **** priv->session_id = g_strdup_printf (EBDL_SESSION_CONF_FILE, g_get_user_config_dir ()); if (G_UNLIKELY (! g_file_test (priv->session_id, G_FILE_TEST_IS_REGULAR))) { ! creat (priv->session_id, S_IRUSR | S_IWUSR); } g_key_file_load_from_file (priv->session, priv->session_id, 0, NULL); --- 454,459 ---- priv->session_id = g_strdup_printf (EBDL_SESSION_CONF_FILE, g_get_user_config_dir ()); if (G_UNLIKELY (! g_file_test (priv->session_id, G_FILE_TEST_IS_REGULAR))) { ! if ((fd = creat (priv->session_id, S_IRUSR | S_IWUSR))) ! close (fd); } g_key_file_load_from_file (priv->session, priv->session_id, 0, NULL); *************** *** 392,405 **** factory = g_object_new (E_TYPE_MONITOR_FACTORY, NULL); priv->monitor = e_monitor_factory_create_monitor (factory, (EHandler *)handler, &error); ! g_object_unref (handler); g_object_unref (factory); g_assert (priv->monitor); ! ! priv->active_id = g_signal_connect_swapped ( \ ! priv->monitor, "monitor-event", \ ! G_CALLBACK (e_plugins_manager_activation_cb), \ ! manager); ! ! e_monitor_start (priv->monitor, NULL, &error); ! g_assert (error == NULL); ! #define EBDL_MAIN_GROUP "Ebdl Info" #define EBDL_ACTIVE_AGENTS_KEY "Active Agents" --- 470,486 ---- factory = g_object_new (E_TYPE_MONITOR_FACTORY, NULL); priv->monitor = e_monitor_factory_create_monitor (factory, (EHandler *)handler, &error); ! g_object_unref (handler); g_object_unref (factory); ! #if 1 ! if (G_LIKELY (priv->monitor)) { ! priv->active_id = g_signal_connect_swapped ( \ ! priv->monitor, "monitor-event", \ ! G_CALLBACK (e_plugins_manager_activation_cb), \ ! manager); ! ! e_monitor_start (priv->monitor, NULL, &error); ! g_assert (error == NULL); ! } ! #endif ! #define EBDL_MAIN_GROUP "Ebdl Info" #define EBDL_ACTIVE_AGENTS_KEY "Active Agents" *************** *** 410,414 **** /* active required events on monitor signal handler */ ! e_plugins_manager_activation_cb (manager); return g_object_ref (manager); } --- 491,495 ---- /* active required events on monitor signal handler */ ! e_plugins_manager_activation_cb (manager, E_MONITOR_EVENT_CHANGED); return g_object_ref (manager); } *************** *** 427,431 **** } if (G_LIKELY (priv->session)) { ! g_key_file_free (priv->session); priv->session = NULL; } --- 508,512 ---- } if (G_LIKELY (priv->session)) { ! g_key_file_free (priv->session); priv->session = NULL; } *************** *** 534,538 **** manager, \ EBDL_MAIN_GROUP, EBDL_ACTIVE_AGENTS_KEY, priv->active, NULL); ! return TRUE; } --- 615,622 ---- manager, \ EBDL_MAIN_GROUP, EBDL_ACTIVE_AGENTS_KEY, priv->active, NULL); ! ! g_signal_emit (manager, signals[UPDATED], \ ! g_quark_from_static_string ("activated"), plugin); ! return TRUE; } *************** *** 588,591 **** --- 672,678 ---- EBDL_MAIN_GROUP, EBDL_ACTIVE_AGENTS_KEY, priv->active, NULL); + g_signal_emit (manager, signals[UPDATED], \ + g_quark_from_static_string ("deactivated"), plugin); + return TRUE; } |