# HG changeset patch
# Node ID 029691d57e3f
# Parent  24e5305ebcb6
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -680,6 +680,10 @@
 		* purple_serv_set_permit_deny
 		* PurpleSetPublicAliasFailureCallback
 		* PurpleSetPublicAliasSuccessCallback
+		* purple_signal_connect_priority_vargs
+		* purple_signal_connect_vargs
+		* purple_signal_emit_vargs
+		* purple_signal_get_types
 		* purple_smiley_get_type
 		* purple_smiley_new
 		* purple_smiley_new_from_file
diff --git a/libpurple/signals.h b/libpurple/signals.h
--- a/libpurple/signals.h
+++ b/libpurple/signals.h
@@ -115,21 +115,6 @@
 void purple_signals_unregister_by_instance(void *instance);
 
 /**
- * purple_signal_get_types:
- * @instance:           The instance the signal is registered to.
- * @signal:             The signal.
- * @ret_type: (out):    The return type.
- * @num_values: (out):  The returned number of parameters.
- * @param_types: (out): The returned list of parameter types.
- *
- * Outputs a list of value types used for a signal through the @ret_type,
- * @num_values and @param_types out parameters.
- */
-void purple_signal_get_types(void *instance, const char *signal,
-							GType *ret_type, int *num_values,
-							GType **param_types);
-
-/**
  * purple_signal_connect_priority:
  * @instance: The instance to connect to.
  * @signal:   The name of the signal to connect.
@@ -175,57 +160,6 @@
 	void *handle, GCallback func, void *data);
 
 /**
- * purple_signal_connect_priority_vargs:
- * @instance: The instance to connect to.
- * @signal:   The name of the signal to connect.
- * @handle:   The handle of the receiver.
- * @func: (scope notified):    The callback function.
- * @data:     The data to pass to the callback function.
- * @priority: The priority with which the handler should be called. Signal
- *                 handlers are called in ascending numerical order of
- *                 @priority from #PURPLE_SIGNAL_PRIORITY_LOWEST to
- *                 #PURPLE_SIGNAL_PRIORITY_HIGHEST.
- *
- * Connects a signal handler to a signal for a particular object.
- *
- * The signal handler will take a va_args of arguments, instead of
- * individual arguments.
- *
- * Take care not to register a handler function twice. Purple will
- * not correct any mistakes for you in this area.
- *
- * See purple_signal_disconnect()
- *
- * Returns: The signal handler ID.
- */
-gulong purple_signal_connect_priority_vargs(void *instance, const char *signal,
-	void *handle, GCallback func, void *data, int priority);
-
-/**
- * purple_signal_connect_vargs:
- * @instance: The instance to connect to.
- * @signal:   The name of the signal to connect.
- * @handle:   The handle of the receiver.
- * @func: (scope notified):    The callback function.
- * @data:     The data to pass to the callback function.
- *
- * Connects a signal handler to a signal for a particular object.
- * (Its priority defaults to 0, aka #PURPLE_SIGNAL_PRIORITY_DEFAULT.)
- *
- * The signal handler will take a va_args of arguments, instead of
- * individual arguments.
- *
- * Take care not to register a handler function twice. Purple will
- * not correct any mistakes for you in this area.
- *
- * See purple_signal_disconnect()
- *
- * Returns: The signal handler ID.
- */
-gulong purple_signal_connect_vargs(void *instance, const char *signal,
-	void *handle, GCallback func, void *data);
-
-/**
  * purple_signal_disconnect:
  * @instance: The instance to disconnect from.
  * @signal:   The name of the signal to disconnect.
@@ -260,18 +194,6 @@
 void purple_signal_emit(void *instance, const char *signal, ...);
 
 /**
- * purple_signal_emit_vargs:
- * @instance: The instance emitting the signal.
- * @signal:   The signal being emitted.
- * @args:     The arguments list.
- *
- * Emits a signal, using a va_list of arguments.
- *
- * See purple_signal_connect(), purple_signal_disconnect()
- */
-void purple_signal_emit_vargs(void *instance, const char *signal, va_list args);
-
-/**
  * purple_signal_emit_return_1:
  * @instance: The instance emitting the signal.
  * @signal:   The signal being emitted.
@@ -287,22 +209,6 @@
 void *purple_signal_emit_return_1(void *instance, const char *signal, ...);
 
 /**
- * purple_signal_emit_vargs_return_1:
- * @instance: The instance emitting the signal.
- * @signal:   The signal being emitted.
- * @args:     The arguments list.
- *
- * Emits a signal and returns the first non-NULL return value.
- *
- * Further signal handlers are NOT called after a handler returns
- * something other than NULL.
- *
- * Returns: The first non-NULL return value
- */
-void *purple_signal_emit_vargs_return_1(void *instance, const char *signal,
-									  va_list args);
-
-/**
  * purple_signals_init:
  *
  * Initializes the signals subsystem.
diff --git a/libpurple/signals.c b/libpurple/signals.c
--- a/libpurple/signals.c
+++ b/libpurple/signals.c
@@ -179,38 +179,6 @@
 	/* g_return_if_fail(found); */
 }
 
-void
-purple_signal_get_types(void *instance, const char *signal,
-					   GType *ret_type,
-					   int *num_values, GType **value_types)
-{
-	PurpleInstanceData *instance_data;
-	PurpleSignalData *signal_data;
-
-	g_return_if_fail(instance    != NULL);
-	g_return_if_fail(signal      != NULL);
-	g_return_if_fail(num_values  != NULL);
-	g_return_if_fail(value_types != NULL);
-
-	/* Get the instance data */
-	instance_data =
-		(PurpleInstanceData *)g_hash_table_lookup(instance_table, instance);
-
-	g_return_if_fail(instance_data != NULL);
-
-	/* Get the signal data */
-	signal_data =
-		(PurpleSignalData *)g_hash_table_lookup(instance_data->signals, signal);
-
-	g_return_if_fail(signal_data != NULL);
-
-	*num_values  = signal_data->num_values;
-	*value_types = signal_data->value_types;
-
-	if (ret_type != NULL)
-		*ret_type = signal_data->ret_type;
-}
-
 static gint handler_priority(void * a, void * b) {
 	PurpleSignalHandlerData *ah = (PurpleSignalHandlerData*)a;
 	PurpleSignalHandlerData *bh = (PurpleSignalHandlerData*)b;
@@ -283,20 +251,6 @@
 	return signal_connect_common(instance, signal, handle, func, data, PURPLE_SIGNAL_PRIORITY_DEFAULT, FALSE);
 }
 
-gulong
-purple_signal_connect_priority_vargs(void *instance, const char *signal, void *handle,
-						  GCallback func, void *data, int priority)
-{
-	return signal_connect_common(instance, signal, handle, func, data, priority, TRUE);
-}
-
-gulong
-purple_signal_connect_vargs(void *instance, const char *signal, void *handle,
-						  GCallback func, void *data)
-{
-	return signal_connect_common(instance, signal, handle, func, data, PURPLE_SIGNAL_PRIORITY_DEFAULT, TRUE);
-}
-
 void
 purple_signal_disconnect(void *instance, const char *signal,
 					   void *handle, GCallback func)
@@ -398,23 +352,11 @@
 void
 purple_signal_emit(void *instance, const char *signal, ...)
 {
-	va_list args;
-
-	g_return_if_fail(instance != NULL);
-	g_return_if_fail(signal   != NULL);
-
-	va_start(args, signal);
-	purple_signal_emit_vargs(instance, signal, args);
-	va_end(args);
-}
-
-void
-purple_signal_emit_vargs(void *instance, const char *signal, va_list args)
-{
 	PurpleInstanceData *instance_data;
 	PurpleSignalData *signal_data;
 	PurpleSignalHandlerData *handler_data;
 	GList *l, *l_next;
+	va_list args;
 	va_list tmp;
 
 	g_return_if_fail(instance != NULL);
@@ -433,6 +375,8 @@
 		return;
 	}
 
+	va_start(args, signal);
+
 	for (l = signal_data->handlers; l != NULL; l = l_next)
 	{
 		l_next = l->next;
@@ -456,33 +400,19 @@
 
 		va_end(tmp);
 	}
+
+	va_end(args);
 }
 
 void *
-purple_signal_emit_return_1(void *instance, const char *signal, ...)
-{
-	void *ret_val;
-	va_list args;
-
-	g_return_val_if_fail(instance != NULL, NULL);
-	g_return_val_if_fail(signal   != NULL, NULL);
-
-	va_start(args, signal);
-	ret_val = purple_signal_emit_vargs_return_1(instance, signal, args);
-	va_end(args);
-
-	return ret_val;
-}
-
-void *
-purple_signal_emit_vargs_return_1(void *instance, const char *signal,
-								va_list args)
-{
+purple_signal_emit_return_1(void *instance, const char *signal, ...) {
 	PurpleInstanceData *instance_data;
 	PurpleSignalData *signal_data;
 	PurpleSignalHandlerData *handler_data;
 	GList *l, *l_next;
+	va_list args;
 	va_list tmp;
+	void *ret_val = NULL;
 
 	g_return_val_if_fail(instance != NULL, NULL);
 	g_return_val_if_fail(signal   != NULL, NULL);
@@ -500,10 +430,9 @@
 		return 0;
 	}
 
+	va_start(args, signal);
 	for (l = signal_data->handlers; l != NULL; l = l_next)
 	{
-		void *ret_val = NULL;
-
 		l_next = l->next;
 
 		handler_data = (PurpleSignalHandlerData *)l->data;
@@ -521,11 +450,14 @@
 		}
 		va_end(tmp);
 
-		if (ret_val != NULL)
-			return ret_val;
+		if(ret_val != NULL) {
+			break;
+		}
 	}
 
-	return NULL;
+	va_end(args);
+
+	return ret_val;
 }
 
 void
