From adb39a1431a49ba9134e1d231a6e6040315f11e2 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Wed, 22 May 2024 07:37:55 +0200 Subject: [PATCH] add glib (#1051) * add glib * add gettext and make * .. --------- Co-authored-by: Thorsten Beier --- recipes/recipes_emscripten/glib/build.sh | 9 + .../glib/patches/emscripten-configure.diff | 1132 +++++ .../glib/patches/emscripten-disable-pcre.diff | 3926 +++++++++++++++++ .../glib/patches/emscripten-function-ptr.diff | 2383 ++++++++++ .../glib/patches/emscripten-wasm.diff | 2588 +++++++++++ .../glib/patches/fix-python12.diff | 42 + recipes/recipes_emscripten/glib/recipe.yaml | 38 + 7 files changed, 10118 insertions(+) create mode 100644 recipes/recipes_emscripten/glib/build.sh create mode 100644 recipes/recipes_emscripten/glib/patches/emscripten-configure.diff create mode 100644 recipes/recipes_emscripten/glib/patches/emscripten-disable-pcre.diff create mode 100644 recipes/recipes_emscripten/glib/patches/emscripten-function-ptr.diff create mode 100644 recipes/recipes_emscripten/glib/patches/emscripten-wasm.diff create mode 100644 recipes/recipes_emscripten/glib/patches/fix-python12.diff create mode 100644 recipes/recipes_emscripten/glib/recipe.yaml diff --git a/recipes/recipes_emscripten/glib/build.sh b/recipes/recipes_emscripten/glib/build.sh new file mode 100644 index 000000000..eb0bdf01d --- /dev/null +++ b/recipes/recipes_emscripten/glib/build.sh @@ -0,0 +1,9 @@ +emconfigure ./configure \ + --enable-shared=no \ + --enable-static=yes \ + --with-threads=no \ + --with-pcre=internal \ + --disable-libmount \ + --prefix=${PREFIX} + +emmake make install \ No newline at end of file diff --git a/recipes/recipes_emscripten/glib/patches/emscripten-configure.diff b/recipes/recipes_emscripten/glib/patches/emscripten-configure.diff new file mode 100644 index 000000000..7c605e588 --- /dev/null +++ b/recipes/recipes_emscripten/glib/patches/emscripten-configure.diff @@ -0,0 +1,1132 @@ +Disables configure checks for threads, networking, and pcre, hard-coding the +results for Wasm. Also disables the building of unrequired output binaries. + +Index: glib-2.56.4/configure +=================================================================== +--- glib-2.56.4.orig/configure ++++ glib-2.56.4/configure +@@ -24230,132 +24230,17 @@ fi + + # We can't just use AC_CHECK_FUNC/AC_CHECK_LIB here. Bug 586150 + NETWORK_LIBS="" +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_query" >&5 +-$as_echo_n "checking for res_query... " >&6; } +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +- #include +- #include +- #include + +-int +-main () +-{ ++ $as_echo "#define THREADS_POSIX 1" >>confdefs.h ++ $as_echo "#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1" >>confdefs.h ++ $as_echo "#define CLOCK_MONOTONIC 1" >>confdefs.h ++ THREADS_POSIX_TRUE= ++ THREADS_POSIX_FALSE='#' ++ THREADS_WIN32_TRUE='#' ++ THREADS_WIN32_FALSE= ++ THREADS_NONE_TRUE='#' ++ THREADS_NONE_FALSE= + +- res_query("test", 0, 0, (void *)0, 0); +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +-else +- save_libs="$LIBS" +- LIBS="-lresolv $LIBS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +- #include +- #include +- #include +- +-int +-main () +-{ +- +- res_query("test", 0, 0, (void *)0, 0); +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: in -lresolv" >&5 +-$as_echo "in -lresolv" >&6; } +- NETWORK_LIBS="-lresolv $NETWORK_LIBS" +-else +- LIBS="-lbind $save_libs" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-res_query("test", 0, 0, (void *)0, 0); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: in -lbind" >&5 +-$as_echo "in -lbind" >&6; } +- NETWORK_LIBS="-lbind $NETWORK_LIBS" +-else +- as_fn_error $? "not found" "$LINENO" 5 +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- LIBS="$save_libs" +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket" +-if test "x$ac_cv_func_socket" = xyes; then : +- : +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +-$as_echo_n "checking for socket in -lsocket... " >&6; } +-if ${ac_cv_lib_socket_socket+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lsocket $LIBS" +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char socket (); +-int +-main () +-{ +-return socket (); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- ac_cv_lib_socket_socket=yes +-else +- ac_cv_lib_socket_socket=no +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +-$as_echo "$ac_cv_lib_socket_socket" >&6; } +-if test "x$ac_cv_lib_socket_socket" = xyes; then : +- NETWORK_LIBS="-lsocket $NETWORK_LIBS" +-else +- as_fn_error $? "Could not find socket()" "$LINENO" 5 +-fi +- +-fi +- +- save_libs="$LIBS" +- LIBS="$LIBS $NETWORK_LIBS" +- + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for res_init" >&5 + $as_echo_n "checking for res_init... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -26946,714 +26829,6 @@ fi + PLATFORM_WIN32_FALSE= + fi + +- +- +- +-# Check whether --with-threads was given. +-if test "${with_threads+set}" = set; then : +- withval=$with_threads; +-else +- with_threads=yes +-fi +- +- +- +-THREAD_NO_IMPLEMENTATION="No thread implementation found." +- +-FLAG_DOES_NOT_WORK="I can't find the MACRO to enable thread safety on your +- platform (normally it's "_REENTRANT"). I'll not use any flag on +- compilation now, but then your programs might not work. +- Please provide information on how it is done on your system." +- +-LIBS_NOT_FOUND_1="I can't find the libraries for the thread implementation +- " +- +-LIBS_NOT_FOUND_2=". Please choose another thread implementation or +- provide information on your thread implementation." +- +-FUNC_NO_GETPWUID_R="the 'g_get_(user_name|real_name|home_dir|tmp_dir)' +- functions will not be MT-safe during their first call because +- there is no working 'getpwuid_r' on your system." +- +-FUNC_NO_LOCALTIME_R="the 'g_date_set_time' function will not be MT-safe +- because there is no 'localtime_r' on your system." +- +-AIX_COMPILE_INFO="AIX's C compiler needs to be called by a different name, when +- linking threaded applications. As GLib cannot do that +- automatically, you will get an linkg error everytime you are +- not using the right compiler. In that case you have to relink +- with the right compiler. Ususally just '_r' is appended +- to the compiler name." +- +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread implementation" >&5 +-$as_echo_n "checking for thread implementation... " >&6; } +- +-have_threads=no +-if test "x$with_threads" = xyes || test "x$with_threads" = xposix; then : +- +- if test "x$have_threads" = xno; then : +- +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : +- have_threads=posix +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- +-fi +- # Tru64Unix requires -pthread to find pthread.h. See #103020 +- if test "x$have_threads" = xno; then +- glib_save_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS -pthread" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : +- have_threads=posix +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- CPPFLAGS="$glib_save_CPPFLAGS" +- fi +- +-fi +-if test "x$with_threads" = xyes || test "x$with_threads" = xwin32; then +- case $host in +- *-*-mingw*) +- have_threads=win32 +- ;; +- esac +-fi +- +-if test "x$have_threads" = xno; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none available" >&5 +-$as_echo "none available" >&6; } +- as_fn_error $? "$THREAD_NO_IMPLEMENTATION" "$LINENO" 5 +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_threads" >&5 +-$as_echo "$have_threads" >&6; } +-fi +- +- +- +-G_THREAD_LIBS= +-G_THREAD_LIBS_EXTRA= +-G_THREAD_CFLAGS= +- +- +- +-if test x"$have_threads" = xposix; then : +- +- # First we test for posix, whether -pthread or -pthreads do the trick as +- # both CPPFLAG and LIBS. +- # One of them does for most gcc versions and some other platforms/compilers +- # too and could be considered as the canonical way to go. +- case $host in +- *-*-cygwin*|*-*-darwin*) +- # skip cygwin and darwin -pthread or -pthreads test +- ;; +- *-solaris*) +- # These compiler/linker flags work with both Sun Studio and gcc +- # Sun Studio expands -mt to -D_REENTRANT and -lthread +- # gcc expands -pthreads to -D_REENTRANT -D_PTHREADS -lpthread +- G_THREAD_CFLAGS="-D_REENTRANT -D_PTHREADS" +- G_THREAD_LIBS="-lpthread -lthread" +- ;; +- *) +- for flag in pthread pthreads mt; do +- glib_save_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -$flag" +- if test "$cross_compiling" = yes; then : +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-#include +-int check_me = 0; +-void* func(void* data) {check_me = 42; return &check_me;} +-int main() +- { pthread_t t; +- void *ret; +- pthread_create (&t, 0, func, 0); +- pthread_join (t, &ret); +- return (check_me != 42 || ret != &check_me); +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- glib_flag_works=yes +-else +- glib_flag_works=no +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-#include +-int check_me = 0; +-void* func(void* data) {check_me = 42; return &check_me;} +-int main() +- { pthread_t t; +- void *ret; +- pthread_create (&t, 0, func, 0); +- pthread_join (t, &ret); +- return (check_me != 42 || ret != &check_me); +-} +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- glib_flag_works=yes +-else +- glib_flag_works=no +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- +- CFLAGS="$glib_save_CFLAGS" +- if test $glib_flag_works = yes ; then +- G_THREAD_CFLAGS=-$flag +- G_THREAD_LIBS=-$flag +- break; +- fi +- done +- ;; +- esac +- +-fi +- +-if test x"$G_THREAD_CFLAGS" = x; then : +- +- +- # The canonical -pthread[s] does not work. Try something different. +- +- case $host in +- *-aix*) +- if test x"$GCC" = xyes; then +- # GCC 3.0 and above needs -pthread. +- # Should be coverd by the case above. +- # GCC 2.x and below needs -mthreads +- G_THREAD_CFLAGS="-mthreads" +- G_THREAD_LIBS=$G_THREAD_CFLAGS +- else +- # We are probably using the aix compiler. Normaly a +- # program would have to be compiled with the _r variant +- # of the corresponding compiler, but we as GLib cannot +- # do that: but the good news is that for compiling the +- # only difference is the added -D_THREAD_SAFE compile +- # option. This is according to the "C for AIX User's +- # Guide". +- G_THREAD_CFLAGS="-D_THREAD_SAFE" +- fi +- ;; +- *-sysv5uw7*) # UnixWare 7 +- # We are not using gcc with -pthread. Catched above. +- G_THREAD_CFLAGS="-Kthread" +- G_THREAD_LIBS=$G_THREAD_CFLAGS +- ;; +- *-mingw*) +- # No flag needed when using MSVCRT.DLL +- G_THREAD_CFLAGS="" +- ;; +- *) +- G_THREAD_CFLAGS="-D_REENTRANT" # good default guess otherwise +- ;; +- esac +- +-fi +- +-# if we are not finding the localtime_r function, then we probably are +-# not using the proper multithread flag +- +-glib_save_CPPFLAGS="$CPPFLAGS" +-CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS" +- +-# First we test, whether localtime_r is declared in time.h +-# directly. Then we test whether a macro localtime_r exists, in +-# which case localtime_r in the test program is replaced and thus +-# if we still find localtime_r in the output, it is not defined as +-# a macro. +- +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-_ACEOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]" >/dev/null 2>&1; then : +- +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +- localtime_r(a,b) +-_ACEOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "[^a-zA-Z1-9_]localtime_r[^a-zA-Z1-9_]" >/dev/null 2>&1; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FLAG_DOES_NOT_WORK" >&5 +-$as_echo "$as_me: WARNING: $FLAG_DOES_NOT_WORK" >&2;} +-fi +-rm -f conftest* +- +-fi +-rm -f conftest* +- +- +-CPPFLAGS="$glib_save_CPPFLAGS" +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking thread related cflags" >&5 +-$as_echo_n "checking thread related cflags... " >&6; } +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $G_THREAD_CFLAGS" >&5 +-$as_echo "$G_THREAD_CFLAGS" >&6; } +-CPPFLAGS="$CPPFLAGS $G_THREAD_CFLAGS" +- +- +-if test x$have_threads = xposix; then : +- +- glib_save_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" +- if test x"$G_THREAD_LIBS" = x ; then : +- +- case $host in +- *-aix*) +- # We are not using gcc (would have set G_THREAD_LIBS) and thus +- # probably using the aix compiler. +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $AIX_COMPILE_INFO" >&5 +-$as_echo "$as_me: WARNING: $AIX_COMPILE_INFO" >&2;} +- ;; +- *) +- G_THREAD_LIBS=error +- glib_save_LIBS="$LIBS" +- for thread_lib in "" pthread pthread32 pthreads thread; do +- if test x"$thread_lib" = x; then +- add_thread_lib="" +- IN="" +- else +- add_thread_lib="-l$thread_lib" +- IN=" in -l$thread_lib" +- fi +- if test x"$have_threads" = xposix; then +- defattr=0 +- else +- defattr=pthread_attr_default +- fi +- +- LIBS="$add_thread_lib $glib_save_LIBS" +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create/pthread_join$IN" >&5 +-$as_echo_n "checking for pthread_create/pthread_join$IN... " >&6; } +- if test "$cross_compiling" = yes; then : +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-#include +-int check_me = 0; +-void* func(void* data) {check_me = 42; return &check_me;} +-int main() +- { pthread_t t; +- void *ret; +- pthread_create (&t, $defattr, func, 0); +- pthread_join (t, &ret); +- return (check_me != 42 || ret != &check_me); +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- glib_result=yes +-else +- glib_result=no +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-#include +-int check_me = 0; +-void* func(void* data) {check_me = 42; return &check_me;} +-int main() +- { pthread_t t; +- void *ret; +- pthread_create (&t, $defattr, func, 0); +- pthread_join (t, &ret); +- return (check_me != 42 || ret != &check_me); +-} +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- glib_result=yes +-else +- glib_result=no +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_result" >&5 +-$as_echo "$glib_result" >&6; } +- +- if test "$glib_result" = "yes" ; then +- G_THREAD_LIBS="$add_thread_lib" +- break +- fi +- done +- if test "x$G_THREAD_LIBS" = xerror; then +- as_fn_error $? "$LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2" "$LINENO" 5 +- fi +- LIBS="$glib_save_LIBS" +- ;; +- esac +- +-fi +- +- g_threads_impl="POSIX" +- +-$as_echo "#define THREADS_POSIX 1" >>confdefs.h +- +- +- CPPFLAGS="$glib_save_CPPFLAGS" +- +-elif test x$have_threads = xwin32; then : +- +- +-$as_echo "#define THREADS_WIN32 1" >>confdefs.h +- +- g_threads_impl="WIN32" +- +-else +- +- +-$as_echo "#define THREADS_NONE 1" >>confdefs.h +- +- g_threads_impl="NONE" +- G_THREAD_LIBS=error +- +-fi +- if test "$g_threads_impl" = "POSIX"; then +- THREADS_POSIX_TRUE= +- THREADS_POSIX_FALSE='#' +-else +- THREADS_POSIX_TRUE='#' +- THREADS_POSIX_FALSE= +-fi +- +- if test "$g_threads_impl" = "WIN32"; then +- THREADS_WIN32_TRUE= +- THREADS_WIN32_FALSE='#' +-else +- THREADS_WIN32_TRUE='#' +- THREADS_WIN32_FALSE= +-fi +- +- if test "$g_threads_impl" = "NONE"; then +- THREADS_NONE_TRUE= +- THREADS_NONE_FALSE='#' +-else +- THREADS_NONE_TRUE='#' +- THREADS_NONE_FALSE= +-fi +- +- +-if test "x$G_THREAD_LIBS" = xerror; then +- as_fn_error $? "$LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2" "$LINENO" 5 +-fi +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking thread related libraries" >&5 +-$as_echo_n "checking thread related libraries... " >&6; } +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $G_THREAD_LIBS" >&5 +-$as_echo "$G_THREAD_LIBS" >&6; } +- +- +-glib_save_LIBS="$LIBS" +-# we are not doing the following for now, as this might require glib +-# to always be linked with the thread libs on some platforms. +-# LIBS="$LIBS $G_THREAD_LIBS" +-for ac_func in localtime_r gmtime_r getpwuid_r getgrgid_r +-do : +- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +-if eval test \"x\$"$as_ac_var"\" = x"yes"; then : +- cat >>confdefs.h <<_ACEOF +-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +-_ACEOF +- +-fi +-done +- +- +-LIBS="$G_THREAD_LIBS $LIBS" +-if test x"$have_threads" = xposix; then : +- +- glib_save_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" +- # This is not AC_CHECK_FUNC to also work with function +- # name mangling in header files. +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_setstacksize" >&5 +-$as_echo_n "checking for pthread_attr_setstacksize... " >&6; } +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-pthread_attr_t t; pthread_attr_setstacksize(&t,0) +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-$as_echo "#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1" >>confdefs.h +- +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_condattr_setclock" >&5 +-$as_echo_n "checking for pthread_condattr_setclock... " >&6; } +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-pthread_condattr_t a; pthread_condattr_setclock(&a,0) +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-$as_echo "#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1" >>confdefs.h +- +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_cond_timedwait_relative_np" >&5 +-$as_echo_n "checking for pthread_cond_timedwait_relative_np... " >&6; } +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-pthread_cond_timedwait_relative_np(NULL, NULL, NULL) +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-$as_echo "#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 1" >>confdefs.h +- +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np(const char*)" >&5 +-$as_echo_n "checking for pthread_setname_np(const char*)... " >&6; } +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-pthread_setname_np("example") +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-$as_echo "#define HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID 1" >>confdefs.h +- +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_setname_np(pthread_t, const char*)" >&5 +-$as_echo_n "checking for pthread_setname_np(pthread_t, const char*)... " >&6; } +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-pthread_setname_np(pthread_self(), "example") +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-$as_echo "#define HAVE_PTHREAD_SETNAME_NP_WITH_TID 1" >>confdefs.h +- +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_getname_np(pthread_t, name, len)" >&5 +-$as_echo_n "checking for pthread_getname_np(pthread_t, name, len)... " >&6; } +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-int +-main () +-{ +-char name[16]; pthread_getname_np(pthread_self(), name, 16); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-$as_echo "#define HAVE_PTHREAD_GETNAME_NP 1" >>confdefs.h +- +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- CPPFLAGS="$glib_save_CPPFLAGS" +- +-fi +- +-LIBS="$glib_save_LIBS" +- +-# now spit out all the warnings. +-if test "$ac_cv_func_getpwuid_r" != "yes"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FUNC_NO_GETPWUID_R" >&5 +-$as_echo "$as_me: WARNING: $FUNC_NO_GETPWUID_R" >&2;} +-fi +-if test "$ac_cv_func_localtime_r" != "yes"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $FUNC_NO_LOCALTIME_R" >&5 +-$as_echo "$as_me: WARNING: $FUNC_NO_LOCALTIME_R" >&2;} +-fi +- +-# +-# Hack to deal with: +-# +-# a) GCC < 3.3 for Linux doesn't include -lpthread when +-# building shared libraries with linux. +-# b) FreeBSD doesn't do this either. +-# +-case $host in +- *android*) +- G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS" +- ;; +- *-*-freebsd*|*-*-linux*) +- G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`" +- ;; +- *) +- G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS" +- ;; +-esac +- +- +- +- +- +- +-for ac_func in clock_gettime +-do : +- ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +-if test "x$ac_cv_func_clock_gettime" = xyes; then : +- cat >>confdefs.h <<_ACEOF +-#define HAVE_CLOCK_GETTIME 1 +-_ACEOF +- +-else +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +-$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +-if ${ac_cv_lib_rt_clock_gettime+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- ac_check_lib_save_LIBS=$LIBS +-LIBS="-lrt $LIBS" +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char clock_gettime (); +-int +-main () +-{ +-return clock_gettime (); +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_link "$LINENO"; then : +- ac_cv_lib_rt_clock_gettime=yes +-else +- ac_cv_lib_rt_clock_gettime=no +-fi +-rm -f core conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-LIBS=$ac_check_lib_save_LIBS +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +-$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +-if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : +- +- G_THREAD_LIBS="$G_THREAD_LIBS -lrt" +- G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS_FOR_GTHREAD -lrt" +- +-fi +- +- +-fi +-done +- +- +- +- +- +- + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lock-free atomic intrinsics" >&5 + $as_echo_n "checking for lock-free atomic intrinsics... " >&6; } + if ${glib_cv_g_atomic_lock_free+:} false; then : +@@ -27998,208 +27173,13 @@ $as_echo "$broken_poll" >&6; } + $as_echo "$broken_poll" >&6; } + + +-PCRE_REQUIRED_VERSION=8.13 +- +-# Check if we should use the internal or the system-supplied pcre +- +-# Check whether --with-pcre was given. +-if test "${with_pcre+set}" = set; then : +- withval=$with_pcre; +-else +- with_pcre=system +-fi +- +- +- if test "x$with_pcre" = xsystem; then +- USE_SYSTEM_PCRE_TRUE= +- USE_SYSTEM_PCRE_FALSE='#' +-else +- USE_SYSTEM_PCRE_TRUE='#' +- USE_SYSTEM_PCRE_FALSE= +-fi +- +- +-if test "x$with_pcre" = xsystem; then : +- +- +-pkg_failed=no +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCRE" >&5 +-$as_echo_n "checking for PCRE... " >&6; } +- +-if test -n "$PCRE_CFLAGS"; then +- pkg_cv_PCRE_CFLAGS="$PCRE_CFLAGS" +- elif test -n "$PKG_CONFIG"; then +- if test -n "$PKG_CONFIG" && \ +- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre >= \$PCRE_REQUIRED_VERSION\""; } >&5 +- ($PKG_CONFIG --exists --print-errors "libpcre >= $PCRE_REQUIRED_VERSION") 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; then +- pkg_cv_PCRE_CFLAGS=`$PKG_CONFIG --cflags "libpcre >= $PCRE_REQUIRED_VERSION" 2>/dev/null` +- test "x$?" != "x0" && pkg_failed=yes +-else +- pkg_failed=yes +-fi +- else +- pkg_failed=untried +-fi +-if test -n "$PCRE_LIBS"; then +- pkg_cv_PCRE_LIBS="$PCRE_LIBS" +- elif test -n "$PKG_CONFIG"; then +- if test -n "$PKG_CONFIG" && \ +- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcre >= \$PCRE_REQUIRED_VERSION\""; } >&5 +- ($PKG_CONFIG --exists --print-errors "libpcre >= $PCRE_REQUIRED_VERSION") 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; then +- pkg_cv_PCRE_LIBS=`$PKG_CONFIG --libs "libpcre >= $PCRE_REQUIRED_VERSION" 2>/dev/null` +- test "x$?" != "x0" && pkg_failed=yes +-else +- pkg_failed=yes +-fi +- else +- pkg_failed=untried +-fi +- +- +- +-if test $pkg_failed = yes; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +- +-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then +- _pkg_short_errors_supported=yes +-else +- _pkg_short_errors_supported=no +-fi +- if test $_pkg_short_errors_supported = yes; then +- PCRE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcre >= $PCRE_REQUIRED_VERSION" 2>&1` +- else +- PCRE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcre >= $PCRE_REQUIRED_VERSION" 2>&1` +- fi +- # Put the nasty error message in config.log where it belongs +- echo "$PCRE_PKG_ERRORS" >&5 +- +- as_fn_error $? "Package requirements (libpcre >= $PCRE_REQUIRED_VERSION) were not met: +- +-$PCRE_PKG_ERRORS +- +-Consider adjusting the PKG_CONFIG_PATH environment variable if you +-installed software in a non-standard prefix. +- +-Alternatively, you may set the environment variables PCRE_CFLAGS +-and PCRE_LIBS to avoid the need to call pkg-config. +-See the pkg-config man page for more details." "$LINENO" 5 +-elif test $pkg_failed = untried; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +-is in your PATH or set the PKG_CONFIG environment variable to the full +-path to pkg-config. +- +-Alternatively, you may set the environment variables PCRE_CFLAGS +-and PCRE_LIBS to avoid the need to call pkg-config. +-See the pkg-config man page for more details. +- +-To get pkg-config, see . +-See \`config.log' for more details" "$LINENO" 5; } +-else +- PCRE_CFLAGS=$pkg_cv_PCRE_CFLAGS +- PCRE_LIBS=$pkg_cv_PCRE_LIBS +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-fi +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Unicode support in PCRE" >&5 +-$as_echo_n "checking for Unicode support in PCRE... " >&6; } +-if ${glib_cv_pcre_has_unicode+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- +- glib_save_CFLAGS="$CFLAGS" +- glib_save_LIBS="$LIBS" +- CFLAGS="$CFLAGS $PCRE_CFLAGS" LIBS="$PCRE_LIBS" +- if test "$cross_compiling" = yes; then : +- glib_cv_pcre_has_unicode=yes +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +- int main () { +- int support; +- pcre_config (PCRE_CONFIG_UTF8, &support); +- if (!support) +- return 1; +- pcre_config (PCRE_CONFIG_UNICODE_PROPERTIES, &support); +- if (!support) +- return 1; +- return 0; +- } +-_ACEOF +-if ac_fn_c_try_run "$LINENO"; then : +- glib_cv_pcre_has_unicode=yes +-else +- glib_cv_pcre_has_unicode=no +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi +- +- CFLAGS="$glib_save_CFLAGS" +- LIBS="$glib_save_LIBS" +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glib_cv_pcre_has_unicode" >&5 +-$as_echo "$glib_cv_pcre_has_unicode" >&6; } +- if test "$glib_cv_pcre_has_unicode" = "no"; then +- as_fn_error $? "*** The system-supplied PCRE does not support Unicode properties or UTF-8." "$LINENO" 5 +- fi +- +- +- + $as_echo "#define USE_SYSTEM_PCRE /**/" >>confdefs.h ++USE_SYSTEM_PCRE_TRUE= ++USE_SYSTEM_PCRE_FALSE='#' + +- PCRE_REQUIRES=libpcre +- +- +-else +- +- # If using gcc 4 pass -Wno-pointer-sign when compiling the internal PCRE +- if test x"$GCC" = xyes; then : +- +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler understands -Wno-pointer-sign" >&5 +-$as_echo_n "checking whether compiler understands -Wno-pointer-sign... " >&6; } +- save_CFLAGS="$CFLAGS" +- CFLAGS="$CFLAGS -Wno-pointer-sign" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_c_try_compile "$LINENO"; then : +- PCRE_WARN_CFLAGS="$PCRE_WARN_CFLAGS -Wno-pointer-sign" +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- CFLAGS="$save_CFLAGS" +- +-fi +- +-fi +- +- ++G_THREAD_LIBS=' ' ++G_THREAD_LIBS_EXTRA=' ' ++G_THREAD_CFLAGS=' ' + + case $host in + *-*-cygwin*) +Index: glib-2.56.4/gio/Makefile.in +=================================================================== +--- glib-2.56.4.orig/gio/Makefile.in ++++ glib-2.56.4/gio/Makefile.in +@@ -195,9 +195,7 @@ TESTS = $(am__EXEEXT_2) + @OS_COCOA_TRUE@am__append_39 = libgio-objc-2.0.la + @HAVE_LIBMOUNT_TRUE@am__append_40 = $(LIBMOUNT_CFLAGS) + @HAVE_LIBMOUNT_TRUE@am__append_41 = $(LIBMOUNT_LIBS) +-bin_PROGRAMS = gio-querymodules$(EXEEXT) glib-compile-schemas$(EXEEXT) \ +- glib-compile-resources$(EXEEXT) gsettings$(EXEEXT) \ +- gdbus$(EXEEXT) $(am__EXEEXT_1) gresource$(EXEEXT) gio$(EXEEXT) ++bin_PROGRAMS = + @ENABLE_DTRACE_TRUE@am__append_42 = gio_probes.h gio_probes.lo + @ENABLE_DTRACE_TRUE@am__append_43 = gio_probes.h gio_probes.h.tmp + @ENABLE_DTRACE_TRUE@am__append_44 = gio_probes.lo +Index: glib-2.56.4/glib/Makefile.in +=================================================================== +--- glib-2.56.4.orig/glib/Makefile.in ++++ glib-2.56.4/glib/Makefile.in +@@ -170,7 +170,7 @@ TESTS = $(am__EXEEXT_5) + @ENABLE_SYSTEMTAP_TRUE@am__append_22 = $(tapset_DATA) + @OS_WIN32_TRUE@@OS_WIN32_X64_TRUE@am__append_23 = gspawn-win64-helper gspawn-win64-helper-console + @OS_WIN32_TRUE@@OS_WIN32_X64_FALSE@am__append_24 = gspawn-win32-helper gspawn-win32-helper-console +-bin_PROGRAMS = $(am__EXEEXT_4) ++bin_PROGRAMS = + @OS_UNIX_TRUE@am__append_25 = gtester + @OS_UNIX_TRUE@am__append_26 = ${auto_config_binscripts} + subdir = glib +Index: glib-2.56.4/gobject/Makefile.in +=================================================================== +--- glib-2.56.4.orig/gobject/Makefile.in ++++ glib-2.56.4/gobject/Makefile.in +@@ -165,7 +165,7 @@ TESTS = $(am__EXEEXT_1) + @ENABLE_DTRACE_TRUE@am__append_17 = gobject_probes.h + @ENABLE_DTRACE_TRUE@am__append_18 = gobject_probes.lo + @ENABLE_SYSTEMTAP_TRUE@am__append_19 = $(tapset_DATA) +-bin_PROGRAMS = gobject-query$(EXEEXT) ++bin_PROGRAMS = + subdir = gobject + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/m4macros/attributes.m4 \ +Index: glib-2.56.4/Makefile.in +=================================================================== +--- glib-2.56.4.orig/Makefile.in ++++ glib-2.56.4/Makefile.in +@@ -834,7 +834,7 @@ ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS} + + @ENABLE_INSTALLED_TESTS_TRUE@installed_test_meta_DATA = $(installed_testcases:=.test) + ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS} +-SUBDIRS = . m4macros glib gmodule gthread gobject gio po docs tests ++SUBDIRS = . m4macros glib gmodule gthread gobject gio po docs + DIST_SUBDIRS = $(SUBDIRS) build win32 + bin_SCRIPTS = glib-gettextize + AM_CPPFLAGS = \ diff --git a/recipes/recipes_emscripten/glib/patches/emscripten-disable-pcre.diff b/recipes/recipes_emscripten/glib/patches/emscripten-disable-pcre.diff new file mode 100644 index 000000000..19285bc65 --- /dev/null +++ b/recipes/recipes_emscripten/glib/patches/emscripten-disable-pcre.diff @@ -0,0 +1,3926 @@ +Disables use of PCRE in the glib code base. + +Index: glib-2.56.4/gio/gsettingsschema.c +=================================================================== +--- glib-2.56.4.orig/gio/gsettingsschema.c ++++ glib-2.56.4/gio/gsettingsschema.c +@@ -534,58 +534,7 @@ normalise_whitespace (const gchar *orig) + static gchar * + normalise_whitespace (const gchar *orig) + { +- /* We normalise by the same rules as in intltool: +- * +- * sub cleanup { +- * s/^\s+//; +- * s/\s+$//; +- * s/\s+/ /g; +- * return $_; +- * } +- * +- * $message = join "\n\n", map &cleanup, split/\n\s*\n+/, $message; +- * +- * Where \s is an ascii space character. +- * +- * We aim for ease of implementation over efficiency -- this code is +- * not run in normal applications. +- */ +- static GRegex *cleanup[3]; +- static GRegex *splitter; +- gchar **lines; +- gchar *result; +- gint i; +- +- if (g_once_init_enter (&splitter)) +- { +- GRegex *s; +- +- cleanup[0] = g_regex_new ("^\\s+", 0, 0, 0); +- cleanup[1] = g_regex_new ("\\s+$", 0, 0, 0); +- cleanup[2] = g_regex_new ("\\s+", 0, 0, 0); +- s = g_regex_new ("\\n\\s*\\n+", 0, 0, 0); +- +- g_once_init_leave (&splitter, s); +- } +- +- lines = g_regex_split (splitter, orig, 0); +- for (i = 0; lines[i]; i++) +- { +- gchar *a, *b, *c; +- +- a = g_regex_replace_literal (cleanup[0], lines[i], -1, 0, "", 0, 0); +- b = g_regex_replace_literal (cleanup[1], a, -1, 0, "", 0, 0); +- c = g_regex_replace_literal (cleanup[2], b, -1, 0, " ", 0, 0); +- g_free (lines[i]); +- g_free (a); +- g_free (b); +- lines[i] = c; +- } +- +- result = g_strjoinv ("\n\n", lines); +- g_strfreev (lines); +- +- return result; ++ return orig; + } + + static void +Index: glib-2.56.4/glib/glib.h +=================================================================== +--- glib-2.56.4.orig/glib/glib.h ++++ glib-2.56.4/glib/glib.h +@@ -69,7 +69,6 @@ + #include + #include + #include +-#include + #include + #include + #include +Index: glib-2.56.4/glib/gregex.c +=================================================================== +--- glib-2.56.4.orig/glib/gregex.c ++++ glib-2.56.4/glib/gregex.c +@@ -1,3182 +0,0 @@ +-/* GRegex -- regular expression API wrapper around PCRE. +- * +- * Copyright (C) 1999, 2000 Scott Wimer +- * Copyright (C) 2004, Matthias Clasen +- * Copyright (C) 2005 - 2007, Marco Barisione +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public License +- * along with this library; if not, see . +- */ +- +-#include "config.h" +- +-#include +- +-#ifdef USE_SYSTEM_PCRE +-#include +-#else +-#include "pcre/pcre.h" +-#endif +- +-#include "gtypes.h" +-#include "gregex.h" +-#include "glibintl.h" +-#include "glist.h" +-#include "gmessages.h" +-#include "gstrfuncs.h" +-#include "gatomic.h" +-#include "gthread.h" +- +-/** +- * SECTION:gregex +- * @title: Perl-compatible regular expressions +- * @short_description: matches strings against regular expressions +- * @see_also: [Regular expression syntax][glib-regex-syntax] +- * +- * The g_regex_*() functions implement regular +- * expression pattern matching using syntax and semantics similar to +- * Perl regular expression. +- * +- * Some functions accept a @start_position argument, setting it differs +- * from just passing over a shortened string and setting #G_REGEX_MATCH_NOTBOL +- * in the case of a pattern that begins with any kind of lookbehind assertion. +- * For example, consider the pattern "\Biss\B" which finds occurrences of "iss" +- * in the middle of words. ("\B" matches only if the current position in the +- * subject is not a word boundary.) When applied to the string "Mississipi" +- * from the fourth byte, namely "issipi", it does not match, because "\B" is +- * always false at the start of the subject, which is deemed to be a word +- * boundary. However, if the entire string is passed , but with +- * @start_position set to 4, it finds the second occurrence of "iss" because +- * it is able to look behind the starting point to discover that it is +- * preceded by a letter. +- * +- * Note that, unless you set the #G_REGEX_RAW flag, all the strings passed +- * to these functions must be encoded in UTF-8. The lengths and the positions +- * inside the strings are in bytes and not in characters, so, for instance, +- * "\xc3\xa0" (i.e. "à") is two bytes long but it is treated as a +- * single character. If you set #G_REGEX_RAW the strings can be non-valid +- * UTF-8 strings and a byte is treated as a character, so "\xc3\xa0" is two +- * bytes and two characters long. +- * +- * When matching a pattern, "\n" matches only against a "\n" character in +- * the string, and "\r" matches only a "\r" character. To match any newline +- * sequence use "\R". This particular group matches either the two-character +- * sequence CR + LF ("\r\n"), or one of the single characters LF (linefeed, +- * U+000A, "\n"), VT vertical tab, U+000B, "\v"), FF (formfeed, U+000C, "\f"), +- * CR (carriage return, U+000D, "\r"), NEL (next line, U+0085), LS (line +- * separator, U+2028), or PS (paragraph separator, U+2029). +- * +- * The behaviour of the dot, circumflex, and dollar metacharacters are +- * affected by newline characters, the default is to recognize any newline +- * character (the same characters recognized by "\R"). This can be changed +- * with #G_REGEX_NEWLINE_CR, #G_REGEX_NEWLINE_LF and #G_REGEX_NEWLINE_CRLF +- * compile options, and with #G_REGEX_MATCH_NEWLINE_ANY, +- * #G_REGEX_MATCH_NEWLINE_CR, #G_REGEX_MATCH_NEWLINE_LF and +- * #G_REGEX_MATCH_NEWLINE_CRLF match options. These settings are also +- * relevant when compiling a pattern if #G_REGEX_EXTENDED is set, and an +- * unescaped "#" outside a character class is encountered. This indicates +- * a comment that lasts until after the next newline. +- * +- * When setting the %G_REGEX_JAVASCRIPT_COMPAT flag, pattern syntax and pattern +- * matching is changed to be compatible with the way that regular expressions +- * work in JavaScript. More precisely, a lonely ']' character in the pattern +- * is a syntax error; the '\x' escape only allows 0 to 2 hexadecimal digits, and +- * you must use the '\u' escape sequence with 4 hex digits to specify a unicode +- * codepoint instead of '\x' or 'x{....}'. If '\x' or '\u' are not followed by +- * the specified number of hex digits, they match 'x' and 'u' literally; also +- * '\U' always matches 'U' instead of being an error in the pattern. Finally, +- * pattern matching is modified so that back references to an unset subpattern +- * group produces a match with the empty string instead of an error. See +- * pcreapi(3) for more information. +- * +- * Creating and manipulating the same #GRegex structure from different +- * threads is not a problem as #GRegex does not modify its internal +- * state between creation and destruction, on the other hand #GMatchInfo +- * is not threadsafe. +- * +- * The regular expressions low-level functionalities are obtained through +- * the excellent +- * [PCRE](http://www.pcre.org/) +- * library written by Philip Hazel. +- */ +- +-/* Mask of all the possible values for GRegexCompileFlags. */ +-#define G_REGEX_COMPILE_MASK (G_REGEX_CASELESS | \ +- G_REGEX_MULTILINE | \ +- G_REGEX_DOTALL | \ +- G_REGEX_EXTENDED | \ +- G_REGEX_ANCHORED | \ +- G_REGEX_DOLLAR_ENDONLY | \ +- G_REGEX_UNGREEDY | \ +- G_REGEX_RAW | \ +- G_REGEX_NO_AUTO_CAPTURE | \ +- G_REGEX_OPTIMIZE | \ +- G_REGEX_FIRSTLINE | \ +- G_REGEX_DUPNAMES | \ +- G_REGEX_NEWLINE_CR | \ +- G_REGEX_NEWLINE_LF | \ +- G_REGEX_NEWLINE_CRLF | \ +- G_REGEX_NEWLINE_ANYCRLF | \ +- G_REGEX_BSR_ANYCRLF | \ +- G_REGEX_JAVASCRIPT_COMPAT) +- +-/* Mask of all GRegexCompileFlags values that are (not) passed trough to PCRE */ +-#define G_REGEX_COMPILE_PCRE_MASK (G_REGEX_COMPILE_MASK & ~G_REGEX_COMPILE_NONPCRE_MASK) +-#define G_REGEX_COMPILE_NONPCRE_MASK (G_REGEX_RAW | \ +- G_REGEX_OPTIMIZE) +- +-/* Mask of all the possible values for GRegexMatchFlags. */ +-#define G_REGEX_MATCH_MASK (G_REGEX_MATCH_ANCHORED | \ +- G_REGEX_MATCH_NOTBOL | \ +- G_REGEX_MATCH_NOTEOL | \ +- G_REGEX_MATCH_NOTEMPTY | \ +- G_REGEX_MATCH_PARTIAL | \ +- G_REGEX_MATCH_NEWLINE_CR | \ +- G_REGEX_MATCH_NEWLINE_LF | \ +- G_REGEX_MATCH_NEWLINE_CRLF | \ +- G_REGEX_MATCH_NEWLINE_ANY | \ +- G_REGEX_MATCH_NEWLINE_ANYCRLF | \ +- G_REGEX_MATCH_BSR_ANYCRLF | \ +- G_REGEX_MATCH_BSR_ANY | \ +- G_REGEX_MATCH_PARTIAL_SOFT | \ +- G_REGEX_MATCH_PARTIAL_HARD | \ +- G_REGEX_MATCH_NOTEMPTY_ATSTART) +- +-/* we rely on these flags having the same values */ +-G_STATIC_ASSERT (G_REGEX_CASELESS == PCRE_CASELESS); +-G_STATIC_ASSERT (G_REGEX_MULTILINE == PCRE_MULTILINE); +-G_STATIC_ASSERT (G_REGEX_DOTALL == PCRE_DOTALL); +-G_STATIC_ASSERT (G_REGEX_EXTENDED == PCRE_EXTENDED); +-G_STATIC_ASSERT (G_REGEX_ANCHORED == PCRE_ANCHORED); +-G_STATIC_ASSERT (G_REGEX_DOLLAR_ENDONLY == PCRE_DOLLAR_ENDONLY); +-G_STATIC_ASSERT (G_REGEX_UNGREEDY == PCRE_UNGREEDY); +-G_STATIC_ASSERT (G_REGEX_NO_AUTO_CAPTURE == PCRE_NO_AUTO_CAPTURE); +-G_STATIC_ASSERT (G_REGEX_FIRSTLINE == PCRE_FIRSTLINE); +-G_STATIC_ASSERT (G_REGEX_DUPNAMES == PCRE_DUPNAMES); +-G_STATIC_ASSERT (G_REGEX_NEWLINE_CR == PCRE_NEWLINE_CR); +-G_STATIC_ASSERT (G_REGEX_NEWLINE_LF == PCRE_NEWLINE_LF); +-G_STATIC_ASSERT (G_REGEX_NEWLINE_CRLF == PCRE_NEWLINE_CRLF); +-G_STATIC_ASSERT (G_REGEX_NEWLINE_ANYCRLF == PCRE_NEWLINE_ANYCRLF); +-G_STATIC_ASSERT (G_REGEX_BSR_ANYCRLF == PCRE_BSR_ANYCRLF); +-G_STATIC_ASSERT (G_REGEX_JAVASCRIPT_COMPAT == PCRE_JAVASCRIPT_COMPAT); +- +-G_STATIC_ASSERT (G_REGEX_MATCH_ANCHORED == PCRE_ANCHORED); +-G_STATIC_ASSERT (G_REGEX_MATCH_NOTBOL == PCRE_NOTBOL); +-G_STATIC_ASSERT (G_REGEX_MATCH_NOTEOL == PCRE_NOTEOL); +-G_STATIC_ASSERT (G_REGEX_MATCH_NOTEMPTY == PCRE_NOTEMPTY); +-G_STATIC_ASSERT (G_REGEX_MATCH_PARTIAL == PCRE_PARTIAL); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_CR == PCRE_NEWLINE_CR); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_LF == PCRE_NEWLINE_LF); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_CRLF == PCRE_NEWLINE_CRLF); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_ANY == PCRE_NEWLINE_ANY); +-G_STATIC_ASSERT (G_REGEX_MATCH_NEWLINE_ANYCRLF == PCRE_NEWLINE_ANYCRLF); +-G_STATIC_ASSERT (G_REGEX_MATCH_BSR_ANYCRLF == PCRE_BSR_ANYCRLF); +-G_STATIC_ASSERT (G_REGEX_MATCH_BSR_ANY == PCRE_BSR_UNICODE); +-G_STATIC_ASSERT (G_REGEX_MATCH_PARTIAL_SOFT == PCRE_PARTIAL_SOFT); +-G_STATIC_ASSERT (G_REGEX_MATCH_PARTIAL_HARD == PCRE_PARTIAL_HARD); +-G_STATIC_ASSERT (G_REGEX_MATCH_NOTEMPTY_ATSTART == PCRE_NOTEMPTY_ATSTART); +- +-/* These PCRE flags are unused or not exposed publically in GRegexFlags, so +- * it should be ok to reuse them for different things. +- */ +-G_STATIC_ASSERT (G_REGEX_OPTIMIZE == PCRE_NO_UTF8_CHECK); +-G_STATIC_ASSERT (G_REGEX_RAW == PCRE_UTF8); +- +-/* if the string is in UTF-8 use g_utf8_ functions, else use +- * use just +/- 1. */ +-#define NEXT_CHAR(re, s) (((re)->compile_opts & G_REGEX_RAW) ? \ +- ((s) + 1) : \ +- g_utf8_next_char (s)) +-#define PREV_CHAR(re, s) (((re)->compile_opts & G_REGEX_RAW) ? \ +- ((s) - 1) : \ +- g_utf8_prev_char (s)) +- +-struct _GMatchInfo +-{ +- volatile gint ref_count; /* the ref count */ +- GRegex *regex; /* the regex */ +- GRegexMatchFlags match_opts; /* options used at match time on the regex */ +- gint matches; /* number of matching sub patterns */ +- gint pos; /* position in the string where last match left off */ +- gint n_offsets; /* number of offsets */ +- gint *offsets; /* array of offsets paired 0,1 ; 2,3 ; 3,4 etc */ +- gint *workspace; /* workspace for pcre_dfa_exec() */ +- gint n_workspace; /* number of workspace elements */ +- const gchar *string; /* string passed to the match function */ +- gssize string_len; /* length of string */ +-}; +- +-struct _GRegex +-{ +- volatile gint ref_count; /* the ref count for the immutable part */ +- gchar *pattern; /* the pattern */ +- pcre *pcre_re; /* compiled form of the pattern */ +- GRegexCompileFlags compile_opts; /* options used at compile time on the pattern */ +- GRegexMatchFlags match_opts; /* options used at match time on the regex */ +- pcre_extra *extra; /* data stored when G_REGEX_OPTIMIZE is used */ +-}; +- +-/* TRUE if ret is an error code, FALSE otherwise. */ +-#define IS_PCRE_ERROR(ret) ((ret) < PCRE_ERROR_NOMATCH && (ret) != PCRE_ERROR_PARTIAL) +- +-typedef struct _InterpolationData InterpolationData; +-static gboolean interpolation_list_needs_match (GList *list); +-static gboolean interpolate_replacement (const GMatchInfo *match_info, +- GString *result, +- gpointer data); +-static GList *split_replacement (const gchar *replacement, +- GError **error); +-static void free_interpolation_data (InterpolationData *data); +- +- +-static const gchar * +-match_error (gint errcode) +-{ +- switch (errcode) +- { +- case PCRE_ERROR_NOMATCH: +- /* not an error */ +- break; +- case PCRE_ERROR_NULL: +- /* NULL argument, this should not happen in GRegex */ +- g_warning ("A NULL argument was passed to PCRE"); +- break; +- case PCRE_ERROR_BADOPTION: +- return "bad options"; +- case PCRE_ERROR_BADMAGIC: +- return _("corrupted object"); +- case PCRE_ERROR_UNKNOWN_OPCODE: +- return N_("internal error or corrupted object"); +- case PCRE_ERROR_NOMEMORY: +- return _("out of memory"); +- case PCRE_ERROR_NOSUBSTRING: +- /* not used by pcre_exec() */ +- break; +- case PCRE_ERROR_MATCHLIMIT: +- return _("backtracking limit reached"); +- case PCRE_ERROR_CALLOUT: +- /* callouts are not implemented */ +- break; +- case PCRE_ERROR_BADUTF8: +- case PCRE_ERROR_BADUTF8_OFFSET: +- /* we do not check if strings are valid */ +- break; +- case PCRE_ERROR_PARTIAL: +- /* not an error */ +- break; +- case PCRE_ERROR_BADPARTIAL: +- return _("the pattern contains items not supported for partial matching"); +- case PCRE_ERROR_INTERNAL: +- return _("internal error"); +- case PCRE_ERROR_BADCOUNT: +- /* negative ovecsize, this should not happen in GRegex */ +- g_warning ("A negative ovecsize was passed to PCRE"); +- break; +- case PCRE_ERROR_DFA_UITEM: +- return _("the pattern contains items not supported for partial matching"); +- case PCRE_ERROR_DFA_UCOND: +- return _("back references as conditions are not supported for partial matching"); +- case PCRE_ERROR_DFA_UMLIMIT: +- /* the match_field field is not used in GRegex */ +- break; +- case PCRE_ERROR_DFA_WSSIZE: +- /* handled expanding the workspace */ +- break; +- case PCRE_ERROR_DFA_RECURSE: +- case PCRE_ERROR_RECURSIONLIMIT: +- return _("recursion limit reached"); +- case PCRE_ERROR_BADNEWLINE: +- return _("invalid combination of newline flags"); +- case PCRE_ERROR_BADOFFSET: +- return _("bad offset"); +- case PCRE_ERROR_SHORTUTF8: +- return _("short utf8"); +- case PCRE_ERROR_RECURSELOOP: +- return _("recursion loop"); +- default: +- break; +- } +- return _("unknown error"); +-} +- +-static void +-translate_compile_error (gint *errcode, const gchar **errmsg) +-{ +- /* Compile errors are created adding 100 to the error code returned +- * by PCRE. +- * If errcode is known we put the translatable error message in +- * erromsg. If errcode is unknown we put the generic +- * G_REGEX_ERROR_COMPILE error code in errcode and keep the +- * untranslated error message returned by PCRE. +- * Note that there can be more PCRE errors with the same GRegexError +- * and that some PCRE errors are useless for us. +- */ +- *errcode += 100; +- +- switch (*errcode) +- { +- case G_REGEX_ERROR_STRAY_BACKSLASH: +- *errmsg = _("\\ at end of pattern"); +- break; +- case G_REGEX_ERROR_MISSING_CONTROL_CHAR: +- *errmsg = _("\\c at end of pattern"); +- break; +- case G_REGEX_ERROR_UNRECOGNIZED_ESCAPE: +- *errmsg = _("unrecognized character following \\"); +- break; +- case G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER: +- *errmsg = _("numbers out of order in {} quantifier"); +- break; +- case G_REGEX_ERROR_QUANTIFIER_TOO_BIG: +- *errmsg = _("number too big in {} quantifier"); +- break; +- case G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS: +- *errmsg = _("missing terminating ] for character class"); +- break; +- case G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS: +- *errmsg = _("invalid escape sequence in character class"); +- break; +- case G_REGEX_ERROR_RANGE_OUT_OF_ORDER: +- *errmsg = _("range out of order in character class"); +- break; +- case G_REGEX_ERROR_NOTHING_TO_REPEAT: +- *errmsg = _("nothing to repeat"); +- break; +- case 111: /* internal error: unexpected repeat */ +- *errcode = G_REGEX_ERROR_INTERNAL; +- *errmsg = _("unexpected repeat"); +- break; +- case G_REGEX_ERROR_UNRECOGNIZED_CHARACTER: +- *errmsg = _("unrecognized character after (? or (?-"); +- break; +- case G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS: +- *errmsg = _("POSIX named classes are supported only within a class"); +- break; +- case G_REGEX_ERROR_UNMATCHED_PARENTHESIS: +- *errmsg = _("missing terminating )"); +- break; +- case G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE: +- *errmsg = _("reference to non-existent subpattern"); +- break; +- case G_REGEX_ERROR_UNTERMINATED_COMMENT: +- *errmsg = _("missing ) after comment"); +- break; +- case G_REGEX_ERROR_EXPRESSION_TOO_LARGE: +- *errmsg = _("regular expression is too large"); +- break; +- case G_REGEX_ERROR_MEMORY_ERROR: +- *errmsg = _("failed to get memory"); +- break; +- case 122: /* unmatched parentheses */ +- *errcode = G_REGEX_ERROR_UNMATCHED_PARENTHESIS; +- *errmsg = _(") without opening ("); +- break; +- case 123: /* internal error: code overflow */ +- *errcode = G_REGEX_ERROR_INTERNAL; +- *errmsg = _("code overflow"); +- break; +- case 124: /* "unrecognized character after (?<\0 */ +- *errcode = G_REGEX_ERROR_UNRECOGNIZED_CHARACTER; +- *errmsg = _("unrecognized character after (?<"); +- break; +- case G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND: +- *errmsg = _("lookbehind assertion is not fixed length"); +- break; +- case G_REGEX_ERROR_MALFORMED_CONDITION: +- *errmsg = _("malformed number or name after (?("); +- break; +- case G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES: +- *errmsg = _("conditional group contains more than two branches"); +- break; +- case G_REGEX_ERROR_ASSERTION_EXPECTED: +- *errmsg = _("assertion expected after (?("); +- break; +- case 129: +- *errcode = G_REGEX_ERROR_UNMATCHED_PARENTHESIS; +- /* translators: '(?R' and '(?[+-]digits' are both meant as (groups of) +- * sequences here, '(?-54' would be an example for the second group. +- */ +- *errmsg = _("(?R or (?[+-]digits must be followed by )"); +- break; +- case G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME: +- *errmsg = _("unknown POSIX class name"); +- break; +- case G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED: +- *errmsg = _("POSIX collating elements are not supported"); +- break; +- case G_REGEX_ERROR_HEX_CODE_TOO_LARGE: +- *errmsg = _("character value in \\x{...} sequence is too large"); +- break; +- case G_REGEX_ERROR_INVALID_CONDITION: +- *errmsg = _("invalid condition (?(0)"); +- break; +- case G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND: +- *errmsg = _("\\C not allowed in lookbehind assertion"); +- break; +- case 137: /* PCRE does not support \\L, \\l, \\N{name}, \\U, or \\u\0 */ +- /* A number of Perl escapes are not handled by PCRE. +- * Therefore it explicitly raises ERR37. +- */ +- *errcode = G_REGEX_ERROR_UNRECOGNIZED_ESCAPE; +- *errmsg = _("escapes \\L, \\l, \\N{name}, \\U, and \\u are not supported"); +- break; +- case G_REGEX_ERROR_INFINITE_LOOP: +- *errmsg = _("recursive call could loop indefinitely"); +- break; +- case 141: /* unrecognized character after (?P\0 */ +- *errcode = G_REGEX_ERROR_UNRECOGNIZED_CHARACTER; +- *errmsg = _("unrecognized character after (?P"); +- break; +- case G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR: +- *errmsg = _("missing terminator in subpattern name"); +- break; +- case G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME: +- *errmsg = _("two named subpatterns have the same name"); +- break; +- case G_REGEX_ERROR_MALFORMED_PROPERTY: +- *errmsg = _("malformed \\P or \\p sequence"); +- break; +- case G_REGEX_ERROR_UNKNOWN_PROPERTY: +- *errmsg = _("unknown property name after \\P or \\p"); +- break; +- case G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG: +- *errmsg = _("subpattern name is too long (maximum 32 characters)"); +- break; +- case G_REGEX_ERROR_TOO_MANY_SUBPATTERNS: +- *errmsg = _("too many named subpatterns (maximum 10,000)"); +- break; +- case G_REGEX_ERROR_INVALID_OCTAL_VALUE: +- *errmsg = _("octal value is greater than \\377"); +- break; +- case 152: /* internal error: overran compiling workspace */ +- *errcode = G_REGEX_ERROR_INTERNAL; +- *errmsg = _("overran compiling workspace"); +- break; +- case 153: /* internal error: previously-checked referenced subpattern not found */ +- *errcode = G_REGEX_ERROR_INTERNAL; +- *errmsg = _("previously-checked referenced subpattern not found"); +- break; +- case G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE: +- *errmsg = _("DEFINE group contains more than one branch"); +- break; +- case G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS: +- *errmsg = _("inconsistent NEWLINE options"); +- break; +- case G_REGEX_ERROR_MISSING_BACK_REFERENCE: +- *errmsg = _("\\g is not followed by a braced, angle-bracketed, or quoted name or " +- "number, or by a plain number"); +- break; +- case G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE: +- *errmsg = _("a numbered reference must not be zero"); +- break; +- case G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN: +- *errmsg = _("an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)"); +- break; +- case G_REGEX_ERROR_UNKNOWN_BACKTRACKING_CONTROL_VERB: +- *errmsg = _("(*VERB) not recognized"); +- break; +- case G_REGEX_ERROR_NUMBER_TOO_BIG: +- *errmsg = _("number is too big"); +- break; +- case G_REGEX_ERROR_MISSING_SUBPATTERN_NAME: +- *errmsg = _("missing subpattern name after (?&"); +- break; +- case G_REGEX_ERROR_MISSING_DIGIT: +- *errmsg = _("digit expected after (?+"); +- break; +- case G_REGEX_ERROR_INVALID_DATA_CHARACTER: +- *errmsg = _("] is an invalid data character in JavaScript compatibility mode"); +- break; +- case G_REGEX_ERROR_EXTRA_SUBPATTERN_NAME: +- *errmsg = _("different names for subpatterns of the same number are not allowed"); +- break; +- case G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED: +- *errmsg = _("(*MARK) must have an argument"); +- break; +- case G_REGEX_ERROR_INVALID_CONTROL_CHAR: +- *errmsg = _( "\\c must be followed by an ASCII character"); +- break; +- case G_REGEX_ERROR_MISSING_NAME: +- *errmsg = _("\\k is not followed by a braced, angle-bracketed, or quoted name"); +- break; +- case G_REGEX_ERROR_NOT_SUPPORTED_IN_CLASS: +- *errmsg = _("\\N is not supported in a class"); +- break; +- case G_REGEX_ERROR_TOO_MANY_FORWARD_REFERENCES: +- *errmsg = _("too many forward references"); +- break; +- case G_REGEX_ERROR_NAME_TOO_LONG: +- *errmsg = _("name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)"); +- break; +- case G_REGEX_ERROR_CHARACTER_VALUE_TOO_LARGE: +- *errmsg = _("character value in \\u.... sequence is too large"); +- break; +- +- case 116: /* erroffset passed as NULL */ +- /* This should not happen as we never pass a NULL erroffset */ +- g_warning ("erroffset passed as NULL"); +- *errcode = G_REGEX_ERROR_COMPILE; +- break; +- case 117: /* unknown option bit(s) set */ +- /* This should not happen as we check options before passing them +- * to pcre_compile2() */ +- g_warning ("unknown option bit(s) set"); +- *errcode = G_REGEX_ERROR_COMPILE; +- break; +- case 132: /* this version of PCRE is compiled without UTF support */ +- case 144: /* invalid UTF-8 string */ +- case 145: /* support for \\P, \\p, and \\X has not been compiled */ +- case 167: /* this version of PCRE is not compiled with Unicode property support */ +- case 173: /* disallowed Unicode code point (>= 0xd800 && <= 0xdfff) */ +- case 174: /* invalid UTF-16 string */ +- /* These errors should not happen as we are using an UTF-8 and UCP-enabled PCRE +- * and we do not check if strings are valid */ +- case 170: /* internal error: unknown opcode in find_fixedlength() */ +- *errcode = G_REGEX_ERROR_INTERNAL; +- break; +- +- default: +- *errcode = G_REGEX_ERROR_COMPILE; +- } +-} +- +-/* GMatchInfo */ +- +-static GMatchInfo * +-match_info_new (const GRegex *regex, +- const gchar *string, +- gint string_len, +- gint start_position, +- gint match_options, +- gboolean is_dfa) +-{ +- GMatchInfo *match_info; +- +- if (string_len < 0) +- string_len = strlen (string); +- +- match_info = g_new0 (GMatchInfo, 1); +- match_info->ref_count = 1; +- match_info->regex = g_regex_ref ((GRegex *)regex); +- match_info->string = string; +- match_info->string_len = string_len; +- match_info->matches = PCRE_ERROR_NOMATCH; +- match_info->pos = start_position; +- match_info->match_opts = match_options; +- +- if (is_dfa) +- { +- /* These values should be enough for most cases, if they are not +- * enough g_regex_match_all_full() will expand them. */ +- match_info->n_offsets = 24; +- match_info->n_workspace = 100; +- match_info->workspace = g_new (gint, match_info->n_workspace); +- } +- else +- { +- gint capture_count; +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_CAPTURECOUNT, &capture_count); +- match_info->n_offsets = (capture_count + 1) * 3; +- } +- +- match_info->offsets = g_new0 (gint, match_info->n_offsets); +- /* Set an invalid position for the previous match. */ +- match_info->offsets[0] = -1; +- match_info->offsets[1] = -1; +- +- return match_info; +-} +- +-/** +- * g_match_info_get_regex: +- * @match_info: a #GMatchInfo +- * +- * Returns #GRegex object used in @match_info. It belongs to Glib +- * and must not be freed. Use g_regex_ref() if you need to keep it +- * after you free @match_info object. +- * +- * Returns: #GRegex object used in @match_info +- * +- * Since: 2.14 +- */ +-GRegex * +-g_match_info_get_regex (const GMatchInfo *match_info) +-{ +- g_return_val_if_fail (match_info != NULL, NULL); +- return match_info->regex; +-} +- +-/** +- * g_match_info_get_string: +- * @match_info: a #GMatchInfo +- * +- * Returns the string searched with @match_info. This is the +- * string passed to g_regex_match() or g_regex_replace() so +- * you may not free it before calling this function. +- * +- * Returns: the string searched with @match_info +- * +- * Since: 2.14 +- */ +-const gchar * +-g_match_info_get_string (const GMatchInfo *match_info) +-{ +- g_return_val_if_fail (match_info != NULL, NULL); +- return match_info->string; +-} +- +-/** +- * g_match_info_ref: +- * @match_info: a #GMatchInfo +- * +- * Increases reference count of @match_info by 1. +- * +- * Returns: @match_info +- * +- * Since: 2.30 +- */ +-GMatchInfo * +-g_match_info_ref (GMatchInfo *match_info) +-{ +- g_return_val_if_fail (match_info != NULL, NULL); +- g_atomic_int_inc (&match_info->ref_count); +- return match_info; +-} +- +-/** +- * g_match_info_unref: +- * @match_info: a #GMatchInfo +- * +- * Decreases reference count of @match_info by 1. When reference count drops +- * to zero, it frees all the memory associated with the match_info structure. +- * +- * Since: 2.30 +- */ +-void +-g_match_info_unref (GMatchInfo *match_info) +-{ +- if (g_atomic_int_dec_and_test (&match_info->ref_count)) +- { +- g_regex_unref (match_info->regex); +- g_free (match_info->offsets); +- g_free (match_info->workspace); +- g_free (match_info); +- } +-} +- +-/** +- * g_match_info_free: +- * @match_info: (nullable): a #GMatchInfo, or %NULL +- * +- * If @match_info is not %NULL, calls g_match_info_unref(); otherwise does +- * nothing. +- * +- * Since: 2.14 +- */ +-void +-g_match_info_free (GMatchInfo *match_info) +-{ +- if (match_info == NULL) +- return; +- +- g_match_info_unref (match_info); +-} +- +-/** +- * g_match_info_next: +- * @match_info: a #GMatchInfo structure +- * @error: location to store the error occurring, or %NULL to ignore errors +- * +- * Scans for the next match using the same parameters of the previous +- * call to g_regex_match_full() or g_regex_match() that returned +- * @match_info. +- * +- * The match is done on the string passed to the match function, so you +- * cannot free it before calling this function. +- * +- * Returns: %TRUE is the string matched, %FALSE otherwise +- * +- * Since: 2.14 +- */ +-gboolean +-g_match_info_next (GMatchInfo *match_info, +- GError **error) +-{ +- gint prev_match_start; +- gint prev_match_end; +- +- g_return_val_if_fail (match_info != NULL, FALSE); +- g_return_val_if_fail (error == NULL || *error == NULL, FALSE); +- g_return_val_if_fail (match_info->pos >= 0, FALSE); +- +- prev_match_start = match_info->offsets[0]; +- prev_match_end = match_info->offsets[1]; +- +- if (match_info->pos > match_info->string_len) +- { +- /* we have reached the end of the string */ +- match_info->pos = -1; +- match_info->matches = PCRE_ERROR_NOMATCH; +- return FALSE; +- } +- +- match_info->matches = pcre_exec (match_info->regex->pcre_re, +- match_info->regex->extra, +- match_info->string, +- match_info->string_len, +- match_info->pos, +- match_info->regex->match_opts | match_info->match_opts, +- match_info->offsets, +- match_info->n_offsets); +- if (IS_PCRE_ERROR (match_info->matches)) +- { +- g_set_error (error, G_REGEX_ERROR, G_REGEX_ERROR_MATCH, +- _("Error while matching regular expression %s: %s"), +- match_info->regex->pattern, match_error (match_info->matches)); +- return FALSE; +- } +- +- /* avoid infinite loops if the pattern is an empty string or something +- * equivalent */ +- if (match_info->pos == match_info->offsets[1]) +- { +- if (match_info->pos > match_info->string_len) +- { +- /* we have reached the end of the string */ +- match_info->pos = -1; +- match_info->matches = PCRE_ERROR_NOMATCH; +- return FALSE; +- } +- +- match_info->pos = NEXT_CHAR (match_info->regex, +- &match_info->string[match_info->pos]) - +- match_info->string; +- } +- else +- { +- match_info->pos = match_info->offsets[1]; +- } +- +- /* it's possible to get two identical matches when we are matching +- * empty strings, for instance if the pattern is "(?=[A-Z0-9])" and +- * the string is "RegExTest" we have: +- * - search at position 0: match from 0 to 0 +- * - search at position 1: match from 3 to 3 +- * - search at position 3: match from 3 to 3 (duplicate) +- * - search at position 4: match from 5 to 5 +- * - search at position 5: match from 5 to 5 (duplicate) +- * - search at position 6: no match -> stop +- * so we have to ignore the duplicates. +- * see bug #515944: http://bugzilla.gnome.org/show_bug.cgi?id=515944 */ +- if (match_info->matches >= 0 && +- prev_match_start == match_info->offsets[0] && +- prev_match_end == match_info->offsets[1]) +- { +- /* ignore this match and search the next one */ +- return g_match_info_next (match_info, error); +- } +- +- return match_info->matches >= 0; +-} +- +-/** +- * g_match_info_matches: +- * @match_info: a #GMatchInfo structure +- * +- * Returns whether the previous match operation succeeded. +- * +- * Returns: %TRUE if the previous match operation succeeded, +- * %FALSE otherwise +- * +- * Since: 2.14 +- */ +-gboolean +-g_match_info_matches (const GMatchInfo *match_info) +-{ +- g_return_val_if_fail (match_info != NULL, FALSE); +- +- return match_info->matches >= 0; +-} +- +-/** +- * g_match_info_get_match_count: +- * @match_info: a #GMatchInfo structure +- * +- * Retrieves the number of matched substrings (including substring 0, +- * that is the whole matched text), so 1 is returned if the pattern +- * has no substrings in it and 0 is returned if the match failed. +- * +- * If the last match was obtained using the DFA algorithm, that is +- * using g_regex_match_all() or g_regex_match_all_full(), the retrieved +- * count is not that of the number of capturing parentheses but that of +- * the number of matched substrings. +- * +- * Returns: Number of matched substrings, or -1 if an error occurred +- * +- * Since: 2.14 +- */ +-gint +-g_match_info_get_match_count (const GMatchInfo *match_info) +-{ +- g_return_val_if_fail (match_info, -1); +- +- if (match_info->matches == PCRE_ERROR_NOMATCH) +- /* no match */ +- return 0; +- else if (match_info->matches < PCRE_ERROR_NOMATCH) +- /* error */ +- return -1; +- else +- /* match */ +- return match_info->matches; +-} +- +-/** +- * g_match_info_is_partial_match: +- * @match_info: a #GMatchInfo structure +- * +- * Usually if the string passed to g_regex_match*() matches as far as +- * it goes, but is too short to match the entire pattern, %FALSE is +- * returned. There are circumstances where it might be helpful to +- * distinguish this case from other cases in which there is no match. +- * +- * Consider, for example, an application where a human is required to +- * type in data for a field with specific formatting requirements. An +- * example might be a date in the form ddmmmyy, defined by the pattern +- * "^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$". +- * If the application sees the user’s keystrokes one by one, and can +- * check that what has been typed so far is potentially valid, it is +- * able to raise an error as soon as a mistake is made. +- * +- * GRegex supports the concept of partial matching by means of the +- * #G_REGEX_MATCH_PARTIAL_SOFT and #G_REGEX_MATCH_PARTIAL_HARD flags. +- * When they are used, the return code for +- * g_regex_match() or g_regex_match_full() is, as usual, %TRUE +- * for a complete match, %FALSE otherwise. But, when these functions +- * return %FALSE, you can check if the match was partial calling +- * g_match_info_is_partial_match(). +- * +- * The difference between #G_REGEX_MATCH_PARTIAL_SOFT and +- * #G_REGEX_MATCH_PARTIAL_HARD is that when a partial match is encountered +- * with #G_REGEX_MATCH_PARTIAL_SOFT, matching continues to search for a +- * possible complete match, while with #G_REGEX_MATCH_PARTIAL_HARD matching +- * stops at the partial match. +- * When both #G_REGEX_MATCH_PARTIAL_SOFT and #G_REGEX_MATCH_PARTIAL_HARD +- * are set, the latter takes precedence. +- * +- * There were formerly some restrictions on the pattern for partial matching. +- * The restrictions no longer apply. +- * +- * See pcrepartial(3) for more information on partial matching. +- * +- * Returns: %TRUE if the match was partial, %FALSE otherwise +- * +- * Since: 2.14 +- */ +-gboolean +-g_match_info_is_partial_match (const GMatchInfo *match_info) +-{ +- g_return_val_if_fail (match_info != NULL, FALSE); +- +- return match_info->matches == PCRE_ERROR_PARTIAL; +-} +- +-/** +- * g_match_info_expand_references: +- * @match_info: (nullable): a #GMatchInfo or %NULL +- * @string_to_expand: the string to expand +- * @error: location to store the error occurring, or %NULL to ignore errors +- * +- * Returns a new string containing the text in @string_to_expand with +- * references and escape sequences expanded. References refer to the last +- * match done with @string against @regex and have the same syntax used by +- * g_regex_replace(). +- * +- * The @string_to_expand must be UTF-8 encoded even if #G_REGEX_RAW was +- * passed to g_regex_new(). +- * +- * The backreferences are extracted from the string passed to the match +- * function, so you cannot call this function after freeing the string. +- * +- * @match_info may be %NULL in which case @string_to_expand must not +- * contain references. For instance "foo\n" does not refer to an actual +- * pattern and '\n' merely will be replaced with \n character, +- * while to expand "\0" (whole match) one needs the result of a match. +- * Use g_regex_check_replacement() to find out whether @string_to_expand +- * contains references. +- * +- * Returns: (nullable): the expanded string, or %NULL if an error occurred +- * +- * Since: 2.14 +- */ +-gchar * +-g_match_info_expand_references (const GMatchInfo *match_info, +- const gchar *string_to_expand, +- GError **error) +-{ +- GString *result; +- GList *list; +- GError *tmp_error = NULL; +- +- g_return_val_if_fail (string_to_expand != NULL, NULL); +- g_return_val_if_fail (error == NULL || *error == NULL, NULL); +- +- list = split_replacement (string_to_expand, &tmp_error); +- if (tmp_error != NULL) +- { +- g_propagate_error (error, tmp_error); +- return NULL; +- } +- +- if (!match_info && interpolation_list_needs_match (list)) +- { +- g_critical ("String '%s' contains references to the match, can't " +- "expand references without GMatchInfo object", +- string_to_expand); +- return NULL; +- } +- +- result = g_string_sized_new (strlen (string_to_expand)); +- interpolate_replacement (match_info, result, list); +- +- g_list_free_full (list, (GDestroyNotify) free_interpolation_data); +- +- return g_string_free (result, FALSE); +-} +- +-/** +- * g_match_info_fetch: +- * @match_info: #GMatchInfo structure +- * @match_num: number of the sub expression +- * +- * Retrieves the text matching the @match_num'th capturing +- * parentheses. 0 is the full text of the match, 1 is the first paren +- * set, 2 the second, and so on. +- * +- * If @match_num is a valid sub pattern but it didn't match anything +- * (e.g. sub pattern 1, matching "b" against "(a)?b") then an empty +- * string is returned. +- * +- * If the match was obtained using the DFA algorithm, that is using +- * g_regex_match_all() or g_regex_match_all_full(), the retrieved +- * string is not that of a set of parentheses but that of a matched +- * substring. Substrings are matched in reverse order of length, so +- * 0 is the longest match. +- * +- * The string is fetched from the string passed to the match function, +- * so you cannot call this function after freeing the string. +- * +- * Returns: (nullable): The matched substring, or %NULL if an error +- * occurred. You have to free the string yourself +- * +- * Since: 2.14 +- */ +-gchar * +-g_match_info_fetch (const GMatchInfo *match_info, +- gint match_num) +-{ +- /* we cannot use pcre_get_substring() because it allocates the +- * string using pcre_malloc(). */ +- gchar *match = NULL; +- gint start, end; +- +- g_return_val_if_fail (match_info != NULL, NULL); +- g_return_val_if_fail (match_num >= 0, NULL); +- +- /* match_num does not exist or it didn't matched, i.e. matching "b" +- * against "(a)?b" then group 0 is empty. */ +- if (!g_match_info_fetch_pos (match_info, match_num, &start, &end)) +- match = NULL; +- else if (start == -1) +- match = g_strdup (""); +- else +- match = g_strndup (&match_info->string[start], end - start); +- +- return match; +-} +- +-/** +- * g_match_info_fetch_pos: +- * @match_info: #GMatchInfo structure +- * @match_num: number of the sub expression +- * @start_pos: (out) (optional): pointer to location where to store +- * the start position, or %NULL +- * @end_pos: (out) (optional): pointer to location where to store +- * the end position, or %NULL +- * +- * Retrieves the position in bytes of the @match_num'th capturing +- * parentheses. 0 is the full text of the match, 1 is the first +- * paren set, 2 the second, and so on. +- * +- * If @match_num is a valid sub pattern but it didn't match anything +- * (e.g. sub pattern 1, matching "b" against "(a)?b") then @start_pos +- * and @end_pos are set to -1 and %TRUE is returned. +- * +- * If the match was obtained using the DFA algorithm, that is using +- * g_regex_match_all() or g_regex_match_all_full(), the retrieved +- * position is not that of a set of parentheses but that of a matched +- * substring. Substrings are matched in reverse order of length, so +- * 0 is the longest match. +- * +- * Returns: %TRUE if the position was fetched, %FALSE otherwise. If +- * the position cannot be fetched, @start_pos and @end_pos are left +- * unchanged +- * +- * Since: 2.14 +- */ +-gboolean +-g_match_info_fetch_pos (const GMatchInfo *match_info, +- gint match_num, +- gint *start_pos, +- gint *end_pos) +-{ +- g_return_val_if_fail (match_info != NULL, FALSE); +- g_return_val_if_fail (match_num >= 0, FALSE); +- +- /* make sure the sub expression number they're requesting is less than +- * the total number of sub expressions that were matched. */ +- if (match_num >= match_info->matches) +- return FALSE; +- +- if (start_pos != NULL) +- *start_pos = match_info->offsets[2 * match_num]; +- +- if (end_pos != NULL) +- *end_pos = match_info->offsets[2 * match_num + 1]; +- +- return TRUE; +-} +- +-/* +- * Returns number of first matched subpattern with name @name. +- * There may be more than one in case when DUPNAMES is used, +- * and not all subpatterns with that name match; +- * pcre_get_stringnumber() does not work in that case. +- */ +-static gint +-get_matched_substring_number (const GMatchInfo *match_info, +- const gchar *name) +-{ +- gint entrysize; +- gchar *first, *last; +- guchar *entry; +- +- if (!(match_info->regex->compile_opts & G_REGEX_DUPNAMES)) +- return pcre_get_stringnumber (match_info->regex->pcre_re, name); +- +- /* This code is copied from pcre_get.c: get_first_set() */ +- entrysize = pcre_get_stringtable_entries (match_info->regex->pcre_re, +- name, +- &first, +- &last); +- +- if (entrysize <= 0) +- return entrysize; +- +- for (entry = (guchar*) first; entry <= (guchar*) last; entry += entrysize) +- { +- gint n = (entry[0] << 8) + entry[1]; +- if (match_info->offsets[n*2] >= 0) +- return n; +- } +- +- return (first[0] << 8) + first[1]; +-} +- +-/** +- * g_match_info_fetch_named: +- * @match_info: #GMatchInfo structure +- * @name: name of the subexpression +- * +- * Retrieves the text matching the capturing parentheses named @name. +- * +- * If @name is a valid sub pattern name but it didn't match anything +- * (e.g. sub pattern "X", matching "b" against "(?Pa)?b") +- * then an empty string is returned. +- * +- * The string is fetched from the string passed to the match function, +- * so you cannot call this function after freeing the string. +- * +- * Returns: (nullable): The matched substring, or %NULL if an error +- * occurred. You have to free the string yourself +- * +- * Since: 2.14 +- */ +-gchar * +-g_match_info_fetch_named (const GMatchInfo *match_info, +- const gchar *name) +-{ +- /* we cannot use pcre_get_named_substring() because it allocates the +- * string using pcre_malloc(). */ +- gint num; +- +- g_return_val_if_fail (match_info != NULL, NULL); +- g_return_val_if_fail (name != NULL, NULL); +- +- num = get_matched_substring_number (match_info, name); +- if (num < 0) +- return NULL; +- else +- return g_match_info_fetch (match_info, num); +-} +- +-/** +- * g_match_info_fetch_named_pos: +- * @match_info: #GMatchInfo structure +- * @name: name of the subexpression +- * @start_pos: (out) (optional): pointer to location where to store +- * the start position, or %NULL +- * @end_pos: (out) (optional): pointer to location where to store +- * the end position, or %NULL +- * +- * Retrieves the position in bytes of the capturing parentheses named @name. +- * +- * If @name is a valid sub pattern name but it didn't match anything +- * (e.g. sub pattern "X", matching "b" against "(?Pa)?b") +- * then @start_pos and @end_pos are set to -1 and %TRUE is returned. +- * +- * Returns: %TRUE if the position was fetched, %FALSE otherwise. +- * If the position cannot be fetched, @start_pos and @end_pos +- * are left unchanged. +- * +- * Since: 2.14 +- */ +-gboolean +-g_match_info_fetch_named_pos (const GMatchInfo *match_info, +- const gchar *name, +- gint *start_pos, +- gint *end_pos) +-{ +- gint num; +- +- g_return_val_if_fail (match_info != NULL, FALSE); +- g_return_val_if_fail (name != NULL, FALSE); +- +- num = get_matched_substring_number (match_info, name); +- if (num < 0) +- return FALSE; +- +- return g_match_info_fetch_pos (match_info, num, start_pos, end_pos); +-} +- +-/** +- * g_match_info_fetch_all: +- * @match_info: a #GMatchInfo structure +- * +- * Bundles up pointers to each of the matching substrings from a match +- * and stores them in an array of gchar pointers. The first element in +- * the returned array is the match number 0, i.e. the entire matched +- * text. +- * +- * If a sub pattern didn't match anything (e.g. sub pattern 1, matching +- * "b" against "(a)?b") then an empty string is inserted. +- * +- * If the last match was obtained using the DFA algorithm, that is using +- * g_regex_match_all() or g_regex_match_all_full(), the retrieved +- * strings are not that matched by sets of parentheses but that of the +- * matched substring. Substrings are matched in reverse order of length, +- * so the first one is the longest match. +- * +- * The strings are fetched from the string passed to the match function, +- * so you cannot call this function after freeing the string. +- * +- * Returns: (transfer full): a %NULL-terminated array of gchar * +- * pointers. It must be freed using g_strfreev(). If the previous +- * match failed %NULL is returned +- * +- * Since: 2.14 +- */ +-gchar ** +-g_match_info_fetch_all (const GMatchInfo *match_info) +-{ +- /* we cannot use pcre_get_substring_list() because the returned value +- * isn't suitable for g_strfreev(). */ +- gchar **result; +- gint i; +- +- g_return_val_if_fail (match_info != NULL, NULL); +- +- if (match_info->matches < 0) +- return NULL; +- +- result = g_new (gchar *, match_info->matches + 1); +- for (i = 0; i < match_info->matches; i++) +- result[i] = g_match_info_fetch (match_info, i); +- result[i] = NULL; +- +- return result; +-} +- +- +-/* GRegex */ +- +-G_DEFINE_QUARK (g-regex-error-quark, g_regex_error) +- +-/** +- * g_regex_ref: +- * @regex: a #GRegex +- * +- * Increases reference count of @regex by 1. +- * +- * Returns: @regex +- * +- * Since: 2.14 +- */ +-GRegex * +-g_regex_ref (GRegex *regex) +-{ +- g_return_val_if_fail (regex != NULL, NULL); +- g_atomic_int_inc (®ex->ref_count); +- return regex; +-} +- +-/** +- * g_regex_unref: +- * @regex: a #GRegex +- * +- * Decreases reference count of @regex by 1. When reference count drops +- * to zero, it frees all the memory associated with the regex structure. +- * +- * Since: 2.14 +- */ +-void +-g_regex_unref (GRegex *regex) +-{ +- g_return_if_fail (regex != NULL); +- +- if (g_atomic_int_dec_and_test (®ex->ref_count)) +- { +- g_free (regex->pattern); +- if (regex->pcre_re != NULL) +- pcre_free (regex->pcre_re); +- if (regex->extra != NULL) +- pcre_free (regex->extra); +- g_free (regex); +- } +-} +- +-/* +- * @match_options: (inout) (optional): +- */ +-static pcre *regex_compile (const gchar *pattern, +- GRegexCompileFlags compile_options, +- GRegexCompileFlags *compile_options_out, +- GRegexMatchFlags *match_options, +- GError **error); +- +-/** +- * g_regex_new: +- * @pattern: the regular expression +- * @compile_options: compile options for the regular expression, or 0 +- * @match_options: match options for the regular expression, or 0 +- * @error: return location for a #GError +- * +- * Compiles the regular expression to an internal form, and does +- * the initial setup of the #GRegex structure. +- * +- * Returns: (nullable): a #GRegex structure or %NULL if an error occured. Call +- * g_regex_unref() when you are done with it +- * +- * Since: 2.14 +- */ +-GRegex * +-g_regex_new (const gchar *pattern, +- GRegexCompileFlags compile_options, +- GRegexMatchFlags match_options, +- GError **error) +-{ +- GRegex *regex; +- pcre *re; +- const gchar *errmsg; +- gboolean optimize = FALSE; +- static volatile gsize initialised = 0; +- +- g_return_val_if_fail (pattern != NULL, NULL); +- g_return_val_if_fail (error == NULL || *error == NULL, NULL); +- g_return_val_if_fail ((compile_options & ~G_REGEX_COMPILE_MASK) == 0, NULL); +- g_return_val_if_fail ((match_options & ~G_REGEX_MATCH_MASK) == 0, NULL); +- +- if (g_once_init_enter (&initialised)) +- { +- int supports_utf8, supports_ucp; +- +- pcre_config (PCRE_CONFIG_UTF8, &supports_utf8); +- if (!supports_utf8) +- g_critical (_("PCRE library is compiled without UTF8 support")); +- +- pcre_config (PCRE_CONFIG_UNICODE_PROPERTIES, &supports_ucp); +- if (!supports_ucp) +- g_critical (_("PCRE library is compiled without UTF8 properties support")); +- +- g_once_init_leave (&initialised, supports_utf8 && supports_ucp ? 1 : 2); +- } +- +- if (G_UNLIKELY (initialised != 1)) +- { +- g_set_error_literal (error, G_REGEX_ERROR, G_REGEX_ERROR_COMPILE, +- _("PCRE library is compiled with incompatible options")); +- return NULL; +- } +- +- /* G_REGEX_OPTIMIZE has the same numeric value of PCRE_NO_UTF8_CHECK, +- * as we do not need to wrap PCRE_NO_UTF8_CHECK. */ +- if (compile_options & G_REGEX_OPTIMIZE) +- optimize = TRUE; +- +- re = regex_compile (pattern, compile_options, &compile_options, +- &match_options, error); +- +- if (re == NULL) +- return NULL; +- +- regex = g_new0 (GRegex, 1); +- regex->ref_count = 1; +- regex->pattern = g_strdup (pattern); +- regex->pcre_re = re; +- regex->compile_opts = compile_options; +- regex->match_opts = match_options; +- +- if (optimize) +- { +- regex->extra = pcre_study (regex->pcre_re, 0, &errmsg); +- if (errmsg != NULL) +- { +- GError *tmp_error = g_error_new (G_REGEX_ERROR, +- G_REGEX_ERROR_OPTIMIZE, +- _("Error while optimizing " +- "regular expression %s: %s"), +- regex->pattern, +- errmsg); +- g_propagate_error (error, tmp_error); +- +- g_regex_unref (regex); +- return NULL; +- } +- } +- +- return regex; +-} +- +-static pcre * +-regex_compile (const gchar *pattern, +- GRegexCompileFlags compile_options, +- GRegexCompileFlags *compile_options_out, +- GRegexMatchFlags *match_options, +- GError **error) +-{ +- pcre *re; +- const gchar *errmsg; +- gint erroffset; +- gint errcode; +- GRegexCompileFlags nonpcre_compile_options; +- unsigned long int pcre_compile_options; +- +- nonpcre_compile_options = compile_options & G_REGEX_COMPILE_NONPCRE_MASK; +- +- /* In GRegex the string are, by default, UTF-8 encoded. PCRE +- * instead uses UTF-8 only if required with PCRE_UTF8. */ +- if (compile_options & G_REGEX_RAW) +- { +- /* disable utf-8 */ +- compile_options &= ~G_REGEX_RAW; +- } +- else +- { +- /* enable utf-8 */ +- compile_options |= PCRE_UTF8 | PCRE_NO_UTF8_CHECK; +- +- if (match_options != NULL) +- *match_options |= PCRE_NO_UTF8_CHECK; +- } +- +- /* PCRE_NEWLINE_ANY is the default for the internal PCRE but +- * not for the system one. */ +- if (!(compile_options & G_REGEX_NEWLINE_CR) && +- !(compile_options & G_REGEX_NEWLINE_LF)) +- { +- compile_options |= PCRE_NEWLINE_ANY; +- } +- +- compile_options |= PCRE_UCP; +- +- /* PCRE_BSR_UNICODE is the default for the internal PCRE but +- * possibly not for the system one. +- */ +- if (~compile_options & G_REGEX_BSR_ANYCRLF) +- compile_options |= PCRE_BSR_UNICODE; +- +- /* compile the pattern */ +- re = pcre_compile2 (pattern, compile_options, &errcode, +- &errmsg, &erroffset, NULL); +- +- /* if the compilation failed, set the error member and return +- * immediately */ +- if (re == NULL) +- { +- GError *tmp_error; +- +- /* Translate the PCRE error code to GRegexError and use a translated +- * error message if possible */ +- translate_compile_error (&errcode, &errmsg); +- +- /* PCRE uses byte offsets but we want to show character offsets */ +- erroffset = g_utf8_pointer_to_offset (pattern, &pattern[erroffset]); +- +- tmp_error = g_error_new (G_REGEX_ERROR, errcode, +- _("Error while compiling regular " +- "expression %s at char %d: %s"), +- pattern, erroffset, errmsg); +- g_propagate_error (error, tmp_error); +- +- return NULL; +- } +- +- /* For options set at the beginning of the pattern, pcre puts them into +- * compile options, e.g. "(?i)foo" will make the pcre structure store +- * PCRE_CASELESS even though it wasn't explicitly given for compilation. */ +- pcre_fullinfo (re, NULL, PCRE_INFO_OPTIONS, &pcre_compile_options); +- compile_options = pcre_compile_options & G_REGEX_COMPILE_PCRE_MASK; +- +- /* Don't leak PCRE_NEWLINE_ANY, which is part of PCRE_NEWLINE_ANYCRLF */ +- if ((pcre_compile_options & PCRE_NEWLINE_ANYCRLF) != PCRE_NEWLINE_ANYCRLF) +- compile_options &= ~PCRE_NEWLINE_ANY; +- +- compile_options |= nonpcre_compile_options; +- +- if (!(compile_options & G_REGEX_DUPNAMES)) +- { +- gboolean jchanged = FALSE; +- pcre_fullinfo (re, NULL, PCRE_INFO_JCHANGED, &jchanged); +- if (jchanged) +- compile_options |= G_REGEX_DUPNAMES; +- } +- +- if (compile_options_out != 0) +- *compile_options_out = compile_options; +- +- return re; +-} +- +-/** +- * g_regex_get_pattern: +- * @regex: a #GRegex structure +- * +- * Gets the pattern string associated with @regex, i.e. a copy of +- * the string passed to g_regex_new(). +- * +- * Returns: the pattern of @regex +- * +- * Since: 2.14 +- */ +-const gchar * +-g_regex_get_pattern (const GRegex *regex) +-{ +- g_return_val_if_fail (regex != NULL, NULL); +- +- return regex->pattern; +-} +- +-/** +- * g_regex_get_max_backref: +- * @regex: a #GRegex +- * +- * Returns the number of the highest back reference +- * in the pattern, or 0 if the pattern does not contain +- * back references. +- * +- * Returns: the number of the highest back reference +- * +- * Since: 2.14 +- */ +-gint +-g_regex_get_max_backref (const GRegex *regex) +-{ +- gint value; +- +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_BACKREFMAX, &value); +- +- return value; +-} +- +-/** +- * g_regex_get_capture_count: +- * @regex: a #GRegex +- * +- * Returns the number of capturing subpatterns in the pattern. +- * +- * Returns: the number of capturing subpatterns +- * +- * Since: 2.14 +- */ +-gint +-g_regex_get_capture_count (const GRegex *regex) +-{ +- gint value; +- +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_CAPTURECOUNT, &value); +- +- return value; +-} +- +-/** +- * g_regex_get_has_cr_or_lf: +- * @regex: a #GRegex structure +- * +- * Checks whether the pattern contains explicit CR or LF references. +- * +- * Returns: %TRUE if the pattern contains explicit CR or LF references +- * +- * Since: 2.34 +- */ +-gboolean +-g_regex_get_has_cr_or_lf (const GRegex *regex) +-{ +- gint value; +- +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_HASCRORLF, &value); +- +- return !!value; +-} +- +-/** +- * g_regex_get_max_lookbehind: +- * @regex: a #GRegex structure +- * +- * Gets the number of characters in the longest lookbehind assertion in the +- * pattern. This information is useful when doing multi-segment matching using +- * the partial matching facilities. +- * +- * Returns: the number of characters in the longest lookbehind assertion. +- * +- * Since: 2.38 +- */ +-gint +-g_regex_get_max_lookbehind (const GRegex *regex) +-{ +- gint max_lookbehind; +- +- pcre_fullinfo (regex->pcre_re, regex->extra, +- PCRE_INFO_MAXLOOKBEHIND, &max_lookbehind); +- +- return max_lookbehind; +-} +- +-/** +- * g_regex_get_compile_flags: +- * @regex: a #GRegex +- * +- * Returns the compile options that @regex was created with. +- * +- * Depending on the version of PCRE that is used, this may or may not +- * include flags set by option expressions such as `(?i)` found at the +- * top-level within the compiled pattern. +- * +- * Returns: flags from #GRegexCompileFlags +- * +- * Since: 2.26 +- */ +-GRegexCompileFlags +-g_regex_get_compile_flags (const GRegex *regex) +-{ +- g_return_val_if_fail (regex != NULL, 0); +- +- return regex->compile_opts; +-} +- +-/** +- * g_regex_get_match_flags: +- * @regex: a #GRegex +- * +- * Returns the match options that @regex was created with. +- * +- * Returns: flags from #GRegexMatchFlags +- * +- * Since: 2.26 +- */ +-GRegexMatchFlags +-g_regex_get_match_flags (const GRegex *regex) +-{ +- g_return_val_if_fail (regex != NULL, 0); +- +- return regex->match_opts & G_REGEX_MATCH_MASK; +-} +- +-/** +- * g_regex_match_simple: +- * @pattern: the regular expression +- * @string: the string to scan for matches +- * @compile_options: compile options for the regular expression, or 0 +- * @match_options: match options, or 0 +- * +- * Scans for a match in @string for @pattern. +- * +- * This function is equivalent to g_regex_match() but it does not +- * require to compile the pattern with g_regex_new(), avoiding some +- * lines of code when you need just to do a match without extracting +- * substrings, capture counts, and so on. +- * +- * If this function is to be called on the same @pattern more than +- * once, it's more efficient to compile the pattern once with +- * g_regex_new() and then use g_regex_match(). +- * +- * Returns: %TRUE if the string matched, %FALSE otherwise +- * +- * Since: 2.14 +- */ +-gboolean +-g_regex_match_simple (const gchar *pattern, +- const gchar *string, +- GRegexCompileFlags compile_options, +- GRegexMatchFlags match_options) +-{ +- GRegex *regex; +- gboolean result; +- +- regex = g_regex_new (pattern, compile_options, 0, NULL); +- if (!regex) +- return FALSE; +- result = g_regex_match_full (regex, string, -1, 0, match_options, NULL, NULL); +- g_regex_unref (regex); +- return result; +-} +- +-/** +- * g_regex_match: +- * @regex: a #GRegex structure from g_regex_new() +- * @string: the string to scan for matches +- * @match_options: match options +- * @match_info: (out) (optional): pointer to location where to store +- * the #GMatchInfo, or %NULL if you do not need it +- * +- * Scans for a match in string for the pattern in @regex. +- * The @match_options are combined with the match options specified +- * when the @regex structure was created, letting you have more +- * flexibility in reusing #GRegex structures. +- * +- * A #GMatchInfo structure, used to get information on the match, +- * is stored in @match_info if not %NULL. Note that if @match_info +- * is not %NULL then it is created even if the function returns %FALSE, +- * i.e. you must free it regardless if regular expression actually matched. +- * +- * To retrieve all the non-overlapping matches of the pattern in +- * string you can use g_match_info_next(). +- * +- * |[ +- * static void +- * print_uppercase_words (const gchar *string) +- * { +- * // Print all uppercase-only words. +- * GRegex *regex; +- * GMatchInfo *match_info; +- * +- * regex = g_regex_new ("[A-Z]+", 0, 0, NULL); +- * g_regex_match (regex, string, 0, &match_info); +- * while (g_match_info_matches (match_info)) +- * { +- * gchar *word = g_match_info_fetch (match_info, 0); +- * g_print ("Found: %s\n", word); +- * g_free (word); +- * g_match_info_next (match_info, NULL); +- * } +- * g_match_info_free (match_info); +- * g_regex_unref (regex); +- * } +- * ]| +- * +- * @string is not copied and is used in #GMatchInfo internally. If +- * you use any #GMatchInfo method (except g_match_info_free()) after +- * freeing or modifying @string then the behaviour is undefined. +- * +- * Returns: %TRUE is the string matched, %FALSE otherwise +- * +- * Since: 2.14 +- */ +-gboolean +-g_regex_match (const GRegex *regex, +- const gchar *string, +- GRegexMatchFlags match_options, +- GMatchInfo **match_info) +-{ +- return g_regex_match_full (regex, string, -1, 0, match_options, +- match_info, NULL); +-} +- +-/** +- * g_regex_match_full: +- * @regex: a #GRegex structure from g_regex_new() +- * @string: (array length=string_len): the string to scan for matches +- * @string_len: the length of @string, or -1 if @string is nul-terminated +- * @start_position: starting index of the string to match, in bytes +- * @match_options: match options +- * @match_info: (out) (optional): pointer to location where to store +- * the #GMatchInfo, or %NULL if you do not need it +- * @error: location to store the error occurring, or %NULL to ignore errors +- * +- * Scans for a match in string for the pattern in @regex. +- * The @match_options are combined with the match options specified +- * when the @regex structure was created, letting you have more +- * flexibility in reusing #GRegex structures. +- * +- * Setting @start_position differs from just passing over a shortened +- * string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern +- * that begins with any kind of lookbehind assertion, such as "\b". +- * +- * A #GMatchInfo structure, used to get information on the match, is +- * stored in @match_info if not %NULL. Note that if @match_info is +- * not %NULL then it is created even if the function returns %FALSE, +- * i.e. you must free it regardless if regular expression actually +- * matched. +- * +- * @string is not copied and is used in #GMatchInfo internally. If +- * you use any #GMatchInfo method (except g_match_info_free()) after +- * freeing or modifying @string then the behaviour is undefined. +- * +- * To retrieve all the non-overlapping matches of the pattern in +- * string you can use g_match_info_next(). +- * +- * |[ +- * static void +- * print_uppercase_words (const gchar *string) +- * { +- * // Print all uppercase-only words. +- * GRegex *regex; +- * GMatchInfo *match_info; +- * GError *error = NULL; +- * +- * regex = g_regex_new ("[A-Z]+", 0, 0, NULL); +- * g_regex_match_full (regex, string, -1, 0, 0, &match_info, &error); +- * while (g_match_info_matches (match_info)) +- * { +- * gchar *word = g_match_info_fetch (match_info, 0); +- * g_print ("Found: %s\n", word); +- * g_free (word); +- * g_match_info_next (match_info, &error); +- * } +- * g_match_info_free (match_info); +- * g_regex_unref (regex); +- * if (error != NULL) +- * { +- * g_printerr ("Error while matching: %s\n", error->message); +- * g_error_free (error); +- * } +- * } +- * ]| +- * +- * Returns: %TRUE is the string matched, %FALSE otherwise +- * +- * Since: 2.14 +- */ +-gboolean +-g_regex_match_full (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- GRegexMatchFlags match_options, +- GMatchInfo **match_info, +- GError **error) +-{ +- GMatchInfo *info; +- gboolean match_ok; +- +- g_return_val_if_fail (regex != NULL, FALSE); +- g_return_val_if_fail (string != NULL, FALSE); +- g_return_val_if_fail (start_position >= 0, FALSE); +- g_return_val_if_fail (error == NULL || *error == NULL, FALSE); +- g_return_val_if_fail ((match_options & ~G_REGEX_MATCH_MASK) == 0, FALSE); +- +- info = match_info_new (regex, string, string_len, start_position, +- match_options, FALSE); +- match_ok = g_match_info_next (info, error); +- if (match_info != NULL) +- *match_info = info; +- else +- g_match_info_free (info); +- +- return match_ok; +-} +- +-/** +- * g_regex_match_all: +- * @regex: a #GRegex structure from g_regex_new() +- * @string: the string to scan for matches +- * @match_options: match options +- * @match_info: (out) (optional): pointer to location where to store +- * the #GMatchInfo, or %NULL if you do not need it +- * +- * Using the standard algorithm for regular expression matching only +- * the longest match in the string is retrieved. This function uses +- * a different algorithm so it can retrieve all the possible matches. +- * For more documentation see g_regex_match_all_full(). +- * +- * A #GMatchInfo structure, used to get information on the match, is +- * stored in @match_info if not %NULL. Note that if @match_info is +- * not %NULL then it is created even if the function returns %FALSE, +- * i.e. you must free it regardless if regular expression actually +- * matched. +- * +- * @string is not copied and is used in #GMatchInfo internally. If +- * you use any #GMatchInfo method (except g_match_info_free()) after +- * freeing or modifying @string then the behaviour is undefined. +- * +- * Returns: %TRUE is the string matched, %FALSE otherwise +- * +- * Since: 2.14 +- */ +-gboolean +-g_regex_match_all (const GRegex *regex, +- const gchar *string, +- GRegexMatchFlags match_options, +- GMatchInfo **match_info) +-{ +- return g_regex_match_all_full (regex, string, -1, 0, match_options, +- match_info, NULL); +-} +- +-/** +- * g_regex_match_all_full: +- * @regex: a #GRegex structure from g_regex_new() +- * @string: (array length=string_len): the string to scan for matches +- * @string_len: the length of @string, or -1 if @string is nul-terminated +- * @start_position: starting index of the string to match, in bytes +- * @match_options: match options +- * @match_info: (out) (optional): pointer to location where to store +- * the #GMatchInfo, or %NULL if you do not need it +- * @error: location to store the error occurring, or %NULL to ignore errors +- * +- * Using the standard algorithm for regular expression matching only +- * the longest match in the string is retrieved, it is not possible +- * to obtain all the available matches. For instance matching +- * " " against the pattern "<.*>" +- * you get " ". +- * +- * This function uses a different algorithm (called DFA, i.e. deterministic +- * finite automaton), so it can retrieve all the possible matches, all +- * starting at the same point in the string. For instance matching +- * " " against the pattern "<.*>;" +- * you would obtain three matches: " ", +- * " " and "". +- * +- * The number of matched strings is retrieved using +- * g_match_info_get_match_count(). To obtain the matched strings and +- * their position you can use, respectively, g_match_info_fetch() and +- * g_match_info_fetch_pos(). Note that the strings are returned in +- * reverse order of length; that is, the longest matching string is +- * given first. +- * +- * Note that the DFA algorithm is slower than the standard one and it +- * is not able to capture substrings, so backreferences do not work. +- * +- * Setting @start_position differs from just passing over a shortened +- * string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern +- * that begins with any kind of lookbehind assertion, such as "\b". +- * +- * A #GMatchInfo structure, used to get information on the match, is +- * stored in @match_info if not %NULL. Note that if @match_info is +- * not %NULL then it is created even if the function returns %FALSE, +- * i.e. you must free it regardless if regular expression actually +- * matched. +- * +- * @string is not copied and is used in #GMatchInfo internally. If +- * you use any #GMatchInfo method (except g_match_info_free()) after +- * freeing or modifying @string then the behaviour is undefined. +- * +- * Returns: %TRUE is the string matched, %FALSE otherwise +- * +- * Since: 2.14 +- */ +-gboolean +-g_regex_match_all_full (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- GRegexMatchFlags match_options, +- GMatchInfo **match_info, +- GError **error) +-{ +- GMatchInfo *info; +- gboolean done; +- pcre *pcre_re; +- pcre_extra *extra; +- gboolean retval; +- +- g_return_val_if_fail (regex != NULL, FALSE); +- g_return_val_if_fail (string != NULL, FALSE); +- g_return_val_if_fail (start_position >= 0, FALSE); +- g_return_val_if_fail (error == NULL || *error == NULL, FALSE); +- g_return_val_if_fail ((match_options & ~G_REGEX_MATCH_MASK) == 0, FALSE); +- +-#ifdef PCRE_NO_AUTO_POSSESS +- /* For PCRE >= 8.34 we need to turn off PCRE_NO_AUTO_POSSESS, which +- * is an optimization for normal regex matching, but results in omitting +- * some shorter matches here, and an observable behaviour change. +- * +- * DFA matching is rather niche, and very rarely used according to +- * codesearch.debian.net, so don't bother caching the recompiled RE. */ +- pcre_re = regex_compile (regex->pattern, +- regex->compile_opts | PCRE_NO_AUTO_POSSESS, +- NULL, NULL, error); +- +- if (pcre_re == NULL) +- return FALSE; +- +- /* Not bothering to cache the optimization data either, with similar +- * reasoning */ +- extra = NULL; +-#else +- /* For PCRE < 8.33 the precompiled regex is fine. */ +- pcre_re = regex->pcre_re; +- extra = regex->extra; +-#endif +- +- info = match_info_new (regex, string, string_len, start_position, +- match_options, TRUE); +- +- done = FALSE; +- while (!done) +- { +- done = TRUE; +- info->matches = pcre_dfa_exec (pcre_re, extra, +- info->string, info->string_len, +- info->pos, +- regex->match_opts | match_options, +- info->offsets, info->n_offsets, +- info->workspace, info->n_workspace); +- if (info->matches == PCRE_ERROR_DFA_WSSIZE) +- { +- /* info->workspace is too small. */ +- info->n_workspace *= 2; +- info->workspace = g_realloc (info->workspace, +- info->n_workspace * sizeof (gint)); +- done = FALSE; +- } +- else if (info->matches == 0) +- { +- /* info->offsets is too small. */ +- info->n_offsets *= 2; +- info->offsets = g_realloc (info->offsets, +- info->n_offsets * sizeof (gint)); +- done = FALSE; +- } +- else if (IS_PCRE_ERROR (info->matches)) +- { +- g_set_error (error, G_REGEX_ERROR, G_REGEX_ERROR_MATCH, +- _("Error while matching regular expression %s: %s"), +- regex->pattern, match_error (info->matches)); +- } +- } +- +-#ifdef PCRE_NO_AUTO_POSSESS +- pcre_free (pcre_re); +-#endif +- +- /* set info->pos to -1 so that a call to g_match_info_next() fails. */ +- info->pos = -1; +- retval = info->matches >= 0; +- +- if (match_info != NULL) +- *match_info = info; +- else +- g_match_info_free (info); +- +- return retval; +-} +- +-/** +- * g_regex_get_string_number: +- * @regex: #GRegex structure +- * @name: name of the subexpression +- * +- * Retrieves the number of the subexpression named @name. +- * +- * Returns: The number of the subexpression or -1 if @name +- * does not exists +- * +- * Since: 2.14 +- */ +-gint +-g_regex_get_string_number (const GRegex *regex, +- const gchar *name) +-{ +- gint num; +- +- g_return_val_if_fail (regex != NULL, -1); +- g_return_val_if_fail (name != NULL, -1); +- +- num = pcre_get_stringnumber (regex->pcre_re, name); +- if (num == PCRE_ERROR_NOSUBSTRING) +- num = -1; +- +- return num; +-} +- +-/** +- * g_regex_split_simple: +- * @pattern: the regular expression +- * @string: the string to scan for matches +- * @compile_options: compile options for the regular expression, or 0 +- * @match_options: match options, or 0 +- * +- * Breaks the string on the pattern, and returns an array of +- * the tokens. If the pattern contains capturing parentheses, +- * then the text for each of the substrings will also be returned. +- * If the pattern does not match anywhere in the string, then the +- * whole string is returned as the first token. +- * +- * This function is equivalent to g_regex_split() but it does +- * not require to compile the pattern with g_regex_new(), avoiding +- * some lines of code when you need just to do a split without +- * extracting substrings, capture counts, and so on. +- * +- * If this function is to be called on the same @pattern more than +- * once, it's more efficient to compile the pattern once with +- * g_regex_new() and then use g_regex_split(). +- * +- * As a special case, the result of splitting the empty string "" +- * is an empty vector, not a vector containing a single string. +- * The reason for this special case is that being able to represent +- * a empty vector is typically more useful than consistent handling +- * of empty elements. If you do need to represent empty elements, +- * you'll need to check for the empty string before calling this +- * function. +- * +- * A pattern that can match empty strings splits @string into +- * separate characters wherever it matches the empty string between +- * characters. For example splitting "ab c" using as a separator +- * "\s*", you will get "a", "b" and "c". +- * +- * Returns: (transfer full): a %NULL-terminated array of strings. Free +- * it using g_strfreev() +- * +- * Since: 2.14 +- **/ +-gchar ** +-g_regex_split_simple (const gchar *pattern, +- const gchar *string, +- GRegexCompileFlags compile_options, +- GRegexMatchFlags match_options) +-{ +- GRegex *regex; +- gchar **result; +- +- regex = g_regex_new (pattern, compile_options, 0, NULL); +- if (!regex) +- return NULL; +- +- result = g_regex_split_full (regex, string, -1, 0, match_options, 0, NULL); +- g_regex_unref (regex); +- return result; +-} +- +-/** +- * g_regex_split: +- * @regex: a #GRegex structure +- * @string: the string to split with the pattern +- * @match_options: match time option flags +- * +- * Breaks the string on the pattern, and returns an array of the tokens. +- * If the pattern contains capturing parentheses, then the text for each +- * of the substrings will also be returned. If the pattern does not match +- * anywhere in the string, then the whole string is returned as the first +- * token. +- * +- * As a special case, the result of splitting the empty string "" is an +- * empty vector, not a vector containing a single string. The reason for +- * this special case is that being able to represent a empty vector is +- * typically more useful than consistent handling of empty elements. If +- * you do need to represent empty elements, you'll need to check for the +- * empty string before calling this function. +- * +- * A pattern that can match empty strings splits @string into separate +- * characters wherever it matches the empty string between characters. +- * For example splitting "ab c" using as a separator "\s*", you will get +- * "a", "b" and "c". +- * +- * Returns: (transfer full): a %NULL-terminated gchar ** array. Free +- * it using g_strfreev() +- * +- * Since: 2.14 +- **/ +-gchar ** +-g_regex_split (const GRegex *regex, +- const gchar *string, +- GRegexMatchFlags match_options) +-{ +- return g_regex_split_full (regex, string, -1, 0, +- match_options, 0, NULL); +-} +- +-/** +- * g_regex_split_full: +- * @regex: a #GRegex structure +- * @string: (array length=string_len): the string to split with the pattern +- * @string_len: the length of @string, or -1 if @string is nul-terminated +- * @start_position: starting index of the string to match, in bytes +- * @match_options: match time option flags +- * @max_tokens: the maximum number of tokens to split @string into. +- * If this is less than 1, the string is split completely +- * @error: return location for a #GError +- * +- * Breaks the string on the pattern, and returns an array of the tokens. +- * If the pattern contains capturing parentheses, then the text for each +- * of the substrings will also be returned. If the pattern does not match +- * anywhere in the string, then the whole string is returned as the first +- * token. +- * +- * As a special case, the result of splitting the empty string "" is an +- * empty vector, not a vector containing a single string. The reason for +- * this special case is that being able to represent a empty vector is +- * typically more useful than consistent handling of empty elements. If +- * you do need to represent empty elements, you'll need to check for the +- * empty string before calling this function. +- * +- * A pattern that can match empty strings splits @string into separate +- * characters wherever it matches the empty string between characters. +- * For example splitting "ab c" using as a separator "\s*", you will get +- * "a", "b" and "c". +- * +- * Setting @start_position differs from just passing over a shortened +- * string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern +- * that begins with any kind of lookbehind assertion, such as "\b". +- * +- * Returns: (transfer full): a %NULL-terminated gchar ** array. Free +- * it using g_strfreev() +- * +- * Since: 2.14 +- **/ +-gchar ** +-g_regex_split_full (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- GRegexMatchFlags match_options, +- gint max_tokens, +- GError **error) +-{ +- GError *tmp_error = NULL; +- GMatchInfo *match_info; +- GList *list, *last; +- gint i; +- gint token_count; +- gboolean match_ok; +- /* position of the last separator. */ +- gint last_separator_end; +- /* was the last match 0 bytes long? */ +- gboolean last_match_is_empty; +- /* the returned array of char **s */ +- gchar **string_list; +- +- g_return_val_if_fail (regex != NULL, NULL); +- g_return_val_if_fail (string != NULL, NULL); +- g_return_val_if_fail (start_position >= 0, NULL); +- g_return_val_if_fail (error == NULL || *error == NULL, NULL); +- g_return_val_if_fail ((match_options & ~G_REGEX_MATCH_MASK) == 0, NULL); +- +- if (max_tokens <= 0) +- max_tokens = G_MAXINT; +- +- if (string_len < 0) +- string_len = strlen (string); +- +- /* zero-length string */ +- if (string_len - start_position == 0) +- return g_new0 (gchar *, 1); +- +- if (max_tokens == 1) +- { +- string_list = g_new0 (gchar *, 2); +- string_list[0] = g_strndup (&string[start_position], +- string_len - start_position); +- return string_list; +- } +- +- list = NULL; +- token_count = 0; +- last_separator_end = start_position; +- last_match_is_empty = FALSE; +- +- match_ok = g_regex_match_full (regex, string, string_len, start_position, +- match_options, &match_info, &tmp_error); +- +- while (tmp_error == NULL) +- { +- if (match_ok) +- { +- last_match_is_empty = +- (match_info->offsets[0] == match_info->offsets[1]); +- +- /* we need to skip empty separators at the same position of the end +- * of another separator. e.g. the string is "a b" and the separator +- * is " *", so from 1 to 2 we have a match and at position 2 we have +- * an empty match. */ +- if (last_separator_end != match_info->offsets[1]) +- { +- gchar *token; +- gint match_count; +- +- token = g_strndup (string + last_separator_end, +- match_info->offsets[0] - last_separator_end); +- list = g_list_prepend (list, token); +- token_count++; +- +- /* if there were substrings, these need to be added to +- * the list. */ +- match_count = g_match_info_get_match_count (match_info); +- if (match_count > 1) +- { +- for (i = 1; i < match_count; i++) +- list = g_list_prepend (list, g_match_info_fetch (match_info, i)); +- } +- } +- } +- else +- { +- /* if there was no match, copy to end of string. */ +- if (!last_match_is_empty) +- { +- gchar *token = g_strndup (string + last_separator_end, +- match_info->string_len - last_separator_end); +- list = g_list_prepend (list, token); +- } +- /* no more tokens, end the loop. */ +- break; +- } +- +- /* -1 to leave room for the last part. */ +- if (token_count >= max_tokens - 1) +- { +- /* we have reached the maximum number of tokens, so we copy +- * the remaining part of the string. */ +- if (last_match_is_empty) +- { +- /* the last match was empty, so we have moved one char +- * after the real position to avoid empty matches at the +- * same position. */ +- match_info->pos = PREV_CHAR (regex, &string[match_info->pos]) - string; +- } +- /* the if is needed in the case we have terminated the available +- * tokens, but we are at the end of the string, so there are no +- * characters left to copy. */ +- if (string_len > match_info->pos) +- { +- gchar *token = g_strndup (string + match_info->pos, +- string_len - match_info->pos); +- list = g_list_prepend (list, token); +- } +- /* end the loop. */ +- break; +- } +- +- last_separator_end = match_info->pos; +- if (last_match_is_empty) +- /* if the last match was empty, g_match_info_next() has moved +- * forward to avoid infinite loops, but we still need to copy that +- * character. */ +- last_separator_end = PREV_CHAR (regex, &string[last_separator_end]) - string; +- +- match_ok = g_match_info_next (match_info, &tmp_error); +- } +- g_match_info_free (match_info); +- if (tmp_error != NULL) +- { +- g_propagate_error (error, tmp_error); +- g_list_free_full (list, g_free); +- return NULL; +- } +- +- string_list = g_new (gchar *, g_list_length (list) + 1); +- i = 0; +- for (last = g_list_last (list); last; last = g_list_previous (last)) +- string_list[i++] = last->data; +- string_list[i] = NULL; +- g_list_free (list); +- +- return string_list; +-} +- +-enum +-{ +- REPL_TYPE_STRING, +- REPL_TYPE_CHARACTER, +- REPL_TYPE_SYMBOLIC_REFERENCE, +- REPL_TYPE_NUMERIC_REFERENCE, +- REPL_TYPE_CHANGE_CASE +-}; +- +-typedef enum +-{ +- CHANGE_CASE_NONE = 1 << 0, +- CHANGE_CASE_UPPER = 1 << 1, +- CHANGE_CASE_LOWER = 1 << 2, +- CHANGE_CASE_UPPER_SINGLE = 1 << 3, +- CHANGE_CASE_LOWER_SINGLE = 1 << 4, +- CHANGE_CASE_SINGLE_MASK = CHANGE_CASE_UPPER_SINGLE | CHANGE_CASE_LOWER_SINGLE, +- CHANGE_CASE_LOWER_MASK = CHANGE_CASE_LOWER | CHANGE_CASE_LOWER_SINGLE, +- CHANGE_CASE_UPPER_MASK = CHANGE_CASE_UPPER | CHANGE_CASE_UPPER_SINGLE +-} ChangeCase; +- +-struct _InterpolationData +-{ +- gchar *text; +- gint type; +- gint num; +- gchar c; +- ChangeCase change_case; +-}; +- +-static void +-free_interpolation_data (InterpolationData *data) +-{ +- g_free (data->text); +- g_free (data); +-} +- +-static const gchar * +-expand_escape (const gchar *replacement, +- const gchar *p, +- InterpolationData *data, +- GError **error) +-{ +- const gchar *q, *r; +- gint x, d, h, i; +- const gchar *error_detail; +- gint base = 0; +- GError *tmp_error = NULL; +- +- p++; +- switch (*p) +- { +- case 't': +- p++; +- data->c = '\t'; +- data->type = REPL_TYPE_CHARACTER; +- break; +- case 'n': +- p++; +- data->c = '\n'; +- data->type = REPL_TYPE_CHARACTER; +- break; +- case 'v': +- p++; +- data->c = '\v'; +- data->type = REPL_TYPE_CHARACTER; +- break; +- case 'r': +- p++; +- data->c = '\r'; +- data->type = REPL_TYPE_CHARACTER; +- break; +- case 'f': +- p++; +- data->c = '\f'; +- data->type = REPL_TYPE_CHARACTER; +- break; +- case 'a': +- p++; +- data->c = '\a'; +- data->type = REPL_TYPE_CHARACTER; +- break; +- case 'b': +- p++; +- data->c = '\b'; +- data->type = REPL_TYPE_CHARACTER; +- break; +- case '\\': +- p++; +- data->c = '\\'; +- data->type = REPL_TYPE_CHARACTER; +- break; +- case 'x': +- p++; +- x = 0; +- if (*p == '{') +- { +- p++; +- do +- { +- h = g_ascii_xdigit_value (*p); +- if (h < 0) +- { +- error_detail = _("hexadecimal digit or “}” expected"); +- goto error; +- } +- x = x * 16 + h; +- p++; +- } +- while (*p != '}'); +- p++; +- } +- else +- { +- for (i = 0; i < 2; i++) +- { +- h = g_ascii_xdigit_value (*p); +- if (h < 0) +- { +- error_detail = _("hexadecimal digit expected"); +- goto error; +- } +- x = x * 16 + h; +- p++; +- } +- } +- data->type = REPL_TYPE_STRING; +- data->text = g_new0 (gchar, 8); +- g_unichar_to_utf8 (x, data->text); +- break; +- case 'l': +- p++; +- data->type = REPL_TYPE_CHANGE_CASE; +- data->change_case = CHANGE_CASE_LOWER_SINGLE; +- break; +- case 'u': +- p++; +- data->type = REPL_TYPE_CHANGE_CASE; +- data->change_case = CHANGE_CASE_UPPER_SINGLE; +- break; +- case 'L': +- p++; +- data->type = REPL_TYPE_CHANGE_CASE; +- data->change_case = CHANGE_CASE_LOWER; +- break; +- case 'U': +- p++; +- data->type = REPL_TYPE_CHANGE_CASE; +- data->change_case = CHANGE_CASE_UPPER; +- break; +- case 'E': +- p++; +- data->type = REPL_TYPE_CHANGE_CASE; +- data->change_case = CHANGE_CASE_NONE; +- break; +- case 'g': +- p++; +- if (*p != '<') +- { +- error_detail = _("missing “<” in symbolic reference"); +- goto error; +- } +- q = p + 1; +- do +- { +- p++; +- if (!*p) +- { +- error_detail = _("unfinished symbolic reference"); +- goto error; +- } +- } +- while (*p != '>'); +- if (p - q == 0) +- { +- error_detail = _("zero-length symbolic reference"); +- goto error; +- } +- if (g_ascii_isdigit (*q)) +- { +- x = 0; +- do +- { +- h = g_ascii_digit_value (*q); +- if (h < 0) +- { +- error_detail = _("digit expected"); +- p = q; +- goto error; +- } +- x = x * 10 + h; +- q++; +- } +- while (q != p); +- data->num = x; +- data->type = REPL_TYPE_NUMERIC_REFERENCE; +- } +- else +- { +- r = q; +- do +- { +- if (!g_ascii_isalnum (*r)) +- { +- error_detail = _("illegal symbolic reference"); +- p = r; +- goto error; +- } +- r++; +- } +- while (r != p); +- data->text = g_strndup (q, p - q); +- data->type = REPL_TYPE_SYMBOLIC_REFERENCE; +- } +- p++; +- break; +- case '0': +- /* if \0 is followed by a number is an octal number representing a +- * character, else it is a numeric reference. */ +- if (g_ascii_digit_value (*g_utf8_next_char (p)) >= 0) +- { +- base = 8; +- p = g_utf8_next_char (p); +- } +- case '1': +- case '2': +- case '3': +- case '4': +- case '5': +- case '6': +- case '7': +- case '8': +- case '9': +- x = 0; +- d = 0; +- for (i = 0; i < 3; i++) +- { +- h = g_ascii_digit_value (*p); +- if (h < 0) +- break; +- if (h > 7) +- { +- if (base == 8) +- break; +- else +- base = 10; +- } +- if (i == 2 && base == 10) +- break; +- x = x * 8 + h; +- d = d * 10 + h; +- p++; +- } +- if (base == 8 || i == 3) +- { +- data->type = REPL_TYPE_STRING; +- data->text = g_new0 (gchar, 8); +- g_unichar_to_utf8 (x, data->text); +- } +- else +- { +- data->type = REPL_TYPE_NUMERIC_REFERENCE; +- data->num = d; +- } +- break; +- case 0: +- error_detail = _("stray final “\\”"); +- goto error; +- break; +- default: +- error_detail = _("unknown escape sequence"); +- goto error; +- } +- +- return p; +- +- error: +- /* G_GSSIZE_FORMAT doesn't work with gettext, so we use %lu */ +- tmp_error = g_error_new (G_REGEX_ERROR, +- G_REGEX_ERROR_REPLACE, +- _("Error while parsing replacement " +- "text “%s” at char %lu: %s"), +- replacement, +- (gulong)(p - replacement), +- error_detail); +- g_propagate_error (error, tmp_error); +- +- return NULL; +-} +- +-static GList * +-split_replacement (const gchar *replacement, +- GError **error) +-{ +- GList *list = NULL; +- InterpolationData *data; +- const gchar *p, *start; +- +- start = p = replacement; +- while (*p) +- { +- if (*p == '\\') +- { +- data = g_new0 (InterpolationData, 1); +- start = p = expand_escape (replacement, p, data, error); +- if (p == NULL) +- { +- g_list_free_full (list, (GDestroyNotify) free_interpolation_data); +- free_interpolation_data (data); +- +- return NULL; +- } +- list = g_list_prepend (list, data); +- } +- else +- { +- p++; +- if (*p == '\\' || *p == '\0') +- { +- if (p - start > 0) +- { +- data = g_new0 (InterpolationData, 1); +- data->text = g_strndup (start, p - start); +- data->type = REPL_TYPE_STRING; +- list = g_list_prepend (list, data); +- } +- } +- } +- } +- +- return g_list_reverse (list); +-} +- +-/* Change the case of c based on change_case. */ +-#define CHANGE_CASE(c, change_case) \ +- (((change_case) & CHANGE_CASE_LOWER_MASK) ? \ +- g_unichar_tolower (c) : \ +- g_unichar_toupper (c)) +- +-static void +-string_append (GString *string, +- const gchar *text, +- ChangeCase *change_case) +-{ +- gunichar c; +- +- if (text[0] == '\0') +- return; +- +- if (*change_case == CHANGE_CASE_NONE) +- { +- g_string_append (string, text); +- } +- else if (*change_case & CHANGE_CASE_SINGLE_MASK) +- { +- c = g_utf8_get_char (text); +- g_string_append_unichar (string, CHANGE_CASE (c, *change_case)); +- g_string_append (string, g_utf8_next_char (text)); +- *change_case = CHANGE_CASE_NONE; +- } +- else +- { +- while (*text != '\0') +- { +- c = g_utf8_get_char (text); +- g_string_append_unichar (string, CHANGE_CASE (c, *change_case)); +- text = g_utf8_next_char (text); +- } +- } +-} +- +-static gboolean +-interpolate_replacement (const GMatchInfo *match_info, +- GString *result, +- gpointer data) +-{ +- GList *list; +- InterpolationData *idata; +- gchar *match; +- ChangeCase change_case = CHANGE_CASE_NONE; +- +- for (list = data; list; list = list->next) +- { +- idata = list->data; +- switch (idata->type) +- { +- case REPL_TYPE_STRING: +- string_append (result, idata->text, &change_case); +- break; +- case REPL_TYPE_CHARACTER: +- g_string_append_c (result, CHANGE_CASE (idata->c, change_case)); +- if (change_case & CHANGE_CASE_SINGLE_MASK) +- change_case = CHANGE_CASE_NONE; +- break; +- case REPL_TYPE_NUMERIC_REFERENCE: +- match = g_match_info_fetch (match_info, idata->num); +- if (match) +- { +- string_append (result, match, &change_case); +- g_free (match); +- } +- break; +- case REPL_TYPE_SYMBOLIC_REFERENCE: +- match = g_match_info_fetch_named (match_info, idata->text); +- if (match) +- { +- string_append (result, match, &change_case); +- g_free (match); +- } +- break; +- case REPL_TYPE_CHANGE_CASE: +- change_case = idata->change_case; +- break; +- } +- } +- +- return FALSE; +-} +- +-/* whether actual match_info is needed for replacement, i.e. +- * whether there are references +- */ +-static gboolean +-interpolation_list_needs_match (GList *list) +-{ +- while (list != NULL) +- { +- InterpolationData *data = list->data; +- +- if (data->type == REPL_TYPE_SYMBOLIC_REFERENCE || +- data->type == REPL_TYPE_NUMERIC_REFERENCE) +- { +- return TRUE; +- } +- +- list = list->next; +- } +- +- return FALSE; +-} +- +-/** +- * g_regex_replace: +- * @regex: a #GRegex structure +- * @string: (array length=string_len): the string to perform matches against +- * @string_len: the length of @string, or -1 if @string is nul-terminated +- * @start_position: starting index of the string to match, in bytes +- * @replacement: text to replace each match with +- * @match_options: options for the match +- * @error: location to store the error occurring, or %NULL to ignore errors +- * +- * Replaces all occurrences of the pattern in @regex with the +- * replacement text. Backreferences of the form '\number' or +- * '\g' in the replacement text are interpolated by the +- * number-th captured subexpression of the match, '\g' refers +- * to the captured subexpression with the given name. '\0' refers +- * to the complete match, but '\0' followed by a number is the octal +- * representation of a character. To include a literal '\' in the +- * replacement, write '\\\\'. +- * +- * There are also escapes that changes the case of the following text: +- * +- * - \l: Convert to lower case the next character +- * - \u: Convert to upper case the next character +- * - \L: Convert to lower case till \E +- * - \U: Convert to upper case till \E +- * - \E: End case modification +- * +- * If you do not need to use backreferences use g_regex_replace_literal(). +- * +- * The @replacement string must be UTF-8 encoded even if #G_REGEX_RAW was +- * passed to g_regex_new(). If you want to use not UTF-8 encoded stings +- * you can use g_regex_replace_literal(). +- * +- * Setting @start_position differs from just passing over a shortened +- * string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern that +- * begins with any kind of lookbehind assertion, such as "\b". +- * +- * Returns: a newly allocated string containing the replacements +- * +- * Since: 2.14 +- */ +-gchar * +-g_regex_replace (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- const gchar *replacement, +- GRegexMatchFlags match_options, +- GError **error) +-{ +- gchar *result; +- GList *list; +- GError *tmp_error = NULL; +- +- g_return_val_if_fail (regex != NULL, NULL); +- g_return_val_if_fail (string != NULL, NULL); +- g_return_val_if_fail (start_position >= 0, NULL); +- g_return_val_if_fail (replacement != NULL, NULL); +- g_return_val_if_fail (error == NULL || *error == NULL, NULL); +- g_return_val_if_fail ((match_options & ~G_REGEX_MATCH_MASK) == 0, NULL); +- +- list = split_replacement (replacement, &tmp_error); +- if (tmp_error != NULL) +- { +- g_propagate_error (error, tmp_error); +- return NULL; +- } +- +- result = g_regex_replace_eval (regex, +- string, string_len, start_position, +- match_options, +- interpolate_replacement, +- (gpointer)list, +- &tmp_error); +- if (tmp_error != NULL) +- g_propagate_error (error, tmp_error); +- +- g_list_free_full (list, (GDestroyNotify) free_interpolation_data); +- +- return result; +-} +- +-static gboolean +-literal_replacement (const GMatchInfo *match_info, +- GString *result, +- gpointer data) +-{ +- g_string_append (result, data); +- return FALSE; +-} +- +-/** +- * g_regex_replace_literal: +- * @regex: a #GRegex structure +- * @string: (array length=string_len): the string to perform matches against +- * @string_len: the length of @string, or -1 if @string is nul-terminated +- * @start_position: starting index of the string to match, in bytes +- * @replacement: text to replace each match with +- * @match_options: options for the match +- * @error: location to store the error occurring, or %NULL to ignore errors +- * +- * Replaces all occurrences of the pattern in @regex with the +- * replacement text. @replacement is replaced literally, to +- * include backreferences use g_regex_replace(). +- * +- * Setting @start_position differs from just passing over a +- * shortened string and setting #G_REGEX_MATCH_NOTBOL in the +- * case of a pattern that begins with any kind of lookbehind +- * assertion, such as "\b". +- * +- * Returns: a newly allocated string containing the replacements +- * +- * Since: 2.14 +- */ +-gchar * +-g_regex_replace_literal (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- const gchar *replacement, +- GRegexMatchFlags match_options, +- GError **error) +-{ +- g_return_val_if_fail (replacement != NULL, NULL); +- g_return_val_if_fail ((match_options & ~G_REGEX_MATCH_MASK) == 0, NULL); +- +- return g_regex_replace_eval (regex, +- string, string_len, start_position, +- match_options, +- literal_replacement, +- (gpointer)replacement, +- error); +-} +- +-/** +- * g_regex_replace_eval: +- * @regex: a #GRegex structure from g_regex_new() +- * @string: (array length=string_len): string to perform matches against +- * @string_len: the length of @string, or -1 if @string is nul-terminated +- * @start_position: starting index of the string to match, in bytes +- * @match_options: options for the match +- * @eval: a function to call for each match +- * @user_data: user data to pass to the function +- * @error: location to store the error occurring, or %NULL to ignore errors +- * +- * Replaces occurrences of the pattern in regex with the output of +- * @eval for that occurrence. +- * +- * Setting @start_position differs from just passing over a shortened +- * string and setting #G_REGEX_MATCH_NOTBOL in the case of a pattern +- * that begins with any kind of lookbehind assertion, such as "\b". +- * +- * The following example uses g_regex_replace_eval() to replace multiple +- * strings at once: +- * |[ +- * static gboolean +- * eval_cb (const GMatchInfo *info, +- * GString *res, +- * gpointer data) +- * { +- * gchar *match; +- * gchar *r; +- * +- * match = g_match_info_fetch (info, 0); +- * r = g_hash_table_lookup ((GHashTable *)data, match); +- * g_string_append (res, r); +- * g_free (match); +- * +- * return FALSE; +- * } +- * +- * ... +- * +- * GRegex *reg; +- * GHashTable *h; +- * gchar *res; +- * +- * h = g_hash_table_new (g_str_hash, g_str_equal); +- * +- * g_hash_table_insert (h, "1", "ONE"); +- * g_hash_table_insert (h, "2", "TWO"); +- * g_hash_table_insert (h, "3", "THREE"); +- * g_hash_table_insert (h, "4", "FOUR"); +- * +- * reg = g_regex_new ("1|2|3|4", 0, 0, NULL); +- * res = g_regex_replace_eval (reg, text, -1, 0, 0, eval_cb, h, NULL); +- * g_hash_table_destroy (h); +- * +- * ... +- * ]| +- * +- * Returns: a newly allocated string containing the replacements +- * +- * Since: 2.14 +- */ +-gchar * +-g_regex_replace_eval (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- GRegexMatchFlags match_options, +- GRegexEvalCallback eval, +- gpointer user_data, +- GError **error) +-{ +- GMatchInfo *match_info; +- GString *result; +- gint str_pos = 0; +- gboolean done = FALSE; +- GError *tmp_error = NULL; +- +- g_return_val_if_fail (regex != NULL, NULL); +- g_return_val_if_fail (string != NULL, NULL); +- g_return_val_if_fail (start_position >= 0, NULL); +- g_return_val_if_fail (eval != NULL, NULL); +- g_return_val_if_fail ((match_options & ~G_REGEX_MATCH_MASK) == 0, NULL); +- +- if (string_len < 0) +- string_len = strlen (string); +- +- result = g_string_sized_new (string_len); +- +- /* run down the string making matches. */ +- g_regex_match_full (regex, string, string_len, start_position, +- match_options, &match_info, &tmp_error); +- while (!done && g_match_info_matches (match_info)) +- { +- g_string_append_len (result, +- string + str_pos, +- match_info->offsets[0] - str_pos); +- done = (*eval) (match_info, result, user_data); +- str_pos = match_info->offsets[1]; +- g_match_info_next (match_info, &tmp_error); +- } +- g_match_info_free (match_info); +- if (tmp_error != NULL) +- { +- g_propagate_error (error, tmp_error); +- g_string_free (result, TRUE); +- return NULL; +- } +- +- g_string_append_len (result, string + str_pos, string_len - str_pos); +- return g_string_free (result, FALSE); +-} +- +-/** +- * g_regex_check_replacement: +- * @replacement: the replacement string +- * @has_references: (out) (optional): location to store information about +- * references in @replacement or %NULL +- * @error: location to store error +- * +- * Checks whether @replacement is a valid replacement string +- * (see g_regex_replace()), i.e. that all escape sequences in +- * it are valid. +- * +- * If @has_references is not %NULL then @replacement is checked +- * for pattern references. For instance, replacement text 'foo\n' +- * does not contain references and may be evaluated without information +- * about actual match, but '\0\1' (whole match followed by first +- * subpattern) requires valid #GMatchInfo object. +- * +- * Returns: whether @replacement is a valid replacement string +- * +- * Since: 2.14 +- */ +-gboolean +-g_regex_check_replacement (const gchar *replacement, +- gboolean *has_references, +- GError **error) +-{ +- GList *list; +- GError *tmp = NULL; +- +- list = split_replacement (replacement, &tmp); +- +- if (tmp) +- { +- g_propagate_error (error, tmp); +- return FALSE; +- } +- +- if (has_references) +- *has_references = interpolation_list_needs_match (list); +- +- g_list_free_full (list, (GDestroyNotify) free_interpolation_data); +- +- return TRUE; +-} +- +-/** +- * g_regex_escape_nul: +- * @string: the string to escape +- * @length: the length of @string +- * +- * Escapes the nul characters in @string to "\x00". It can be used +- * to compile a regex with embedded nul characters. +- * +- * For completeness, @length can be -1 for a nul-terminated string. +- * In this case the output string will be of course equal to @string. +- * +- * Returns: a newly-allocated escaped string +- * +- * Since: 2.30 +- */ +-gchar * +-g_regex_escape_nul (const gchar *string, +- gint length) +-{ +- GString *escaped; +- const gchar *p, *piece_start, *end; +- gint backslashes; +- +- g_return_val_if_fail (string != NULL, NULL); +- +- if (length < 0) +- return g_strdup (string); +- +- end = string + length; +- p = piece_start = string; +- escaped = g_string_sized_new (length + 1); +- +- backslashes = 0; +- while (p < end) +- { +- switch (*p) +- { +- case '\0': +- if (p != piece_start) +- { +- /* copy the previous piece. */ +- g_string_append_len (escaped, piece_start, p - piece_start); +- } +- if ((backslashes & 1) == 0) +- g_string_append_c (escaped, '\\'); +- g_string_append_c (escaped, 'x'); +- g_string_append_c (escaped, '0'); +- g_string_append_c (escaped, '0'); +- piece_start = ++p; +- backslashes = 0; +- break; +- case '\\': +- backslashes++; +- ++p; +- break; +- default: +- backslashes = 0; +- p = g_utf8_next_char (p); +- break; +- } +- } +- +- if (piece_start < end) +- g_string_append_len (escaped, piece_start, end - piece_start); +- +- return g_string_free (escaped, FALSE); +-} +- +-/** +- * g_regex_escape_string: +- * @string: (array length=length): the string to escape +- * @length: the length of @string, or -1 if @string is nul-terminated +- * +- * Escapes the special characters used for regular expressions +- * in @string, for instance "a.b*c" becomes "a\.b\*c". This +- * function is useful to dynamically generate regular expressions. +- * +- * @string can contain nul characters that are replaced with "\0", +- * in this case remember to specify the correct length of @string +- * in @length. +- * +- * Returns: a newly-allocated escaped string +- * +- * Since: 2.14 +- */ +-gchar * +-g_regex_escape_string (const gchar *string, +- gint length) +-{ +- GString *escaped; +- const char *p, *piece_start, *end; +- +- g_return_val_if_fail (string != NULL, NULL); +- +- if (length < 0) +- length = strlen (string); +- +- end = string + length; +- p = piece_start = string; +- escaped = g_string_sized_new (length + 1); +- +- while (p < end) +- { +- switch (*p) +- { +- case '\0': +- case '\\': +- case '|': +- case '(': +- case ')': +- case '[': +- case ']': +- case '{': +- case '}': +- case '^': +- case '$': +- case '*': +- case '+': +- case '?': +- case '.': +- if (p != piece_start) +- /* copy the previous piece. */ +- g_string_append_len (escaped, piece_start, p - piece_start); +- g_string_append_c (escaped, '\\'); +- if (*p == '\0') +- g_string_append_c (escaped, '0'); +- else +- g_string_append_c (escaped, *p); +- piece_start = ++p; +- break; +- default: +- p = g_utf8_next_char (p); +- break; +- } +- } +- +- if (piece_start < end) +- g_string_append_len (escaped, piece_start, end - piece_start); +- +- return g_string_free (escaped, FALSE); +-} +Index: glib-2.56.4/glib/gregex.h +=================================================================== +--- glib-2.56.4.orig/glib/gregex.h ++++ glib-2.56.4/glib/gregex.h +@@ -1,609 +0,0 @@ +-/* GRegex -- regular expression API wrapper around PCRE. +- * +- * Copyright (C) 1999, 2000 Scott Wimer +- * Copyright (C) 2004, Matthias Clasen +- * Copyright (C) 2005 - 2007, Marco Barisione +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2.1 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public License +- * along with this library; if not, see . +- */ +- +-#ifndef __G_REGEX_H__ +-#define __G_REGEX_H__ +- +-#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) +-#error "Only can be included directly." +-#endif +- +-#include +-#include +- +-G_BEGIN_DECLS +- +-/** +- * GRegexError: +- * @G_REGEX_ERROR_COMPILE: Compilation of the regular expression failed. +- * @G_REGEX_ERROR_OPTIMIZE: Optimization of the regular expression failed. +- * @G_REGEX_ERROR_REPLACE: Replacement failed due to an ill-formed replacement +- * string. +- * @G_REGEX_ERROR_MATCH: The match process failed. +- * @G_REGEX_ERROR_INTERNAL: Internal error of the regular expression engine. +- * Since 2.16 +- * @G_REGEX_ERROR_STRAY_BACKSLASH: "\\" at end of pattern. Since 2.16 +- * @G_REGEX_ERROR_MISSING_CONTROL_CHAR: "\\c" at end of pattern. Since 2.16 +- * @G_REGEX_ERROR_UNRECOGNIZED_ESCAPE: Unrecognized character follows "\\". +- * Since 2.16 +- * @G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER: Numbers out of order in "{}" +- * quantifier. Since 2.16 +- * @G_REGEX_ERROR_QUANTIFIER_TOO_BIG: Number too big in "{}" quantifier. +- * Since 2.16 +- * @G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS: Missing terminating "]" for +- * character class. Since 2.16 +- * @G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS: Invalid escape sequence +- * in character class. Since 2.16 +- * @G_REGEX_ERROR_RANGE_OUT_OF_ORDER: Range out of order in character class. +- * Since 2.16 +- * @G_REGEX_ERROR_NOTHING_TO_REPEAT: Nothing to repeat. Since 2.16 +- * @G_REGEX_ERROR_UNRECOGNIZED_CHARACTER: Unrecognized character after "(?", +- * "(?<" or "(?P". Since 2.16 +- * @G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS: POSIX named classes are +- * supported only within a class. Since 2.16 +- * @G_REGEX_ERROR_UNMATCHED_PARENTHESIS: Missing terminating ")" or ")" +- * without opening "(". Since 2.16 +- * @G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE: Reference to non-existent +- * subpattern. Since 2.16 +- * @G_REGEX_ERROR_UNTERMINATED_COMMENT: Missing terminating ")" after comment. +- * Since 2.16 +- * @G_REGEX_ERROR_EXPRESSION_TOO_LARGE: Regular expression too large. +- * Since 2.16 +- * @G_REGEX_ERROR_MEMORY_ERROR: Failed to get memory. Since 2.16 +- * @G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND: Lookbehind assertion is not +- * fixed length. Since 2.16 +- * @G_REGEX_ERROR_MALFORMED_CONDITION: Malformed number or name after "(?(". +- * Since 2.16 +- * @G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES: Conditional group contains +- * more than two branches. Since 2.16 +- * @G_REGEX_ERROR_ASSERTION_EXPECTED: Assertion expected after "(?(". +- * Since 2.16 +- * @G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME: Unknown POSIX class name. +- * Since 2.16 +- * @G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED: POSIX collating +- * elements are not supported. Since 2.16 +- * @G_REGEX_ERROR_HEX_CODE_TOO_LARGE: Character value in "\\x{...}" sequence +- * is too large. Since 2.16 +- * @G_REGEX_ERROR_INVALID_CONDITION: Invalid condition "(?(0)". Since 2.16 +- * @G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND: \\C not allowed in +- * lookbehind assertion. Since 2.16 +- * @G_REGEX_ERROR_INFINITE_LOOP: Recursive call could loop indefinitely. +- * Since 2.16 +- * @G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR: Missing terminator +- * in subpattern name. Since 2.16 +- * @G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME: Two named subpatterns have +- * the same name. Since 2.16 +- * @G_REGEX_ERROR_MALFORMED_PROPERTY: Malformed "\\P" or "\\p" sequence. +- * Since 2.16 +- * @G_REGEX_ERROR_UNKNOWN_PROPERTY: Unknown property name after "\\P" or +- * "\\p". Since 2.16 +- * @G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG: Subpattern name is too long +- * (maximum 32 characters). Since 2.16 +- * @G_REGEX_ERROR_TOO_MANY_SUBPATTERNS: Too many named subpatterns (maximum +- * 10,000). Since 2.16 +- * @G_REGEX_ERROR_INVALID_OCTAL_VALUE: Octal value is greater than "\\377". +- * Since 2.16 +- * @G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE: "DEFINE" group contains more +- * than one branch. Since 2.16 +- * @G_REGEX_ERROR_DEFINE_REPETION: Repeating a "DEFINE" group is not allowed. +- * This error is never raised. Since: 2.16 Deprecated: 2.34 +- * @G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS: Inconsistent newline options. +- * Since 2.16 +- * @G_REGEX_ERROR_MISSING_BACK_REFERENCE: "\\g" is not followed by a braced, +- * angle-bracketed, or quoted name or number, or by a plain number. Since: 2.16 +- * @G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE: relative reference must not be zero. Since: 2.34 +- * @G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN: the backtracing +- * control verb used does not allow an argument. Since: 2.34 +- * @G_REGEX_ERROR_UNKNOWN_BACKTRACKING_CONTROL_VERB: unknown backtracing +- * control verb. Since: 2.34 +- * @G_REGEX_ERROR_NUMBER_TOO_BIG: number is too big in escape sequence. Since: 2.34 +- * @G_REGEX_ERROR_MISSING_SUBPATTERN_NAME: Missing subpattern name. Since: 2.34 +- * @G_REGEX_ERROR_MISSING_DIGIT: Missing digit. Since 2.34 +- * @G_REGEX_ERROR_INVALID_DATA_CHARACTER: In JavaScript compatibility mode, +- * "[" is an invalid data character. Since: 2.34 +- * @G_REGEX_ERROR_EXTRA_SUBPATTERN_NAME: different names for subpatterns of the +- * same number are not allowed. Since: 2.34 +- * @G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED: the backtracing control +- * verb requires an argument. Since: 2.34 +- * @G_REGEX_ERROR_INVALID_CONTROL_CHAR: "\\c" must be followed by an ASCII +- * character. Since: 2.34 +- * @G_REGEX_ERROR_MISSING_NAME: "\\k" is not followed by a braced, angle-bracketed, or +- * quoted name. Since: 2.34 +- * @G_REGEX_ERROR_NOT_SUPPORTED_IN_CLASS: "\\N" is not supported in a class. Since: 2.34 +- * @G_REGEX_ERROR_TOO_MANY_FORWARD_REFERENCES: too many forward references. Since: 2.34 +- * @G_REGEX_ERROR_NAME_TOO_LONG: the name is too long in "(*MARK)", "(*PRUNE)", +- * "(*SKIP)", or "(*THEN)". Since: 2.34 +- * @G_REGEX_ERROR_CHARACTER_VALUE_TOO_LARGE: the character value in the \\u sequence is +- * too large. Since: 2.34 +- * +- * Error codes returned by regular expressions functions. +- * +- * Since: 2.14 +- */ +-typedef enum +-{ +- G_REGEX_ERROR_COMPILE, +- G_REGEX_ERROR_OPTIMIZE, +- G_REGEX_ERROR_REPLACE, +- G_REGEX_ERROR_MATCH, +- G_REGEX_ERROR_INTERNAL, +- +- /* These are the error codes from PCRE + 100 */ +- G_REGEX_ERROR_STRAY_BACKSLASH = 101, +- G_REGEX_ERROR_MISSING_CONTROL_CHAR = 102, +- G_REGEX_ERROR_UNRECOGNIZED_ESCAPE = 103, +- G_REGEX_ERROR_QUANTIFIERS_OUT_OF_ORDER = 104, +- G_REGEX_ERROR_QUANTIFIER_TOO_BIG = 105, +- G_REGEX_ERROR_UNTERMINATED_CHARACTER_CLASS = 106, +- G_REGEX_ERROR_INVALID_ESCAPE_IN_CHARACTER_CLASS = 107, +- G_REGEX_ERROR_RANGE_OUT_OF_ORDER = 108, +- G_REGEX_ERROR_NOTHING_TO_REPEAT = 109, +- G_REGEX_ERROR_UNRECOGNIZED_CHARACTER = 112, +- G_REGEX_ERROR_POSIX_NAMED_CLASS_OUTSIDE_CLASS = 113, +- G_REGEX_ERROR_UNMATCHED_PARENTHESIS = 114, +- G_REGEX_ERROR_INEXISTENT_SUBPATTERN_REFERENCE = 115, +- G_REGEX_ERROR_UNTERMINATED_COMMENT = 118, +- G_REGEX_ERROR_EXPRESSION_TOO_LARGE = 120, +- G_REGEX_ERROR_MEMORY_ERROR = 121, +- G_REGEX_ERROR_VARIABLE_LENGTH_LOOKBEHIND = 125, +- G_REGEX_ERROR_MALFORMED_CONDITION = 126, +- G_REGEX_ERROR_TOO_MANY_CONDITIONAL_BRANCHES = 127, +- G_REGEX_ERROR_ASSERTION_EXPECTED = 128, +- G_REGEX_ERROR_UNKNOWN_POSIX_CLASS_NAME = 130, +- G_REGEX_ERROR_POSIX_COLLATING_ELEMENTS_NOT_SUPPORTED = 131, +- G_REGEX_ERROR_HEX_CODE_TOO_LARGE = 134, +- G_REGEX_ERROR_INVALID_CONDITION = 135, +- G_REGEX_ERROR_SINGLE_BYTE_MATCH_IN_LOOKBEHIND = 136, +- G_REGEX_ERROR_INFINITE_LOOP = 140, +- G_REGEX_ERROR_MISSING_SUBPATTERN_NAME_TERMINATOR = 142, +- G_REGEX_ERROR_DUPLICATE_SUBPATTERN_NAME = 143, +- G_REGEX_ERROR_MALFORMED_PROPERTY = 146, +- G_REGEX_ERROR_UNKNOWN_PROPERTY = 147, +- G_REGEX_ERROR_SUBPATTERN_NAME_TOO_LONG = 148, +- G_REGEX_ERROR_TOO_MANY_SUBPATTERNS = 149, +- G_REGEX_ERROR_INVALID_OCTAL_VALUE = 151, +- G_REGEX_ERROR_TOO_MANY_BRANCHES_IN_DEFINE = 154, +- G_REGEX_ERROR_DEFINE_REPETION = 155, +- G_REGEX_ERROR_INCONSISTENT_NEWLINE_OPTIONS = 156, +- G_REGEX_ERROR_MISSING_BACK_REFERENCE = 157, +- G_REGEX_ERROR_INVALID_RELATIVE_REFERENCE = 158, +- G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_FORBIDDEN = 159, +- G_REGEX_ERROR_UNKNOWN_BACKTRACKING_CONTROL_VERB = 160, +- G_REGEX_ERROR_NUMBER_TOO_BIG = 161, +- G_REGEX_ERROR_MISSING_SUBPATTERN_NAME = 162, +- G_REGEX_ERROR_MISSING_DIGIT = 163, +- G_REGEX_ERROR_INVALID_DATA_CHARACTER = 164, +- G_REGEX_ERROR_EXTRA_SUBPATTERN_NAME = 165, +- G_REGEX_ERROR_BACKTRACKING_CONTROL_VERB_ARGUMENT_REQUIRED = 166, +- G_REGEX_ERROR_INVALID_CONTROL_CHAR = 168, +- G_REGEX_ERROR_MISSING_NAME = 169, +- G_REGEX_ERROR_NOT_SUPPORTED_IN_CLASS = 171, +- G_REGEX_ERROR_TOO_MANY_FORWARD_REFERENCES = 172, +- G_REGEX_ERROR_NAME_TOO_LONG = 175, +- G_REGEX_ERROR_CHARACTER_VALUE_TOO_LARGE = 176 +-} GRegexError; +- +-/** +- * G_REGEX_ERROR: +- * +- * Error domain for regular expressions. Errors in this domain will be +- * from the #GRegexError enumeration. See #GError for information on +- * error domains. +- * +- * Since: 2.14 +- */ +-#define G_REGEX_ERROR g_regex_error_quark () +- +-GLIB_AVAILABLE_IN_ALL +-GQuark g_regex_error_quark (void); +- +-/** +- * GRegexCompileFlags: +- * @G_REGEX_CASELESS: Letters in the pattern match both upper- and +- * lowercase letters. This option can be changed within a pattern +- * by a "(?i)" option setting. +- * @G_REGEX_MULTILINE: By default, GRegex treats the strings as consisting +- * of a single line of characters (even if it actually contains +- * newlines). The "start of line" metacharacter ("^") matches only +- * at the start of the string, while the "end of line" metacharacter +- * ("$") matches only at the end of the string, or before a terminating +- * newline (unless #G_REGEX_DOLLAR_ENDONLY is set). When +- * #G_REGEX_MULTILINE is set, the "start of line" and "end of line" +- * constructs match immediately following or immediately before any +- * newline in the string, respectively, as well as at the very start +- * and end. This can be changed within a pattern by a "(?m)" option +- * setting. +- * @G_REGEX_DOTALL: A dot metacharacter (".") in the pattern matches all +- * characters, including newlines. Without it, newlines are excluded. +- * This option can be changed within a pattern by a ("?s") option setting. +- * @G_REGEX_EXTENDED: Whitespace data characters in the pattern are +- * totally ignored except when escaped or inside a character class. +- * Whitespace does not include the VT character (code 11). In addition, +- * characters between an unescaped "#" outside a character class and +- * the next newline character, inclusive, are also ignored. This can +- * be changed within a pattern by a "(?x)" option setting. +- * @G_REGEX_ANCHORED: The pattern is forced to be "anchored", that is, +- * it is constrained to match only at the first matching point in the +- * string that is being searched. This effect can also be achieved by +- * appropriate constructs in the pattern itself such as the "^" +- * metacharacter. +- * @G_REGEX_DOLLAR_ENDONLY: A dollar metacharacter ("$") in the pattern +- * matches only at the end of the string. Without this option, a +- * dollar also matches immediately before the final character if +- * it is a newline (but not before any other newlines). This option +- * is ignored if #G_REGEX_MULTILINE is set. +- * @G_REGEX_UNGREEDY: Inverts the "greediness" of the quantifiers so that +- * they are not greedy by default, but become greedy if followed by "?". +- * It can also be set by a "(?U)" option setting within the pattern. +- * @G_REGEX_RAW: Usually strings must be valid UTF-8 strings, using this +- * flag they are considered as a raw sequence of bytes. +- * @G_REGEX_NO_AUTO_CAPTURE: Disables the use of numbered capturing +- * parentheses in the pattern. Any opening parenthesis that is not +- * followed by "?" behaves as if it were followed by "?:" but named +- * parentheses can still be used for capturing (and they acquire numbers +- * in the usual way). +- * @G_REGEX_OPTIMIZE: Optimize the regular expression. If the pattern will +- * be used many times, then it may be worth the effort to optimize it +- * to improve the speed of matches. +- * @G_REGEX_FIRSTLINE: Limits an unanchored pattern to match before (or at) the +- * first newline. Since: 2.34 +- * @G_REGEX_DUPNAMES: Names used to identify capturing subpatterns need not +- * be unique. This can be helpful for certain types of pattern when it +- * is known that only one instance of the named subpattern can ever be +- * matched. +- * @G_REGEX_NEWLINE_CR: Usually any newline character or character sequence is +- * recognized. If this option is set, the only recognized newline character +- * is '\r'. +- * @G_REGEX_NEWLINE_LF: Usually any newline character or character sequence is +- * recognized. If this option is set, the only recognized newline character +- * is '\n'. +- * @G_REGEX_NEWLINE_CRLF: Usually any newline character or character sequence is +- * recognized. If this option is set, the only recognized newline character +- * sequence is '\r\n'. +- * @G_REGEX_NEWLINE_ANYCRLF: Usually any newline character or character sequence +- * is recognized. If this option is set, the only recognized newline character +- * sequences are '\r', '\n', and '\r\n'. Since: 2.34 +- * @G_REGEX_BSR_ANYCRLF: Usually any newline character or character sequence +- * is recognised. If this option is set, then "\R" only recognizes the newline +- * characters '\r', '\n' and '\r\n'. Since: 2.34 +- * @G_REGEX_JAVASCRIPT_COMPAT: Changes behaviour so that it is compatible with +- * JavaScript rather than PCRE. Since: 2.34 +- * +- * Flags specifying compile-time options. +- * +- * Since: 2.14 +- */ +-/* Remember to update G_REGEX_COMPILE_MASK in gregex.c after +- * adding a new flag. +- */ +-typedef enum +-{ +- G_REGEX_CASELESS = 1 << 0, +- G_REGEX_MULTILINE = 1 << 1, +- G_REGEX_DOTALL = 1 << 2, +- G_REGEX_EXTENDED = 1 << 3, +- G_REGEX_ANCHORED = 1 << 4, +- G_REGEX_DOLLAR_ENDONLY = 1 << 5, +- G_REGEX_UNGREEDY = 1 << 9, +- G_REGEX_RAW = 1 << 11, +- G_REGEX_NO_AUTO_CAPTURE = 1 << 12, +- G_REGEX_OPTIMIZE = 1 << 13, +- G_REGEX_FIRSTLINE = 1 << 18, +- G_REGEX_DUPNAMES = 1 << 19, +- G_REGEX_NEWLINE_CR = 1 << 20, +- G_REGEX_NEWLINE_LF = 1 << 21, +- G_REGEX_NEWLINE_CRLF = G_REGEX_NEWLINE_CR | G_REGEX_NEWLINE_LF, +- G_REGEX_NEWLINE_ANYCRLF = G_REGEX_NEWLINE_CR | 1 << 22, +- G_REGEX_BSR_ANYCRLF = 1 << 23, +- G_REGEX_JAVASCRIPT_COMPAT = 1 << 25 +-} GRegexCompileFlags; +- +-/** +- * GRegexMatchFlags: +- * @G_REGEX_MATCH_ANCHORED: The pattern is forced to be "anchored", that is, +- * it is constrained to match only at the first matching point in the +- * string that is being searched. This effect can also be achieved by +- * appropriate constructs in the pattern itself such as the "^" +- * metacharacter. +- * @G_REGEX_MATCH_NOTBOL: Specifies that first character of the string is +- * not the beginning of a line, so the circumflex metacharacter should +- * not match before it. Setting this without #G_REGEX_MULTILINE (at +- * compile time) causes circumflex never to match. This option affects +- * only the behaviour of the circumflex metacharacter, it does not +- * affect "\A". +- * @G_REGEX_MATCH_NOTEOL: Specifies that the end of the subject string is +- * not the end of a line, so the dollar metacharacter should not match +- * it nor (except in multiline mode) a newline immediately before it. +- * Setting this without #G_REGEX_MULTILINE (at compile time) causes +- * dollar never to match. This option affects only the behaviour of +- * the dollar metacharacter, it does not affect "\Z" or "\z". +- * @G_REGEX_MATCH_NOTEMPTY: An empty string is not considered to be a valid +- * match if this option is set. If there are alternatives in the pattern, +- * they are tried. If all the alternatives match the empty string, the +- * entire match fails. For example, if the pattern "a?b?" is applied to +- * a string not beginning with "a" or "b", it matches the empty string +- * at the start of the string. With this flag set, this match is not +- * valid, so GRegex searches further into the string for occurrences +- * of "a" or "b". +- * @G_REGEX_MATCH_PARTIAL: Turns on the partial matching feature, for more +- * documentation on partial matching see g_match_info_is_partial_match(). +- * @G_REGEX_MATCH_NEWLINE_CR: Overrides the newline definition set when +- * creating a new #GRegex, setting the '\r' character as line terminator. +- * @G_REGEX_MATCH_NEWLINE_LF: Overrides the newline definition set when +- * creating a new #GRegex, setting the '\n' character as line terminator. +- * @G_REGEX_MATCH_NEWLINE_CRLF: Overrides the newline definition set when +- * creating a new #GRegex, setting the '\r\n' characters sequence as line terminator. +- * @G_REGEX_MATCH_NEWLINE_ANY: Overrides the newline definition set when +- * creating a new #GRegex, any Unicode newline sequence +- * is recognised as a newline. These are '\r', '\n' and '\rn', and the +- * single characters U+000B LINE TABULATION, U+000C FORM FEED (FF), +- * U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and +- * U+2029 PARAGRAPH SEPARATOR. +- * @G_REGEX_MATCH_NEWLINE_ANYCRLF: Overrides the newline definition set when +- * creating a new #GRegex; any '\r', '\n', or '\r\n' character sequence +- * is recognized as a newline. Since: 2.34 +- * @G_REGEX_MATCH_BSR_ANYCRLF: Overrides the newline definition for "\R" set when +- * creating a new #GRegex; only '\r', '\n', or '\r\n' character sequences +- * are recognized as a newline by "\R". Since: 2.34 +- * @G_REGEX_MATCH_BSR_ANY: Overrides the newline definition for "\R" set when +- * creating a new #GRegex; any Unicode newline character or character sequence +- * are recognized as a newline by "\R". These are '\r', '\n' and '\rn', and the +- * single characters U+000B LINE TABULATION, U+000C FORM FEED (FF), +- * U+0085 NEXT LINE (NEL), U+2028 LINE SEPARATOR and +- * U+2029 PARAGRAPH SEPARATOR. Since: 2.34 +- * @G_REGEX_MATCH_PARTIAL_SOFT: An alias for #G_REGEX_MATCH_PARTIAL. Since: 2.34 +- * @G_REGEX_MATCH_PARTIAL_HARD: Turns on the partial matching feature. In contrast to +- * to #G_REGEX_MATCH_PARTIAL_SOFT, this stops matching as soon as a partial match +- * is found, without continuing to search for a possible complete match. See +- * g_match_info_is_partial_match() for more information. Since: 2.34 +- * @G_REGEX_MATCH_NOTEMPTY_ATSTART: Like #G_REGEX_MATCH_NOTEMPTY, but only applied to +- * the start of the matched string. For anchored +- * patterns this can only happen for pattern containing "\K". Since: 2.34 +- * +- * Flags specifying match-time options. +- * +- * Since: 2.14 +- */ +-/* Remember to update G_REGEX_MATCH_MASK in gregex.c after +- * adding a new flag. */ +-typedef enum +-{ +- G_REGEX_MATCH_ANCHORED = 1 << 4, +- G_REGEX_MATCH_NOTBOL = 1 << 7, +- G_REGEX_MATCH_NOTEOL = 1 << 8, +- G_REGEX_MATCH_NOTEMPTY = 1 << 10, +- G_REGEX_MATCH_PARTIAL = 1 << 15, +- G_REGEX_MATCH_NEWLINE_CR = 1 << 20, +- G_REGEX_MATCH_NEWLINE_LF = 1 << 21, +- G_REGEX_MATCH_NEWLINE_CRLF = G_REGEX_MATCH_NEWLINE_CR | G_REGEX_MATCH_NEWLINE_LF, +- G_REGEX_MATCH_NEWLINE_ANY = 1 << 22, +- G_REGEX_MATCH_NEWLINE_ANYCRLF = G_REGEX_MATCH_NEWLINE_CR | G_REGEX_MATCH_NEWLINE_ANY, +- G_REGEX_MATCH_BSR_ANYCRLF = 1 << 23, +- G_REGEX_MATCH_BSR_ANY = 1 << 24, +- G_REGEX_MATCH_PARTIAL_SOFT = G_REGEX_MATCH_PARTIAL, +- G_REGEX_MATCH_PARTIAL_HARD = 1 << 27, +- G_REGEX_MATCH_NOTEMPTY_ATSTART = 1 << 28 +-} GRegexMatchFlags; +- +-/** +- * GRegex: +- * +- * A GRegex is the "compiled" form of a regular expression pattern. +- * This structure is opaque and its fields cannot be accessed directly. +- * +- * Since: 2.14 +- */ +-typedef struct _GRegex GRegex; +- +- +-/** +- * GMatchInfo: +- * +- * A GMatchInfo is an opaque struct used to return information about +- * matches. +- */ +-typedef struct _GMatchInfo GMatchInfo; +- +-/** +- * GRegexEvalCallback: +- * @match_info: the #GMatchInfo generated by the match. +- * Use g_match_info_get_regex() and g_match_info_get_string() if you +- * need the #GRegex or the matched string. +- * @result: a #GString containing the new string +- * @user_data: user data passed to g_regex_replace_eval() +- * +- * Specifies the type of the function passed to g_regex_replace_eval(). +- * It is called for each occurrence of the pattern in the string passed +- * to g_regex_replace_eval(), and it should append the replacement to +- * @result. +- * +- * Returns: %FALSE to continue the replacement process, %TRUE to stop it +- * +- * Since: 2.14 +- */ +-typedef gboolean (*GRegexEvalCallback) (const GMatchInfo *match_info, +- GString *result, +- gpointer user_data); +- +- +-GLIB_AVAILABLE_IN_ALL +-GRegex *g_regex_new (const gchar *pattern, +- GRegexCompileFlags compile_options, +- GRegexMatchFlags match_options, +- GError **error); +-GLIB_AVAILABLE_IN_ALL +-GRegex *g_regex_ref (GRegex *regex); +-GLIB_AVAILABLE_IN_ALL +-void g_regex_unref (GRegex *regex); +-GLIB_AVAILABLE_IN_ALL +-const gchar *g_regex_get_pattern (const GRegex *regex); +-GLIB_AVAILABLE_IN_ALL +-gint g_regex_get_max_backref (const GRegex *regex); +-GLIB_AVAILABLE_IN_ALL +-gint g_regex_get_capture_count (const GRegex *regex); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_regex_get_has_cr_or_lf (const GRegex *regex); +-GLIB_AVAILABLE_IN_2_38 +-gint g_regex_get_max_lookbehind (const GRegex *regex); +-GLIB_AVAILABLE_IN_ALL +-gint g_regex_get_string_number (const GRegex *regex, +- const gchar *name); +-GLIB_AVAILABLE_IN_ALL +-gchar *g_regex_escape_string (const gchar *string, +- gint length); +-GLIB_AVAILABLE_IN_ALL +-gchar *g_regex_escape_nul (const gchar *string, +- gint length); +- +-GLIB_AVAILABLE_IN_ALL +-GRegexCompileFlags g_regex_get_compile_flags (const GRegex *regex); +-GLIB_AVAILABLE_IN_ALL +-GRegexMatchFlags g_regex_get_match_flags (const GRegex *regex); +- +-/* Matching. */ +-GLIB_AVAILABLE_IN_ALL +-gboolean g_regex_match_simple (const gchar *pattern, +- const gchar *string, +- GRegexCompileFlags compile_options, +- GRegexMatchFlags match_options); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_regex_match (const GRegex *regex, +- const gchar *string, +- GRegexMatchFlags match_options, +- GMatchInfo **match_info); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_regex_match_full (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- GRegexMatchFlags match_options, +- GMatchInfo **match_info, +- GError **error); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_regex_match_all (const GRegex *regex, +- const gchar *string, +- GRegexMatchFlags match_options, +- GMatchInfo **match_info); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_regex_match_all_full (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- GRegexMatchFlags match_options, +- GMatchInfo **match_info, +- GError **error); +- +-/* String splitting. */ +-GLIB_AVAILABLE_IN_ALL +-gchar **g_regex_split_simple (const gchar *pattern, +- const gchar *string, +- GRegexCompileFlags compile_options, +- GRegexMatchFlags match_options); +-GLIB_AVAILABLE_IN_ALL +-gchar **g_regex_split (const GRegex *regex, +- const gchar *string, +- GRegexMatchFlags match_options); +-GLIB_AVAILABLE_IN_ALL +-gchar **g_regex_split_full (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- GRegexMatchFlags match_options, +- gint max_tokens, +- GError **error); +- +-/* String replacement. */ +-GLIB_AVAILABLE_IN_ALL +-gchar *g_regex_replace (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- const gchar *replacement, +- GRegexMatchFlags match_options, +- GError **error); +-GLIB_AVAILABLE_IN_ALL +-gchar *g_regex_replace_literal (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- const gchar *replacement, +- GRegexMatchFlags match_options, +- GError **error); +-GLIB_AVAILABLE_IN_ALL +-gchar *g_regex_replace_eval (const GRegex *regex, +- const gchar *string, +- gssize string_len, +- gint start_position, +- GRegexMatchFlags match_options, +- GRegexEvalCallback eval, +- gpointer user_data, +- GError **error); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_regex_check_replacement (const gchar *replacement, +- gboolean *has_references, +- GError **error); +- +-/* Match info */ +-GLIB_AVAILABLE_IN_ALL +-GRegex *g_match_info_get_regex (const GMatchInfo *match_info); +-GLIB_AVAILABLE_IN_ALL +-const gchar *g_match_info_get_string (const GMatchInfo *match_info); +- +-GLIB_AVAILABLE_IN_ALL +-GMatchInfo *g_match_info_ref (GMatchInfo *match_info); +-GLIB_AVAILABLE_IN_ALL +-void g_match_info_unref (GMatchInfo *match_info); +-GLIB_AVAILABLE_IN_ALL +-void g_match_info_free (GMatchInfo *match_info); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_match_info_next (GMatchInfo *match_info, +- GError **error); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_match_info_matches (const GMatchInfo *match_info); +-GLIB_AVAILABLE_IN_ALL +-gint g_match_info_get_match_count (const GMatchInfo *match_info); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_match_info_is_partial_match (const GMatchInfo *match_info); +-GLIB_AVAILABLE_IN_ALL +-gchar *g_match_info_expand_references(const GMatchInfo *match_info, +- const gchar *string_to_expand, +- GError **error); +-GLIB_AVAILABLE_IN_ALL +-gchar *g_match_info_fetch (const GMatchInfo *match_info, +- gint match_num); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_match_info_fetch_pos (const GMatchInfo *match_info, +- gint match_num, +- gint *start_pos, +- gint *end_pos); +-GLIB_AVAILABLE_IN_ALL +-gchar *g_match_info_fetch_named (const GMatchInfo *match_info, +- const gchar *name); +-GLIB_AVAILABLE_IN_ALL +-gboolean g_match_info_fetch_named_pos (const GMatchInfo *match_info, +- const gchar *name, +- gint *start_pos, +- gint *end_pos); +-GLIB_AVAILABLE_IN_ALL +-gchar **g_match_info_fetch_all (const GMatchInfo *match_info); +- +-G_END_DECLS +- +-#endif /* __G_REGEX_H__ */ +Index: glib-2.56.4/glib/glib-autocleanups.h +=================================================================== +--- glib-2.56.4.orig/glib/glib-autocleanups.h ++++ glib-2.56.4/glib/glib-autocleanups.h +@@ -65,8 +65,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRand, g_rand_free) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GQueue, g_queue_free) + G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GQueue, g_queue_clear) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRand, g_rand_free) +-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRegex, g_regex_unref) +-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GMatchInfo, g_match_info_unref) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GScanner, g_scanner_destroy) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSequence, g_sequence_free) + G_DEFINE_AUTOPTR_CLEANUP_FUNC(GSList, g_slist_free) +Index: glib-2.56.4/gobject/glib-types.h +=================================================================== +--- glib-2.56.4.orig/gobject/glib-types.h ++++ glib-2.56.4/gobject/glib-types.h +@@ -86,15 +86,6 @@ typedef gsize GType; + #define G_TYPE_HASH_TABLE (g_hash_table_get_type ()) + + /** +- * G_TYPE_REGEX: +- * +- * The #GType for a boxed type holding a #GRegex reference. +- * +- * Since: 2.14 +- */ +-#define G_TYPE_REGEX (g_regex_get_type ()) +- +-/** + * G_TYPE_MATCH_INFO: + * + * The #GType for a boxed type holding a #GMatchInfo reference. +Index: glib-2.56.4/gobject/gboxed.c +=================================================================== +--- glib-2.56.4.orig/gobject/gboxed.c ++++ glib-2.56.4/gobject/gboxed.c +@@ -133,9 +133,6 @@ G_DEFINE_BOXED_TYPE (GBytes, g_bytes, g_bytes_ref, g_b + G_DEFINE_BOXED_TYPE (GByteArray, g_byte_array, g_byte_array_ref, g_byte_array_unref) + G_DEFINE_BOXED_TYPE (GBytes, g_bytes, g_bytes_ref, g_bytes_unref) + +-G_DEFINE_BOXED_TYPE (GRegex, g_regex, g_regex_ref, g_regex_unref) +-G_DEFINE_BOXED_TYPE (GMatchInfo, g_match_info, g_match_info_ref, g_match_info_unref) +- + #define g_variant_type_get_type g_variant_type_get_gtype + G_DEFINE_BOXED_TYPE (GVariantType, g_variant_type, g_variant_type_copy, g_variant_type_free) + #undef g_variant_type_get_type diff --git a/recipes/recipes_emscripten/glib/patches/emscripten-function-ptr.diff b/recipes/recipes_emscripten/glib/patches/emscripten-function-ptr.diff new file mode 100644 index 000000000..7bec7e917 --- /dev/null +++ b/recipes/recipes_emscripten/glib/patches/emscripten-function-ptr.diff @@ -0,0 +1,2383 @@ +This patch file is a modified version of kleisauke's patches for glib, +backported to version 2.56.4. Originally available at, +https://github.com/GNOME/glib/compare/2.76.2...kleisauke:wasm-vips-2.76.2.patch + +Index: glib-2.56.4/gio/gapplication.c +=================================================================== +--- glib-2.56.4.orig/gio/gapplication.c ++++ glib-2.56.4/gio/gapplication.c +@@ -282,8 +282,10 @@ static guint g_application_signals[NR_SIGNALS]; + + static guint g_application_signals[NR_SIGNALS]; + +-static void g_application_action_group_iface_init (GActionGroupInterface *); +-static void g_application_action_map_iface_init (GActionMapInterface *); ++static void g_application_action_group_iface_init (GActionGroupInterface *iface, ++ gpointer iface_data); ++static void g_application_action_map_iface_init (GActionMapInterface *iface, ++ gpointer iface_data); + G_DEFINE_TYPE_WITH_CODE (GApplication, g_application, G_TYPE_OBJECT, + G_ADD_PRIVATE (GApplication) + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, g_application_action_group_iface_init) +@@ -309,7 +311,8 @@ static GType g_application_exported_actions_get_type + } GApplicationExportedActions; + + static GType g_application_exported_actions_get_type (void); +-static void g_application_exported_actions_iface_init (GRemoteActionGroupInterface *iface); ++static void g_application_exported_actions_iface_init (GRemoteActionGroupInterface *iface, ++ gpointer iface_data); + G_DEFINE_TYPE_WITH_CODE (GApplicationExportedActions, g_application_exported_actions, G_TYPE_SIMPLE_ACTION_GROUP, + G_IMPLEMENT_INTERFACE (G_TYPE_REMOTE_ACTION_GROUP, g_application_exported_actions_iface_init)) + +@@ -353,7 +356,8 @@ static void + } + + static void +-g_application_exported_actions_iface_init (GRemoteActionGroupInterface *iface) ++g_application_exported_actions_iface_init (GRemoteActionGroupInterface *iface, ++ gpointer iface_data) + { + iface->activate_action_full = g_application_exported_actions_activate_action_full; + iface->change_action_state_full = g_application_exported_actions_change_action_state_full; +@@ -2623,7 +2627,8 @@ static void + } + + static void +-g_application_action_group_iface_init (GActionGroupInterface *iface) ++g_application_action_group_iface_init (GActionGroupInterface *iface, ++ gpointer iface_data) + { + iface->list_actions = g_application_list_actions; + iface->query_action = g_application_query_action; +@@ -2632,7 +2637,8 @@ static void + } + + static void +-g_application_action_map_iface_init (GActionMapInterface *iface) ++g_application_action_map_iface_init (GActionMapInterface *iface, ++ gpointer iface_data) + { + iface->lookup_action = g_application_lookup_action; + iface->add_action = g_application_add_action; +Index: glib-2.56.4/gio/gbufferedinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gbufferedinputstream.c ++++ glib-2.56.4/gio/gbufferedinputstream.c +@@ -113,7 +113,8 @@ static gssize g_buffered_input_stream_real_fill_finish + GAsyncResult *result, + GError **error); + +-static void g_buffered_input_stream_seekable_iface_init (GSeekableIface *iface); ++static void g_buffered_input_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data); + static goffset g_buffered_input_stream_tell (GSeekable *seekable); + static gboolean g_buffered_input_stream_can_seek (GSeekable *seekable); + static gboolean g_buffered_input_stream_seek (GSeekable *seekable, +@@ -300,7 +301,8 @@ static void + } + + static void +-g_buffered_input_stream_seekable_iface_init (GSeekableIface *iface) ++g_buffered_input_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data) + { + iface->tell = g_buffered_input_stream_tell; + iface->can_seek = g_buffered_input_stream_can_seek; +Index: glib-2.56.4/gio/gbufferedoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gbufferedoutputstream.c ++++ glib-2.56.4/gio/gbufferedoutputstream.c +@@ -105,7 +105,8 @@ static gboolean g_buffered_output_stream_close_finish + GAsyncResult *result, + GError **error); + +-static void g_buffered_output_stream_seekable_iface_init (GSeekableIface *iface); ++static void g_buffered_output_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data); + static goffset g_buffered_output_stream_tell (GSeekable *seekable); + static gboolean g_buffered_output_stream_can_seek (GSeekable *seekable); + static gboolean g_buffered_output_stream_seek (GSeekable *seekable, +@@ -346,7 +347,8 @@ static void + } + + static void +-g_buffered_output_stream_seekable_iface_init (GSeekableIface *iface) ++g_buffered_output_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data) + { + iface->tell = g_buffered_output_stream_tell; + iface->can_seek = g_buffered_output_stream_can_seek; +Index: glib-2.56.4/gio/gbytesicon.c +=================================================================== +--- glib-2.56.4.orig/gio/gbytesicon.c ++++ glib-2.56.4/gio/gbytesicon.c +@@ -57,8 +57,10 @@ enum + PROP_BYTES + }; + +-static void g_bytes_icon_icon_iface_init (GIconIface *iface); +-static void g_bytes_icon_loadable_icon_iface_init (GLoadableIconIface *iface); ++static void g_bytes_icon_icon_iface_init (GIconIface *iface, ++ gpointer iface_data); ++static void g_bytes_icon_loadable_icon_iface_init (GLoadableIconIface *iface, ++ gpointer iface_data); + G_DEFINE_TYPE_WITH_CODE (GBytesIcon, g_bytes_icon, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ICON, g_bytes_icon_icon_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_LOADABLE_ICON, g_bytes_icon_loadable_icon_iface_init)) +@@ -205,7 +207,8 @@ static void + } + + static void +-g_bytes_icon_icon_iface_init (GIconIface *iface) ++g_bytes_icon_icon_iface_init (GIconIface *iface, ++ gpointer iface_data) + { + iface->hash = g_bytes_icon_hash; + iface->equal = g_bytes_icon_equal; +@@ -258,7 +261,8 @@ static void + } + + static void +-g_bytes_icon_loadable_icon_iface_init (GLoadableIconIface *iface) ++g_bytes_icon_loadable_icon_iface_init (GLoadableIconIface *iface, ++ gpointer iface_data) + { + iface->load = g_bytes_icon_load; + iface->load_async = g_bytes_icon_load_async; +Index: glib-2.56.4/gio/gcharsetconverter.c +=================================================================== +--- glib-2.56.4.orig/gio/gcharsetconverter.c ++++ glib-2.56.4/gio/gcharsetconverter.c +@@ -45,8 +45,10 @@ enum { + * GIConv. + */ + +-static void g_charset_converter_iface_init (GConverterIface *iface); +-static void g_charset_converter_initable_iface_init (GInitableIface *iface); ++static void g_charset_converter_iface_init (GConverterIface *iface, ++ gpointer iface_data); ++static void g_charset_converter_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + /** + * GCharsetConverter: +@@ -421,7 +423,8 @@ static void + } + + static void +-g_charset_converter_iface_init (GConverterIface *iface) ++g_charset_converter_iface_init (GConverterIface *iface, ++ gpointer iface_data) + { + iface->convert = g_charset_converter_convert; + iface->reset = g_charset_converter_reset; +@@ -466,7 +469,8 @@ static void + } + + static void +-g_charset_converter_initable_iface_init (GInitableIface *iface) ++g_charset_converter_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_charset_converter_initable_init; + } +Index: glib-2.56.4/gio/gconverterinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gconverterinputstream.c ++++ glib-2.56.4/gio/gconverterinputstream.c +@@ -91,8 +91,8 @@ static GSource *g_converter_input_stream_create_source + static GSource *g_converter_input_stream_create_source (GPollableInputStream *stream, + GCancellable *cancellable); + +-static void g_converter_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); +- ++static void g_converter_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, ++ gpointer iface_data); + G_DEFINE_TYPE_WITH_CODE (GConverterInputStream, + g_converter_input_stream, + G_TYPE_FILTER_INPUT_STREAM, +@@ -127,7 +127,8 @@ static void + } + + static void +-g_converter_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) ++g_converter_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, ++ gpointer iface_data) + { + iface->can_poll = g_converter_input_stream_can_poll; + iface->is_readable = g_converter_input_stream_is_readable; +Index: glib-2.56.4/gio/gconverteroutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gconverteroutputstream.c ++++ glib-2.56.4/gio/gconverteroutputstream.c +@@ -106,7 +106,8 @@ static GSource *g_converter_output_stream_create_sourc + static GSource *g_converter_output_stream_create_source (GPollableOutputStream *stream, + GCancellable *cancellable); + +-static void g_converter_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); ++static void g_converter_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GConverterOutputStream, + g_converter_output_stream, +@@ -143,7 +144,8 @@ static void + } + + static void +-g_converter_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) ++g_converter_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, ++ gpointer iface_data) + { + iface->can_poll = g_converter_output_stream_can_poll; + iface->is_writable = g_converter_output_stream_is_writable; +Index: glib-2.56.4/gio/gdataoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gdataoutputstream.c ++++ glib-2.56.4/gio/gdataoutputstream.c +@@ -58,7 +58,8 @@ static void g_data_output_stream_get_property (GObject + GValue *value, + GParamSpec *pspec); + +-static void g_data_output_stream_seekable_iface_init (GSeekableIface *iface); ++static void g_data_output_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data); + static goffset g_data_output_stream_tell (GSeekable *seekable); + static gboolean g_data_output_stream_can_seek (GSeekable *seekable); + static gboolean g_data_output_stream_seek (GSeekable *seekable, +@@ -160,7 +161,8 @@ static void + } + + static void +-g_data_output_stream_seekable_iface_init (GSeekableIface *iface) ++g_data_output_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data) + { + iface->tell = g_data_output_stream_tell; + iface->can_seek = g_data_output_stream_can_seek; +Index: glib-2.56.4/gio/gdbusactiongroup.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusactiongroup.c ++++ glib-2.56.4/gio/gdbusactiongroup.c +@@ -129,8 +129,10 @@ action_info_new_from_iter (GVariantIter *iter) + return info; + } + +-static void g_dbus_action_group_remote_iface_init (GRemoteActionGroupInterface *iface); +-static void g_dbus_action_group_iface_init (GActionGroupInterface *iface); ++static void g_dbus_action_group_remote_iface_init (GRemoteActionGroupInterface *iface, ++ gpointer iface_data); ++static void g_dbus_action_group_iface_init (GActionGroupInterface *iface, ++ gpointer iface_data); + G_DEFINE_TYPE_WITH_CODE (GDBusActionGroup, g_dbus_action_group, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, g_dbus_action_group_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_REMOTE_ACTION_GROUP, g_dbus_action_group_remote_iface_init)) +@@ -457,14 +459,16 @@ static void + } + + static void +-g_dbus_action_group_remote_iface_init (GRemoteActionGroupInterface *iface) ++g_dbus_action_group_remote_iface_init (GRemoteActionGroupInterface *iface, ++ gpointer iface_data) + { + iface->activate_action_full = g_dbus_action_group_activate_action_full; + iface->change_action_state_full = g_dbus_action_group_change_action_state_full; + } + + static void +-g_dbus_action_group_iface_init (GActionGroupInterface *iface) ++g_dbus_action_group_iface_init (GActionGroupInterface *iface, ++ gpointer iface_data) + { + iface->list_actions = g_dbus_action_group_list_actions; + iface->query_action = g_dbus_action_group_query_action; +Index: glib-2.56.4/gio/gdbusconnection.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusconnection.c ++++ glib-2.56.4/gio/gdbusconnection.c +@@ -532,8 +532,10 @@ static guint signals[LAST_SIGNAL] = { 0 }; + + static guint signals[LAST_SIGNAL] = { 0 }; + +-static void initable_iface_init (GInitableIface *initable_iface); +-static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface); ++static void initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data); ++static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GDBusConnection, g_dbus_connection, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init) +@@ -2632,7 +2634,8 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface) ++initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data) + { + initable_iface->init = initable_init; + } +@@ -2640,7 +2643,8 @@ static void + /* ---------------------------------------------------------------------------------------------------- */ + + static void +-async_initable_iface_init (GAsyncInitableIface *async_initable_iface) ++async_initable_iface_init (GAsyncInitableIface *async_initable_iface, ++ gpointer iface_data) + { + /* Use default */ + } +Index: glib-2.56.4/gio/gdbusdaemon.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusdaemon.c ++++ glib-2.56.4/gio/gdbusdaemon.c +@@ -69,8 +69,10 @@ static guint g_dbus_daemon_signals[NR_SIGNALS]; + static guint g_dbus_daemon_signals[NR_SIGNALS]; + + +-static void initable_iface_init (GInitableIface *initable_iface); +-static void g_dbus_daemon_iface_init (_GFreedesktopDBusIface *iface); ++static void initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data); ++static void g_dbus_daemon_iface_init (_GFreedesktopDBusIface *iface, ++ gpointer iface_data); + + #define g_dbus_daemon_get_type _g_dbus_daemon_get_type + G_DEFINE_TYPE_WITH_CODE (GDBusDaemon, g_dbus_daemon, _G_TYPE_FREEDESKTOP_DBUS_SKELETON, +@@ -1716,7 +1718,8 @@ static void + } + + static void +-g_dbus_daemon_iface_init (_GFreedesktopDBusIface *iface) ++g_dbus_daemon_iface_init (_GFreedesktopDBusIface *iface, ++ gpointer iface_data) + { + iface->handle_add_match = handle_add_match; + iface->handle_get_connection_selinux_security_context = handle_get_connection_selinux_security_context; +@@ -1738,7 +1741,8 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface) ++initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data) + { + initable_iface->init = initable_init; + } +Index: glib-2.56.4/gio/gdbusobjectmanagerclient.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusobjectmanagerclient.c ++++ glib-2.56.4/gio/gdbusobjectmanagerclient.c +@@ -165,9 +165,12 @@ static guint signals[LAST_SIGNAL] = { 0 }; + + static guint signals[LAST_SIGNAL] = { 0 }; + +-static void initable_iface_init (GInitableIface *initable_iface); +-static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface); +-static void dbus_object_manager_interface_init (GDBusObjectManagerIface *iface); ++static void initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data); ++static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface, ++ gpointer iface_data); ++static void dbus_object_manager_interface_init (GDBusObjectManagerIface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GDBusObjectManagerClient, g_dbus_object_manager_client, G_TYPE_OBJECT, + G_ADD_PRIVATE (GDBusObjectManagerClient) +@@ -1409,13 +1412,15 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface) ++initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data) + { + initable_iface->init = initable_init; + } + + static void +-async_initable_iface_init (GAsyncInitableIface *async_initable_iface) ++async_initable_iface_init (GAsyncInitableIface *async_initable_iface, ++ gpointer iface_data) + { + /* for now, just use default: run GInitable code in thread */ + } +@@ -1751,7 +1756,8 @@ static void + + + static void +-dbus_object_manager_interface_init (GDBusObjectManagerIface *iface) ++dbus_object_manager_interface_init (GDBusObjectManagerIface *iface, ++ gpointer iface_data) + { + iface->get_object_path = g_dbus_object_manager_client_get_object_path; + iface->get_objects = g_dbus_object_manager_client_get_objects; +Index: glib-2.56.4/gio/gdbusproxy.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusproxy.c ++++ glib-2.56.4/gio/gdbusproxy.c +@@ -179,9 +179,12 @@ static guint signals[LAST_SIGNAL] = {0}; + + static guint signals[LAST_SIGNAL] = {0}; + +-static void dbus_interface_iface_init (GDBusInterfaceIface *dbus_interface_iface); +-static void initable_iface_init (GInitableIface *initable_iface); +-static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface); ++static void dbus_interface_iface_init (GDBusInterfaceIface *dbus_interface_iface, ++ gpointer iface_data); ++static void initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data); ++static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GDBusProxy, g_dbus_proxy, G_TYPE_OBJECT, + G_ADD_PRIVATE (GDBusProxy) +@@ -1879,7 +1882,8 @@ static void + } + + static void +-async_initable_iface_init (GAsyncInitableIface *async_initable_iface) ++async_initable_iface_init (GAsyncInitableIface *async_initable_iface, ++ gpointer iface_data) + { + async_initable_iface->init_async = async_initable_init_async; + async_initable_iface->init_finish = async_initable_init_finish; +@@ -1966,7 +1970,8 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface) ++initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data) + { + initable_iface->init = initable_init; + } +@@ -3206,7 +3211,8 @@ static void + } + + static void +-dbus_interface_iface_init (GDBusInterfaceIface *dbus_interface_iface) ++dbus_interface_iface_init (GDBusInterfaceIface *dbus_interface_iface, ++ gpointer iface_data) + { + dbus_interface_iface->get_info = _g_dbus_proxy_get_info; + dbus_interface_iface->get_object = _g_dbus_proxy_get_object; +Index: glib-2.56.4/gio/gdbusserver.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusserver.c ++++ glib-2.56.4/gio/gdbusserver.c +@@ -151,7 +151,8 @@ static guint _signals[LAST_SIGNAL] = {0}; + + static guint _signals[LAST_SIGNAL] = {0}; + +-static void initable_iface_init (GInitableIface *initable_iface); ++static void initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GDBusServer, g_dbus_server, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)) +@@ -1132,7 +1133,8 @@ static void + + + static void +-initable_iface_init (GInitableIface *initable_iface) ++initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data) + { + initable_iface->init = initable_init; + } +Index: glib-2.56.4/gio/gdesktopappinfo.c +=================================================================== +--- glib-2.56.4.orig/gio/gdesktopappinfo.c ++++ glib-2.56.4/gio/gdesktopappinfo.c +@@ -80,7 +80,8 @@ enum { + PROP_FILENAME + }; + +-static void g_desktop_app_info_iface_init (GAppInfoIface *iface); ++static void g_desktop_app_info_iface_init (GAppInfoIface *iface, ++ gpointer iface_data); + static gboolean g_desktop_app_info_ensure_saved (GDesktopAppInfo *info, + GError **error); + +@@ -3776,7 +3777,8 @@ static void + /* GAppInfo interface init */ + + static void +-g_desktop_app_info_iface_init (GAppInfoIface *iface) ++g_desktop_app_info_iface_init (GAppInfoIface *iface, ++ gpointer iface_data) + { + iface->dup = g_desktop_app_info_dup; + iface->equal = g_desktop_app_info_equal; +Index: glib-2.56.4/gio/gdummyfile.c +=================================================================== +--- glib-2.56.4.orig/gio/gdummyfile.c ++++ glib-2.56.4/gio/gdummyfile.c +@@ -31,7 +31,8 @@ + #include "gfile.h" + + +-static void g_dummy_file_file_iface_init (GFileIface *iface); ++static void g_dummy_file_file_iface_init (GFileIface *iface, ++ gpointer iface_data); + + typedef struct { + char *scheme; +@@ -396,7 +397,8 @@ static void + + + static void +-g_dummy_file_file_iface_init (GFileIface *iface) ++g_dummy_file_file_iface_init (GFileIface *iface, ++ gpointer iface_data) + { + iface->dup = g_dummy_file_dup; + iface->hash = g_dummy_file_hash; +Index: glib-2.56.4/gio/gdummyproxyresolver.c +=================================================================== +--- glib-2.56.4.orig/gio/gdummyproxyresolver.c ++++ glib-2.56.4/gio/gdummyproxyresolver.c +@@ -36,7 +36,8 @@ struct _GDummyProxyResolver { + GObject parent_instance; + }; + +-static void g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface); ++static void g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface, ++ gpointer iface_data); + + #define g_dummy_proxy_resolver_get_type _g_dummy_proxy_resolver_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyProxyResolver, g_dummy_proxy_resolver, G_TYPE_OBJECT, +@@ -125,7 +126,8 @@ static void + } + + static void +-g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface) ++g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface, ++ gpointer iface_data) + { + iface->is_supported = g_dummy_proxy_resolver_is_supported; + iface->lookup = g_dummy_proxy_resolver_lookup; +Index: glib-2.56.4/gio/gdummytlsbackend.c +=================================================================== +--- glib-2.56.4.orig/gio/gdummytlsbackend.c ++++ glib-2.56.4/gio/gdummytlsbackend.c +@@ -51,7 +51,8 @@ struct _GDummyTlsBackend { + GTlsDatabase *database; + }; + +-static void g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface); ++static void g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface, ++ gpointer iface_data); + + #define g_dummy_tls_backend_get_type _g_dummy_tls_backend_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyTlsBackend, g_dummy_tls_backend, G_TYPE_OBJECT, +@@ -103,7 +104,8 @@ static void + } + + static void +-g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface) ++g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface, ++ gpointer iface_data) + { + iface->get_certificate_type = _g_dummy_tls_certificate_get_type; + iface->get_client_connection_type = _g_dummy_tls_connection_get_type; +@@ -138,7 +140,8 @@ enum + PROP_CERT_ISSUER + }; + +-static void g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface); ++static void g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + #define g_dummy_tls_certificate_get_type _g_dummy_tls_certificate_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyTlsCertificate, g_dummy_tls_certificate, G_TYPE_TLS_CERTIFICATE, +@@ -197,7 +200,8 @@ static void + } + + static void +-g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface) ++g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_dummy_tls_certificate_initable_init; + } +@@ -238,7 +242,8 @@ enum + PROP_CONN_AUTHENTICATION_MODE + }; + +-static void g_dummy_tls_connection_initable_iface_init (GInitableIface *iface); ++static void g_dummy_tls_connection_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + #define g_dummy_tls_connection_get_type _g_dummy_tls_connection_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyTlsConnection, g_dummy_tls_connection, G_TYPE_TLS_CONNECTION, +@@ -319,7 +324,8 @@ static void + } + + static void +-g_dummy_tls_connection_initable_iface_init (GInitableIface *iface) ++g_dummy_tls_connection_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_dummy_tls_connection_initable_init; + } +@@ -357,7 +363,8 @@ enum + PROP_DTLS_CONN_AUTHENTICATION_MODE, + }; + +-static void g_dummy_dtls_connection_initable_iface_init (GInitableIface *iface); ++static void g_dummy_dtls_connection_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + #define g_dummy_dtls_connection_get_type _g_dummy_dtls_connection_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyDtlsConnection, g_dummy_dtls_connection, G_TYPE_OBJECT, +@@ -421,7 +428,8 @@ static void + } + + static void +-g_dummy_dtls_connection_initable_iface_init (GInitableIface *iface) ++g_dummy_dtls_connection_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_dummy_dtls_connection_initable_init; + } +@@ -447,8 +455,10 @@ enum + PROP_ANCHORS, + }; + +-static void g_dummy_tls_database_file_database_iface_init (GTlsFileDatabaseInterface *iface); +-static void g_dummy_tls_database_initable_iface_init (GInitableIface *iface); ++static void g_dummy_tls_database_file_database_iface_init (GTlsFileDatabaseInterface *iface, ++ gpointer iface_data); ++static void g_dummy_tls_database_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + #define g_dummy_tls_database_get_type _g_dummy_tls_database_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyTlsDatabase, g_dummy_tls_database, G_TYPE_TLS_DATABASE, +@@ -496,7 +506,8 @@ static void + } + + static void +-g_dummy_tls_database_file_database_iface_init (GTlsFileDatabaseInterface *iface) ++g_dummy_tls_database_file_database_iface_init (GTlsFileDatabaseInterface *iface, ++ gpointer iface_data) + { + } + +@@ -511,7 +522,8 @@ static void + } + + static void +-g_dummy_tls_database_initable_iface_init (GInitableIface *iface) ++g_dummy_tls_database_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_dummy_tls_database_initable_init; + } +Index: glib-2.56.4/gio/gemblem.c +=================================================================== +--- glib-2.56.4.orig/gio/gemblem.c ++++ glib-2.56.4/gio/gemblem.c +@@ -42,7 +42,8 @@ + * supported. More may be added in the future. + */ + +-static void g_emblem_iface_init (GIconIface *iface); ++static void g_emblem_iface_init (GIconIface *iface, ++ gpointer iface_data); + + struct _GEmblem + { +@@ -369,7 +370,8 @@ static void + } + + static void +-g_emblem_iface_init (GIconIface *iface) ++g_emblem_iface_init (GIconIface *iface, ++ gpointer iface_data) + { + iface->hash = g_emblem_hash; + iface->equal = g_emblem_equal; +Index: glib-2.56.4/gio/gemblemedicon.c +=================================================================== +--- glib-2.56.4.orig/gio/gemblemedicon.c ++++ glib-2.56.4/gio/gemblemedicon.c +@@ -56,7 +56,8 @@ static GParamSpec *properties[NUM_PROPERTIES] = { NULL + + static GParamSpec *properties[NUM_PROPERTIES] = { NULL, }; + +-static void g_emblemed_icon_icon_iface_init (GIconIface *iface); ++static void g_emblemed_icon_icon_iface_init (GIconIface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GEmblemedIcon, g_emblemed_icon, G_TYPE_OBJECT, + G_ADD_PRIVATE (GEmblemedIcon) +@@ -457,7 +458,8 @@ static void + } + + static void +-g_emblemed_icon_icon_iface_init (GIconIface *iface) ++g_emblemed_icon_icon_iface_init (GIconIface *iface, ++ gpointer iface_data) + { + iface->hash = g_emblemed_icon_hash; + iface->equal = g_emblemed_icon_equal; +Index: glib-2.56.4/gio/gfileicon.c +=================================================================== +--- glib-2.56.4.orig/gio/gfileicon.c ++++ glib-2.56.4/gio/gfileicon.c +@@ -41,8 +41,10 @@ + * + **/ + +-static void g_file_icon_icon_iface_init (GIconIface *iface); +-static void g_file_icon_loadable_icon_iface_init (GLoadableIconIface *iface); ++static void g_file_icon_icon_iface_init (GIconIface *iface, ++ gpointer iface_data); ++static void g_file_icon_loadable_icon_iface_init (GLoadableIconIface *iface, ++ gpointer iface_data); + static void g_file_icon_load_async (GLoadableIcon *icon, + int size, + GCancellable *cancellable, +@@ -264,7 +266,8 @@ static void + } + + static void +-g_file_icon_icon_iface_init (GIconIface *iface) ++g_file_icon_icon_iface_init (GIconIface *iface, ++ gpointer iface_data) + { + iface->hash = g_file_icon_hash; + iface->equal = g_file_icon_equal; +@@ -344,7 +347,8 @@ static void + } + + static void +-g_file_icon_loadable_icon_iface_init (GLoadableIconIface *iface) ++g_file_icon_loadable_icon_iface_init (GLoadableIconIface *iface, ++ gpointer iface_data) + { + iface->load = g_file_icon_load; + iface->load_async = g_file_icon_load_async; +Index: glib-2.56.4/gio/gfileinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gfileinputstream.c ++++ glib-2.56.4/gio/gfileinputstream.c +@@ -47,7 +47,8 @@ + * To position a file input stream, use g_seekable_seek(). + **/ + +-static void g_file_input_stream_seekable_iface_init (GSeekableIface *iface); ++static void g_file_input_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data); + static goffset g_file_input_stream_seekable_tell (GSeekable *seekable); + static gboolean g_file_input_stream_seekable_can_seek (GSeekable *seekable); + static gboolean g_file_input_stream_seekable_seek (GSeekable *seekable, +@@ -88,7 +89,8 @@ static void + } + + static void +-g_file_input_stream_seekable_iface_init (GSeekableIface *iface) ++g_file_input_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data) + { + iface->tell = g_file_input_stream_seekable_tell; + iface->can_seek = g_file_input_stream_seekable_can_seek; +Index: glib-2.56.4/gio/gfileiostream.c +=================================================================== +--- glib-2.56.4.orig/gio/gfileiostream.c ++++ glib-2.56.4/gio/gfileiostream.c +@@ -60,7 +60,8 @@ + * Since: 2.22 + **/ + +-static void g_file_io_stream_seekable_iface_init (GSeekableIface *iface); ++static void g_file_io_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data); + static goffset g_file_io_stream_seekable_tell (GSeekable *seekable); + static gboolean g_file_io_stream_seekable_can_seek (GSeekable *seekable); + static gboolean g_file_io_stream_seekable_seek (GSeekable *seekable, +@@ -93,7 +94,8 @@ static void + g_file_io_stream_seekable_iface_init)) + + static void +-g_file_io_stream_seekable_iface_init (GSeekableIface *iface) ++g_file_io_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data) + { + iface->tell = g_file_io_stream_seekable_tell; + iface->can_seek = g_file_io_stream_seekable_can_seek; +Index: glib-2.56.4/gio/gfileoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gfileoutputstream.c ++++ glib-2.56.4/gio/gfileoutputstream.c +@@ -52,7 +52,8 @@ + * stream, use g_seekable_truncate(). + **/ + +-static void g_file_output_stream_seekable_iface_init (GSeekableIface *iface); ++static void g_file_output_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data); + static goffset g_file_output_stream_seekable_tell (GSeekable *seekable); + static gboolean g_file_output_stream_seekable_can_seek (GSeekable *seekable); + static gboolean g_file_output_stream_seekable_seek (GSeekable *seekable, +@@ -92,7 +93,8 @@ static void + } + + static void +-g_file_output_stream_seekable_iface_init (GSeekableIface *iface) ++g_file_output_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data) + { + iface->tell = g_file_output_stream_seekable_tell; + iface->can_seek = g_file_output_stream_seekable_can_seek; +Index: glib-2.56.4/gio/ghttpproxy.c +=================================================================== +--- glib-2.56.4.orig/gio/ghttpproxy.c ++++ glib-2.56.4/gio/ghttpproxy.c +@@ -51,7 +51,8 @@ struct _GHttpProxyClass + GObjectClass parent_class; + }; + +-static void g_http_proxy_iface_init (GProxyInterface *proxy_iface); ++static void g_http_proxy_iface_init (GProxyInterface *proxy_iface, ++ gpointer iface_data); + + #define g_http_proxy_get_type _g_http_proxy_get_type + G_DEFINE_TYPE_WITH_CODE (GHttpProxy, g_http_proxy, G_TYPE_OBJECT, +@@ -363,7 +364,8 @@ static void + } + + static void +-g_http_proxy_iface_init (GProxyInterface *proxy_iface) ++g_http_proxy_iface_init (GProxyInterface *proxy_iface, ++ gpointer iface_data) + { + proxy_iface->connect = g_http_proxy_connect; + proxy_iface->connect_async = g_http_proxy_connect_async; +Index: glib-2.56.4/gio/ginetaddressmask.c +=================================================================== +--- glib-2.56.4.orig/gio/ginetaddressmask.c ++++ glib-2.56.4/gio/ginetaddressmask.c +@@ -54,7 +54,8 @@ struct _GInetAddressMaskPrivate + guint length; + }; + +-static void g_inet_address_mask_initable_iface_init (GInitableIface *iface); ++static void g_inet_address_mask_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GInetAddressMask, g_inet_address_mask, G_TYPE_OBJECT, + G_ADD_PRIVATE (GInetAddressMask) +@@ -228,7 +229,8 @@ static void + } + + static void +-g_inet_address_mask_initable_iface_init (GInitableIface *iface) ++g_inet_address_mask_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_inet_address_mask_initable_init; + } +Index: glib-2.56.4/gio/ginetsocketaddress.c +=================================================================== +--- glib-2.56.4.orig/gio/ginetsocketaddress.c ++++ glib-2.56.4/gio/ginetsocketaddress.c +@@ -55,7 +55,8 @@ struct _GInetSocketAddressPrivate + guint32 scope_id; + }; + +-static void g_inet_socket_address_connectable_iface_init (GSocketConnectableIface *iface); ++static void g_inet_socket_address_connectable_iface_init (GSocketConnectableIface *iface, ++ gpointer iface_data); + static gchar *g_inet_socket_address_connectable_to_string (GSocketConnectable *connectable); + + G_DEFINE_TYPE_WITH_CODE (GInetSocketAddress, g_inet_socket_address, G_TYPE_SOCKET_ADDRESS, +@@ -309,7 +310,8 @@ static void + } + + static void +-g_inet_socket_address_connectable_iface_init (GSocketConnectableIface *iface) ++g_inet_socket_address_connectable_iface_init (GSocketConnectableIface *iface, ++ gpointer iface_data) + { + GSocketConnectableIface *parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gliststore.c +=================================================================== +--- glib-2.56.4.orig/gio/gliststore.c ++++ glib-2.56.4/gio/gliststore.c +@@ -64,7 +64,8 @@ enum + N_PROPERTIES + }; + +-static void g_list_store_iface_init (GListModelInterface *iface); ++static void g_list_store_iface_init (GListModelInterface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GListStore, g_list_store, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, g_list_store_iface_init)); +@@ -204,7 +205,8 @@ static void + } + + static void +-g_list_store_iface_init (GListModelInterface *iface) ++g_list_store_iface_init (GListModelInterface *iface, ++ gpointer iface_data) + { + iface->get_item_type = g_list_store_get_item_type; + iface->get_n_items = g_list_store_get_n_items; +Index: glib-2.56.4/gio/glocalfile.c +=================================================================== +--- glib-2.56.4.orig/gio/glocalfile.c ++++ glib-2.56.4/gio/glocalfile.c +@@ -92,7 +92,8 @@ + #endif + + +-static void g_local_file_file_iface_init (GFileIface *iface); ++static void g_local_file_file_iface_init (GFileIface *iface, ++ gpointer iface_data); + + static GFileAttributeInfoList *local_writable_attributes = NULL; + static /* GFileAttributeInfoList * */ gsize local_writable_namespaces = 0; +@@ -2941,7 +2942,8 @@ static void + } + + static void +-g_local_file_file_iface_init (GFileIface *iface) ++g_local_file_file_iface_init (GFileIface *iface, ++ gpointer iface_data) + { + iface->dup = g_local_file_dup; + iface->hash = g_local_file_hash; +Index: glib-2.56.4/gio/glocalfileinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/glocalfileinputstream.c ++++ glib-2.56.4/gio/glocalfileinputstream.c +@@ -49,7 +49,8 @@ struct _GLocalFileInputStreamPrivate { + }; + + #ifdef G_OS_UNIX +-static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); ++static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data); + #endif + + #define g_local_file_input_stream_get_type _g_local_file_input_stream_get_type +@@ -114,7 +115,8 @@ static void + + #ifdef G_OS_UNIX + static void +-g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) ++g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data) + { + iface->get_fd = g_local_file_input_stream_get_fd; + } +Index: glib-2.56.4/gio/glocalfileoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/glocalfileoutputstream.c ++++ glib-2.56.4/gio/glocalfileoutputstream.c +@@ -67,7 +67,8 @@ struct _GLocalFileOutputStreamPrivate { + }; + + #ifdef G_OS_UNIX +-static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); ++static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data); + #endif + + #define g_local_file_output_stream_get_type _g_local_file_output_stream_get_type +@@ -154,7 +155,8 @@ static void + + #ifdef G_OS_UNIX + static void +-g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) ++g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data) + { + iface->get_fd = g_local_file_output_stream_get_fd; + } +Index: glib-2.56.4/gio/gmemoryinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gmemoryinputstream.c ++++ glib-2.56.4/gio/gmemoryinputstream.c +@@ -78,7 +78,8 @@ static gboolean g_memory_input_stream_close_finish (GI + GAsyncResult *result, + GError **error); + +-static void g_memory_input_stream_seekable_iface_init (GSeekableIface *iface); ++static void g_memory_input_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data); + static goffset g_memory_input_stream_tell (GSeekable *seekable); + static gboolean g_memory_input_stream_can_seek (GSeekable *seekable); + static gboolean g_memory_input_stream_seek (GSeekable *seekable, +@@ -92,7 +93,8 @@ static gboolean g_memory_input_stream_truncate + GCancellable *cancellable, + GError **error); + +-static void g_memory_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); ++static void g_memory_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, ++ gpointer iface_data); + static gboolean g_memory_input_stream_is_readable (GPollableInputStream *stream); + static GSource *g_memory_input_stream_create_source (GPollableInputStream *stream, + GCancellable *cancellable); +@@ -143,7 +145,8 @@ static void + } + + static void +-g_memory_input_stream_seekable_iface_init (GSeekableIface *iface) ++g_memory_input_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data) + { + iface->tell = g_memory_input_stream_tell; + iface->can_seek = g_memory_input_stream_can_seek; +@@ -153,7 +156,8 @@ static void + } + + static void +-g_memory_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) ++g_memory_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, ++ gpointer iface_data) + { + iface->is_readable = g_memory_input_stream_is_readable; + iface->create_source = g_memory_input_stream_create_source; +Index: glib-2.56.4/gio/gmemoryoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gmemoryoutputstream.c ++++ glib-2.56.4/gio/gmemoryoutputstream.c +@@ -96,7 +96,8 @@ static gboolean g_memory_output_stream_close_finish (G + GAsyncResult *result, + GError **error); + +-static void g_memory_output_stream_seekable_iface_init (GSeekableIface *iface); ++static void g_memory_output_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data); + static goffset g_memory_output_stream_tell (GSeekable *seekable); + static gboolean g_memory_output_stream_can_seek (GSeekable *seekable); + static gboolean g_memory_output_stream_seek (GSeekable *seekable, +@@ -114,7 +115,8 @@ static GSource *g_memory_output_stream_create_source + static GSource *g_memory_output_stream_create_source (GPollableOutputStream *stream, + GCancellable *cancellable); + +-static void g_memory_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); ++static void g_memory_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GMemoryOutputStream, g_memory_output_stream, G_TYPE_OUTPUT_STREAM, + G_ADD_PRIVATE (GMemoryOutputStream) +@@ -221,7 +223,8 @@ static void + } + + static void +-g_memory_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) ++g_memory_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, ++ gpointer iface_data) + { + iface->is_writable = g_memory_output_stream_is_writable; + iface->create_source = g_memory_output_stream_create_source; +@@ -310,7 +313,8 @@ static void + } + + static void +-g_memory_output_stream_seekable_iface_init (GSeekableIface *iface) ++g_memory_output_stream_seekable_iface_init (GSeekableIface *iface, ++ gpointer iface_data) + { + iface->tell = g_memory_output_stream_tell; + iface->can_seek = g_memory_output_stream_can_seek; +Index: glib-2.56.4/gio/gnetworkaddress.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkaddress.c ++++ glib-2.56.4/gio/gnetworkaddress.c +@@ -83,7 +83,8 @@ static void g_network_address_get_property (GObject + GValue *value, + GParamSpec *pspec); + +-static void g_network_address_connectable_iface_init (GSocketConnectableIface *iface); ++static void g_network_address_connectable_iface_init (GSocketConnectableIface *iface, ++ gpointer iface_data); + static GSocketAddressEnumerator *g_network_address_connectable_enumerate (GSocketConnectable *connectable); + static GSocketAddressEnumerator *g_network_address_connectable_proxy_enumerate (GSocketConnectable *connectable); + static gchar *g_network_address_connectable_to_string (GSocketConnectable *connectable); +@@ -142,7 +143,8 @@ static void + } + + static void +-g_network_address_connectable_iface_init (GSocketConnectableIface *connectable_iface) ++g_network_address_connectable_iface_init (GSocketConnectableIface *connectable_iface, ++ gpointer iface_data) + { + connectable_iface->enumerate = g_network_address_connectable_enumerate; + connectable_iface->proxy_enumerate = g_network_address_connectable_proxy_enumerate; +Index: glib-2.56.4/gio/gnetworkmonitorbase.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkmonitorbase.c ++++ glib-2.56.4/gio/gnetworkmonitorbase.c +@@ -31,8 +31,10 @@ + #include "gtask.h" + #include "glibintl.h" + +-static void g_network_monitor_base_iface_init (GNetworkMonitorInterface *iface); +-static void g_network_monitor_base_initable_iface_init (GInitableIface *iface); ++static void g_network_monitor_base_iface_init (GNetworkMonitorInterface *iface, ++ gpointer iface_data); ++static void g_network_monitor_base_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + enum + { +@@ -334,7 +336,8 @@ static void + } + + static void +-g_network_monitor_base_iface_init (GNetworkMonitorInterface *monitor_iface) ++g_network_monitor_base_iface_init (GNetworkMonitorInterface *monitor_iface, ++ gpointer iface_data) + { + monitor_iface->can_reach = g_network_monitor_base_can_reach; + monitor_iface->can_reach_async = g_network_monitor_base_can_reach_async; +@@ -356,7 +359,8 @@ static void + } + + static void +-g_network_monitor_base_initable_iface_init (GInitableIface *iface) ++g_network_monitor_base_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_network_monitor_base_initable_init; + } +Index: glib-2.56.4/gio/gnetworkmonitornetlink.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkmonitornetlink.c ++++ glib-2.56.4/gio/gnetworkmonitornetlink.c +@@ -40,8 +40,10 @@ static GInitableIface *initable_parent_iface; + #include + + static GInitableIface *initable_parent_iface; +-static void g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *iface); +-static void g_network_monitor_netlink_initable_iface_init (GInitableIface *iface); ++static void g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *iface, ++ gpointer iface_data); ++static void g_network_monitor_netlink_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + struct _GNetworkMonitorNetlinkPrivate + { +@@ -468,12 +470,14 @@ static void + } + + static void +-g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *monitor_iface) ++g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *monitor_iface, ++ gpointer iface_data) + { + } + + static void +-g_network_monitor_netlink_initable_iface_init (GInitableIface *iface) ++g_network_monitor_netlink_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + initable_parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gnetworkmonitornm.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkmonitornm.c ++++ glib-2.56.4/gio/gnetworkmonitornm.c +@@ -32,8 +32,10 @@ + #include "gnetworkmonitor.h" + #include "gdbusproxy.h" + +-static void g_network_monitor_nm_iface_init (GNetworkMonitorInterface *iface); +-static void g_network_monitor_nm_initable_iface_init (GInitableIface *iface); ++static void g_network_monitor_nm_iface_init (GNetworkMonitorInterface *iface, ++ gpointer iface_data); ++static void g_network_monitor_nm_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + enum + { +@@ -356,12 +358,14 @@ static void + } + + static void +-g_network_monitor_nm_iface_init (GNetworkMonitorInterface *monitor_iface) ++g_network_monitor_nm_iface_init (GNetworkMonitorInterface *monitor_iface, ++ gpointer iface_data) + { + } + + static void +-g_network_monitor_nm_initable_iface_init (GInitableIface *iface) ++g_network_monitor_nm_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_network_monitor_nm_initable_init; + } +Index: glib-2.56.4/gio/gnetworkmonitorportal.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkmonitorportal.c ++++ glib-2.56.4/gio/gnetworkmonitorportal.c +@@ -25,8 +25,10 @@ static GInitableIface *initable_parent_iface; + #include "gportalsupport.h" + + static GInitableIface *initable_parent_iface; +-static void g_network_monitor_portal_iface_init (GNetworkMonitorInterface *iface); +-static void g_network_monitor_portal_initable_iface_init (GInitableIface *iface); ++static void g_network_monitor_portal_iface_init (GNetworkMonitorInterface *iface, ++ gpointer iface_data); ++static void g_network_monitor_portal_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + enum + { +@@ -366,12 +368,14 @@ static void + } + + static void +-g_network_monitor_portal_iface_init (GNetworkMonitorInterface *monitor_iface) ++g_network_monitor_portal_iface_init (GNetworkMonitorInterface *monitor_iface, ++ gpointer iface_data) + { + } + + static void +-g_network_monitor_portal_initable_iface_init (GInitableIface *iface) ++g_network_monitor_portal_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + initable_parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gnetworkservice.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkservice.c ++++ glib-2.56.4/gio/gnetworkservice.c +@@ -86,7 +86,8 @@ static void g_network_service_get_property (GObject + GValue *value, + GParamSpec *pspec); + +-static void g_network_service_connectable_iface_init (GSocketConnectableIface *iface); ++static void g_network_service_connectable_iface_init (GSocketConnectableIface *iface, ++ gpointer iface_data); + static GSocketAddressEnumerator *g_network_service_connectable_enumerate (GSocketConnectable *connectable); + static GSocketAddressEnumerator *g_network_service_connectable_proxy_enumerate (GSocketConnectable *connectable); + static gchar *g_network_service_connectable_to_string (GSocketConnectable *connectable); +@@ -156,7 +157,8 @@ static void + } + + static void +-g_network_service_connectable_iface_init (GSocketConnectableIface *connectable_iface) ++g_network_service_connectable_iface_init (GSocketConnectableIface *connectable_iface, ++ gpointer iface_data) + { + connectable_iface->enumerate = g_network_service_connectable_enumerate; + connectable_iface->proxy_enumerate = g_network_service_connectable_proxy_enumerate; +Index: glib-2.56.4/gio/gpropertyaction.c +=================================================================== +--- glib-2.56.4.orig/gio/gpropertyaction.c ++++ glib-2.56.4/gio/gpropertyaction.c +@@ -106,7 +106,8 @@ typedef GObjectClass GPropertyActionClass; + + typedef GObjectClass GPropertyActionClass; + +-static void g_property_action_iface_init (GActionInterface *iface); ++static void g_property_action_iface_init (GActionInterface *iface, ++ gpointer iface_data); + G_DEFINE_TYPE_WITH_CODE (GPropertyAction, g_property_action, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION, g_property_action_iface_init)) + +@@ -401,7 +402,8 @@ void + } + + void +-g_property_action_iface_init (GActionInterface *iface) ++g_property_action_iface_init (GActionInterface *iface, ++ gpointer iface_data) + { + iface->get_name = g_property_action_get_name; + iface->get_parameter_type = g_property_action_get_parameter_type; +Index: glib-2.56.4/gio/gproxyresolverportal.c +=================================================================== +--- glib-2.56.4.orig/gio/gproxyresolverportal.c ++++ glib-2.56.4/gio/gproxyresolverportal.c +@@ -31,7 +31,8 @@ struct _GProxyResolverPortal { + gboolean network_available; + }; + +-static void g_proxy_resolver_portal_iface_init (GProxyResolverInterface *iface); ++static void g_proxy_resolver_portal_iface_init (GProxyResolverInterface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GProxyResolverPortal, g_proxy_resolver_portal, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_PROXY_RESOLVER, +@@ -199,7 +200,8 @@ static void + } + + static void +-g_proxy_resolver_portal_iface_init (GProxyResolverInterface *iface) ++g_proxy_resolver_portal_iface_init (GProxyResolverInterface *iface, ++ gpointer iface_data) + { + iface->is_supported = g_proxy_resolver_portal_is_supported; + iface->lookup = g_proxy_resolver_portal_lookup; +Index: glib-2.56.4/gio/gresourcefile.c +=================================================================== +--- glib-2.56.4.orig/gio/gresourcefile.c ++++ glib-2.56.4/gio/gresourcefile.c +@@ -66,7 +66,8 @@ typedef struct _GResourceFileEnumeratorClass GResour + typedef struct _GResourceFileEnumerator GResourceFileEnumerator; + typedef struct _GResourceFileEnumeratorClass GResourceFileEnumeratorClass; + +-static void g_resource_file_file_iface_init (GFileIface *iface); ++static void g_resource_file_file_iface_init (GFileIface *iface, ++ gpointer iface_data); + + static GFileAttributeInfoList *resource_writable_attributes = NULL; + static GFileAttributeInfoList *resource_writable_namespaces = NULL; +@@ -645,7 +646,8 @@ static void + } + + static void +-g_resource_file_file_iface_init (GFileIface *iface) ++g_resource_file_file_iface_init (GFileIface *iface, ++ gpointer iface_data) + { + iface->dup = g_resource_file_dup; + iface->hash = g_resource_file_hash; +Index: glib-2.56.4/gio/gsettings.c +=================================================================== +--- glib-2.56.4.orig/gio/gsettings.c ++++ glib-2.56.4/gio/gsettings.c +@@ -3124,7 +3124,8 @@ static GType g_settings_action_get_type (void); + typedef GObjectClass GSettingsActionClass; + + static GType g_settings_action_get_type (void); +-static void g_settings_action_iface_init (GActionInterface *iface); ++static void g_settings_action_iface_init (GActionInterface *iface, ++ gpointer iface_data); + G_DEFINE_TYPE_WITH_CODE (GSettingsAction, g_settings_action, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION, g_settings_action_iface_init)) + +@@ -3284,7 +3285,8 @@ static void + } + + static void +-g_settings_action_iface_init (GActionInterface *iface) ++g_settings_action_iface_init (GActionInterface *iface, ++ gpointer iface_data) + { + iface->get_name = g_settings_action_get_name; + iface->get_parameter_type = g_settings_action_get_parameter_type; +Index: glib-2.56.4/gio/gsimpleaction.c +=================================================================== +--- glib-2.56.4.orig/gio/gsimpleaction.c ++++ glib-2.56.4/gio/gsimpleaction.c +@@ -58,7 +58,8 @@ typedef GObjectClass GSimpleActionClass; + + typedef GObjectClass GSimpleActionClass; + +-static void g_simple_action_iface_init (GActionInterface *iface); ++static void g_simple_action_iface_init (GActionInterface *iface, ++ gpointer iface_data); + G_DEFINE_TYPE_WITH_CODE (GSimpleAction, g_simple_action, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION, g_simple_action_iface_init)) + +@@ -347,7 +348,8 @@ void + } + + void +-g_simple_action_iface_init (GActionInterface *iface) ++g_simple_action_iface_init (GActionInterface *iface, ++ gpointer iface_data) + { + iface->get_name = g_simple_action_get_name; + iface->get_parameter_type = g_simple_action_get_parameter_type; +Index: glib-2.56.4/gio/gsimpleactiongroup.c +=================================================================== +--- glib-2.56.4.orig/gio/gsimpleactiongroup.c ++++ glib-2.56.4/gio/gsimpleactiongroup.c +@@ -40,8 +40,10 @@ struct _GSimpleActionGroupPrivate + GHashTable *table; /* string -> GAction */ + }; + +-static void g_simple_action_group_iface_init (GActionGroupInterface *); +-static void g_simple_action_group_map_iface_init (GActionMapInterface *); ++static void g_simple_action_group_iface_init (GActionGroupInterface *iface, ++ gpointer iface_data); ++static void g_simple_action_group_map_iface_init (GActionMapInterface *iface, ++ gpointer iface_data); + G_DEFINE_TYPE_WITH_CODE (GSimpleActionGroup, + g_simple_action_group, G_TYPE_OBJECT, + G_ADD_PRIVATE (GSimpleActionGroup) +@@ -272,7 +274,8 @@ static void + } + + static void +-g_simple_action_group_iface_init (GActionGroupInterface *iface) ++g_simple_action_group_iface_init (GActionGroupInterface *iface, ++ gpointer iface_data) + { + iface->list_actions = g_simple_action_group_list_actions; + iface->query_action = g_simple_action_group_query_action; +@@ -281,7 +284,8 @@ static void + } + + static void +-g_simple_action_group_map_iface_init (GActionMapInterface *iface) ++g_simple_action_group_map_iface_init (GActionMapInterface *iface, ++ gpointer iface_data) + { + iface->add_action = g_simple_action_group_add_action; + iface->remove_action = g_simple_action_group_remove_action; +Index: glib-2.56.4/gio/gsimpleasyncresult.c +=================================================================== +--- glib-2.56.4.orig/gio/gsimpleasyncresult.c ++++ glib-2.56.4/gio/gsimpleasyncresult.c +@@ -205,7 +205,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS + + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +-static void g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface); ++static void g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface, ++ gpointer iface_data); + + struct _GSimpleAsyncResult + { +@@ -464,7 +465,8 @@ static void + } + + static void +-g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface) ++g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface, ++ gpointer iface_data) + { + iface->get_user_data = g_simple_async_result_get_user_data; + iface->get_source_object = g_simple_async_result_get_source_object; +Index: glib-2.56.4/gio/gsimpleproxyresolver.c +=================================================================== +--- glib-2.56.4.orig/gio/gsimpleproxyresolver.c ++++ glib-2.56.4/gio/gsimpleproxyresolver.c +@@ -62,7 +62,8 @@ struct _GSimpleProxyResolverPrivate { + GSimpleProxyResolverDomain *ignore_domains; + }; + +-static void g_simple_proxy_resolver_iface_init (GProxyResolverInterface *iface); ++static void g_simple_proxy_resolver_iface_init (GProxyResolverInterface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GSimpleProxyResolver, g_simple_proxy_resolver, G_TYPE_OBJECT, + G_ADD_PRIVATE (GSimpleProxyResolver) +@@ -477,7 +478,8 @@ static void + } + + static void +-g_simple_proxy_resolver_iface_init (GProxyResolverInterface *iface) ++g_simple_proxy_resolver_iface_init (GProxyResolverInterface *iface, ++ gpointer iface_data) + { + iface->lookup = g_simple_proxy_resolver_lookup; + iface->lookup_async = g_simple_proxy_resolver_lookup_async; +Index: glib-2.56.4/gio/gsocket.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocket.c ++++ glib-2.56.4/gio/gsocket.c +@@ -141,12 +141,14 @@ + * Since: 2.22 + */ + +-static void g_socket_initable_iface_init (GInitableIface *iface); ++static void g_socket_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + static gboolean g_socket_initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error); + +-static void g_socket_datagram_based_iface_init (GDatagramBasedInterface *iface); ++static void g_socket_datagram_based_iface_init (GDatagramBasedInterface *iface, ++ gpointer iface_data); + static gint g_socket_datagram_based_receive_messages (GDatagramBased *self, + GInputMessage *messages, + guint num_messages, +@@ -1056,13 +1058,15 @@ static void + } + + static void +-g_socket_initable_iface_init (GInitableIface *iface) ++g_socket_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_socket_initable_init; + } + + static void +-g_socket_datagram_based_iface_init (GDatagramBasedInterface *iface) ++g_socket_datagram_based_iface_init (GDatagramBasedInterface *iface, ++ gpointer iface_data) + { + iface->receive_messages = g_socket_datagram_based_receive_messages; + iface->send_messages = g_socket_datagram_based_send_messages; +Index: glib-2.56.4/gio/gsocketaddress.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocketaddress.c ++++ glib-2.56.4/gio/gsocketaddress.c +@@ -64,7 +64,8 @@ enum + PROP_FAMILY + }; + +-static void g_socket_address_connectable_iface_init (GSocketConnectableIface *iface); ++static void g_socket_address_connectable_iface_init (GSocketConnectableIface *iface, ++ gpointer iface_data); + static GSocketAddressEnumerator *g_socket_address_connectable_enumerate (GSocketConnectable *connectable); + static GSocketAddressEnumerator *g_socket_address_connectable_proxy_enumerate (GSocketConnectable *connectable); + +@@ -125,7 +126,8 @@ static void + } + + static void +-g_socket_address_connectable_iface_init (GSocketConnectableIface *connectable_iface) ++g_socket_address_connectable_iface_init (GSocketConnectableIface *connectable_iface, ++ gpointer iface_data) + { + connectable_iface->enumerate = g_socket_address_connectable_enumerate; + connectable_iface->proxy_enumerate = g_socket_address_connectable_proxy_enumerate; +Index: glib-2.56.4/gio/gsocketinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocketinputstream.c ++++ glib-2.56.4/gio/gsocketinputstream.c +@@ -39,9 +39,11 @@ struct _GSocketInputStreamPrivate + gsize count; + }; + +-static void g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); ++static void g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, ++ gpointer iface_data); + #ifdef G_OS_UNIX +-static void g_socket_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); ++static void g_socket_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data); + #endif + + #define g_socket_input_stream_get_type _g_socket_input_stream_get_type +@@ -198,14 +200,16 @@ static void + + #ifdef G_OS_UNIX + static void +-g_socket_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) ++g_socket_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data) + { + iface->get_fd = g_socket_input_stream_get_fd; + } + #endif + + static void +-g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) ++g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, ++ gpointer iface_data) + { + iface->is_readable = g_socket_input_stream_pollable_is_readable; + iface->create_source = g_socket_input_stream_pollable_create_source; +Index: glib-2.56.4/gio/gsocketoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocketoutputstream.c ++++ glib-2.56.4/gio/gsocketoutputstream.c +@@ -43,9 +43,11 @@ struct _GSocketOutputStreamPrivate + gsize count; + }; + +-static void g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); ++static void g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, ++ gpointer iface_data); + #ifdef G_OS_UNIX +-static void g_socket_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); ++static void g_socket_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data); + #endif + + #define g_socket_output_stream_get_type _g_socket_output_stream_get_type +@@ -202,14 +204,16 @@ static void + + #ifdef G_OS_UNIX + static void +-g_socket_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) ++g_socket_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data) + { + iface->get_fd = g_socket_output_stream_get_fd; + } + #endif + + static void +-g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) ++g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, ++ gpointer iface_data) + { + iface->is_writable = g_socket_output_stream_pollable_is_writable; + iface->create_source = g_socket_output_stream_pollable_create_source; +Index: glib-2.56.4/gio/gsocks4aproxy.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocks4aproxy.c ++++ glib-2.56.4/gio/gsocks4aproxy.c +@@ -48,7 +48,8 @@ + #define SOCKS4_REP_NO_IDENT 92 + #define SOCKS4_REP_BAD_IDENT 93 + +-static void g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface); ++static void g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface, ++ gpointer iface_data); + + #define g_socks4a_proxy_get_type _g_socks4a_proxy_get_type + G_DEFINE_TYPE_WITH_CODE (GSocks4aProxy, g_socks4a_proxy, G_TYPE_OBJECT, +@@ -449,7 +450,8 @@ static void + } + + static void +-g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface) ++g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface, ++ gpointer iface_data) + { + proxy_iface->connect = g_socks4a_proxy_connect; + proxy_iface->connect_async = g_socks4a_proxy_connect_async; +Index: glib-2.56.4/gio/gsocks5proxy.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocks5proxy.c ++++ glib-2.56.4/gio/gsocks5proxy.c +@@ -80,7 +80,8 @@ struct _GSocks5ProxyClass + GObjectClass parent_class; + }; + +-static void g_socks5_proxy_iface_init (GProxyInterface *proxy_iface); ++static void g_socks5_proxy_iface_init (GProxyInterface *proxy_iface, ++ gpointer iface_data); + + #define g_socks5_proxy_get_type _g_socks5_proxy_get_type + G_DEFINE_TYPE_WITH_CODE (GSocks5Proxy, g_socks5_proxy, G_TYPE_OBJECT, +@@ -1033,7 +1034,8 @@ static void + } + + static void +-g_socks5_proxy_iface_init (GProxyInterface *proxy_iface) ++g_socks5_proxy_iface_init (GProxyInterface *proxy_iface, ++ gpointer iface_data) + { + proxy_iface->connect = g_socks5_proxy_connect; + proxy_iface->connect_async = g_socks5_proxy_connect_async; +Index: glib-2.56.4/gio/gsubprocess.c +=================================================================== +--- glib-2.56.4.orig/gio/gsubprocess.c ++++ glib-2.56.4/gio/gsubprocess.c +@@ -140,7 +140,8 @@ + * via the worker thread so that we don't race with waitpid() and + * accidentally send a signal to an already-reaped child. + */ +-static void initable_iface_init (GInitableIface *initable_iface); ++static void initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data); + + typedef GObjectClass GSubprocessClass; + +@@ -642,7 +643,8 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface) ++initable_iface_init (GInitableIface *initable_iface, ++ gpointer iface_data) + { + initable_iface->init = initable_init; + } +Index: glib-2.56.4/gio/gtask.c +=================================================================== +--- glib-2.56.4.orig/gio/gtask.c ++++ glib-2.56.4/gio/gtask.c +@@ -589,7 +589,8 @@ typedef enum + PROP_COMPLETED = 1, + } GTaskProperty; + +-static void g_task_async_result_iface_init (GAsyncResultIface *iface); ++static void g_task_async_result_iface_init (GAsyncResultIface *iface, ++ gpointer iface_data); + static void g_task_thread_pool_init (void); + + G_DEFINE_TYPE_WITH_CODE (GTask, g_task, G_TYPE_OBJECT, +@@ -2042,7 +2043,8 @@ static void + } + + static void +-g_task_async_result_iface_init (GAsyncResultIface *iface) ++g_task_async_result_iface_init (GAsyncResultIface *iface, ++ gpointer iface_data) + { + iface->get_user_data = g_task_get_user_data; + iface->get_source_object = g_task_ref_source_object; +Index: glib-2.56.4/gio/gthemedicon.c +=================================================================== +--- glib-2.56.4.orig/gio/gthemedicon.c ++++ glib-2.56.4/gio/gthemedicon.c +@@ -43,7 +43,8 @@ + * themes that inherit other themes. + **/ + +-static void g_themed_icon_icon_iface_init (GIconIface *iface); ++static void g_themed_icon_icon_iface_init (GIconIface *iface, ++ gpointer iface_data); + + struct _GThemedIcon + { +@@ -541,7 +542,8 @@ static void + } + + static void +-g_themed_icon_icon_iface_init (GIconIface *iface) ++g_themed_icon_icon_iface_init (GIconIface *iface, ++ gpointer iface_data) + { + iface->hash = g_themed_icon_hash; + iface->equal = g_themed_icon_equal; +Index: glib-2.56.4/gio/gunixinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixinputstream.c ++++ glib-2.56.4/gio/gunixinputstream.c +@@ -67,8 +67,10 @@ struct _GUnixInputStreamPrivate { + guint is_pipe_or_socket : 1; + }; + +-static void g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); +-static void g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); ++static void g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, ++ gpointer iface_data); ++static void g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GUnixInputStream, g_unix_input_stream, G_TYPE_INPUT_STREAM, + G_ADD_PRIVATE (GUnixInputStream) +@@ -169,7 +171,8 @@ static void + } + + static void +-g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) ++g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, ++ gpointer iface_data) + { + iface->can_poll = g_unix_input_stream_pollable_can_poll; + iface->is_readable = g_unix_input_stream_pollable_is_readable; +@@ -177,7 +180,8 @@ static void + } + + static void +-g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) ++g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data) + { + iface->get_fd = (int (*) (GFileDescriptorBased *))g_unix_input_stream_get_fd; + } +Index: glib-2.56.4/gio/gunixmount.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixmount.c ++++ glib-2.56.4/gio/gunixmount.c +@@ -61,7 +61,8 @@ struct _GUnixMount { + gboolean can_eject; + }; + +-static void g_unix_mount_mount_iface_init (GMountIface *iface); ++static void g_unix_mount_mount_iface_init (GMountIface *iface, ++ gpointer iface_data); + + #define g_unix_mount_get_type _g_unix_mount_get_type + G_DEFINE_TYPE_WITH_CODE (GUnixMount, g_unix_mount, G_TYPE_OBJECT, +@@ -375,7 +376,8 @@ static void + } + + static void +-g_unix_mount_mount_iface_init (GMountIface *iface) ++g_unix_mount_mount_iface_init (GMountIface *iface, ++ gpointer iface_data) + { + iface->get_root = g_unix_mount_get_root; + iface->get_name = g_unix_mount_get_name; +Index: glib-2.56.4/gio/gunixoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixoutputstream.c ++++ glib-2.56.4/gio/gunixoutputstream.c +@@ -67,8 +67,10 @@ struct _GUnixOutputStreamPrivate { + guint is_pipe_or_socket : 1; + }; + +-static void g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); +-static void g_unix_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); ++static void g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, ++ gpointer iface_data); ++static void g_unix_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data); + + G_DEFINE_TYPE_WITH_CODE (GUnixOutputStream, g_unix_output_stream, G_TYPE_OUTPUT_STREAM, + G_ADD_PRIVATE (GUnixOutputStream) +@@ -154,7 +156,8 @@ static void + } + + static void +-g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) ++g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, ++ gpointer iface_data) + { + iface->can_poll = g_unix_output_stream_pollable_can_poll; + iface->is_writable = g_unix_output_stream_pollable_is_writable; +@@ -162,7 +165,8 @@ static void + } + + static void +-g_unix_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) ++g_unix_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, ++ gpointer iface_data) + { + iface->get_fd = (int (*) (GFileDescriptorBased *))g_unix_output_stream_get_fd; + } +Index: glib-2.56.4/gio/gunixsocketaddress.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixsocketaddress.c ++++ glib-2.56.4/gio/gunixsocketaddress.c +@@ -77,7 +77,8 @@ struct _GUnixSocketAddressPrivate + GUnixSocketAddressType address_type; + }; + +-static void g_unix_socket_address_connectable_iface_init (GSocketConnectableIface *iface); ++static void g_unix_socket_address_connectable_iface_init (GSocketConnectableIface *iface, ++ gpointer iface_data); + static gchar *g_unix_socket_address_connectable_to_string (GSocketConnectable *connectable); + + G_DEFINE_TYPE_WITH_CODE (GUnixSocketAddress, g_unix_socket_address, G_TYPE_SOCKET_ADDRESS, +@@ -309,7 +310,8 @@ static void + } + + static void +-g_unix_socket_address_connectable_iface_init (GSocketConnectableIface *iface) ++g_unix_socket_address_connectable_iface_init (GSocketConnectableIface *iface, ++ gpointer iface_data) + { + GSocketConnectableIface *parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gunixvolume.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixvolume.c ++++ glib-2.56.4/gio/gunixvolume.c +@@ -59,7 +59,8 @@ struct _GUnixVolume { + GIcon *symbolic_icon; + }; + +-static void g_unix_volume_volume_iface_init (GVolumeIface *iface); ++static void g_unix_volume_volume_iface_init (GVolumeIface *iface, ++ gpointer iface_data); + + #define g_unix_volume_get_type _g_unix_volume_get_type + G_DEFINE_TYPE_WITH_CODE (GUnixVolume, g_unix_volume, G_TYPE_OBJECT, +@@ -417,7 +418,8 @@ static void + } + + static void +-g_unix_volume_volume_iface_init (GVolumeIface *iface) ++g_unix_volume_volume_iface_init (GVolumeIface *iface, ++ gpointer iface_data) + { + iface->get_name = g_unix_volume_get_name; + iface->get_icon = g_unix_volume_get_icon; +Index: glib-2.56.4/gio/gwin32appinfo.c +=================================================================== +--- glib-2.56.4.orig/gio/gwin32appinfo.c ++++ glib-2.56.4/gio/gwin32appinfo.c +@@ -3435,7 +3435,8 @@ g_win32_appinfo_init (void) + } + + +-static void g_win32_app_info_iface_init (GAppInfoIface *iface); ++static void g_win32_app_info_iface_init (GAppInfoIface *iface, ++ gpointer iface_data); + + struct _GWin32AppInfo + { +@@ -4419,7 +4420,8 @@ static void + /* GAppInfo interface init */ + + static void +-g_win32_app_info_iface_init (GAppInfoIface *iface) ++g_win32_app_info_iface_init (GAppInfoIface *iface, ++ gpointer iface_data) + { + iface->dup = g_win32_app_info_dup; + iface->equal = g_win32_app_info_equal; +Index: glib-2.56.4/gio/gwin32mount.c +=================================================================== +--- glib-2.56.4.orig/gio/gwin32mount.c ++++ glib-2.56.4/gio/gwin32mount.c +@@ -55,7 +55,8 @@ struct _GWin32Mount { + gboolean can_eject; + }; + +-static void g_win32_mount_mount_iface_init (GMountIface *iface); ++static void g_win32_mount_mount_iface_init (GMountIface *iface, ++ gpointer iface_data) + + #define g_win32_mount_get_type _g_win32_mount_get_type + G_DEFINE_TYPE_WITH_CODE (GWin32Mount, g_win32_mount, G_TYPE_OBJECT, +@@ -346,7 +347,8 @@ static void + } + + static void +-g_win32_mount_mount_iface_init (GMountIface *iface) ++g_win32_mount_mount_iface_init (GMountIface *iface, ++ gpointer iface_data) + { + iface->get_root = g_win32_mount_get_root; + iface->get_name = g_win32_mount_get_name; +Index: glib-2.56.4/gio/gwin32networkmonitor.c +=================================================================== +--- glib-2.56.4.orig/gio/gwin32networkmonitor.c ++++ glib-2.56.4/gio/gwin32networkmonitor.c +@@ -44,8 +44,10 @@ static GInitableIface *initable_parent_iface; + #include "gioerror.h" + + static GInitableIface *initable_parent_iface; +-static void g_win32_network_monitor_iface_init (GNetworkMonitorInterface *iface); +-static void g_win32_network_monitor_initable_iface_init (GInitableIface *iface); ++static void g_win32_network_monitor_iface_init (GNetworkMonitorInterface *iface, ++ gpointer iface_data); ++static void g_win32_network_monitor_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + + struct _GWin32NetworkMonitorPrivate + { +@@ -326,12 +328,14 @@ static void + } + + static void +-g_win32_network_monitor_iface_init (GNetworkMonitorInterface *monitor_iface) ++g_win32_network_monitor_iface_init (GNetworkMonitorInterface *monitor_iface, ++ gpointer iface_data) + { + } + + static void +-g_win32_network_monitor_initable_iface_init (GInitableIface *iface) ++g_win32_network_monitor_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + initable_parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gwin32registrykey.c +=================================================================== +--- glib-2.56.4.orig/gio/gwin32registrykey.c ++++ glib-2.56.4/gio/gwin32registrykey.c +@@ -414,7 +414,8 @@ struct _GWin32RegistryKeyPrivate { + gpointer user_data; + }; + +-static void g_win32_registry_key_initable_iface_init (GInitableIface *iface); ++static void g_win32_registry_key_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data); + static gboolean g_win32_registry_key_initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error); +@@ -521,7 +522,8 @@ static void + } + + static void +-g_win32_registry_key_initable_iface_init (GInitableIface *iface) ++g_win32_registry_key_initable_iface_init (GInitableIface *iface, ++ gpointer iface_data) + { + iface->init = g_win32_registry_key_initable_init; + } +Index: glib-2.56.4/gio/gzlibcompressor.c +=================================================================== +--- glib-2.56.4.orig/gio/gzlibcompressor.c ++++ glib-2.56.4/gio/gzlibcompressor.c +@@ -49,7 +49,8 @@ enum { + * compresses data using zlib. + */ + +-static void g_zlib_compressor_iface_init (GConverterIface *iface); ++static void g_zlib_compressor_iface_init (GConverterIface *iface, ++ gpointer iface_data); + + /** + * GZlibCompressor: +@@ -429,7 +430,8 @@ static void + } + + static void +-g_zlib_compressor_iface_init (GConverterIface *iface) ++g_zlib_compressor_iface_init (GConverterIface *iface, ++ gpointer iface_data) + { + iface->convert = g_zlib_compressor_convert; + iface->reset = g_zlib_compressor_reset; +Index: glib-2.56.4/gio/gzlibdecompressor.c +=================================================================== +--- glib-2.56.4.orig/gio/gzlibdecompressor.c ++++ glib-2.56.4/gio/gzlibdecompressor.c +@@ -48,7 +48,8 @@ enum { + * decompresses data compressed with zlib. + */ + +-static void g_zlib_decompressor_iface_init (GConverterIface *iface); ++static void g_zlib_decompressor_iface_init (GConverterIface *iface, ++ gpointer iface_data); + + typedef struct { + gz_header gzheader; +@@ -406,7 +407,8 @@ static void + } + + static void +-g_zlib_decompressor_iface_init (GConverterIface *iface) ++g_zlib_decompressor_iface_init (GConverterIface *iface, ++ gpointer iface_data) + { + iface->convert = g_zlib_decompressor_convert; + iface->reset = g_zlib_decompressor_reset; +Index: glib-2.56.4/gobject/gobject.c +=================================================================== +--- glib-2.56.4.orig/gobject/gobject.c ++++ glib-2.56.4/gobject/gobject.c +@@ -143,7 +143,8 @@ static void g_object_base_class_finalize (GObjectClas + /* --- prototypes --- */ + static void g_object_base_class_init (GObjectClass *class); + static void g_object_base_class_finalize (GObjectClass *class); +-static void g_object_do_class_init (GObjectClass *class); ++static void g_object_do_class_init (GObjectClass *class, ++ gpointer class_data); + static void g_object_init (GObject *object, + GObjectClass *class); + static GObject* g_object_constructor (GType type, +@@ -451,7 +452,8 @@ static void + } + + static void +-g_object_do_class_init (GObjectClass *class) ++g_object_do_class_init (GObjectClass *class, ++ gpointer class_data) + { + /* read the comment about typedef struct CArray; on why not to change this quark */ + quark_closure_array = g_quark_from_static_string ("GObject-closure-array"); +Index: glib-2.56.4/gobject/gparam.h +=================================================================== +--- glib-2.56.4.orig/gobject/gparam.h ++++ glib-2.56.4/gobject/gparam.h +@@ -380,7 +380,8 @@ struct _GParamSpecTypeInfo + /* type system portion */ + guint16 instance_size; /* obligatory */ + guint16 n_preallocs; /* optional */ +- void (*instance_init) (GParamSpec *pspec); /* optional */ ++ void (*instance_init) (GParamSpec *pspec, /* optional */ ++ gpointer class_data); + + /* class portion */ + GType value_type; /* obligatory */ +Index: glib-2.56.4/gobject/gparamspecs.c +=================================================================== +--- glib-2.56.4.orig/gobject/gparamspecs.c ++++ glib-2.56.4/gobject/gparamspecs.c +@@ -59,7 +59,8 @@ static void + + /* --- param spec functions --- */ + static void +-param_char_init (GParamSpec *pspec) ++param_char_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecChar *cspec = G_PARAM_SPEC_CHAR (pspec); + +@@ -88,7 +89,8 @@ static void + } + + static void +-param_uchar_init (GParamSpec *pspec) ++param_uchar_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecUChar *uspec = G_PARAM_SPEC_UCHAR (pspec); + +@@ -135,7 +137,8 @@ static void + } + + static void +-param_int_init (GParamSpec *pspec) ++param_int_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecInt *ispec = G_PARAM_SPEC_INT (pspec); + +@@ -175,7 +178,8 @@ static void + } + + static void +-param_uint_init (GParamSpec *pspec) ++param_uint_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecUInt *uspec = G_PARAM_SPEC_UINT (pspec); + +@@ -215,7 +219,8 @@ static void + } + + static void +-param_long_init (GParamSpec *pspec) ++param_long_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecLong *lspec = G_PARAM_SPEC_LONG (pspec); + +@@ -260,7 +265,8 @@ static void + } + + static void +-param_ulong_init (GParamSpec *pspec) ++param_ulong_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecULong *uspec = G_PARAM_SPEC_ULONG (pspec); + +@@ -304,7 +310,8 @@ static void + } + + static void +-param_int64_init (GParamSpec *pspec) ++param_int64_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecInt64 *lspec = G_PARAM_SPEC_INT64 (pspec); + +@@ -344,7 +351,8 @@ static void + } + + static void +-param_uint64_init (GParamSpec *pspec) ++param_uint64_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecUInt64 *uspec = G_PARAM_SPEC_UINT64 (pspec); + +@@ -384,7 +392,8 @@ static void + } + + static void +-param_unichar_init (GParamSpec *pspec) ++param_unichar_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecUnichar *uspec = G_PARAM_SPEC_UNICHAR (pspec); + +@@ -426,7 +435,8 @@ static void + } + + static void +-param_enum_init (GParamSpec *pspec) ++param_enum_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecEnum *espec = G_PARAM_SPEC_ENUM (pspec); + +@@ -471,7 +481,8 @@ static void + } + + static void +-param_flags_init (GParamSpec *pspec) ++param_flags_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecFlags *fspec = G_PARAM_SPEC_FLAGS (pspec); + +@@ -517,7 +528,8 @@ static void + } + + static void +-param_float_init (GParamSpec *pspec) ++param_float_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecFloat *fspec = G_PARAM_SPEC_FLOAT (pspec); + +@@ -560,7 +572,8 @@ static void + } + + static void +-param_double_init (GParamSpec *pspec) ++param_double_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecDouble *dspec = G_PARAM_SPEC_DOUBLE (pspec); + +@@ -603,7 +616,8 @@ static void + } + + static void +-param_string_init (GParamSpec *pspec) ++param_string_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecString *sspec = G_PARAM_SPEC_STRING (pspec); + +@@ -711,7 +725,8 @@ static void + } + + static void +-param_param_init (GParamSpec *pspec) ++param_param_init (GParamSpec *pspec, ++ gpointer class_data) + { + /* GParamSpecParam *spec = G_PARAM_SPEC_PARAM (pspec); */ + } +@@ -742,7 +757,8 @@ static void + } + + static void +-param_boxed_init (GParamSpec *pspec) ++param_boxed_init (GParamSpec *pspec, ++ gpointer class_data) + { + /* GParamSpecBoxed *bspec = G_PARAM_SPEC_BOXED (pspec); */ + } +@@ -780,7 +796,8 @@ static void + } + + static void +-param_pointer_init (GParamSpec *pspec) ++param_pointer_init (GParamSpec *pspec, ++ gpointer class_data) + { + /* GParamSpecPointer *spec = G_PARAM_SPEC_POINTER (pspec); */ + } +@@ -816,7 +833,8 @@ static void + } + + static void +-param_value_array_init (GParamSpec *pspec) ++param_value_array_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecValueArray *aspec = G_PARAM_SPEC_VALUE_ARRAY (pspec); + +@@ -964,7 +982,8 @@ static void + } + + static void +-param_object_init (GParamSpec *pspec) ++param_object_init (GParamSpec *pspec, ++ gpointer class_data) + { + /* GParamSpecObject *ospec = G_PARAM_SPEC_OBJECT (pspec); */ + } +@@ -1008,7 +1027,8 @@ static void + } + + static void +-param_override_init (GParamSpec *pspec) ++param_override_init (GParamSpec *pspec, ++ gpointer class_data) + { + /* GParamSpecOverride *ospec = G_PARAM_SPEC_OVERRIDE (pspec); */ + } +@@ -1057,7 +1077,8 @@ static void + } + + static void +-param_gtype_init (GParamSpec *pspec) ++param_gtype_init (GParamSpec *pspec, ++ gpointer class_data) + { + } + +@@ -1101,7 +1122,8 @@ static void + } + + static void +-param_variant_init (GParamSpec *pspec) ++param_variant_init (GParamSpec *pspec, ++ gpointer class_data) + { + GParamSpecVariant *vspec = G_PARAM_SPEC_VARIANT (pspec); + +Index: glib-2.56.4/gobject/gtype.h +=================================================================== +--- glib-2.56.4.orig/gobject/gtype.h ++++ glib-2.56.4/gobject/gtype.h +@@ -1790,7 +1790,7 @@ guint g_type_get_type_registration_serial (void); + */ + #define G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) { \ + const GInterfaceInfo g_implement_interface_info = { \ +- (GInterfaceInitFunc)(void (*)(void)) iface_init, NULL, NULL \ ++ (GInterfaceInitFunc) iface_init, NULL, NULL \ + }; \ + g_type_add_interface_static (g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \ + } +@@ -1926,7 +1926,8 @@ guint g_type_get_type_registration_serial (void); + */ + #if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38 + #define _G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \ +-static void type_name##_class_intern_init (gpointer klass) \ ++static void type_name##_class_intern_init (gpointer klass, \ ++ gpointer class_data) \ + { \ + type_name##_parent_class = g_type_class_peek_parent (klass); \ + if (TypeName##_private_offset != 0) \ +@@ -1936,7 +1937,8 @@ static void type_name##_class_intern_init (gpointe + + #else + #define _G_DEFINE_TYPE_EXTENDED_CLASS_INIT(TypeName, type_name) \ +-static void type_name##_class_intern_init (gpointer klass) \ ++static void type_name##_class_intern_init (gpointer klass, \ ++ gpointer class_data) \ + { \ + type_name##_parent_class = g_type_class_peek_parent (klass); \ + type_name##_class_init ((TypeName##Class*) klass); \ +@@ -1974,9 +1976,9 @@ type_name##_get_type (void) \ + g_type_register_static_simple (TYPE_PARENT, \ + g_intern_static_string (#TypeName), \ + sizeof (TypeName##Class), \ +- (GClassInitFunc)(void (*)(void)) type_name##_class_intern_init, \ ++ (GClassInitFunc) type_name##_class_intern_init, \ + sizeof (TypeName), \ +- (GInstanceInitFunc)(void (*)(void)) type_name##_init, \ ++ (GInstanceInitFunc) type_name##_init_adapter, \ + (GTypeFlags) flags); \ + { /* custom code follows */ + #define _G_DEFINE_TYPE_EXTENDED_END() \ +@@ -1996,7 +1998,12 @@ type_name##_get_type (void) \ + + #define _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TypeName, type_name, TYPE_PREREQ) \ + \ +-static void type_name##_default_init (TypeName##Interface *klass); \ ++static void type_name##_default_init (TypeName##Interface *klass); \ ++static void type_name##_default_init_adapter (TypeName##Interface *klass, \ ++ gpointer class_data) \ ++{ \ ++ type_name##_default_init (klass); \ ++} \ + \ + GType \ + type_name##_get_type (void) \ +@@ -2008,7 +2015,7 @@ type_name##_get_type (void) \ + g_type_register_static_simple (G_TYPE_INTERFACE, \ + g_intern_static_string (#TypeName), \ + sizeof (TypeName##Interface), \ +- (GClassInitFunc)(void (*)(void)) type_name##_default_init, \ ++ (GClassInitFunc) type_name##_default_init_adapter, \ + 0, \ + (GInstanceInitFunc)NULL, \ + (GTypeFlags) 0); \ +Index: glib-2.56.4/gobject/gtypemodule.c +=================================================================== +--- glib-2.56.4.orig/gobject/gtypemodule.c ++++ glib-2.56.4/gobject/gtypemodule.c +@@ -126,7 +126,8 @@ static void + } + + static void +-g_type_module_iface_init (GTypePluginClass *iface) ++g_type_module_iface_init (GTypePluginClass *iface, ++ gpointer iface_data) + { + iface->use_plugin = g_type_module_use_plugin; + iface->unuse_plugin = (void (*) (GTypePlugin *))g_type_module_unuse; diff --git a/recipes/recipes_emscripten/glib/patches/emscripten-wasm.diff b/recipes/recipes_emscripten/glib/patches/emscripten-wasm.diff new file mode 100644 index 000000000..7d8b46f16 --- /dev/null +++ b/recipes/recipes_emscripten/glib/patches/emscripten-wasm.diff @@ -0,0 +1,2588 @@ +This patch file is a modified version of kleisauke's patches for glib, +backported to version 2.56.4. Originally available at, +https://github.com/GNOME/glib/compare/2.76.2...kleisauke:wasm-vips-2.76.2.patch + +Also includes disabling some glib functions that require the libffi library. + +Index: glib-2.56.4/gio/gapplication.c +=================================================================== +--- glib-2.56.4.orig/gio/gapplication.c ++++ glib-2.56.4/gio/gapplication.c +@@ -282,10 +282,8 @@ static guint g_application_signals[NR_SIGNALS]; + + static guint g_application_signals[NR_SIGNALS]; + +-static void g_application_action_group_iface_init (GActionGroupInterface *iface, +- gpointer iface_data); +-static void g_application_action_map_iface_init (GActionMapInterface *iface, +- gpointer iface_data); ++static void g_application_action_group_iface_init (GActionGroupInterface *); ++static void g_application_action_map_iface_init (GActionMapInterface *); + G_DEFINE_TYPE_WITH_CODE (GApplication, g_application, G_TYPE_OBJECT, + G_ADD_PRIVATE (GApplication) + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, g_application_action_group_iface_init) +@@ -311,8 +309,7 @@ static GType g_application_exported_actions_get_type + } GApplicationExportedActions; + + static GType g_application_exported_actions_get_type (void); +-static void g_application_exported_actions_iface_init (GRemoteActionGroupInterface *iface, +- gpointer iface_data); ++static void g_application_exported_actions_iface_init (GRemoteActionGroupInterface *iface); + G_DEFINE_TYPE_WITH_CODE (GApplicationExportedActions, g_application_exported_actions, G_TYPE_SIMPLE_ACTION_GROUP, + G_IMPLEMENT_INTERFACE (G_TYPE_REMOTE_ACTION_GROUP, g_application_exported_actions_iface_init)) + +@@ -356,8 +353,7 @@ static void + } + + static void +-g_application_exported_actions_iface_init (GRemoteActionGroupInterface *iface, +- gpointer iface_data) ++g_application_exported_actions_iface_init (GRemoteActionGroupInterface *iface) + { + iface->activate_action_full = g_application_exported_actions_activate_action_full; + iface->change_action_state_full = g_application_exported_actions_change_action_state_full; +@@ -2627,8 +2623,7 @@ static void + } + + static void +-g_application_action_group_iface_init (GActionGroupInterface *iface, +- gpointer iface_data) ++g_application_action_group_iface_init (GActionGroupInterface *iface) + { + iface->list_actions = g_application_list_actions; + iface->query_action = g_application_query_action; +@@ -2637,8 +2632,7 @@ static void + } + + static void +-g_application_action_map_iface_init (GActionMapInterface *iface, +- gpointer iface_data) ++g_application_action_map_iface_init (GActionMapInterface *iface) + { + iface->lookup_action = g_application_lookup_action; + iface->add_action = g_application_add_action; +Index: glib-2.56.4/gio/gbufferedinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gbufferedinputstream.c ++++ glib-2.56.4/gio/gbufferedinputstream.c +@@ -113,8 +113,7 @@ static gssize g_buffered_input_stream_real_fill_finish + GAsyncResult *result, + GError **error); + +-static void g_buffered_input_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data); ++static void g_buffered_input_stream_seekable_iface_init (GSeekableIface *iface); + static goffset g_buffered_input_stream_tell (GSeekable *seekable); + static gboolean g_buffered_input_stream_can_seek (GSeekable *seekable); + static gboolean g_buffered_input_stream_seek (GSeekable *seekable, +@@ -301,8 +300,7 @@ static void + } + + static void +-g_buffered_input_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data) ++g_buffered_input_stream_seekable_iface_init (GSeekableIface *iface) + { + iface->tell = g_buffered_input_stream_tell; + iface->can_seek = g_buffered_input_stream_can_seek; +Index: glib-2.56.4/gio/gbufferedoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gbufferedoutputstream.c ++++ glib-2.56.4/gio/gbufferedoutputstream.c +@@ -105,8 +105,7 @@ static gboolean g_buffered_output_stream_close_finish + GAsyncResult *result, + GError **error); + +-static void g_buffered_output_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data); ++static void g_buffered_output_stream_seekable_iface_init (GSeekableIface *iface); + static goffset g_buffered_output_stream_tell (GSeekable *seekable); + static gboolean g_buffered_output_stream_can_seek (GSeekable *seekable); + static gboolean g_buffered_output_stream_seek (GSeekable *seekable, +@@ -347,8 +346,7 @@ static void + } + + static void +-g_buffered_output_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data) ++g_buffered_output_stream_seekable_iface_init (GSeekableIface *iface) + { + iface->tell = g_buffered_output_stream_tell; + iface->can_seek = g_buffered_output_stream_can_seek; +Index: glib-2.56.4/gio/gbytesicon.c +=================================================================== +--- glib-2.56.4.orig/gio/gbytesicon.c ++++ glib-2.56.4/gio/gbytesicon.c +@@ -57,10 +57,8 @@ enum + PROP_BYTES + }; + +-static void g_bytes_icon_icon_iface_init (GIconIface *iface, +- gpointer iface_data); +-static void g_bytes_icon_loadable_icon_iface_init (GLoadableIconIface *iface, +- gpointer iface_data); ++static void g_bytes_icon_icon_iface_init (GIconIface *iface); ++static void g_bytes_icon_loadable_icon_iface_init (GLoadableIconIface *iface); + G_DEFINE_TYPE_WITH_CODE (GBytesIcon, g_bytes_icon, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ICON, g_bytes_icon_icon_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_LOADABLE_ICON, g_bytes_icon_loadable_icon_iface_init)) +@@ -207,8 +205,7 @@ static void + } + + static void +-g_bytes_icon_icon_iface_init (GIconIface *iface, +- gpointer iface_data) ++g_bytes_icon_icon_iface_init (GIconIface *iface) + { + iface->hash = g_bytes_icon_hash; + iface->equal = g_bytes_icon_equal; +@@ -261,8 +258,7 @@ static void + } + + static void +-g_bytes_icon_loadable_icon_iface_init (GLoadableIconIface *iface, +- gpointer iface_data) ++g_bytes_icon_loadable_icon_iface_init (GLoadableIconIface *iface) + { + iface->load = g_bytes_icon_load; + iface->load_async = g_bytes_icon_load_async; +Index: glib-2.56.4/gio/gcharsetconverter.c +=================================================================== +--- glib-2.56.4.orig/gio/gcharsetconverter.c ++++ glib-2.56.4/gio/gcharsetconverter.c +@@ -45,10 +45,8 @@ enum { + * GIConv. + */ + +-static void g_charset_converter_iface_init (GConverterIface *iface, +- gpointer iface_data); +-static void g_charset_converter_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_charset_converter_iface_init (GConverterIface *iface); ++static void g_charset_converter_initable_iface_init (GInitableIface *iface); + + /** + * GCharsetConverter: +@@ -423,8 +421,7 @@ static void + } + + static void +-g_charset_converter_iface_init (GConverterIface *iface, +- gpointer iface_data) ++g_charset_converter_iface_init (GConverterIface *iface) + { + iface->convert = g_charset_converter_convert; + iface->reset = g_charset_converter_reset; +@@ -469,8 +466,7 @@ static void + } + + static void +-g_charset_converter_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_charset_converter_initable_iface_init (GInitableIface *iface) + { + iface->init = g_charset_converter_initable_init; + } +Index: glib-2.56.4/gio/gconverterinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gconverterinputstream.c ++++ glib-2.56.4/gio/gconverterinputstream.c +@@ -91,8 +91,8 @@ static GSource *g_converter_input_stream_create_source + static GSource *g_converter_input_stream_create_source (GPollableInputStream *stream, + GCancellable *cancellable); + +-static void g_converter_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, +- gpointer iface_data); ++static void g_converter_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); ++ + G_DEFINE_TYPE_WITH_CODE (GConverterInputStream, + g_converter_input_stream, + G_TYPE_FILTER_INPUT_STREAM, +@@ -127,8 +127,7 @@ static void + } + + static void +-g_converter_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, +- gpointer iface_data) ++g_converter_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) + { + iface->can_poll = g_converter_input_stream_can_poll; + iface->is_readable = g_converter_input_stream_is_readable; +Index: glib-2.56.4/gio/gconverteroutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gconverteroutputstream.c ++++ glib-2.56.4/gio/gconverteroutputstream.c +@@ -106,8 +106,7 @@ static GSource *g_converter_output_stream_create_sourc + static GSource *g_converter_output_stream_create_source (GPollableOutputStream *stream, + GCancellable *cancellable); + +-static void g_converter_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, +- gpointer iface_data); ++static void g_converter_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); + + G_DEFINE_TYPE_WITH_CODE (GConverterOutputStream, + g_converter_output_stream, +@@ -144,8 +143,7 @@ static void + } + + static void +-g_converter_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, +- gpointer iface_data) ++g_converter_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) + { + iface->can_poll = g_converter_output_stream_can_poll; + iface->is_writable = g_converter_output_stream_is_writable; +Index: glib-2.56.4/gio/gdataoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gdataoutputstream.c ++++ glib-2.56.4/gio/gdataoutputstream.c +@@ -58,8 +58,7 @@ static void g_data_output_stream_get_property (GObject + GValue *value, + GParamSpec *pspec); + +-static void g_data_output_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data); ++static void g_data_output_stream_seekable_iface_init (GSeekableIface *iface); + static goffset g_data_output_stream_tell (GSeekable *seekable); + static gboolean g_data_output_stream_can_seek (GSeekable *seekable); + static gboolean g_data_output_stream_seek (GSeekable *seekable, +@@ -161,8 +160,7 @@ static void + } + + static void +-g_data_output_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data) ++g_data_output_stream_seekable_iface_init (GSeekableIface *iface) + { + iface->tell = g_data_output_stream_tell; + iface->can_seek = g_data_output_stream_can_seek; +Index: glib-2.56.4/gio/gdbusactiongroup.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusactiongroup.c ++++ glib-2.56.4/gio/gdbusactiongroup.c +@@ -129,10 +129,8 @@ action_info_new_from_iter (GVariantIter *iter) + return info; + } + +-static void g_dbus_action_group_remote_iface_init (GRemoteActionGroupInterface *iface, +- gpointer iface_data); +-static void g_dbus_action_group_iface_init (GActionGroupInterface *iface, +- gpointer iface_data); ++static void g_dbus_action_group_remote_iface_init (GRemoteActionGroupInterface *iface); ++static void g_dbus_action_group_iface_init (GActionGroupInterface *iface); + G_DEFINE_TYPE_WITH_CODE (GDBusActionGroup, g_dbus_action_group, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION_GROUP, g_dbus_action_group_iface_init) + G_IMPLEMENT_INTERFACE (G_TYPE_REMOTE_ACTION_GROUP, g_dbus_action_group_remote_iface_init)) +@@ -459,16 +457,14 @@ static void + } + + static void +-g_dbus_action_group_remote_iface_init (GRemoteActionGroupInterface *iface, +- gpointer iface_data) ++g_dbus_action_group_remote_iface_init (GRemoteActionGroupInterface *iface) + { + iface->activate_action_full = g_dbus_action_group_activate_action_full; + iface->change_action_state_full = g_dbus_action_group_change_action_state_full; + } + + static void +-g_dbus_action_group_iface_init (GActionGroupInterface *iface, +- gpointer iface_data) ++g_dbus_action_group_iface_init (GActionGroupInterface *iface) + { + iface->list_actions = g_dbus_action_group_list_actions; + iface->query_action = g_dbus_action_group_query_action; +Index: glib-2.56.4/gio/gdbusconnection.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusconnection.c ++++ glib-2.56.4/gio/gdbusconnection.c +@@ -532,10 +532,8 @@ static guint signals[LAST_SIGNAL] = { 0 }; + + static guint signals[LAST_SIGNAL] = { 0 }; + +-static void initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data); +-static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface, +- gpointer iface_data); ++static void initable_iface_init (GInitableIface *initable_iface); ++static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface); + + G_DEFINE_TYPE_WITH_CODE (GDBusConnection, g_dbus_connection, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init) +@@ -2634,8 +2632,7 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data) ++initable_iface_init (GInitableIface *initable_iface) + { + initable_iface->init = initable_init; + } +@@ -2643,8 +2640,7 @@ static void + /* ---------------------------------------------------------------------------------------------------- */ + + static void +-async_initable_iface_init (GAsyncInitableIface *async_initable_iface, +- gpointer iface_data) ++async_initable_iface_init (GAsyncInitableIface *async_initable_iface) + { + /* Use default */ + } +Index: glib-2.56.4/gio/gdbusdaemon.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusdaemon.c ++++ glib-2.56.4/gio/gdbusdaemon.c +@@ -69,10 +69,8 @@ static guint g_dbus_daemon_signals[NR_SIGNALS]; + static guint g_dbus_daemon_signals[NR_SIGNALS]; + + +-static void initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data); +-static void g_dbus_daemon_iface_init (_GFreedesktopDBusIface *iface, +- gpointer iface_data); ++static void initable_iface_init (GInitableIface *initable_iface); ++static void g_dbus_daemon_iface_init (_GFreedesktopDBusIface *iface); + + #define g_dbus_daemon_get_type _g_dbus_daemon_get_type + G_DEFINE_TYPE_WITH_CODE (GDBusDaemon, g_dbus_daemon, _G_TYPE_FREEDESKTOP_DBUS_SKELETON, +@@ -1718,8 +1716,7 @@ static void + } + + static void +-g_dbus_daemon_iface_init (_GFreedesktopDBusIface *iface, +- gpointer iface_data) ++g_dbus_daemon_iface_init (_GFreedesktopDBusIface *iface) + { + iface->handle_add_match = handle_add_match; + iface->handle_get_connection_selinux_security_context = handle_get_connection_selinux_security_context; +@@ -1741,8 +1738,7 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data) ++initable_iface_init (GInitableIface *initable_iface) + { + initable_iface->init = initable_init; + } +Index: glib-2.56.4/gio/gdbusobjectmanagerclient.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusobjectmanagerclient.c ++++ glib-2.56.4/gio/gdbusobjectmanagerclient.c +@@ -165,12 +165,9 @@ static guint signals[LAST_SIGNAL] = { 0 }; + + static guint signals[LAST_SIGNAL] = { 0 }; + +-static void initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data); +-static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface, +- gpointer iface_data); +-static void dbus_object_manager_interface_init (GDBusObjectManagerIface *iface, +- gpointer iface_data); ++static void initable_iface_init (GInitableIface *initable_iface); ++static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface); ++static void dbus_object_manager_interface_init (GDBusObjectManagerIface *iface); + + G_DEFINE_TYPE_WITH_CODE (GDBusObjectManagerClient, g_dbus_object_manager_client, G_TYPE_OBJECT, + G_ADD_PRIVATE (GDBusObjectManagerClient) +@@ -1412,15 +1409,13 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data) ++initable_iface_init (GInitableIface *initable_iface) + { + initable_iface->init = initable_init; + } + + static void +-async_initable_iface_init (GAsyncInitableIface *async_initable_iface, +- gpointer iface_data) ++async_initable_iface_init (GAsyncInitableIface *async_initable_iface) + { + /* for now, just use default: run GInitable code in thread */ + } +@@ -1756,8 +1751,7 @@ static void + + + static void +-dbus_object_manager_interface_init (GDBusObjectManagerIface *iface, +- gpointer iface_data) ++dbus_object_manager_interface_init (GDBusObjectManagerIface *iface) + { + iface->get_object_path = g_dbus_object_manager_client_get_object_path; + iface->get_objects = g_dbus_object_manager_client_get_objects; +Index: glib-2.56.4/gio/gdbusproxy.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusproxy.c ++++ glib-2.56.4/gio/gdbusproxy.c +@@ -179,12 +179,9 @@ static guint signals[LAST_SIGNAL] = {0}; + + static guint signals[LAST_SIGNAL] = {0}; + +-static void dbus_interface_iface_init (GDBusInterfaceIface *dbus_interface_iface, +- gpointer iface_data); +-static void initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data); +-static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface, +- gpointer iface_data); ++static void dbus_interface_iface_init (GDBusInterfaceIface *dbus_interface_iface); ++static void initable_iface_init (GInitableIface *initable_iface); ++static void async_initable_iface_init (GAsyncInitableIface *async_initable_iface); + + G_DEFINE_TYPE_WITH_CODE (GDBusProxy, g_dbus_proxy, G_TYPE_OBJECT, + G_ADD_PRIVATE (GDBusProxy) +@@ -1882,8 +1879,7 @@ static void + } + + static void +-async_initable_iface_init (GAsyncInitableIface *async_initable_iface, +- gpointer iface_data) ++async_initable_iface_init (GAsyncInitableIface *async_initable_iface) + { + async_initable_iface->init_async = async_initable_init_async; + async_initable_iface->init_finish = async_initable_init_finish; +@@ -1970,8 +1966,7 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data) ++initable_iface_init (GInitableIface *initable_iface) + { + initable_iface->init = initable_init; + } +@@ -3211,8 +3206,7 @@ static void + } + + static void +-dbus_interface_iface_init (GDBusInterfaceIface *dbus_interface_iface, +- gpointer iface_data) ++dbus_interface_iface_init (GDBusInterfaceIface *dbus_interface_iface) + { + dbus_interface_iface->get_info = _g_dbus_proxy_get_info; + dbus_interface_iface->get_object = _g_dbus_proxy_get_object; +Index: glib-2.56.4/gio/gdbusserver.c +=================================================================== +--- glib-2.56.4.orig/gio/gdbusserver.c ++++ glib-2.56.4/gio/gdbusserver.c +@@ -151,8 +151,7 @@ static guint _signals[LAST_SIGNAL] = {0}; + + static guint _signals[LAST_SIGNAL] = {0}; + +-static void initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data); ++static void initable_iface_init (GInitableIface *initable_iface); + + G_DEFINE_TYPE_WITH_CODE (GDBusServer, g_dbus_server, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)) +@@ -1133,8 +1132,7 @@ static void + + + static void +-initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data) ++initable_iface_init (GInitableIface *initable_iface) + { + initable_iface->init = initable_init; + } +Index: glib-2.56.4/gio/gdesktopappinfo.c +=================================================================== +--- glib-2.56.4.orig/gio/gdesktopappinfo.c ++++ glib-2.56.4/gio/gdesktopappinfo.c +@@ -80,8 +80,7 @@ enum { + PROP_FILENAME + }; + +-static void g_desktop_app_info_iface_init (GAppInfoIface *iface, +- gpointer iface_data); ++static void g_desktop_app_info_iface_init (GAppInfoIface *iface); + static gboolean g_desktop_app_info_ensure_saved (GDesktopAppInfo *info, + GError **error); + +@@ -3777,8 +3776,7 @@ static void + /* GAppInfo interface init */ + + static void +-g_desktop_app_info_iface_init (GAppInfoIface *iface, +- gpointer iface_data) ++g_desktop_app_info_iface_init (GAppInfoIface *iface) + { + iface->dup = g_desktop_app_info_dup; + iface->equal = g_desktop_app_info_equal; +Index: glib-2.56.4/gio/gdummyfile.c +=================================================================== +--- glib-2.56.4.orig/gio/gdummyfile.c ++++ glib-2.56.4/gio/gdummyfile.c +@@ -31,8 +31,7 @@ + #include "gfile.h" + + +-static void g_dummy_file_file_iface_init (GFileIface *iface, +- gpointer iface_data); ++static void g_dummy_file_file_iface_init (GFileIface *iface); + + typedef struct { + char *scheme; +@@ -397,8 +396,7 @@ static void + + + static void +-g_dummy_file_file_iface_init (GFileIface *iface, +- gpointer iface_data) ++g_dummy_file_file_iface_init (GFileIface *iface) + { + iface->dup = g_dummy_file_dup; + iface->hash = g_dummy_file_hash; +Index: glib-2.56.4/gio/gdummyproxyresolver.c +=================================================================== +--- glib-2.56.4.orig/gio/gdummyproxyresolver.c ++++ glib-2.56.4/gio/gdummyproxyresolver.c +@@ -36,8 +36,7 @@ struct _GDummyProxyResolver { + GObject parent_instance; + }; + +-static void g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface, +- gpointer iface_data); ++static void g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface); + + #define g_dummy_proxy_resolver_get_type _g_dummy_proxy_resolver_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyProxyResolver, g_dummy_proxy_resolver, G_TYPE_OBJECT, +@@ -126,8 +125,7 @@ static void + } + + static void +-g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface, +- gpointer iface_data) ++g_dummy_proxy_resolver_iface_init (GProxyResolverInterface *iface) + { + iface->is_supported = g_dummy_proxy_resolver_is_supported; + iface->lookup = g_dummy_proxy_resolver_lookup; +Index: glib-2.56.4/gio/gdummytlsbackend.c +=================================================================== +--- glib-2.56.4.orig/gio/gdummytlsbackend.c ++++ glib-2.56.4/gio/gdummytlsbackend.c +@@ -51,8 +51,7 @@ struct _GDummyTlsBackend { + GTlsDatabase *database; + }; + +-static void g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface, +- gpointer iface_data); ++static void g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface); + + #define g_dummy_tls_backend_get_type _g_dummy_tls_backend_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyTlsBackend, g_dummy_tls_backend, G_TYPE_OBJECT, +@@ -104,8 +103,7 @@ static void + } + + static void +-g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface, +- gpointer iface_data) ++g_dummy_tls_backend_iface_init (GTlsBackendInterface *iface) + { + iface->get_certificate_type = _g_dummy_tls_certificate_get_type; + iface->get_client_connection_type = _g_dummy_tls_connection_get_type; +@@ -140,8 +138,7 @@ enum + PROP_CERT_ISSUER + }; + +-static void g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface); + + #define g_dummy_tls_certificate_get_type _g_dummy_tls_certificate_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyTlsCertificate, g_dummy_tls_certificate, G_TYPE_TLS_CERTIFICATE, +@@ -200,8 +197,7 @@ static void + } + + static void +-g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_dummy_tls_certificate_initable_iface_init (GInitableIface *iface) + { + iface->init = g_dummy_tls_certificate_initable_init; + } +@@ -242,8 +238,7 @@ enum + PROP_CONN_AUTHENTICATION_MODE + }; + +-static void g_dummy_tls_connection_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_dummy_tls_connection_initable_iface_init (GInitableIface *iface); + + #define g_dummy_tls_connection_get_type _g_dummy_tls_connection_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyTlsConnection, g_dummy_tls_connection, G_TYPE_TLS_CONNECTION, +@@ -324,8 +319,7 @@ static void + } + + static void +-g_dummy_tls_connection_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_dummy_tls_connection_initable_iface_init (GInitableIface *iface) + { + iface->init = g_dummy_tls_connection_initable_init; + } +@@ -363,8 +357,7 @@ enum + PROP_DTLS_CONN_AUTHENTICATION_MODE, + }; + +-static void g_dummy_dtls_connection_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_dummy_dtls_connection_initable_iface_init (GInitableIface *iface); + + #define g_dummy_dtls_connection_get_type _g_dummy_dtls_connection_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyDtlsConnection, g_dummy_dtls_connection, G_TYPE_OBJECT, +@@ -428,8 +421,7 @@ static void + } + + static void +-g_dummy_dtls_connection_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_dummy_dtls_connection_initable_iface_init (GInitableIface *iface) + { + iface->init = g_dummy_dtls_connection_initable_init; + } +@@ -455,10 +447,8 @@ enum + PROP_ANCHORS, + }; + +-static void g_dummy_tls_database_file_database_iface_init (GTlsFileDatabaseInterface *iface, +- gpointer iface_data); +-static void g_dummy_tls_database_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_dummy_tls_database_file_database_iface_init (GTlsFileDatabaseInterface *iface); ++static void g_dummy_tls_database_initable_iface_init (GInitableIface *iface); + + #define g_dummy_tls_database_get_type _g_dummy_tls_database_get_type + G_DEFINE_TYPE_WITH_CODE (GDummyTlsDatabase, g_dummy_tls_database, G_TYPE_TLS_DATABASE, +@@ -506,8 +496,7 @@ static void + } + + static void +-g_dummy_tls_database_file_database_iface_init (GTlsFileDatabaseInterface *iface, +- gpointer iface_data) ++g_dummy_tls_database_file_database_iface_init (GTlsFileDatabaseInterface *iface) + { + } + +@@ -522,8 +511,7 @@ static void + } + + static void +-g_dummy_tls_database_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_dummy_tls_database_initable_iface_init (GInitableIface *iface) + { + iface->init = g_dummy_tls_database_initable_init; + } +Index: glib-2.56.4/gio/gemblem.c +=================================================================== +--- glib-2.56.4.orig/gio/gemblem.c ++++ glib-2.56.4/gio/gemblem.c +@@ -42,8 +42,7 @@ + * supported. More may be added in the future. + */ + +-static void g_emblem_iface_init (GIconIface *iface, +- gpointer iface_data); ++static void g_emblem_iface_init (GIconIface *iface); + + struct _GEmblem + { +@@ -370,8 +369,7 @@ static void + } + + static void +-g_emblem_iface_init (GIconIface *iface, +- gpointer iface_data) ++g_emblem_iface_init (GIconIface *iface) + { + iface->hash = g_emblem_hash; + iface->equal = g_emblem_equal; +Index: glib-2.56.4/gio/gemblemedicon.c +=================================================================== +--- glib-2.56.4.orig/gio/gemblemedicon.c ++++ glib-2.56.4/gio/gemblemedicon.c +@@ -56,8 +56,7 @@ static GParamSpec *properties[NUM_PROPERTIES] = { NULL + + static GParamSpec *properties[NUM_PROPERTIES] = { NULL, }; + +-static void g_emblemed_icon_icon_iface_init (GIconIface *iface, +- gpointer iface_data); ++static void g_emblemed_icon_icon_iface_init (GIconIface *iface); + + G_DEFINE_TYPE_WITH_CODE (GEmblemedIcon, g_emblemed_icon, G_TYPE_OBJECT, + G_ADD_PRIVATE (GEmblemedIcon) +@@ -458,8 +457,7 @@ static void + } + + static void +-g_emblemed_icon_icon_iface_init (GIconIface *iface, +- gpointer iface_data) ++g_emblemed_icon_icon_iface_init (GIconIface *iface) + { + iface->hash = g_emblemed_icon_hash; + iface->equal = g_emblemed_icon_equal; +Index: glib-2.56.4/gio/gfileicon.c +=================================================================== +--- glib-2.56.4.orig/gio/gfileicon.c ++++ glib-2.56.4/gio/gfileicon.c +@@ -41,10 +41,8 @@ + * + **/ + +-static void g_file_icon_icon_iface_init (GIconIface *iface, +- gpointer iface_data); +-static void g_file_icon_loadable_icon_iface_init (GLoadableIconIface *iface, +- gpointer iface_data); ++static void g_file_icon_icon_iface_init (GIconIface *iface); ++static void g_file_icon_loadable_icon_iface_init (GLoadableIconIface *iface); + static void g_file_icon_load_async (GLoadableIcon *icon, + int size, + GCancellable *cancellable, +@@ -266,8 +264,7 @@ static void + } + + static void +-g_file_icon_icon_iface_init (GIconIface *iface, +- gpointer iface_data) ++g_file_icon_icon_iface_init (GIconIface *iface) + { + iface->hash = g_file_icon_hash; + iface->equal = g_file_icon_equal; +@@ -347,8 +344,7 @@ static void + } + + static void +-g_file_icon_loadable_icon_iface_init (GLoadableIconIface *iface, +- gpointer iface_data) ++g_file_icon_loadable_icon_iface_init (GLoadableIconIface *iface) + { + iface->load = g_file_icon_load; + iface->load_async = g_file_icon_load_async; +Index: glib-2.56.4/gio/gfileinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gfileinputstream.c ++++ glib-2.56.4/gio/gfileinputstream.c +@@ -47,8 +47,7 @@ + * To position a file input stream, use g_seekable_seek(). + **/ + +-static void g_file_input_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data); ++static void g_file_input_stream_seekable_iface_init (GSeekableIface *iface); + static goffset g_file_input_stream_seekable_tell (GSeekable *seekable); + static gboolean g_file_input_stream_seekable_can_seek (GSeekable *seekable); + static gboolean g_file_input_stream_seekable_seek (GSeekable *seekable, +@@ -89,8 +88,7 @@ static void + } + + static void +-g_file_input_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data) ++g_file_input_stream_seekable_iface_init (GSeekableIface *iface) + { + iface->tell = g_file_input_stream_seekable_tell; + iface->can_seek = g_file_input_stream_seekable_can_seek; +Index: glib-2.56.4/gio/gfileiostream.c +=================================================================== +--- glib-2.56.4.orig/gio/gfileiostream.c ++++ glib-2.56.4/gio/gfileiostream.c +@@ -60,8 +60,7 @@ + * Since: 2.22 + **/ + +-static void g_file_io_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data); ++static void g_file_io_stream_seekable_iface_init (GSeekableIface *iface); + static goffset g_file_io_stream_seekable_tell (GSeekable *seekable); + static gboolean g_file_io_stream_seekable_can_seek (GSeekable *seekable); + static gboolean g_file_io_stream_seekable_seek (GSeekable *seekable, +@@ -94,8 +93,7 @@ static void + g_file_io_stream_seekable_iface_init)) + + static void +-g_file_io_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data) ++g_file_io_stream_seekable_iface_init (GSeekableIface *iface) + { + iface->tell = g_file_io_stream_seekable_tell; + iface->can_seek = g_file_io_stream_seekable_can_seek; +Index: glib-2.56.4/gio/gfileoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gfileoutputstream.c ++++ glib-2.56.4/gio/gfileoutputstream.c +@@ -52,8 +52,7 @@ + * stream, use g_seekable_truncate(). + **/ + +-static void g_file_output_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data); ++static void g_file_output_stream_seekable_iface_init (GSeekableIface *iface); + static goffset g_file_output_stream_seekable_tell (GSeekable *seekable); + static gboolean g_file_output_stream_seekable_can_seek (GSeekable *seekable); + static gboolean g_file_output_stream_seekable_seek (GSeekable *seekable, +@@ -93,8 +92,7 @@ static void + } + + static void +-g_file_output_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data) ++g_file_output_stream_seekable_iface_init (GSeekableIface *iface) + { + iface->tell = g_file_output_stream_seekable_tell; + iface->can_seek = g_file_output_stream_seekable_can_seek; +Index: glib-2.56.4/gio/ghttpproxy.c +=================================================================== +--- glib-2.56.4.orig/gio/ghttpproxy.c ++++ glib-2.56.4/gio/ghttpproxy.c +@@ -51,8 +51,7 @@ struct _GHttpProxyClass + GObjectClass parent_class; + }; + +-static void g_http_proxy_iface_init (GProxyInterface *proxy_iface, +- gpointer iface_data); ++static void g_http_proxy_iface_init (GProxyInterface *proxy_iface); + + #define g_http_proxy_get_type _g_http_proxy_get_type + G_DEFINE_TYPE_WITH_CODE (GHttpProxy, g_http_proxy, G_TYPE_OBJECT, +@@ -364,8 +363,7 @@ static void + } + + static void +-g_http_proxy_iface_init (GProxyInterface *proxy_iface, +- gpointer iface_data) ++g_http_proxy_iface_init (GProxyInterface *proxy_iface) + { + proxy_iface->connect = g_http_proxy_connect; + proxy_iface->connect_async = g_http_proxy_connect_async; +Index: glib-2.56.4/gio/ginetaddressmask.c +=================================================================== +--- glib-2.56.4.orig/gio/ginetaddressmask.c ++++ glib-2.56.4/gio/ginetaddressmask.c +@@ -54,8 +54,7 @@ struct _GInetAddressMaskPrivate + guint length; + }; + +-static void g_inet_address_mask_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_inet_address_mask_initable_iface_init (GInitableIface *iface); + + G_DEFINE_TYPE_WITH_CODE (GInetAddressMask, g_inet_address_mask, G_TYPE_OBJECT, + G_ADD_PRIVATE (GInetAddressMask) +@@ -229,8 +228,7 @@ static void + } + + static void +-g_inet_address_mask_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_inet_address_mask_initable_iface_init (GInitableIface *iface) + { + iface->init = g_inet_address_mask_initable_init; + } +Index: glib-2.56.4/gio/ginetsocketaddress.c +=================================================================== +--- glib-2.56.4.orig/gio/ginetsocketaddress.c ++++ glib-2.56.4/gio/ginetsocketaddress.c +@@ -55,8 +55,7 @@ struct _GInetSocketAddressPrivate + guint32 scope_id; + }; + +-static void g_inet_socket_address_connectable_iface_init (GSocketConnectableIface *iface, +- gpointer iface_data); ++static void g_inet_socket_address_connectable_iface_init (GSocketConnectableIface *iface); + static gchar *g_inet_socket_address_connectable_to_string (GSocketConnectable *connectable); + + G_DEFINE_TYPE_WITH_CODE (GInetSocketAddress, g_inet_socket_address, G_TYPE_SOCKET_ADDRESS, +@@ -310,8 +309,7 @@ static void + } + + static void +-g_inet_socket_address_connectable_iface_init (GSocketConnectableIface *iface, +- gpointer iface_data) ++g_inet_socket_address_connectable_iface_init (GSocketConnectableIface *iface) + { + GSocketConnectableIface *parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gliststore.c +=================================================================== +--- glib-2.56.4.orig/gio/gliststore.c ++++ glib-2.56.4/gio/gliststore.c +@@ -64,8 +64,7 @@ enum + N_PROPERTIES + }; + +-static void g_list_store_iface_init (GListModelInterface *iface, +- gpointer iface_data); ++static void g_list_store_iface_init (GListModelInterface *iface); + + G_DEFINE_TYPE_WITH_CODE (GListStore, g_list_store, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, g_list_store_iface_init)); +@@ -205,8 +204,7 @@ static void + } + + static void +-g_list_store_iface_init (GListModelInterface *iface, +- gpointer iface_data) ++g_list_store_iface_init (GListModelInterface *iface) + { + iface->get_item_type = g_list_store_get_item_type; + iface->get_n_items = g_list_store_get_n_items; +Index: glib-2.56.4/gio/glocalfile.c +=================================================================== +--- glib-2.56.4.orig/gio/glocalfile.c ++++ glib-2.56.4/gio/glocalfile.c +@@ -92,8 +92,7 @@ + #endif + + +-static void g_local_file_file_iface_init (GFileIface *iface, +- gpointer iface_data); ++static void g_local_file_file_iface_init (GFileIface *iface); + + static GFileAttributeInfoList *local_writable_attributes = NULL; + static /* GFileAttributeInfoList * */ gsize local_writable_namespaces = 0; +@@ -2942,8 +2941,7 @@ static void + } + + static void +-g_local_file_file_iface_init (GFileIface *iface, +- gpointer iface_data) ++g_local_file_file_iface_init (GFileIface *iface) + { + iface->dup = g_local_file_dup; + iface->hash = g_local_file_hash; +Index: glib-2.56.4/gio/glocalfileinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/glocalfileinputstream.c ++++ glib-2.56.4/gio/glocalfileinputstream.c +@@ -49,8 +49,7 @@ struct _GLocalFileInputStreamPrivate { + }; + + #ifdef G_OS_UNIX +-static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data); ++static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); + #endif + + #define g_local_file_input_stream_get_type _g_local_file_input_stream_get_type +@@ -115,8 +114,7 @@ static void + + #ifdef G_OS_UNIX + static void +-g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data) ++g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) + { + iface->get_fd = g_local_file_input_stream_get_fd; + } +Index: glib-2.56.4/gio/glocalfileoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/glocalfileoutputstream.c ++++ glib-2.56.4/gio/glocalfileoutputstream.c +@@ -67,8 +67,7 @@ struct _GLocalFileOutputStreamPrivate { + }; + + #ifdef G_OS_UNIX +-static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data); ++static void g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); + #endif + + #define g_local_file_output_stream_get_type _g_local_file_output_stream_get_type +@@ -155,8 +154,7 @@ static void + + #ifdef G_OS_UNIX + static void +-g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data) ++g_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) + { + iface->get_fd = g_local_file_output_stream_get_fd; + } +Index: glib-2.56.4/gio/gmemoryinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gmemoryinputstream.c ++++ glib-2.56.4/gio/gmemoryinputstream.c +@@ -78,8 +78,7 @@ static gboolean g_memory_input_stream_close_finish (GI + GAsyncResult *result, + GError **error); + +-static void g_memory_input_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data); ++static void g_memory_input_stream_seekable_iface_init (GSeekableIface *iface); + static goffset g_memory_input_stream_tell (GSeekable *seekable); + static gboolean g_memory_input_stream_can_seek (GSeekable *seekable); + static gboolean g_memory_input_stream_seek (GSeekable *seekable, +@@ -93,8 +92,7 @@ static gboolean g_memory_input_stream_truncate + GCancellable *cancellable, + GError **error); + +-static void g_memory_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, +- gpointer iface_data); ++static void g_memory_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); + static gboolean g_memory_input_stream_is_readable (GPollableInputStream *stream); + static GSource *g_memory_input_stream_create_source (GPollableInputStream *stream, + GCancellable *cancellable); +@@ -145,8 +143,7 @@ static void + } + + static void +-g_memory_input_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data) ++g_memory_input_stream_seekable_iface_init (GSeekableIface *iface) + { + iface->tell = g_memory_input_stream_tell; + iface->can_seek = g_memory_input_stream_can_seek; +@@ -156,8 +153,7 @@ static void + } + + static void +-g_memory_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, +- gpointer iface_data) ++g_memory_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) + { + iface->is_readable = g_memory_input_stream_is_readable; + iface->create_source = g_memory_input_stream_create_source; +Index: glib-2.56.4/gio/gmemoryoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gmemoryoutputstream.c ++++ glib-2.56.4/gio/gmemoryoutputstream.c +@@ -96,8 +96,7 @@ static gboolean g_memory_output_stream_close_finish (G + GAsyncResult *result, + GError **error); + +-static void g_memory_output_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data); ++static void g_memory_output_stream_seekable_iface_init (GSeekableIface *iface); + static goffset g_memory_output_stream_tell (GSeekable *seekable); + static gboolean g_memory_output_stream_can_seek (GSeekable *seekable); + static gboolean g_memory_output_stream_seek (GSeekable *seekable, +@@ -115,8 +114,7 @@ static GSource *g_memory_output_stream_create_source + static GSource *g_memory_output_stream_create_source (GPollableOutputStream *stream, + GCancellable *cancellable); + +-static void g_memory_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, +- gpointer iface_data); ++static void g_memory_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); + + G_DEFINE_TYPE_WITH_CODE (GMemoryOutputStream, g_memory_output_stream, G_TYPE_OUTPUT_STREAM, + G_ADD_PRIVATE (GMemoryOutputStream) +@@ -223,8 +221,7 @@ static void + } + + static void +-g_memory_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, +- gpointer iface_data) ++g_memory_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) + { + iface->is_writable = g_memory_output_stream_is_writable; + iface->create_source = g_memory_output_stream_create_source; +@@ -313,8 +310,7 @@ static void + } + + static void +-g_memory_output_stream_seekable_iface_init (GSeekableIface *iface, +- gpointer iface_data) ++g_memory_output_stream_seekable_iface_init (GSeekableIface *iface) + { + iface->tell = g_memory_output_stream_tell; + iface->can_seek = g_memory_output_stream_can_seek; +Index: glib-2.56.4/gio/gnetworkaddress.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkaddress.c ++++ glib-2.56.4/gio/gnetworkaddress.c +@@ -83,8 +83,7 @@ static void g_network_address_get_property (GObject + GValue *value, + GParamSpec *pspec); + +-static void g_network_address_connectable_iface_init (GSocketConnectableIface *iface, +- gpointer iface_data); ++static void g_network_address_connectable_iface_init (GSocketConnectableIface *iface); + static GSocketAddressEnumerator *g_network_address_connectable_enumerate (GSocketConnectable *connectable); + static GSocketAddressEnumerator *g_network_address_connectable_proxy_enumerate (GSocketConnectable *connectable); + static gchar *g_network_address_connectable_to_string (GSocketConnectable *connectable); +@@ -143,8 +142,7 @@ static void + } + + static void +-g_network_address_connectable_iface_init (GSocketConnectableIface *connectable_iface, +- gpointer iface_data) ++g_network_address_connectable_iface_init (GSocketConnectableIface *connectable_iface) + { + connectable_iface->enumerate = g_network_address_connectable_enumerate; + connectable_iface->proxy_enumerate = g_network_address_connectable_proxy_enumerate; +Index: glib-2.56.4/gio/gnetworkmonitorbase.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkmonitorbase.c ++++ glib-2.56.4/gio/gnetworkmonitorbase.c +@@ -31,10 +31,8 @@ + #include "gtask.h" + #include "glibintl.h" + +-static void g_network_monitor_base_iface_init (GNetworkMonitorInterface *iface, +- gpointer iface_data); +-static void g_network_monitor_base_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_network_monitor_base_iface_init (GNetworkMonitorInterface *iface); ++static void g_network_monitor_base_initable_iface_init (GInitableIface *iface); + + enum + { +@@ -336,8 +334,7 @@ static void + } + + static void +-g_network_monitor_base_iface_init (GNetworkMonitorInterface *monitor_iface, +- gpointer iface_data) ++g_network_monitor_base_iface_init (GNetworkMonitorInterface *monitor_iface) + { + monitor_iface->can_reach = g_network_monitor_base_can_reach; + monitor_iface->can_reach_async = g_network_monitor_base_can_reach_async; +@@ -359,8 +356,7 @@ static void + } + + static void +-g_network_monitor_base_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_network_monitor_base_initable_iface_init (GInitableIface *iface) + { + iface->init = g_network_monitor_base_initable_init; + } +Index: glib-2.56.4/gio/gnetworkmonitornetlink.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkmonitornetlink.c ++++ glib-2.56.4/gio/gnetworkmonitornetlink.c +@@ -40,10 +40,8 @@ static GInitableIface *initable_parent_iface; + #include + + static GInitableIface *initable_parent_iface; +-static void g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *iface, +- gpointer iface_data); +-static void g_network_monitor_netlink_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *iface); ++static void g_network_monitor_netlink_initable_iface_init (GInitableIface *iface); + + struct _GNetworkMonitorNetlinkPrivate + { +@@ -470,14 +468,12 @@ static void + } + + static void +-g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *monitor_iface, +- gpointer iface_data) ++g_network_monitor_netlink_iface_init (GNetworkMonitorInterface *monitor_iface) + { + } + + static void +-g_network_monitor_netlink_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_network_monitor_netlink_initable_iface_init (GInitableIface *iface) + { + initable_parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gnetworkmonitornm.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkmonitornm.c ++++ glib-2.56.4/gio/gnetworkmonitornm.c +@@ -32,10 +32,8 @@ + #include "gnetworkmonitor.h" + #include "gdbusproxy.h" + +-static void g_network_monitor_nm_iface_init (GNetworkMonitorInterface *iface, +- gpointer iface_data); +-static void g_network_monitor_nm_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_network_monitor_nm_iface_init (GNetworkMonitorInterface *iface); ++static void g_network_monitor_nm_initable_iface_init (GInitableIface *iface); + + enum + { +@@ -358,14 +356,12 @@ static void + } + + static void +-g_network_monitor_nm_iface_init (GNetworkMonitorInterface *monitor_iface, +- gpointer iface_data) ++g_network_monitor_nm_iface_init (GNetworkMonitorInterface *monitor_iface) + { + } + + static void +-g_network_monitor_nm_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_network_monitor_nm_initable_iface_init (GInitableIface *iface) + { + iface->init = g_network_monitor_nm_initable_init; + } +Index: glib-2.56.4/gio/gnetworkmonitorportal.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkmonitorportal.c ++++ glib-2.56.4/gio/gnetworkmonitorportal.c +@@ -25,10 +25,8 @@ static GInitableIface *initable_parent_iface; + #include "gportalsupport.h" + + static GInitableIface *initable_parent_iface; +-static void g_network_monitor_portal_iface_init (GNetworkMonitorInterface *iface, +- gpointer iface_data); +-static void g_network_monitor_portal_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_network_monitor_portal_iface_init (GNetworkMonitorInterface *iface); ++static void g_network_monitor_portal_initable_iface_init (GInitableIface *iface); + + enum + { +@@ -368,14 +366,12 @@ static void + } + + static void +-g_network_monitor_portal_iface_init (GNetworkMonitorInterface *monitor_iface, +- gpointer iface_data) ++g_network_monitor_portal_iface_init (GNetworkMonitorInterface *monitor_iface) + { + } + + static void +-g_network_monitor_portal_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_network_monitor_portal_initable_iface_init (GInitableIface *iface) + { + initable_parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gnetworkservice.c +=================================================================== +--- glib-2.56.4.orig/gio/gnetworkservice.c ++++ glib-2.56.4/gio/gnetworkservice.c +@@ -86,8 +86,7 @@ static void g_network_service_get_property (GObject + GValue *value, + GParamSpec *pspec); + +-static void g_network_service_connectable_iface_init (GSocketConnectableIface *iface, +- gpointer iface_data); ++static void g_network_service_connectable_iface_init (GSocketConnectableIface *iface); + static GSocketAddressEnumerator *g_network_service_connectable_enumerate (GSocketConnectable *connectable); + static GSocketAddressEnumerator *g_network_service_connectable_proxy_enumerate (GSocketConnectable *connectable); + static gchar *g_network_service_connectable_to_string (GSocketConnectable *connectable); +@@ -157,8 +156,7 @@ static void + } + + static void +-g_network_service_connectable_iface_init (GSocketConnectableIface *connectable_iface, +- gpointer iface_data) ++g_network_service_connectable_iface_init (GSocketConnectableIface *connectable_iface) + { + connectable_iface->enumerate = g_network_service_connectable_enumerate; + connectable_iface->proxy_enumerate = g_network_service_connectable_proxy_enumerate; +Index: glib-2.56.4/gio/gpropertyaction.c +=================================================================== +--- glib-2.56.4.orig/gio/gpropertyaction.c ++++ glib-2.56.4/gio/gpropertyaction.c +@@ -106,8 +106,7 @@ typedef GObjectClass GPropertyActionClass; + + typedef GObjectClass GPropertyActionClass; + +-static void g_property_action_iface_init (GActionInterface *iface, +- gpointer iface_data); ++static void g_property_action_iface_init (GActionInterface *iface); + G_DEFINE_TYPE_WITH_CODE (GPropertyAction, g_property_action, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION, g_property_action_iface_init)) + +@@ -402,8 +401,7 @@ void + } + + void +-g_property_action_iface_init (GActionInterface *iface, +- gpointer iface_data) ++g_property_action_iface_init (GActionInterface *iface) + { + iface->get_name = g_property_action_get_name; + iface->get_parameter_type = g_property_action_get_parameter_type; +Index: glib-2.56.4/gio/gproxyresolverportal.c +=================================================================== +--- glib-2.56.4.orig/gio/gproxyresolverportal.c ++++ glib-2.56.4/gio/gproxyresolverportal.c +@@ -31,8 +31,7 @@ struct _GProxyResolverPortal { + gboolean network_available; + }; + +-static void g_proxy_resolver_portal_iface_init (GProxyResolverInterface *iface, +- gpointer iface_data); ++static void g_proxy_resolver_portal_iface_init (GProxyResolverInterface *iface); + + G_DEFINE_TYPE_WITH_CODE (GProxyResolverPortal, g_proxy_resolver_portal, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_PROXY_RESOLVER, +@@ -200,8 +199,7 @@ static void + } + + static void +-g_proxy_resolver_portal_iface_init (GProxyResolverInterface *iface, +- gpointer iface_data) ++g_proxy_resolver_portal_iface_init (GProxyResolverInterface *iface) + { + iface->is_supported = g_proxy_resolver_portal_is_supported; + iface->lookup = g_proxy_resolver_portal_lookup; +Index: glib-2.56.4/gio/gresourcefile.c +=================================================================== +--- glib-2.56.4.orig/gio/gresourcefile.c ++++ glib-2.56.4/gio/gresourcefile.c +@@ -66,8 +66,7 @@ typedef struct _GResourceFileEnumeratorClass GResour + typedef struct _GResourceFileEnumerator GResourceFileEnumerator; + typedef struct _GResourceFileEnumeratorClass GResourceFileEnumeratorClass; + +-static void g_resource_file_file_iface_init (GFileIface *iface, +- gpointer iface_data); ++static void g_resource_file_file_iface_init (GFileIface *iface); + + static GFileAttributeInfoList *resource_writable_attributes = NULL; + static GFileAttributeInfoList *resource_writable_namespaces = NULL; +@@ -646,8 +645,7 @@ static void + } + + static void +-g_resource_file_file_iface_init (GFileIface *iface, +- gpointer iface_data) ++g_resource_file_file_iface_init (GFileIface *iface) + { + iface->dup = g_resource_file_dup; + iface->hash = g_resource_file_hash; +Index: glib-2.56.4/gio/gsettings.c +=================================================================== +--- glib-2.56.4.orig/gio/gsettings.c ++++ glib-2.56.4/gio/gsettings.c +@@ -3124,8 +3124,7 @@ static GType g_settings_action_get_type (void); + typedef GObjectClass GSettingsActionClass; + + static GType g_settings_action_get_type (void); +-static void g_settings_action_iface_init (GActionInterface *iface, +- gpointer iface_data); ++static void g_settings_action_iface_init (GActionInterface *iface); + G_DEFINE_TYPE_WITH_CODE (GSettingsAction, g_settings_action, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION, g_settings_action_iface_init)) + +@@ -3285,8 +3284,7 @@ static void + } + + static void +-g_settings_action_iface_init (GActionInterface *iface, +- gpointer iface_data) ++g_settings_action_iface_init (GActionInterface *iface) + { + iface->get_name = g_settings_action_get_name; + iface->get_parameter_type = g_settings_action_get_parameter_type; +Index: glib-2.56.4/gio/gsimpleaction.c +=================================================================== +--- glib-2.56.4.orig/gio/gsimpleaction.c ++++ glib-2.56.4/gio/gsimpleaction.c +@@ -58,8 +58,7 @@ typedef GObjectClass GSimpleActionClass; + + typedef GObjectClass GSimpleActionClass; + +-static void g_simple_action_iface_init (GActionInterface *iface, +- gpointer iface_data); ++static void g_simple_action_iface_init (GActionInterface *iface); + G_DEFINE_TYPE_WITH_CODE (GSimpleAction, g_simple_action, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_ACTION, g_simple_action_iface_init)) + +@@ -348,8 +347,7 @@ void + } + + void +-g_simple_action_iface_init (GActionInterface *iface, +- gpointer iface_data) ++g_simple_action_iface_init (GActionInterface *iface) + { + iface->get_name = g_simple_action_get_name; + iface->get_parameter_type = g_simple_action_get_parameter_type; +Index: glib-2.56.4/gio/gsimpleactiongroup.c +=================================================================== +--- glib-2.56.4.orig/gio/gsimpleactiongroup.c ++++ glib-2.56.4/gio/gsimpleactiongroup.c +@@ -40,10 +40,8 @@ struct _GSimpleActionGroupPrivate + GHashTable *table; /* string -> GAction */ + }; + +-static void g_simple_action_group_iface_init (GActionGroupInterface *iface, +- gpointer iface_data); +-static void g_simple_action_group_map_iface_init (GActionMapInterface *iface, +- gpointer iface_data); ++static void g_simple_action_group_iface_init (GActionGroupInterface *); ++static void g_simple_action_group_map_iface_init (GActionMapInterface *); + G_DEFINE_TYPE_WITH_CODE (GSimpleActionGroup, + g_simple_action_group, G_TYPE_OBJECT, + G_ADD_PRIVATE (GSimpleActionGroup) +@@ -274,8 +272,7 @@ static void + } + + static void +-g_simple_action_group_iface_init (GActionGroupInterface *iface, +- gpointer iface_data) ++g_simple_action_group_iface_init (GActionGroupInterface *iface) + { + iface->list_actions = g_simple_action_group_list_actions; + iface->query_action = g_simple_action_group_query_action; +@@ -284,8 +281,7 @@ static void + } + + static void +-g_simple_action_group_map_iface_init (GActionMapInterface *iface, +- gpointer iface_data) ++g_simple_action_group_map_iface_init (GActionMapInterface *iface) + { + iface->add_action = g_simple_action_group_add_action; + iface->remove_action = g_simple_action_group_remove_action; +Index: glib-2.56.4/gio/gsimpleasyncresult.c +=================================================================== +--- glib-2.56.4.orig/gio/gsimpleasyncresult.c ++++ glib-2.56.4/gio/gsimpleasyncresult.c +@@ -205,8 +205,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS + + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +-static void g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface, +- gpointer iface_data); ++static void g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface); + + struct _GSimpleAsyncResult + { +@@ -465,8 +464,7 @@ static void + } + + static void +-g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface, +- gpointer iface_data) ++g_simple_async_result_async_result_iface_init (GAsyncResultIface *iface) + { + iface->get_user_data = g_simple_async_result_get_user_data; + iface->get_source_object = g_simple_async_result_get_source_object; +Index: glib-2.56.4/gio/gsimpleproxyresolver.c +=================================================================== +--- glib-2.56.4.orig/gio/gsimpleproxyresolver.c ++++ glib-2.56.4/gio/gsimpleproxyresolver.c +@@ -62,8 +62,7 @@ struct _GSimpleProxyResolverPrivate { + GSimpleProxyResolverDomain *ignore_domains; + }; + +-static void g_simple_proxy_resolver_iface_init (GProxyResolverInterface *iface, +- gpointer iface_data); ++static void g_simple_proxy_resolver_iface_init (GProxyResolverInterface *iface); + + G_DEFINE_TYPE_WITH_CODE (GSimpleProxyResolver, g_simple_proxy_resolver, G_TYPE_OBJECT, + G_ADD_PRIVATE (GSimpleProxyResolver) +@@ -478,8 +477,7 @@ static void + } + + static void +-g_simple_proxy_resolver_iface_init (GProxyResolverInterface *iface, +- gpointer iface_data) ++g_simple_proxy_resolver_iface_init (GProxyResolverInterface *iface) + { + iface->lookup = g_simple_proxy_resolver_lookup; + iface->lookup_async = g_simple_proxy_resolver_lookup_async; +Index: glib-2.56.4/gio/gsocket.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocket.c ++++ glib-2.56.4/gio/gsocket.c +@@ -141,14 +141,12 @@ + * Since: 2.22 + */ + +-static void g_socket_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_socket_initable_iface_init (GInitableIface *iface); + static gboolean g_socket_initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error); + +-static void g_socket_datagram_based_iface_init (GDatagramBasedInterface *iface, +- gpointer iface_data); ++static void g_socket_datagram_based_iface_init (GDatagramBasedInterface *iface); + static gint g_socket_datagram_based_receive_messages (GDatagramBased *self, + GInputMessage *messages, + guint num_messages, +@@ -1058,15 +1056,13 @@ static void + } + + static void +-g_socket_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_socket_initable_iface_init (GInitableIface *iface) + { + iface->init = g_socket_initable_init; + } + + static void +-g_socket_datagram_based_iface_init (GDatagramBasedInterface *iface, +- gpointer iface_data) ++g_socket_datagram_based_iface_init (GDatagramBasedInterface *iface) + { + iface->receive_messages = g_socket_datagram_based_receive_messages; + iface->send_messages = g_socket_datagram_based_send_messages; +Index: glib-2.56.4/gio/gsocketaddress.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocketaddress.c ++++ glib-2.56.4/gio/gsocketaddress.c +@@ -64,8 +64,7 @@ enum + PROP_FAMILY + }; + +-static void g_socket_address_connectable_iface_init (GSocketConnectableIface *iface, +- gpointer iface_data); ++static void g_socket_address_connectable_iface_init (GSocketConnectableIface *iface); + static GSocketAddressEnumerator *g_socket_address_connectable_enumerate (GSocketConnectable *connectable); + static GSocketAddressEnumerator *g_socket_address_connectable_proxy_enumerate (GSocketConnectable *connectable); + +@@ -126,8 +125,7 @@ static void + } + + static void +-g_socket_address_connectable_iface_init (GSocketConnectableIface *connectable_iface, +- gpointer iface_data) ++g_socket_address_connectable_iface_init (GSocketConnectableIface *connectable_iface) + { + connectable_iface->enumerate = g_socket_address_connectable_enumerate; + connectable_iface->proxy_enumerate = g_socket_address_connectable_proxy_enumerate; +Index: glib-2.56.4/gio/gsocketinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocketinputstream.c ++++ glib-2.56.4/gio/gsocketinputstream.c +@@ -39,11 +39,9 @@ struct _GSocketInputStreamPrivate + gsize count; + }; + +-static void g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, +- gpointer iface_data); ++static void g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); + #ifdef G_OS_UNIX +-static void g_socket_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data); ++static void g_socket_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); + #endif + + #define g_socket_input_stream_get_type _g_socket_input_stream_get_type +@@ -200,16 +198,14 @@ static void + + #ifdef G_OS_UNIX + static void +-g_socket_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data) ++g_socket_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) + { + iface->get_fd = g_socket_input_stream_get_fd; + } + #endif + + static void +-g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, +- gpointer iface_data) ++g_socket_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) + { + iface->is_readable = g_socket_input_stream_pollable_is_readable; + iface->create_source = g_socket_input_stream_pollable_create_source; +Index: glib-2.56.4/gio/gsocketoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocketoutputstream.c ++++ glib-2.56.4/gio/gsocketoutputstream.c +@@ -43,11 +43,9 @@ struct _GSocketOutputStreamPrivate + gsize count; + }; + +-static void g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, +- gpointer iface_data); ++static void g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); + #ifdef G_OS_UNIX +-static void g_socket_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data); ++static void g_socket_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); + #endif + + #define g_socket_output_stream_get_type _g_socket_output_stream_get_type +@@ -204,16 +202,14 @@ static void + + #ifdef G_OS_UNIX + static void +-g_socket_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data) ++g_socket_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) + { + iface->get_fd = g_socket_output_stream_get_fd; + } + #endif + + static void +-g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, +- gpointer iface_data) ++g_socket_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) + { + iface->is_writable = g_socket_output_stream_pollable_is_writable; + iface->create_source = g_socket_output_stream_pollable_create_source; +Index: glib-2.56.4/gio/gsocks4aproxy.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocks4aproxy.c ++++ glib-2.56.4/gio/gsocks4aproxy.c +@@ -48,8 +48,7 @@ + #define SOCKS4_REP_NO_IDENT 92 + #define SOCKS4_REP_BAD_IDENT 93 + +-static void g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface, +- gpointer iface_data); ++static void g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface); + + #define g_socks4a_proxy_get_type _g_socks4a_proxy_get_type + G_DEFINE_TYPE_WITH_CODE (GSocks4aProxy, g_socks4a_proxy, G_TYPE_OBJECT, +@@ -450,8 +449,7 @@ static void + } + + static void +-g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface, +- gpointer iface_data) ++g_socks4a_proxy_iface_init (GProxyInterface *proxy_iface) + { + proxy_iface->connect = g_socks4a_proxy_connect; + proxy_iface->connect_async = g_socks4a_proxy_connect_async; +Index: glib-2.56.4/gio/gsocks5proxy.c +=================================================================== +--- glib-2.56.4.orig/gio/gsocks5proxy.c ++++ glib-2.56.4/gio/gsocks5proxy.c +@@ -80,8 +80,7 @@ struct _GSocks5ProxyClass + GObjectClass parent_class; + }; + +-static void g_socks5_proxy_iface_init (GProxyInterface *proxy_iface, +- gpointer iface_data); ++static void g_socks5_proxy_iface_init (GProxyInterface *proxy_iface); + + #define g_socks5_proxy_get_type _g_socks5_proxy_get_type + G_DEFINE_TYPE_WITH_CODE (GSocks5Proxy, g_socks5_proxy, G_TYPE_OBJECT, +@@ -1034,8 +1033,7 @@ static void + } + + static void +-g_socks5_proxy_iface_init (GProxyInterface *proxy_iface, +- gpointer iface_data) ++g_socks5_proxy_iface_init (GProxyInterface *proxy_iface) + { + proxy_iface->connect = g_socks5_proxy_connect; + proxy_iface->connect_async = g_socks5_proxy_connect_async; +Index: glib-2.56.4/gio/gsubprocess.c +=================================================================== +--- glib-2.56.4.orig/gio/gsubprocess.c ++++ glib-2.56.4/gio/gsubprocess.c +@@ -140,8 +140,7 @@ + * via the worker thread so that we don't race with waitpid() and + * accidentally send a signal to an already-reaped child. + */ +-static void initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data); ++static void initable_iface_init (GInitableIface *initable_iface); + + typedef GObjectClass GSubprocessClass; + +@@ -643,8 +642,7 @@ static void + } + + static void +-initable_iface_init (GInitableIface *initable_iface, +- gpointer iface_data) ++initable_iface_init (GInitableIface *initable_iface) + { + initable_iface->init = initable_init; + } +Index: glib-2.56.4/gio/gtask.c +=================================================================== +--- glib-2.56.4.orig/gio/gtask.c ++++ glib-2.56.4/gio/gtask.c +@@ -589,8 +589,7 @@ typedef enum + PROP_COMPLETED = 1, + } GTaskProperty; + +-static void g_task_async_result_iface_init (GAsyncResultIface *iface, +- gpointer iface_data); ++static void g_task_async_result_iface_init (GAsyncResultIface *iface); + static void g_task_thread_pool_init (void); + + G_DEFINE_TYPE_WITH_CODE (GTask, g_task, G_TYPE_OBJECT, +@@ -2043,8 +2042,7 @@ static void + } + + static void +-g_task_async_result_iface_init (GAsyncResultIface *iface, +- gpointer iface_data) ++g_task_async_result_iface_init (GAsyncResultIface *iface) + { + iface->get_user_data = g_task_get_user_data; + iface->get_source_object = g_task_ref_source_object; +Index: glib-2.56.4/gio/gthemedicon.c +=================================================================== +--- glib-2.56.4.orig/gio/gthemedicon.c ++++ glib-2.56.4/gio/gthemedicon.c +@@ -43,8 +43,7 @@ + * themes that inherit other themes. + **/ + +-static void g_themed_icon_icon_iface_init (GIconIface *iface, +- gpointer iface_data); ++static void g_themed_icon_icon_iface_init (GIconIface *iface); + + struct _GThemedIcon + { +@@ -542,8 +541,7 @@ static void + } + + static void +-g_themed_icon_icon_iface_init (GIconIface *iface, +- gpointer iface_data) ++g_themed_icon_icon_iface_init (GIconIface *iface) + { + iface->hash = g_themed_icon_hash; + iface->equal = g_themed_icon_equal; +Index: glib-2.56.4/gio/gunixinputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixinputstream.c ++++ glib-2.56.4/gio/gunixinputstream.c +@@ -67,10 +67,8 @@ struct _GUnixInputStreamPrivate { + guint is_pipe_or_socket : 1; + }; + +-static void g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, +- gpointer iface_data); +-static void g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data); ++static void g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface); ++static void g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); + + G_DEFINE_TYPE_WITH_CODE (GUnixInputStream, g_unix_input_stream, G_TYPE_INPUT_STREAM, + G_ADD_PRIVATE (GUnixInputStream) +@@ -171,8 +169,7 @@ static void + } + + static void +-g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface, +- gpointer iface_data) ++g_unix_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface) + { + iface->can_poll = g_unix_input_stream_pollable_can_poll; + iface->is_readable = g_unix_input_stream_pollable_is_readable; +@@ -180,8 +177,7 @@ static void + } + + static void +-g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data) ++g_unix_input_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) + { + iface->get_fd = (int (*) (GFileDescriptorBased *))g_unix_input_stream_get_fd; + } +Index: glib-2.56.4/gio/gunixmount.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixmount.c ++++ glib-2.56.4/gio/gunixmount.c +@@ -61,8 +61,7 @@ struct _GUnixMount { + gboolean can_eject; + }; + +-static void g_unix_mount_mount_iface_init (GMountIface *iface, +- gpointer iface_data); ++static void g_unix_mount_mount_iface_init (GMountIface *iface); + + #define g_unix_mount_get_type _g_unix_mount_get_type + G_DEFINE_TYPE_WITH_CODE (GUnixMount, g_unix_mount, G_TYPE_OBJECT, +@@ -376,8 +375,7 @@ static void + } + + static void +-g_unix_mount_mount_iface_init (GMountIface *iface, +- gpointer iface_data) ++g_unix_mount_mount_iface_init (GMountIface *iface) + { + iface->get_root = g_unix_mount_get_root; + iface->get_name = g_unix_mount_get_name; +Index: glib-2.56.4/gio/gunixoutputstream.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixoutputstream.c ++++ glib-2.56.4/gio/gunixoutputstream.c +@@ -67,10 +67,8 @@ struct _GUnixOutputStreamPrivate { + guint is_pipe_or_socket : 1; + }; + +-static void g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, +- gpointer iface_data); +-static void g_unix_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data); ++static void g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface); ++static void g_unix_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface); + + G_DEFINE_TYPE_WITH_CODE (GUnixOutputStream, g_unix_output_stream, G_TYPE_OUTPUT_STREAM, + G_ADD_PRIVATE (GUnixOutputStream) +@@ -156,8 +154,7 @@ static void + } + + static void +-g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface, +- gpointer iface_data) ++g_unix_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface) + { + iface->can_poll = g_unix_output_stream_pollable_can_poll; + iface->is_writable = g_unix_output_stream_pollable_is_writable; +@@ -165,8 +162,7 @@ static void + } + + static void +-g_unix_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface, +- gpointer iface_data) ++g_unix_output_stream_file_descriptor_based_iface_init (GFileDescriptorBasedIface *iface) + { + iface->get_fd = (int (*) (GFileDescriptorBased *))g_unix_output_stream_get_fd; + } +Index: glib-2.56.4/gio/gunixsocketaddress.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixsocketaddress.c ++++ glib-2.56.4/gio/gunixsocketaddress.c +@@ -77,8 +77,7 @@ struct _GUnixSocketAddressPrivate + GUnixSocketAddressType address_type; + }; + +-static void g_unix_socket_address_connectable_iface_init (GSocketConnectableIface *iface, +- gpointer iface_data); ++static void g_unix_socket_address_connectable_iface_init (GSocketConnectableIface *iface); + static gchar *g_unix_socket_address_connectable_to_string (GSocketConnectable *connectable); + + G_DEFINE_TYPE_WITH_CODE (GUnixSocketAddress, g_unix_socket_address, G_TYPE_SOCKET_ADDRESS, +@@ -310,8 +309,7 @@ static void + } + + static void +-g_unix_socket_address_connectable_iface_init (GSocketConnectableIface *iface, +- gpointer iface_data) ++g_unix_socket_address_connectable_iface_init (GSocketConnectableIface *iface) + { + GSocketConnectableIface *parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gunixvolume.c +=================================================================== +--- glib-2.56.4.orig/gio/gunixvolume.c ++++ glib-2.56.4/gio/gunixvolume.c +@@ -59,8 +59,7 @@ struct _GUnixVolume { + GIcon *symbolic_icon; + }; + +-static void g_unix_volume_volume_iface_init (GVolumeIface *iface, +- gpointer iface_data); ++static void g_unix_volume_volume_iface_init (GVolumeIface *iface); + + #define g_unix_volume_get_type _g_unix_volume_get_type + G_DEFINE_TYPE_WITH_CODE (GUnixVolume, g_unix_volume, G_TYPE_OBJECT, +@@ -418,8 +417,7 @@ static void + } + + static void +-g_unix_volume_volume_iface_init (GVolumeIface *iface, +- gpointer iface_data) ++g_unix_volume_volume_iface_init (GVolumeIface *iface) + { + iface->get_name = g_unix_volume_get_name; + iface->get_icon = g_unix_volume_get_icon; +Index: glib-2.56.4/gio/gwin32appinfo.c +=================================================================== +--- glib-2.56.4.orig/gio/gwin32appinfo.c ++++ glib-2.56.4/gio/gwin32appinfo.c +@@ -3435,8 +3435,7 @@ g_win32_appinfo_init (void) + } + + +-static void g_win32_app_info_iface_init (GAppInfoIface *iface, +- gpointer iface_data); ++static void g_win32_app_info_iface_init (GAppInfoIface *iface); + + struct _GWin32AppInfo + { +@@ -4420,8 +4419,7 @@ static void + /* GAppInfo interface init */ + + static void +-g_win32_app_info_iface_init (GAppInfoIface *iface, +- gpointer iface_data) ++g_win32_app_info_iface_init (GAppInfoIface *iface) + { + iface->dup = g_win32_app_info_dup; + iface->equal = g_win32_app_info_equal; +Index: glib-2.56.4/gio/gwin32mount.c +=================================================================== +--- glib-2.56.4.orig/gio/gwin32mount.c ++++ glib-2.56.4/gio/gwin32mount.c +@@ -55,8 +55,7 @@ struct _GWin32Mount { + gboolean can_eject; + }; + +-static void g_win32_mount_mount_iface_init (GMountIface *iface, +- gpointer iface_data) ++static void g_win32_mount_mount_iface_init (GMountIface *iface); + + #define g_win32_mount_get_type _g_win32_mount_get_type + G_DEFINE_TYPE_WITH_CODE (GWin32Mount, g_win32_mount, G_TYPE_OBJECT, +@@ -347,8 +346,7 @@ static void + } + + static void +-g_win32_mount_mount_iface_init (GMountIface *iface, +- gpointer iface_data) ++g_win32_mount_mount_iface_init (GMountIface *iface) + { + iface->get_root = g_win32_mount_get_root; + iface->get_name = g_win32_mount_get_name; +Index: glib-2.56.4/gio/gwin32networkmonitor.c +=================================================================== +--- glib-2.56.4.orig/gio/gwin32networkmonitor.c ++++ glib-2.56.4/gio/gwin32networkmonitor.c +@@ -44,10 +44,8 @@ static GInitableIface *initable_parent_iface; + #include "gioerror.h" + + static GInitableIface *initable_parent_iface; +-static void g_win32_network_monitor_iface_init (GNetworkMonitorInterface *iface, +- gpointer iface_data); +-static void g_win32_network_monitor_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_win32_network_monitor_iface_init (GNetworkMonitorInterface *iface); ++static void g_win32_network_monitor_initable_iface_init (GInitableIface *iface); + + struct _GWin32NetworkMonitorPrivate + { +@@ -328,14 +326,12 @@ static void + } + + static void +-g_win32_network_monitor_iface_init (GNetworkMonitorInterface *monitor_iface, +- gpointer iface_data) ++g_win32_network_monitor_iface_init (GNetworkMonitorInterface *monitor_iface) + { + } + + static void +-g_win32_network_monitor_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_win32_network_monitor_initable_iface_init (GInitableIface *iface) + { + initable_parent_iface = g_type_interface_peek_parent (iface); + +Index: glib-2.56.4/gio/gwin32registrykey.c +=================================================================== +--- glib-2.56.4.orig/gio/gwin32registrykey.c ++++ glib-2.56.4/gio/gwin32registrykey.c +@@ -414,8 +414,7 @@ struct _GWin32RegistryKeyPrivate { + gpointer user_data; + }; + +-static void g_win32_registry_key_initable_iface_init (GInitableIface *iface, +- gpointer iface_data); ++static void g_win32_registry_key_initable_iface_init (GInitableIface *iface); + static gboolean g_win32_registry_key_initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error); +@@ -522,8 +521,7 @@ static void + } + + static void +-g_win32_registry_key_initable_iface_init (GInitableIface *iface, +- gpointer iface_data) ++g_win32_registry_key_initable_iface_init (GInitableIface *iface) + { + iface->init = g_win32_registry_key_initable_init; + } +Index: glib-2.56.4/gio/gzlibcompressor.c +=================================================================== +--- glib-2.56.4.orig/gio/gzlibcompressor.c ++++ glib-2.56.4/gio/gzlibcompressor.c +@@ -49,8 +49,7 @@ enum { + * compresses data using zlib. + */ + +-static void g_zlib_compressor_iface_init (GConverterIface *iface, +- gpointer iface_data); ++static void g_zlib_compressor_iface_init (GConverterIface *iface); + + /** + * GZlibCompressor: +@@ -430,8 +429,7 @@ static void + } + + static void +-g_zlib_compressor_iface_init (GConverterIface *iface, +- gpointer iface_data) ++g_zlib_compressor_iface_init (GConverterIface *iface) + { + iface->convert = g_zlib_compressor_convert; + iface->reset = g_zlib_compressor_reset; +Index: glib-2.56.4/gio/gzlibdecompressor.c +=================================================================== +--- glib-2.56.4.orig/gio/gzlibdecompressor.c ++++ glib-2.56.4/gio/gzlibdecompressor.c +@@ -48,8 +48,7 @@ enum { + * decompresses data compressed with zlib. + */ + +-static void g_zlib_decompressor_iface_init (GConverterIface *iface, +- gpointer iface_data); ++static void g_zlib_decompressor_iface_init (GConverterIface *iface); + + typedef struct { + gz_header gzheader; +@@ -407,8 +406,7 @@ static void + } + + static void +-g_zlib_decompressor_iface_init (GConverterIface *iface, +- gpointer iface_data) ++g_zlib_decompressor_iface_init (GConverterIface *iface) + { + iface->convert = g_zlib_decompressor_convert; + iface->reset = g_zlib_decompressor_reset; +Index: glib-2.56.4/glib/gatomic.c +=================================================================== +--- glib-2.56.4.orig/glib/gatomic.c ++++ glib-2.56.4/glib/gatomic.c +@@ -396,7 +396,7 @@ gssize + (g_atomic_pointer_add) (volatile void *atomic, + gssize val) + { +- return g_atomic_pointer_add ((volatile gpointer *) atomic, val); ++ return g_atomic_pointer_add ((volatile gssize *) atomic, val); + } + + /** +@@ -420,7 +420,7 @@ gsize + (g_atomic_pointer_and) (volatile void *atomic, + gsize val) + { +- return g_atomic_pointer_and ((volatile gpointer *) atomic, val); ++ return g_atomic_pointer_and ((volatile gssize *) atomic, val); + } + + /** +@@ -444,7 +444,7 @@ gsize + (g_atomic_pointer_or) (volatile void *atomic, + gsize val) + { +- return g_atomic_pointer_or ((volatile gpointer *) atomic, val); ++ return g_atomic_pointer_or ((volatile gssize *) atomic, val); + } + + /** +@@ -468,7 +468,7 @@ gsize + (g_atomic_pointer_xor) (volatile void *atomic, + gsize val) + { +- return g_atomic_pointer_xor ((volatile gpointer *) atomic, val); ++ return g_atomic_pointer_xor ((volatile gssize *) atomic, val); + } + + #elif defined (G_PLATFORM_WIN32) +Index: glib-2.56.4/glib/gdataset.c +=================================================================== +--- glib-2.56.4.orig/glib/gdataset.c ++++ glib-2.56.4/glib/gdataset.c +@@ -1195,7 +1195,7 @@ g_datalist_set_flags (GData **datalist, + g_return_if_fail (datalist != NULL); + g_return_if_fail ((flags & ~G_DATALIST_FLAGS_MASK) == 0); + +- g_atomic_pointer_or (datalist, (gsize)flags); ++ g_atomic_pointer_or ((volatile gssize *) datalist, (gsize)flags); + } + + /** +@@ -1218,7 +1218,7 @@ g_datalist_unset_flags (GData **datalist, + g_return_if_fail (datalist != NULL); + g_return_if_fail ((flags & ~G_DATALIST_FLAGS_MASK) == 0); + +- g_atomic_pointer_and (datalist, ~(gsize)flags); ++ g_atomic_pointer_and ((volatile gssize *) datalist, ~(gsize)flags); + } + + /** +Index: glib-2.56.4/gobject/gtype.h +=================================================================== +--- glib-2.56.4.orig/gobject/gtype.h ++++ glib-2.56.4/gobject/gtype.h +@@ -1950,6 +1950,11 @@ static void type_name##_class_init (TypeNam + \ + static void type_name##_init (TypeName *self); \ + static void type_name##_class_init (TypeName##Class *klass); \ ++static void type_name##_init_adapter (TypeName *self, \ ++ gpointer class_data) \ ++{ \ ++ type_name##_init (self); \ ++} \ + static gpointer type_name##_parent_class = NULL; \ + static gint TypeName##_private_offset; \ + \ +Index: glib-2.56.4/gobject/gparam.c +=================================================================== +--- glib-2.56.4.orig/gobject/gparam.c ++++ glib-2.56.4/gobject/gparam.c +@@ -255,7 +255,7 @@ g_param_spec_sink (GParamSpec *pspec) + gsize oldvalue; + g_return_if_fail (G_IS_PARAM_SPEC (pspec)); + +- oldvalue = g_atomic_pointer_and (&pspec->qdata, ~(gsize)PARAM_FLOATING_FLAG); ++ oldvalue = g_atomic_pointer_and ((volatile gssize *)(&pspec->qdata), ~(gsize)PARAM_FLOATING_FLAG); + if (oldvalue & PARAM_FLOATING_FLAG) + g_param_spec_unref (pspec); + } +@@ -275,7 +275,7 @@ g_param_spec_ref_sink (GParamSpec *pspec) + gsize oldvalue; + g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL); + +- oldvalue = g_atomic_pointer_and (&pspec->qdata, ~(gsize)PARAM_FLOATING_FLAG); ++ oldvalue = g_atomic_pointer_and ((volatile gssize *)(&pspec->qdata), ~(gsize)PARAM_FLOATING_FLAG); + if (!(oldvalue & PARAM_FLOATING_FLAG)) + g_param_spec_ref (pspec); + +Index: glib-2.56.4/gobject/gclosure.c +=================================================================== +--- glib-2.56.4.orig/gobject/gclosure.c ++++ glib-2.56.4/gobject/gclosure.c +@@ -25,8 +25,6 @@ + #include "../glib/valgrind.h" + #include + +-#include +- + #include "gclosure.h" + #include "gboxed.h" + #include "gobject.h" +@@ -1151,169 +1149,8 @@ g_signal_type_cclosure_new (GType itype, + return closure; + } + +-#include +-static ffi_type * +-value_to_ffi_type (const GValue *gvalue, +- gpointer *value, +- gint *enum_tmpval, +- gboolean *tmpval_used) +-{ +- ffi_type *rettype = NULL; +- GType type = g_type_fundamental (G_VALUE_TYPE (gvalue)); +- g_assert (type != G_TYPE_INVALID); ++#include + +- if (enum_tmpval) +- { +- g_assert (tmpval_used != NULL); +- *tmpval_used = FALSE; +- } +- +- switch (type) +- { +- case G_TYPE_BOOLEAN: +- case G_TYPE_CHAR: +- case G_TYPE_INT: +- rettype = &ffi_type_sint; +- *value = (gpointer)&(gvalue->data[0].v_int); +- break; +- case G_TYPE_ENUM: +- /* enums are stored in v_long even though they are integers, which makes +- * marshalling through libffi somewhat complicated. They need to be +- * marshalled as signed ints, but we need to use a temporary int sized +- * value to pass to libffi otherwise it'll pull the wrong value on +- * BE machines with 32-bit integers when treating v_long as 32-bit int. +- */ +- g_assert (enum_tmpval != NULL); +- rettype = &ffi_type_sint; +- *enum_tmpval = g_value_get_enum (gvalue); +- *value = enum_tmpval; +- *tmpval_used = TRUE; +- break; +- case G_TYPE_FLAGS: +- g_assert (enum_tmpval != NULL); +- rettype = &ffi_type_uint; +- *enum_tmpval = g_value_get_flags (gvalue); +- *value = enum_tmpval; +- *tmpval_used = TRUE; +- break; +- case G_TYPE_UCHAR: +- case G_TYPE_UINT: +- rettype = &ffi_type_uint; +- *value = (gpointer)&(gvalue->data[0].v_uint); +- break; +- case G_TYPE_STRING: +- case G_TYPE_OBJECT: +- case G_TYPE_BOXED: +- case G_TYPE_PARAM: +- case G_TYPE_POINTER: +- case G_TYPE_INTERFACE: +- case G_TYPE_VARIANT: +- rettype = &ffi_type_pointer; +- *value = (gpointer)&(gvalue->data[0].v_pointer); +- break; +- case G_TYPE_FLOAT: +- rettype = &ffi_type_float; +- *value = (gpointer)&(gvalue->data[0].v_float); +- break; +- case G_TYPE_DOUBLE: +- rettype = &ffi_type_double; +- *value = (gpointer)&(gvalue->data[0].v_double); +- break; +- case G_TYPE_LONG: +- rettype = &ffi_type_slong; +- *value = (gpointer)&(gvalue->data[0].v_long); +- break; +- case G_TYPE_ULONG: +- rettype = &ffi_type_ulong; +- *value = (gpointer)&(gvalue->data[0].v_ulong); +- break; +- case G_TYPE_INT64: +- rettype = &ffi_type_sint64; +- *value = (gpointer)&(gvalue->data[0].v_int64); +- break; +- case G_TYPE_UINT64: +- rettype = &ffi_type_uint64; +- *value = (gpointer)&(gvalue->data[0].v_uint64); +- break; +- default: +- rettype = &ffi_type_pointer; +- *value = NULL; +- g_warning ("value_to_ffi_type: Unsupported fundamental type: %s", g_type_name (type)); +- break; +- } +- return rettype; +-} +- +-static void +-value_from_ffi_type (GValue *gvalue, gpointer *value) +-{ +- ffi_arg *int_val = (ffi_arg*) value; +- +- switch (g_type_fundamental (G_VALUE_TYPE (gvalue))) +- { +- case G_TYPE_INT: +- g_value_set_int (gvalue, (gint) *int_val); +- break; +- case G_TYPE_FLOAT: +- g_value_set_float (gvalue, *(gfloat*)value); +- break; +- case G_TYPE_DOUBLE: +- g_value_set_double (gvalue, *(gdouble*)value); +- break; +- case G_TYPE_BOOLEAN: +- g_value_set_boolean (gvalue, (gboolean) *int_val); +- break; +- case G_TYPE_STRING: +- g_value_take_string (gvalue, *(gchar**)value); +- break; +- case G_TYPE_CHAR: +- g_value_set_schar (gvalue, (gint8) *int_val); +- break; +- case G_TYPE_UCHAR: +- g_value_set_uchar (gvalue, (guchar) *int_val); +- break; +- case G_TYPE_UINT: +- g_value_set_uint (gvalue, (guint) *int_val); +- break; +- case G_TYPE_POINTER: +- g_value_set_pointer (gvalue, *(gpointer*)value); +- break; +- case G_TYPE_LONG: +- g_value_set_long (gvalue, (glong) *int_val); +- break; +- case G_TYPE_ULONG: +- g_value_set_ulong (gvalue, (gulong) *int_val); +- break; +- case G_TYPE_INT64: +- g_value_set_int64 (gvalue, (gint64) *int_val); +- break; +- case G_TYPE_UINT64: +- g_value_set_uint64 (gvalue, (guint64) *int_val); +- break; +- case G_TYPE_BOXED: +- g_value_take_boxed (gvalue, *(gpointer*)value); +- break; +- case G_TYPE_ENUM: +- g_value_set_enum (gvalue, (gint) *int_val); +- break; +- case G_TYPE_FLAGS: +- g_value_set_flags (gvalue, (guint) *int_val); +- break; +- case G_TYPE_PARAM: +- g_value_take_param (gvalue, *(gpointer*)value); +- break; +- case G_TYPE_OBJECT: +- g_value_take_object (gvalue, *(gpointer*)value); +- break; +- case G_TYPE_VARIANT: +- g_value_take_variant (gvalue, *(gpointer*)value); +- break; +- default: +- g_warning ("value_from_ffi_type: Unsupported fundamental type: %s", +- g_type_name (g_type_fundamental (G_VALUE_TYPE (gvalue)))); +- } +-} +- + typedef union { + gpointer _gpointer; + float _float; +@@ -1326,74 +1163,6 @@ typedef union { + guint64 _guint64; + } va_arg_storage; + +-static ffi_type * +-va_to_ffi_type (GType gtype, +- va_list *va, +- va_arg_storage *storage) +-{ +- ffi_type *rettype = NULL; +- GType type = g_type_fundamental (gtype); +- g_assert (type != G_TYPE_INVALID); +- +- switch (type) +- { +- case G_TYPE_BOOLEAN: +- case G_TYPE_CHAR: +- case G_TYPE_INT: +- case G_TYPE_ENUM: +- rettype = &ffi_type_sint; +- storage->_gint = va_arg (*va, gint); +- break; +- case G_TYPE_UCHAR: +- case G_TYPE_UINT: +- case G_TYPE_FLAGS: +- rettype = &ffi_type_uint; +- storage->_guint = va_arg (*va, guint); +- break; +- case G_TYPE_STRING: +- case G_TYPE_OBJECT: +- case G_TYPE_BOXED: +- case G_TYPE_PARAM: +- case G_TYPE_POINTER: +- case G_TYPE_INTERFACE: +- case G_TYPE_VARIANT: +- rettype = &ffi_type_pointer; +- storage->_gpointer = va_arg (*va, gpointer); +- break; +- case G_TYPE_FLOAT: +- /* Float args are passed as doubles in varargs */ +- rettype = &ffi_type_float; +- storage->_float = (float)va_arg (*va, double); +- break; +- case G_TYPE_DOUBLE: +- rettype = &ffi_type_double; +- storage->_double = va_arg (*va, double); +- break; +- case G_TYPE_LONG: +- rettype = &ffi_type_slong; +- storage->_glong = va_arg (*va, glong); +- break; +- case G_TYPE_ULONG: +- rettype = &ffi_type_ulong; +- storage->_gulong = va_arg (*va, gulong); +- break; +- case G_TYPE_INT64: +- rettype = &ffi_type_sint64; +- storage->_gint64 = va_arg (*va, gint64); +- break; +- case G_TYPE_UINT64: +- rettype = &ffi_type_uint64; +- storage->_guint64 = va_arg (*va, guint64); +- break; +- default: +- rettype = &ffi_type_pointer; +- storage->_guint64 = 0; +- g_warning ("va_to_ffi_type: Unsupported fundamental type: %s", g_type_name (type)); +- break; +- } +- return rettype; +-} +- + /** + * g_cclosure_marshal_generic: + * @closure: A #GClosure. +@@ -1424,73 +1193,8 @@ g_cclosure_marshal_generic (GClosure *closure, + gpointer invocation_hint, + gpointer marshal_data) + { +- ffi_type *rtype; +- void *rvalue; +- int n_args; +- ffi_type **atypes; +- void **args; +- int i; +- ffi_cif cif; +- GCClosure *cc = (GCClosure*) closure; +- gint *enum_tmpval; +- gboolean tmpval_used = FALSE; +- +- enum_tmpval = g_alloca (sizeof (gint)); +- if (return_gvalue && G_VALUE_TYPE (return_gvalue)) +- { +- rtype = value_to_ffi_type (return_gvalue, &rvalue, enum_tmpval, &tmpval_used); +- } +- else +- { +- rtype = &ffi_type_void; +- } +- +- rvalue = g_alloca (MAX (rtype->size, sizeof (ffi_arg))); +- +- n_args = n_param_values + 1; +- atypes = g_alloca (sizeof (ffi_type *) * n_args); +- args = g_alloca (sizeof (gpointer) * n_args); +- +- if (tmpval_used) +- enum_tmpval = g_alloca (sizeof (gint)); +- +- if (G_CCLOSURE_SWAP_DATA (closure)) +- { +- atypes[n_args-1] = value_to_ffi_type (param_values + 0, +- &args[n_args-1], +- enum_tmpval, +- &tmpval_used); +- atypes[0] = &ffi_type_pointer; +- args[0] = &closure->data; +- } +- else +- { +- atypes[0] = value_to_ffi_type (param_values + 0, +- &args[0], +- enum_tmpval, +- &tmpval_used); +- atypes[n_args-1] = &ffi_type_pointer; +- args[n_args-1] = &closure->data; +- } +- +- for (i = 1; i < n_args - 1; i++) +- { +- if (tmpval_used) +- enum_tmpval = g_alloca (sizeof (gint)); +- +- atypes[i] = value_to_ffi_type (param_values + i, +- &args[i], +- enum_tmpval, +- &tmpval_used); +- } +- +- if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, n_args, rtype, atypes) != FFI_OK) +- return; +- +- ffi_call (&cif, marshal_data ? marshal_data : cc->callback, rvalue, args); +- +- if (return_gvalue && G_VALUE_TYPE (return_gvalue)) +- value_from_ffi_type (return_gvalue, rvalue); ++ fprintf(stderr, "g_cclosure_marshal_generic is disabled in this build of glib\n"); ++ exit(1); + } + + /** +@@ -1523,109 +1227,8 @@ g_cclosure_marshal_generic_va (GClosure *closure, + int n_params, + GType *param_types) + { +- ffi_type *rtype; +- void *rvalue; +- int n_args; +- ffi_type **atypes; +- void **args; +- va_arg_storage *storage; +- int i; +- ffi_cif cif; +- GCClosure *cc = (GCClosure*) closure; +- gint *enum_tmpval; +- gboolean tmpval_used = FALSE; +- va_list args_copy; +- +- enum_tmpval = g_alloca (sizeof (gint)); +- if (return_value && G_VALUE_TYPE (return_value)) +- { +- rtype = value_to_ffi_type (return_value, &rvalue, enum_tmpval, &tmpval_used); +- } +- else +- { +- rtype = &ffi_type_void; +- } +- +- rvalue = g_alloca (MAX (rtype->size, sizeof (ffi_arg))); +- +- n_args = n_params + 2; +- atypes = g_alloca (sizeof (ffi_type *) * n_args); +- args = g_alloca (sizeof (gpointer) * n_args); +- storage = g_alloca (sizeof (va_arg_storage) * n_params); +- +- if (G_CCLOSURE_SWAP_DATA (closure)) +- { +- atypes[n_args-1] = &ffi_type_pointer; +- args[n_args-1] = &instance; +- atypes[0] = &ffi_type_pointer; +- args[0] = &closure->data; +- } +- else +- { +- atypes[0] = &ffi_type_pointer; +- args[0] = &instance; +- atypes[n_args-1] = &ffi_type_pointer; +- args[n_args-1] = &closure->data; +- } +- +- G_VA_COPY (args_copy, args_list); +- +- /* Box non-primitive arguments */ +- for (i = 0; i < n_params; i++) +- { +- GType type = param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE; +- GType fundamental = G_TYPE_FUNDAMENTAL (type); +- +- atypes[i+1] = va_to_ffi_type (type, +- &args_copy, +- &storage[i]); +- args[i+1] = &storage[i]; +- +- if ((param_types[i] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0) +- { +- if (fundamental == G_TYPE_STRING && storage[i]._gpointer != NULL) +- storage[i]._gpointer = g_strdup (storage[i]._gpointer); +- else if (fundamental == G_TYPE_PARAM && storage[i]._gpointer != NULL) +- storage[i]._gpointer = g_param_spec_ref (storage[i]._gpointer); +- else if (fundamental == G_TYPE_BOXED && storage[i]._gpointer != NULL) +- storage[i]._gpointer = g_boxed_copy (type, storage[i]._gpointer); +- else if (fundamental == G_TYPE_VARIANT && storage[i]._gpointer != NULL) +- storage[i]._gpointer = g_variant_ref_sink (storage[i]._gpointer); +- } +- if (fundamental == G_TYPE_OBJECT && storage[i]._gpointer != NULL) +- storage[i]._gpointer = g_object_ref (storage[i]._gpointer); +- } +- +- va_end (args_copy); +- +- if (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, n_args, rtype, atypes) != FFI_OK) +- return; +- +- ffi_call (&cif, marshal_data ? marshal_data : cc->callback, rvalue, args); +- +- /* Unbox non-primitive arguments */ +- for (i = 0; i < n_params; i++) +- { +- GType type = param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE; +- GType fundamental = G_TYPE_FUNDAMENTAL (type); +- +- if ((param_types[i] & G_SIGNAL_TYPE_STATIC_SCOPE) == 0) +- { +- if (fundamental == G_TYPE_STRING && storage[i]._gpointer != NULL) +- g_free (storage[i]._gpointer); +- else if (fundamental == G_TYPE_PARAM && storage[i]._gpointer != NULL) +- g_param_spec_unref (storage[i]._gpointer); +- else if (fundamental == G_TYPE_BOXED && storage[i]._gpointer != NULL) +- g_boxed_free (type, storage[i]._gpointer); +- else if (fundamental == G_TYPE_VARIANT && storage[i]._gpointer != NULL) +- g_variant_unref (storage[i]._gpointer); +- } +- if (fundamental == G_TYPE_OBJECT && storage[i]._gpointer != NULL) +- g_object_unref (storage[i]._gpointer); +- } +- +- if (return_value && G_VALUE_TYPE (return_value)) +- value_from_ffi_type (return_value, rvalue); ++ fprintf(stderr, "g_cclosure_marshal_generic_va is disabled in this build of glib\n"); ++ exit(1); + } + + /** diff --git a/recipes/recipes_emscripten/glib/patches/fix-python12.diff b/recipes/recipes_emscripten/glib/patches/fix-python12.diff new file mode 100644 index 000000000..ee4559b67 --- /dev/null +++ b/recipes/recipes_emscripten/glib/patches/fix-python12.diff @@ -0,0 +1,42 @@ +diff -aurp glib-2.56.4.orig/py-compile glib-2.56.4/py-compile +--- glib-2.56.4.orig/py-compile 2024-04-28 22:15:25 ++++ glib-2.56.4/py-compile 2024-04-28 22:16:15 +@@ -116,7 +116,7 @@ $PYTHON -c " + fi + + $PYTHON -c " +-import sys, os, py_compile, imp ++import sys, os, py_compile + + files = '''$files''' + +@@ -129,15 +129,12 @@ for file in files.split(): + continue + sys.stdout.write(file) + sys.stdout.flush() +- if hasattr(imp, 'get_tag'): +- py_compile.compile(filepath, imp.cache_from_source(filepath), path) +- else: +- py_compile.compile(filepath, filepath + 'c', path) ++ py_compile.compile(filepath, filepath + 'c', path) + sys.stdout.write('\n')" || exit $? + + # this will fail for python < 1.5, but that doesn't matter ... + $PYTHON -O -c " +-import sys, os, py_compile, imp ++import sys, os, py_compile + + # pypy does not use .pyo optimization + if hasattr(sys, 'pypy_translation_info'): +@@ -153,10 +150,7 @@ for file in files.split(): + continue + sys.stdout.write(file) + sys.stdout.flush() +- if hasattr(imp, 'get_tag'): +- py_compile.compile(filepath, imp.cache_from_source(filepath, False), path) +- else: +- py_compile.compile(filepath, filepath + 'o', path) ++ py_compile.compile(filepath, filepath + 'o', path) + sys.stdout.write('\n')" 2>/dev/null || : + + # Local Variables: diff --git a/recipes/recipes_emscripten/glib/recipe.yaml b/recipes/recipes_emscripten/glib/recipe.yaml new file mode 100644 index 000000000..6f31b01d0 --- /dev/null +++ b/recipes/recipes_emscripten/glib/recipe.yaml @@ -0,0 +1,38 @@ +context: + version: "2.56.4" + major_minor: "2.56" + +package: + name: glib + version: ${{ version }} + +source: + url: https://download.gnome.org/sources/glib/${{ major_minor }}/glib-${{ version }}.tar.xz + sha256: 27f703d125efb07f8a743666b580df0b4095c59fc8750e8890132c91d437504c + patches: + # patches taken from webR + # License: MIT + - patches/emscripten-configure.diff + - patches/emscripten-function-ptr.diff + - patches/emscripten-wasm.diff + - patches/emscripten-disable-pcre.diff + - patches/fix-python12.diff + +build: + number: 0 + +requirements: + build: + - pkg-config + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - gettext + - make + host: + - zlib + - libffi + +about: + homepage: https://developer.gnome.org/glib/ + license: LGPL-2.1-or-later + summary: Provides core application building blocks for libraries and applications written in C.