annotate src/protocols/gg/gg-utils.h @ 13947:25c55fb4b512

[gaim-migrate @ 16487] Fix SF Bug #1517875 "The text replacement plugin is finally a good thing to use. Unfortunately, it advertises case sensitivity falsely. Try, for example, adding 'h' and 'H' as two separate text replacements. ;-)" committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 11 Jul 2006 20:47:11 +0000
parents fa7313d125ac
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13626
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
1 /**
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
2 * @file gg-utils.h
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
3 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
4 * gaim
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
5 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
6 * Copyright (C) 2005 Bartosz Oler <bartosz@bzimage.us>
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
7 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
11 * (at your option) any later version.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
12 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
16 * GNU General Public License for more details.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
17 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
21 */
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
22
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
23 #ifndef _GAIM_GG_UTILS_H
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
24 #define _GAIM_GG_UTILS_H
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
25
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
26 #include "internal.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
27
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
28 #include "plugin.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
29 #include "version.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
30 #include "notify.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
31 #include "status.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
32 #include "blist.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
33 #include "accountopt.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
34 #include "debug.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
35 #include "util.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
36 #include "request.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
37
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
38 #include "gg.h"
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
39
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
40
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
41 /*
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
42 * Convert a base 10 string to a UIN.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
43 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
44 * @param str The string to convert
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
45 * @return UIN or 0 if an error occurred.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
46 */
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
47 uin_t
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
48 ggp_str_to_uin(const char *str);
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
49
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
50 /**
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
51 * Convert enconding of a given string.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
52 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
53 * @param locstr Input string.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
54 * @param encsrc Current encoding of the string.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
55 * @param encdst Target encoding of the string.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
56 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
57 * @return Converted string (it must be g_free()ed when not used. Or NULL if
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
58 * locstr is NULL.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
59 */
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
60 char *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
61 charset_convert(const gchar *locstr, const char *encsrc, const char *encdst);
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
62
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
63 /**
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
64 * Get UIN of a given account.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
65 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
66 * @param account Current account.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
67 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
68 * @return UIN of an account.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
69 */
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
70 uin_t
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
71 ggp_get_uin(GaimAccount *account);
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
72
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
73 /**
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
74 * Returns the best name of a buddy from the buddylist.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
75 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
76 * @param gc GaimConnection instance.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
77 * @param uin UIN of the buddy.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
78 *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
79 * @return Name of the buddy, or UIN converted to string.
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
80 */
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
81 char *
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
82 ggp_buddy_get_name(GaimConnection *gc, const uin_t uin);
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
83
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
84 #endif /* _GAIM_GG_UTILS_H */
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
85
fa7313d125ac [gaim-migrate @ 16013]
Evan Schoenberg <evan.s@dreskin.net>
parents:
diff changeset
86 /* vim: set ts=8 sts=0 sw=8 noet: */