Skip to content

Commit

Permalink
Remove _gi function variants
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Georg <[email protected]>
  • Loading branch information
phako committed Oct 15, 2016
1 parent 638c77a commit 228cebc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 145 deletions.
2 changes: 0 additions & 2 deletions doc/gupnp-sections.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ GUPnPServiceProxyActionCallback
GUPnPServiceProxyNotifyCallback
gupnp_service_proxy_send_action
gupnp_service_proxy_send_action_valist
gupnp_service_proxy_send_action_hash
gupnp_service_proxy_send_action_list
gupnp_service_proxy_begin_action
gupnp_service_proxy_begin_action_valist
gupnp_service_proxy_begin_action_hash
gupnp_service_proxy_begin_action_list
gupnp_service_proxy_end_action
gupnp_service_proxy_end_action_valist
Expand Down
124 changes: 18 additions & 106 deletions libgupnp/gupnp-service-proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,8 @@ gupnp_service_proxy_send_action_valist (GUPnPServiceProxy *proxy,

result = gupnp_service_proxy_end_action_hash (proxy,
handle,
&local_error,
out_hash);
out_hash,
&local_error);

if (local_error == NULL) {
OUT_HASH_TABLE_TO_VAR_ARGS (out_hash, var_args_copy);
Expand Down Expand Up @@ -727,10 +727,9 @@ gupnp_service_proxy_send_action_hash (GUPnPServiceProxy *proxy,
}

/**
* gupnp_service_proxy_send_action_list_gi: (rename-to gupnp_service_proxy_send_action_list)
* gupnp_service_proxy_send_action_list: (rename-to gupnp_service_proxy_send_action_list)
* @proxy: (transfer none) : A #GUPnPServiceProxy
* @action: An action
* @error: The location where to store any error, or %NULL
* @in_names: (element-type utf8) (transfer none): #GList of 'in' parameter
* names (as strings)
* @in_values: (element-type GValue) (transfer none): #GList of values (as
Expand All @@ -741,58 +740,23 @@ gupnp_service_proxy_send_action_hash (GUPnPServiceProxy *proxy,
* that line up with @out_names
* @out_values: (element-type GValue) (transfer full) (out): #GList of values
* (as #GValue) that line up with @out_names and @out_types.
*
* The synchronous variant of #gupnp_service_proxy_begin_action_list and
* #gupnp_service_proxy_end_action_list.
*
* Return value: %TRUE if sending the action was succesful.
*
**/
gboolean
gupnp_service_proxy_send_action_list_gi (GUPnPServiceProxy *proxy,
const char *action,
GList *in_names,
GList *in_values,
GList *out_names,
GList *out_types,
GList **out_values,
GError **error)
{
return gupnp_service_proxy_send_action_list (proxy, action, error, in_names, in_values, out_names, out_types, out_values);
}

/**
* gupnp_service_proxy_send_action_list: (skip)
* @proxy: A #GUPnPServiceProxy
* @action: An action
* @error: (allow-none): The location where to store any error, or %NULL
* @in_names: (element-type utf8) (transfer none): #GList of 'in' parameter
* names (as strings)
* @in_values: (element-type GValue) (transfer none): #GList of values (as
* #GValue) that line up with @in_names
* @out_names: (element-type utf8) (transfer none): #GList of 'out' parameter
* names (as strings)
* @out_types: (element-type GType) (transfer none): #GList of types (as #GType)
* that line up with @out_names
* @out_values: (element-type GValue) (transfer full) (out): #GList of values
* (as #GValue) that line up with @out_names and @out_types.
*
* The synchronous variant of #gupnp_service_proxy_begin_action_list and
* #gupnp_service_proxy_end_action_list.
*
* Return value: %TRUE if sending the action was succesful.
*
* Since: 0.13.3
**/
gboolean
gupnp_service_proxy_send_action_list (GUPnPServiceProxy *proxy,
const char *action,
GError **error,
GList *in_names,
GList *in_values,
GList *out_names,
GList *out_types,
GList **out_values)
GList **out_values,
GError **error)
{
GMainLoop *main_loop;
GUPnPServiceProxyAction *handle;
Expand Down Expand Up @@ -823,10 +787,10 @@ gupnp_service_proxy_send_action_list (GUPnPServiceProxy *proxy,

if (!gupnp_service_proxy_end_action_list (proxy,
handle,
error,
out_names,
out_types,
out_values))
out_values,
error))
return FALSE;

return TRUE;
Expand Down Expand Up @@ -1461,8 +1425,8 @@ gupnp_service_proxy_end_action_valist (GUPnPServiceProxy *proxy,
local_error = NULL;
result = gupnp_service_proxy_end_action_hash (proxy,
action,
&local_error,
out_hash);
out_hash,
&local_error);

if (local_error == NULL) {
OUT_HASH_TABLE_TO_VAR_ARGS (out_hash, var_args_copy);
Expand All @@ -1476,7 +1440,7 @@ gupnp_service_proxy_end_action_valist (GUPnPServiceProxy *proxy,
}

/**
* gupnp_service_proxy_end_action_list_gi: (rename-to gupnp_service_proxy_end_action_list)
* gupnp_service_proxy_end_action_list:
* @proxy: A #GUPnPServiceProxy
* @action: A #GUPnPServiceProxyAction handle
* @error: The location where to store any error, or %NULL
Expand All @@ -1496,43 +1460,12 @@ gupnp_service_proxy_end_action_valist (GUPnPServiceProxy *proxy,
*
**/
gboolean
gupnp_service_proxy_end_action_list_gi (GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
GList *out_names,
GList *out_types,
GList **out_values,
GError **error)
{
return gupnp_service_proxy_end_action_list (proxy, action, error, out_names, out_types, out_values);
}

/**
* gupnp_service_proxy_end_action_list: (skip)
* @proxy: A #GUPnPServiceProxy
* @action: A #GUPnPServiceProxyAction handle
* @error: (allow-none): The location where to store any error, or %NULL
* @out_names: (element-type utf8) (transfer none): #GList of 'out' parameter
* names (as strings)
* @out_types: (element-type GType) (transfer none): #GList of types (as #GType)
* that line up with @out_names
* @out_values: (element-type GValue) (transfer full) (out): #GList of values
* (as #GValue) that line up with @out_names and @out_types.
*
* A variant of #gupnp_service_proxy_end_action that takes lists of
* out-parameter names, types and place-holders for values. The returned list
* in @out_values must be freed using #g_list_free and each element in it using
* #g_value_unset and #g_slice_free.
*
* Returns: %TRUE on success.
*
**/
gboolean
gupnp_service_proxy_end_action_list (GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
GError **error,
GList *out_names,
GList *out_types,
GList **out_values)
GList **out_values,
GError **error)
{
xmlDoc *response;
xmlNode *params;
Expand Down Expand Up @@ -1588,7 +1521,7 @@ gupnp_service_proxy_end_action_list (GUPnPServiceProxy *proxy,
}

/**
* gupnp_service_proxy_end_action_hash_gi: (rename-to gupnp_service_proxy_end_action_hash)
* gupnp_service_proxy_end_action_hash:
* @proxy: A #GUPnPServiceProxy
* @action: A #GUPnPServiceProxyAction handle
* @error: The location where to store any error, or %NULL
Expand All @@ -1602,32 +1535,11 @@ gupnp_service_proxy_end_action_list (GUPnPServiceProxy *proxy,
*
**/
gboolean
gupnp_service_proxy_end_action_hash_gi (GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
GHashTable *hash,
GError **error)
{
return gupnp_service_proxy_end_action_hash (proxy, action, error, hash);
}

/**
* gupnp_service_proxy_end_action_hash:
* @proxy: A #GUPnPServiceProxy
* @action: A #GUPnPServiceProxyAction handle
* @error: The location where to store any error, or %NULL
* @hash: (element-type utf8 GValue) (out caller-allocates) (transfer none): A #GHashTable of
* out parameter name and initialised #GValue pairs
*
* See gupnp_service_proxy_end_action(); this version takes a #GHashTable for
* runtime generated parameter lists.
*
* Return value: %TRUE on success.
**/
gboolean
gupnp_service_proxy_end_action_hash (GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
GError **error,
GHashTable *hash)
gupnp_service_proxy_end_action_hash
(GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
GHashTable *hash,
GError **error)
{
xmlDoc *response;
xmlNode *params;
Expand Down
32 changes: 3 additions & 29 deletions libgupnp/gupnp-service-proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,12 @@ gupnp_service_proxy_send_action_hash
gboolean
gupnp_service_proxy_send_action_list (GUPnPServiceProxy *proxy,
const char *action,
GError **error,
GList *in_names,
GList *in_values,
GList *out_names,
GList *out_types,
GList **out_values);

gboolean
gupnp_service_proxy_send_action_list_gi (GUPnPServiceProxy *proxy,
const char *action,
GList *in_names,
GList *in_values,
GList *out_names,
GList *out_types,
GList **out_values,
GError **error);
GList **out_values,
GError **error);
GUPnPServiceProxyAction *
gupnp_service_proxy_begin_action (GUPnPServiceProxy *proxy,
const char *action,
Expand Down Expand Up @@ -211,15 +201,6 @@ gupnp_service_proxy_end_action_valist

gboolean
gupnp_service_proxy_end_action_list
(GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
GError **error,
GList *out_names,
GList *out_types,
GList **out_values);

gboolean
gupnp_service_proxy_end_action_list_gi
(GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
GList *out_names,
Expand All @@ -228,19 +209,12 @@ gupnp_service_proxy_end_action_list_gi
GError **error);

gboolean
gupnp_service_proxy_end_action_hash_gi
gupnp_service_proxy_end_action_hash
(GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
GHashTable *hash,
GError **error);

gboolean
gupnp_service_proxy_end_action_hash
(GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action,
GError **error,
GHashTable *hash);

void
gupnp_service_proxy_cancel_action (GUPnPServiceProxy *proxy,
GUPnPServiceProxyAction *action);
Expand Down
4 changes: 0 additions & 4 deletions vala/GUPnP-1.2.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ ServiceProxy
.add_notify skip=false
.begin_action skip=false
.end_action_hash skip
.end_action_hash_gi skip
.end_action_list skip
.end_action_list_gi skip
.send_action_hash skip
.send_action_list skip
.send_action_list_gi skip
WhiteList
.entries skip
ControlError skip
Expand Down
7 changes: 3 additions & 4 deletions vala/gupnp-1.2-custom.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
public class GUPnP.ServiceProxy : GUPnP.ServiceInfo {
public bool send_action (string action, ...) throws GLib.Error;
public bool end_action (GUPnP.ServiceProxyAction action, ...) throws GLib.Error;
public bool end_action_hash (GUPnP.ServiceProxyAction action, [CCode (pos=-0.9)] GLib.HashTable<string, weak GLib.Value*> hash) throws GLib.Error;
public bool end_action_list (GUPnP.ServiceProxyAction action, [CCode (pos=-0.9)] GLib.List<string> out_names, [CCode (pos=-0.8)] GLib.List<GLib.Type?> out_types, [CCode (pos=-0.7)] out GLib.List<weak GLib.Value*> out_values) throws GLib.Error;
public bool end_action_hash (GUPnP.ServiceProxyAction action, GLib.HashTable<string, weak GLib.Value*> hash) throws GLib.Error;
public bool end_action_list (GUPnP.ServiceProxyAction action, GLib.List<string> out_names, GLib.List<GLib.Type?> out_types, out GLib.List<weak GLib.Value*> out_values) throws GLib.Error;

public bool send_action_hash (string action, [CCode (pos=-0.9)] GLib.HashTable<string, GLib.Value?> in_hash, [CCode (pos=-0.8)] GLib.HashTable<string, weak GLib.Value*> out_hash) throws GLib.Error;
public bool send_action_list (string action, [CCode (pos=-0.9)] GLib.List<string> in_names, [CCode (pos=-0.8)] GLib.List<weak GLib.Value?> in_values, [CCode (pos=-0.7)] GLib.List<string> out_names, [CCode (pos=-0.6)] GLib.List<GLib.Type?> out_types, [CCode (pos=-0.5)] out GLib.List<weak GLib.Value*> out_values) throws GLib.Error;
public bool send_action_list (string action, GLib.List<string> in_names, GLib.List<weak GLib.Value?> in_values, GLib.List<string> out_names, GLib.List<GLib.Type?> out_types, out GLib.List<weak GLib.Value*> out_values) throws GLib.Error;
}

public interface GUPnP.Acl : GLib.Object {
Expand Down

0 comments on commit 228cebc

Please sign in to comment.