libpurple/protocols/facebook/util.h

changeset 37416
77536a48b4be
parent 37415
a06ade737f26
child 37471
32c1e77d0474
--- a/libpurple/protocols/facebook/util.h	Wed Dec 16 14:04:26 2015 -0500
+++ b/libpurple/protocols/facebook/util.h	Wed Dec 16 15:13:36 2015 -0500
@@ -216,7 +216,7 @@
                       G_GNUC_PRINTF(3, 4);
 
 /**
- * fb_util_locale_str:
+ * fb_util_get_locale:
  *
  * Gets the locale string (ex: en_US) from the system. The returned
  * string should be freed with #g_free() when no longer needed.
@@ -224,19 +224,20 @@
  * Returns: The locale string.
  */
 gchar *
-fb_util_locale_str(void);
+fb_util_get_locale(void);
 
 /**
- * fb_util_randstr:
- * @size: The size of the string.
+ * fb_util_rand_alnum:
+ * @len: The length of the string.
  *
- * Gets a random alphanumeric string. The returned string should be
- * freed with #g_free() when no longer needed.
+ * Gets a random alphanumeric (A-Za-z0-9) string. This function should
+ * *not* be relied on for cryptographic operations. The returned string
+ * should be freed with #g_free() when no longer needed.
  *
- * Returns: The random string.
+ * Returns: The alphanumeric string.
  */
 gchar *
-fb_util_randstr(gsize size);
+fb_util_rand_alnum(guint len);
 
 /**
  * fb_util_request_buddy:
@@ -295,52 +296,55 @@
                          guint64 timestamp);
 
 /**
- * fb_util_str_is:
+ * fb_util_strtest:
  * @str: The string.
  * @type: The #GAsciiType.
  *
- * Determines if @str abides to the #GAsciiType.
+ * Tests if the string only contains characters allowed by the
+ * #GAsciiType. More than one type can be specified by ORing the types
+ * together.
  *
- * Returns: #TRUE if the string abides to @type, otherwise #FALSE.
+ * Returns: #TRUE if the string only contains characters allowed by the
+ *          #GAsciiType, otherwise #FALSE.
  */
 gboolean
-fb_util_str_is(const gchar *str, GAsciiType type);
+fb_util_strtest(const gchar *str, GAsciiType type);
 
 /**
- * fb_util_zcompressed:
+ * fb_util_zlib_test:
  * @bytes: The #GByteArray.
  *
- * Determines if the #GByteArray is zlib compressed.
+ * Tests if the #GByteArray is zlib compressed.
  *
  * Returns: #TRUE if the #GByteArray is compressed, otherwise #FALSE.
  */
 gboolean
-fb_util_zcompressed(const GByteArray *bytes);
+fb_util_zlib_test(const GByteArray *bytes);
 
 /**
- * fb_util_zcompress:
+ * fb_util_zlib_deflate:
  * @bytes: The #GByteArray.
  * @error: The return location for the #GError or #NULL.
  *
- * Compresses a #GByteArray with zlib. The returned #GByteArray should
- * be freed with #g_byte_array_free() when no longer needed.
+ * Deflates a #GByteArray with zlib. The returned #GByteArray should be
+ * freed with #g_byte_array_free() when no longer needed.
  *
- * Returns: The compressed #GByteArray.
+ * Returns: The deflated #GByteArray or #NULL on error.
  */
 GByteArray *
-fb_util_zcompress(const GByteArray *bytes, GError **error);
+fb_util_zlib_deflate(const GByteArray *bytes, GError **error);
 
 /**
- * fb_util_zuncompress:
+ * fb_util_zlib_inflate:
  * @bytes: The #GByteArray.
  * @error: The return location for the #GError or #NULL.
  *
- * Uncompresses a #GByteArray with zlib. The returned #GByteArray
- * should be freed with #g_byte_array_free() when no longer needed.
+ * Inflates a #GByteArray with zlib. The returned #GByteArray should be
+ * freed with #g_byte_array_free() when no longer needed.
  *
- * Returns: The uncompressed #GByteArray or #NULL on error.
+ * Returns: The inflated #GByteArray or #NULL on error.
  */
 GByteArray *
-fb_util_zuncompress(const GByteArray *bytes, GError **error);
+fb_util_zlib_inflate(const GByteArray *bytes, GError **error);
 
 #endif /* _FACEBOOK_UTIL_H_ */

mercurial