gnome-keyring r1284 - trunk/gp11



Author: nnielsen
Date: Sun Aug 31 20:16:23 2008
New Revision: 1284
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1284&view=rev

Log:
	* gp11/gp11-misc.c:
	* gp11/gp11-module.c: Complete some more documentation.


Modified:
   trunk/gp11/gp11-misc.c
   trunk/gp11/gp11-module.c

Modified: trunk/gp11/gp11-misc.c
==============================================================================
--- trunk/gp11/gp11-misc.c	(original)
+++ trunk/gp11/gp11-misc.c	Sun Aug 31 20:16:23 2008
@@ -27,6 +27,13 @@
 
 #include <glib/gi18n.h>
 
+/**
+ * gp11_get_error_quark:
+ * 
+ * The error domain for GP11 library errors.
+ * 
+ * Return value: The error domain. 
+ */
 GQuark
 gp11_get_error_quark (void)
 {
@@ -36,6 +43,13 @@
 	return domain;
 }
 
+/**
+ * gp11_list_unref_free:
+ * reflist: List of Gobject reference counted pointers.
+ * 
+ * Free a list of GObject based pointers. All objects in the list
+ * will be unreffed and then the list itself will be freed.
+ */
 void
 gp11_list_unref_free (GList *reflist)
 {
@@ -47,6 +61,15 @@
 	g_list_free (reflist);
 }
 
+/**
+ * gp11_message_from_rv:
+ * rv: The PKCS#11 return value to get a message for.
+ * 
+ * Get a message for a PKCS#11 return value or error code. Do not 
+ * pass CKR_OK or other such non errors to this function.
+ * 
+ * Return value: The user readable message. 
+ */
 const gchar*
 gp11_message_from_rv (CK_RV rv)
 {
@@ -228,6 +251,18 @@
 	}
 }
 
+/**
+ * gp11_string_form_chars:
+ * @data: The character data to turn into a null terminated string.
+ * @max: The maximum length of the charater data.
+ * 
+ * Create a string from a set of PKCS#11 characters. This is 
+ * similar to g_strndup, except for that it also strips trailing 
+ * spaces. These space padded strings are often used in PKCS#11
+ * structures.
+ * 
+ * Return value: The null terminated string.
+ */
 gchar*
 gp11_string_from_chars (const guchar *data, gsize max)
 {
@@ -237,6 +272,6 @@
 	g_return_val_if_fail (max, NULL);
 	
 	string = g_strndup ((gchar*)data, max);
-	g_strstrip (string);
+	g_strchomp (string);
 	return string;
 }

Modified: trunk/gp11/gp11-module.c
==============================================================================
--- trunk/gp11/gp11-module.c	(original)
+++ trunk/gp11/gp11-module.c	Sun Aug 31 20:16:23 2008
@@ -187,6 +187,12 @@
  * PUBLIC 
  */
 
+/**
+ * gp11_module_info_free:
+ * @module_info: The module info to free, or NULL.
+ * 
+ * Free a GP11ModuleInfo structure.
+ **/
 void
 gp11_module_info_free (GP11ModuleInfo *module_info)
 {
@@ -197,6 +203,16 @@
 	g_free (module_info);
 }
 
+/**
+ * gp11_module_initialize:
+ * @path: The file system path to the PKCS#11 module to load.
+ * @reserved: Extra arguments for the PKCS#11 module, should usually be NULL.
+ * @err: A location to store an error resulting from a failed load.
+ * 
+ * Load and initialize a PKCS#11 module represented by a GP11Module object.
+ * 
+ * Return value: The loaded PKCS#11 module or NULL if failed.
+ **/
 GP11Module*
 gp11_module_initialize (const gchar *path, gpointer reserved, GError **err)
 {
@@ -268,6 +284,14 @@
 	return mod;
 }
 
+/**
+ * gp11_module_get_info:
+ * @module: The module to get info for.
+ * 
+ * Get the info about a PKCS#11 module. 
+ * 
+ * Return value: The module info. Release this with gp11_module_info_free().
+ **/
 GP11ModuleInfo*
 gp11_module_get_info (GP11Module *module)
 {



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