[libsocialweb: 6/7] Added documentation for sw_service_map_params.



commit 4a75d4484127e5a8d65f3c72053bb7d559b0972e
Author: Eitan Isaacson <eitan isaacson collabora co uk>
Date:   Tue Mar 1 13:24:15 2011 -0800

    Added documentation for sw_service_map_params.

 docs/libsocialweb/libsocialweb-sections.txt |    2 ++
 libsocialweb/sw-service.c                   |   13 +++++++++++++
 libsocialweb/sw-service.h                   |   14 +++++++++++++-
 3 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/docs/libsocialweb/libsocialweb-sections.txt b/docs/libsocialweb/libsocialweb-sections.txt
index bb1968a..e616ad9 100644
--- a/docs/libsocialweb/libsocialweb-sections.txt
+++ b/docs/libsocialweb/libsocialweb-sections.txt
@@ -24,6 +24,8 @@ sw_service_emit_capabilities_changed
 sw_service_emit_user_changed
 sw_service_is_uid_banned
 sw_service_has_cap
+SwServiceSetParamFunc
+sw_service_map_params
 <SUBSECTION Standard>
 SW_SERVICE
 SW_IS_SERVICE
diff --git a/libsocialweb/sw-service.c b/libsocialweb/sw-service.c
index 602db83..1304dbb 100644
--- a/libsocialweb/sw-service.c
+++ b/libsocialweb/sw-service.c
@@ -259,6 +259,19 @@ sw_service_has_cap (const char **caps, const char *cap)
   return FALSE;
 }
 
+/**
+ * sw_service_map_params:
+ * @mapping: An array of #ParameterNameMapping pairs.
+ * @parameters: The #GHashtable of given parameters.
+ * @set_param_func: A #SwServiceSetParamFunc that sets a name/value association
+ *  on the given object.
+ * @remote_call_object: The remote call or hash table object that
+ *  @set_param_func takes as a first parameter.
+ *
+ * Re-map a group of parameters with alternative parameter names.
+ * Used for converting lsw parameter names to service-specific ones.
+ */
+
 void
 sw_service_map_params (const ParameterNameMapping *mapping,
                        GHashTable                 *parameters,
diff --git a/libsocialweb/sw-service.h b/libsocialweb/sw-service.h
index e199d03..ad6a710 100644
--- a/libsocialweb/sw-service.h
+++ b/libsocialweb/sw-service.h
@@ -105,9 +105,21 @@ typedef struct {
   char *service_param;
 } ParameterNameMapping;
 
+/**
+ * SwServiceSetParamFunc:
+ * @object: A remote call or hash object that can store key/value pairs.
+ * @param_name: The parameter name.
+ * @param_value: The parameter value.
+ *
+ * This type signature reflects a function that sets a name/value association
+ * on a given object. Functions such as g_hash_table_insert and
+ * rest_proxy_call_add_param are good examples.
+ */
+
+
 typedef void (*SwServiceSetParamFunc) (gpointer object,
                                        const gchar *param_name,
-                                       const gchar *patam_value);
+                                       const gchar *param_value);
 
 void sw_service_map_params (const ParameterNameMapping *mapping,
                             GHashTable                 *parameters,



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