3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef PURPLE_FACEBOOK_ID_H
23 #define PURPLE_FACEBOOK_ID_H
27 * @section_id: facebook-id
28 * @short_description: <filename>id.h</filename>
29 * @title: Facebook Identifier
31 * The Facebook identifier utilities.
35 #include <glib/gprintf.h>
42 * The format specifier for printing and scanning an #FbId.
44 #define FB_ID_FORMAT G_GINT64_FORMAT
49 * The length modifier for printing an #FbId.
51 #define FB_ID_MODIFIER G_GINT64_MODIFIER
56 * The maximum length, including a null-terminating character, of the
57 * string representation of an #FbId.
59 #define FB_ID_STRMAX 21
64 * The #GType of an #FbId.
66 #define FB_TYPE_ID G_TYPE_INT64
72 * Inserts a literal #FbId into source code.
74 * Return: The literal #FbId value.
76 #define FB_ID_CONSTANT(v) G_GINT64_CONSTANT(v)
80 * @s: The string value.
82 * Converts a string to an #FbId.
84 * Return: The converted #FbId value.
86 #define FB_ID_FROM_STR(s) g_ascii_strtoll(s, NULL, 10)
90 * @s: The string value.
92 * Determines if a string is an #FbId.
94 * Return: #TRUE if the string is an #FbId, otherwise #FALSE.
96 #define FB_ID_IS_STR(s) fb_util_strtest(s, G_ASCII_DIGIT)
101 * @s: The string buffer.
103 * Converts an #FbId to a string. The buffer should be at least the
104 * size of #FB_ID_STRMAX.
106 * Return: The converted string value.
108 #define FB_ID_TO_STR(i, s) g_sprintf(s, "%" FB_ID_FORMAT, (FbId) i)
113 * Compares the values of two #FbId's for equality. See #g_int64_equal.
115 #define fb_id_equal g_int64_equal
120 * Converts a pointer to a #FbId hash value. See #g_int64_hash.
122 #define fb_id_hash g_int64_hash
127 * Represents a numeric Facebook identifier.
131 #endif /* PURPLE_FACEBOOK_ID_H */