[gjs/wip/gobj-kitchen-sink: 2/19] function: Make GjsCallbackTrampoline public



commit ac095d1b91ee0aef11d4e7bf3b7561f3230477fa
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Dec 15 21:03:51 2011 -0500

    function: Make GjsCallbackTrampoline public
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663492

 gi/function.c |   17 +++--------------
 gi/function.h |   19 +++++++++++++++++++
 2 files changed, 22 insertions(+), 14 deletions(-)
---
diff --git a/gi/function.c b/gi/function.c
index 9fecf86..1fe354d 100644
--- a/gi/function.c
+++ b/gi/function.c
@@ -36,7 +36,6 @@
 #include <jsapi.h>
 
 #include <girepository.h>
-#include <girffi.h>
 #include <sys/mman.h>
 #include <unistd.h>
 #include <errno.h>
@@ -72,16 +71,6 @@ static struct JSClass gjs_function_class;
  */
 static GSList *completed_trampolines = NULL;  /* GjsCallbackTrampoline */
 
-typedef struct {
-    gint ref_count;
-    JSRuntime *runtime;
-    GICallableInfo *info;
-    jsval js_function;
-    ffi_cif cif;
-    ffi_closure *closure;
-    GIScopeType scope;
-} GjsCallbackTrampoline;
-
 GJS_DEFINE_PRIV_FROM_JS(Function, gjs_function_class)
 
 /*
@@ -123,13 +112,13 @@ function_new_resolve(JSContext *context,
     return JS_TRUE;
 }
 
-static void
+void
 gjs_callback_trampoline_ref(GjsCallbackTrampoline *trampoline)
 {
     trampoline->ref_count++;
 }
 
-static void
+void
 gjs_callback_trampoline_unref(GjsCallbackTrampoline *trampoline)
 {
     /* Not MT-safe, like all the rest of GJS */
@@ -309,7 +298,7 @@ gjs_destroy_notify_callback(gpointer data)
     gjs_callback_trampoline_unref(trampoline);
 }
 
-static GjsCallbackTrampoline*
+GjsCallbackTrampoline*
 gjs_callback_trampoline_new(JSContext      *context,
                             jsval           function,
                             GICallableInfo *callable_info,
diff --git a/gi/function.h b/gi/function.h
index 134d054..555def6 100644
--- a/gi/function.h
+++ b/gi/function.h
@@ -29,9 +29,28 @@
 #include <jsapi.h>
 
 #include <girepository.h>
+#include <girffi.h>
 
 G_BEGIN_DECLS
 
+typedef struct {
+    gint ref_count;
+    JSRuntime *runtime;
+    GICallableInfo *info;
+    jsval js_function;
+    ffi_cif cif;
+    ffi_closure *closure;
+    GIScopeType scope;
+} GjsCallbackTrampoline;
+
+GjsCallbackTrampoline* gjs_callback_trampoline_new(JSContext      *context,
+                                                   jsval           function,
+                                                   GICallableInfo *callable_info,
+                                                   GIScopeType     scope);
+
+void gjs_callback_trampoline_unref(GjsCallbackTrampoline *trampoline);
+void gjs_callback_trampoline_ref(GjsCallbackTrampoline *trampoline);
+
 JSObject* gjs_define_function   (JSContext      *context,
                                  JSObject       *in_object,
                                  GIFunctionInfo *info);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]