aboutsummaryrefslogtreecommitdiffstats
path: root/facebook/facebook-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'facebook/facebook-util.h')
-rw-r--r--facebook/facebook-util.h72
1 files changed, 38 insertions, 34 deletions
diff --git a/facebook/facebook-util.h b/facebook/facebook-util.h
index 5a0f1f4..1d5aee8 100644
--- a/facebook/facebook-util.h
+++ b/facebook/facebook-util.h
@@ -165,7 +165,7 @@ fb_util_debug_hexdump(FbDebugLevel level, const GByteArray *bytes,
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.
@@ -173,78 +173,82 @@ fb_util_debug_hexdump(FbDebugLevel level, const GByteArray *bytes,
* 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_str_is:
- * @str: The string.
- * @type: The #GAsciiType.
+ * fb_util_rand_uuid:
*
- * Determines if @str abides to the #GAsciiType.
+ * Gets a random UUID string. The returned string should be freed with
+ * #g_free() when no longer needed.
*
- * Returns: #TRUE if the string abides to @type, otherwise #FALSE.
+ * Returns: The UUID string.
*/
-gboolean
-fb_util_str_is(const gchar *str, GAsciiType type);
+gchar *
+fb_util_rand_uuid(void);
/**
- * fb_util_uuid:
+ * fb_util_strtest:
+ * @str: The string.
+ * @type: The #GAsciiType.
*
- * Gets a random UUID string. The returned string should be freed with
- * #g_free() when no longer needed.
+ * Tests if the string only contains characters allowed by the
+ * #GAsciiType. More than one type can be specified by ORing the types
+ * together.
*
- * Returns: The UUID string.
+ * Returns: #TRUE if the string only contains characters allowed by the
+ * #GAsciiType, otherwise #FALSE.
*/
-gchar *
-fb_util_uuid(void);
+gboolean
+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_ */