about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wrapped/generated/functions_list.txt4
-rw-r--r--src/wrapped/generated/wrappeddbustypes.h6
-rwxr-xr-xsrc/wrapped/wrappeddbus.c43
-rwxr-xr-xsrc/wrapped/wrappeddbus_private.h22
4 files changed, 63 insertions, 12 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index aeecda92..371bfbd8 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -2510,10 +2510,12 @@ wrappeddbus:
 - vFpppp:
   - dbus_connection_set_dispatch_status_function
   - dbus_connection_set_wakeup_main_function
+  - dbus_server_set_new_connection_function
 - iFpipp:
   - dbus_connection_set_data
   - dbus_message_set_data
   - dbus_pending_call_set_data
+  - dbus_server_set_data
 - iFppip:
   - dbus_message_get_args
 - iFppiA:
@@ -2527,6 +2529,8 @@ wrappeddbus:
 - iFpppppp:
   - dbus_connection_set_timeout_functions
   - dbus_connection_set_watch_functions
+  - dbus_server_set_timeout_functions
+  - dbus_server_set_watch_functions
 wrappeddbusglib1:
 - vFppp:
   - dbus_g_type_collection_value_iterate
diff --git a/src/wrapped/generated/wrappeddbustypes.h b/src/wrapped/generated/wrappeddbustypes.h
index 0482b585..83ea5b82 100644
--- a/src/wrapped/generated/wrappeddbustypes.h
+++ b/src/wrapped/generated/wrappeddbustypes.h
@@ -30,9 +30,11 @@ typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*);
 	GO(dbus_message_append_args_valist, iFpiA_t) \
 	GO(dbus_connection_set_dispatch_status_function, vFpppp_t) \
 	GO(dbus_connection_set_wakeup_main_function, vFpppp_t) \
+	GO(dbus_server_set_new_connection_function, vFpppp_t) \
 	GO(dbus_connection_set_data, iFpipp_t) \
 	GO(dbus_message_set_data, iFpipp_t) \
 	GO(dbus_pending_call_set_data, iFpipp_t) \
+	GO(dbus_server_set_data, iFpipp_t) \
 	GO(dbus_message_get_args, iFppip_t) \
 	GO(dbus_message_get_args_valist, iFppiA_t) \
 	GO(dbus_connection_add_filter, iFpppp_t) \
@@ -40,6 +42,8 @@ typedef int32_t (*iFpppppp_t)(void*, void*, void*, void*, void*, void*);
 	GO(dbus_connection_try_register_fallback, iFppppp_t) \
 	GO(dbus_connection_try_register_object_path, iFppppp_t) \
 	GO(dbus_connection_set_timeout_functions, iFpppppp_t) \
-	GO(dbus_connection_set_watch_functions, iFpppppp_t)
+	GO(dbus_connection_set_watch_functions, iFpppppp_t) \
+	GO(dbus_server_set_timeout_functions, iFpppppp_t) \
+	GO(dbus_server_set_watch_functions, iFpppppp_t)
 
 #endif // __wrappeddbusTYPES_H_
diff --git a/src/wrapped/wrappeddbus.c b/src/wrapped/wrappeddbus.c
index 491466c2..5f554771 100755
--- a/src/wrapped/wrappeddbus.c
+++ b/src/wrapped/wrappeddbus.c
@@ -349,6 +349,31 @@ static void* finddbus_internal_padFct(void* fct)
     printf_log(LOG_NONE, "Warning, no more slot for dbus dbus_internal_pad callback\n");
     return NULL;
 }
+
+// DBusNewConnectionFunction
+#define GO(A)   \
+static uintptr_t my_DBusNewConnectionFunction_fct_##A = 0;                      \
+static void my_DBusNewConnectionFunction_##A(void* a, void* b, void* c)         \
+{                                                                               \
+    RunFunction(my_context, my_DBusNewConnectionFunction_fct_##A, 3, a, b, c);  \
+}
+SUPER()
+#undef GO
+static void* findDBusNewConnectionFunctionFct(void* fct)
+{
+    if(!fct) return NULL;
+    if(GetNativeFnc((uintptr_t)fct))  return GetNativeFnc((uintptr_t)fct);
+    #define GO(A) if(my_DBusNewConnectionFunction_fct_##A == (uintptr_t)fct) return my_DBusNewConnectionFunction_##A;
+    SUPER()
+    #undef GO
+    #define GO(A) if(my_DBusNewConnectionFunction_fct_##A == 0) {my_DBusNewConnectionFunction_fct_##A = (uintptr_t)fct; return my_DBusNewConnectionFunction_##A; }
+    SUPER()
+    #undef GO
+    printf_log(LOG_NONE, "Warning, no more slot for dbus DBusNewConnectionFunction callback\n");
+    return NULL;
+}
+
+
 #undef SUPER
 
 EXPORT void my_dbus_timeout_set_data(x64emu_t* emu, void* e, void* p, void* f)
@@ -563,7 +588,25 @@ EXPORT int my_dbus_connection_try_register_fallback(x64emu_t* emu, void* connect
     return my->dbus_connection_try_register_fallback(connection, path, vtable?&vt:NULL, data, error);
 }
 
+EXPORT int my_dbus_server_set_watch_functions(x64emu_t* emu, void* server, void* add, void* rem, void* toggle, void* data, void* d)
+{
+    return my->dbus_server_set_watch_functions(server, findDBusAddWatchFunctionFct(add), findDBusRemoveWatchFunctionFct(rem), findDBusWatchToggledFunctionFct(toggle), data, find_DBusFreeFunction_Fct(d));
+}
 
+EXPORT void my_dbus_server_set_new_connection_function(x64emu_t* emu, void* server, void* f, void* data, void* d)
+{
+    my->dbus_server_set_new_connection_function(server, findDBusNewConnectionFunctionFct(f), data, find_DBusFreeFunction_Fct(d));
+}
+
+EXPORT int my_dbus_server_set_timeout_functions(x64emu_t* emu, void* server, void* add, void* rem, void* toggle, void* data, void* d)
+{
+    return my->dbus_server_set_timeout_functions(server, find_DBusAddTimeoutFunction_Fct(add), find_DBusRemoveTimeoutFunction_Fct(rem), find_DBusTimeoutToggledFunction_Fct(toggle), data, find_DBusFreeFunction_Fct(d));
+}
+
+EXPORT int my_dbus_server_set_data(x64emu_t* emu, void* server, int slot, void* data, void* d)
+{
+    return my->dbus_server_set_data(server, slot, data, find_DBusFreeFunction_Fct(d));
+}
 
 #define CUSTOM_INIT \
     getMy(lib);
diff --git a/src/wrapped/wrappeddbus_private.h b/src/wrapped/wrappeddbus_private.h
index c72c99c3..5c546fd2 100755
--- a/src/wrapped/wrappeddbus_private.h
+++ b/src/wrapped/wrappeddbus_private.h
@@ -179,21 +179,21 @@ GOM(dbus_pending_call_set_notify, iFEpppp)
 GO(dbus_pending_call_steal_reply, pFp)
 GO(dbus_pending_call_unref, vFp)
 GO(dbus_realloc, pFpL)
-//GO(dbus_server_allocate_data_slot, 
-//GO(dbus_server_disconnect, 
-//GO(dbus_server_free_data_slot, 
-//GO(dbus_server_get_address, 
+GO(dbus_server_allocate_data_slot, iFp)
+GO(dbus_server_disconnect, vFp)
+GO(dbus_server_free_data_slot, vFp)
+GO(dbus_server_get_address, pFp)
 //GO(dbus_server_get_data, 
 //GO(dbus_server_get_id, 
-//GO(dbus_server_get_is_connected, 
-//GO(dbus_server_listen, 
+GO(dbus_server_get_is_connected, iFp)
+GO(dbus_server_listen, pFpp)
 //GO(dbus_server_ref, 
 //GO(dbus_server_set_auth_mechanisms, 
-//GO(dbus_server_set_data, 
-//GO(dbus_server_set_new_connection_function, 
-//GO(dbus_server_set_timeout_functions, 
-//GO(dbus_server_set_watch_functions, 
-//GO(dbus_server_unref, 
+GOM(dbus_server_set_data, iFEpipp)
+GOM(dbus_server_set_new_connection_function, vFEpppp)
+GOM(dbus_server_set_timeout_functions, iFEpppppp)
+GOM(dbus_server_set_watch_functions, iFEpppppp)
+GO(dbus_server_unref, vFp)
 GO(dbus_set_error, vFpppppppppp)    //vaarg
 GO(dbus_set_error_const, vFppp)
 GO(dbus_set_error_from_message, iFpp)