diff options
Diffstat (limited to 'facebook/facebook-id.h')
-rw-r--r-- | facebook/facebook-id.h | 120 |
1 files changed, 95 insertions, 25 deletions
diff --git a/facebook/facebook-id.h b/facebook/facebook-id.h index 76a671c..66161bb 100644 --- a/facebook/facebook-id.h +++ b/facebook/facebook-id.h @@ -15,43 +15,113 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/** @file **/ +#ifndef _FACEBOOK_ID_H_ +#define _FACEBOOK_ID_H_ -#ifndef _FACEBOOK_ID_H -#define _FACEBOOK_ID_H +/** + * SECTION:id + * @section_id: facebook-id + * @short_description: <filename>facebook-id.h</filename> + * @title: Facebook Identifier + * + * The Facebook identifier utilities. + */ #include <glib.h> #include <glib/gprintf.h> -#define FB_ID_CONSTANT(v) G_GINT64_CONSTANT(v) -#define FB_ID_FORMAT G_GINT64_FORMAT -#define FB_ID_MODIFIER G_GINT64_MODIFIER -#define FB_ID_STRMAX 21 -#define fb_id_hash g_int64_hash -#define fb_id_equal g_int64_equal +#include "facebook-util.h" + +/** + * FB_ID_FORMAT: + * + * The format specifier for printing and scanning an #FbId. + */ +#define FB_ID_FORMAT G_GINT64_FORMAT + +/** + * FB_ID_MODIFIER: + * + * The length modifier for printing an #FbId. + */ +#define FB_ID_MODIFIER G_GINT64_MODIFIER + +/** + * FB_ID_STRMAX: + * + * The maximum length, including a null-terminating character, of the + * string representation of an #FbId. + */ +#define FB_ID_STRMAX 21 + +/** + * FB_TYPE_ID: + * + * The #GType of an #FbId. + */ +#define FB_TYPE_ID G_TYPE_INT64 + +/** + * FB_ID_CONSTANT: + * @v: The value. + * + * Inserts a literal #FbId into source code. + * + * Return: The literal #FbId value. + */ +#define FB_ID_CONSTANT(v) G_GINT64_CONSTANT(v) + +/** + * FB_ID_FROM_STR: + * @s: The string value. + * + * Converts a string to an #FbId. + * + * Return: The converted #FbId value. + */ +#define FB_ID_FROM_STR(s) g_ascii_strtoll(s, NULL, 10) /** - * Converts a string to a #fb_id. + * FB_ID_IS_STR: + * @s: The string value. * - * @param s The string. + * Determines if a string is an #FbId. * - * @return The resulting #fb_id. - **/ -#define FB_ID_FROM_STR(s) \ - g_ascii_strtoll(s, NULL, 10) + * Return: #TRUE if the string is an #FbId, otherwise #FALSE. + */ +#define FB_ID_IS_STR(s) fb_util_str_is(s, G_ASCII_DIGIT) /** - * Converts a #f_uid to a string. The buffer should be at least - * #FB_ID_STRMAX in length. + * FB_ID_TO_STR: + * @i: The #FbId. + * @s: The string buffer. * - * @param i The #fb_id. - * @param s The string buffer. - **/ -#define FB_ID_TO_STR(i, s) \ - g_sprintf(s, "%" FB_ID_FORMAT, (fb_id_t) i) + * Converts an #FbId to a string. The buffer should be at least the + * size of #FB_ID_STRMAX. + * + * Return: The converted string value. + */ +#define FB_ID_TO_STR(i, s) g_sprintf(s, "%" FB_ID_FORMAT, (FbId) i) +/** + * fb_id_equal: + * + * Compares the values of two #FbId's for equality. See #g_int64_equal. + */ +#define fb_id_equal g_int64_equal + +/** + * fb_id_hash: + * + * Converts a pointer to a #FbId hash value. See #g_int64_hash. + */ +#define fb_id_hash g_int64_hash -/** The 64-bit Facebook identifier. **/ -typedef gint64 fb_id_t; +/** + * FbId: + * + * Represents a numeric Facebook identifier. + */ +typedef gint64 FbId; -#endif /* _FACEBOOK_ID_H */ +#endif /* _FACEBOOK_ID_H_ */ |