libpurple/util.h

Fri, 31 Jan 2014 18:22:41 +0530

author
Ankit Vani <a@nevitus.org>
date
Fri, 31 Jan 2014 18:22:41 +0530
branch
soc.2013.gobjectification.plugins
changeset 37034
9d6765962b22
parent 37023
d9bcdc9a91e6
child 37035
e85ed7f4d6e3
permissions
-rw-r--r--

Initial replacements for this branch

4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file util.h Utility Functions
5034
077678f7b048 [gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents: 4890
diff changeset
3 * @ingroup core
20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
4 */
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
5
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
6 /* purple
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7889
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7889
diff changeset
10 * source distribution.
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
11 *
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * (at your option) any later version.
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 *
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * GNU General Public License for more details.
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 *
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19663
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
26 * @todo Rename the functions so that they live somewhere in the purple
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 * namespace.
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
29 #ifndef _PURPLE_UTIL_H_
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
30 #define _PURPLE_UTIL_H_
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31
6474
12d3fe5e5b1b [gaim-migrate @ 6983]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
32 #include <stdio.h>
12d3fe5e5b1b [gaim-migrate @ 6983]
Christian Hammond <chipx86@chipx86.com>
parents: 5944
diff changeset
33
28423
c12dbb691b04 Fix a bunch of doxygen warnings.
Paul Aurich <darkrain42@pidgin.im>
parents: 28384
diff changeset
34 /**
32556
20c90605fb55 I guess doxygen wants this struct to have a comment if prpl.h is going
Mark Doliner <markdoliner@pidgin.im>
parents: 32555
diff changeset
35 * A generic structure that contains information about an "action." One
36637
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36581
diff changeset
36 * place this is is used is by protocols to tell the core the list of available
32556
20c90605fb55 I guess doxygen wants this struct to have a comment if prpl.h is going
Mark Doliner <markdoliner@pidgin.im>
parents: 32555
diff changeset
37 * right-click actions for a buddy list row.
20c90605fb55 I guess doxygen wants this struct to have a comment if prpl.h is going
Mark Doliner <markdoliner@pidgin.im>
parents: 32555
diff changeset
38 */
26649
1a6c4fd19355 Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <darkrain42@pidgin.im>
parents: 25911
diff changeset
39 typedef struct _PurpleMenuAction PurpleMenuAction;
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
40
12106
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
41 /**
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
42 * A key-value pair.
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
43 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
44 * This is used by, among other things, purple_gtk_combo* functions to pass in a
12106
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
45 * list of key-value pairs so it can display a user-friendly value.
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
46 */
26649
1a6c4fd19355 Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <darkrain42@pidgin.im>
parents: 25911
diff changeset
47 typedef struct _PurpleKeyValuePair PurpleKeyValuePair;
1a6c4fd19355 Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <darkrain42@pidgin.im>
parents: 25911
diff changeset
48
5563
d5a7852aa0cb [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5532
diff changeset
49 #include "account.h"
29553
5e7395ef6819 Include signals.h to provide PurpleCallback. I guess all the other places
Michael Ruprecht <maiku@pidgin.im>
parents: 29538
diff changeset
50 #include "signals.h"
10425
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
51 #include "xmlnode.h"
18101
3ce21b5a182c A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents: 17389
diff changeset
52 #include "notify.h"
36581
09d5842255a2 Added missing includes and functions to headers
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
53 #include "protocols.h"
5563
d5a7852aa0cb [gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents: 5532
diff changeset
54
26649
1a6c4fd19355 Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <darkrain42@pidgin.im>
parents: 25911
diff changeset
55
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
56 typedef char *(*PurpleInfoFieldFormatCallback)(const char *field, size_t len);
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
57
26649
1a6c4fd19355 Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <darkrain42@pidgin.im>
parents: 25911
diff changeset
58 struct _PurpleKeyValuePair
12106
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
59 {
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
60 gchar *key;
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
61 void *value;
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
62
26649
1a6c4fd19355 Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <darkrain42@pidgin.im>
parents: 25911
diff changeset
63 };
12106
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
64
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32737
diff changeset
65 G_BEGIN_DECLS
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32737
diff changeset
66
12919
519199cca273 [gaim-migrate @ 15272]
Etan Reisner <deryni@pidgin.im>
parents: 12908
diff changeset
67 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
68 * Creates a new PurpleMenuAction.
13103
81ccb40de82b [gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents: 13090
diff changeset
69 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
70 * @label: The text label to display for this action.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
71 * @callback: The function to be called when the action is used on
12919
519199cca273 [gaim-migrate @ 15272]
Etan Reisner <deryni@pidgin.im>
parents: 12908
diff changeset
72 * the selected item.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
73 * @data: Additional data to be passed to the callback.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
74 * @children: A GList of PurpleMenuActions to be added as a submenu
12919
519199cca273 [gaim-migrate @ 15272]
Etan Reisner <deryni@pidgin.im>
parents: 12908
diff changeset
75 * of the action.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
76 * Returns: The PurpleMenuAction.
12919
519199cca273 [gaim-migrate @ 15272]
Etan Reisner <deryni@pidgin.im>
parents: 12908
diff changeset
77 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
78 PurpleMenuAction *purple_menu_action_new(const char *label, PurpleCallback callback,
12919
519199cca273 [gaim-migrate @ 15272]
Etan Reisner <deryni@pidgin.im>
parents: 12908
diff changeset
79 gpointer data, GList *children);
12106
d7593d9b8bc9 [gaim-migrate @ 14403]
Sean Egan <seanegan@pidgin.im>
parents: 11920
diff changeset
80
13103
81ccb40de82b [gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents: 13090
diff changeset
81 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
82 * Frees a PurpleMenuAction
13103
81ccb40de82b [gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents: 13090
diff changeset
83 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
84 * @act: The PurpleMenuAction to free.
13103
81ccb40de82b [gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents: 13090
diff changeset
85 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
86 void purple_menu_action_free(PurpleMenuAction *act);
13103
81ccb40de82b [gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents: 13090
diff changeset
87
22133
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
88 /**
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
89 * Returns the label of the PurpleMenuAction.
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
90 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
91 * @act: The PurpleMenuAction.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
92 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
93 * Returns: The label string.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
94 */
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
95 char * purple_menu_action_get_label(const PurpleMenuAction *act);
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
96
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
97 /**
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
98 * Returns the callback of the PurpleMenuAction.
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
99 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
100 * @act: The PurpleMenuAction.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
101 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
102 * Returns: The callback function.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
103 */
32293
4eaaed5c53ca disapproval of revision 'c08314ef2b9ceb6479c57fa6114095275488a94c'
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32292
diff changeset
104 PurpleCallback purple_menu_action_get_callback(const PurpleMenuAction *act);
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
105
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
106 /**
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
107 * Returns the data stored in the PurpleMenuAction.
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
108 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
109 * @act: The PurpleMenuAction.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
110 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
111 * Returns: The data.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
112 */
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
113 gpointer purple_menu_action_get_data(const PurpleMenuAction *act);
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
114
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
115 /**
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
116 * Returns the children of the PurpleMenuAction.
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
117 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
118 * @act: The PurpleMenuAction.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
119 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
120 * Returns: The GList of children.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
121 */
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
122 GList* purple_menu_action_get_children(const PurpleMenuAction *act);
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
123
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
124 /**
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
125 * Set the label to the PurpleMenuAction.
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
126 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
127 * @act: The menu action.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
128 * @label: The label for the menu action.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
129 */
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
130 void purple_menu_action_set_label(PurpleMenuAction *act, char *label);
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
131
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
132 /**
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
133 * Set the callback that will be used by the PurpleMenuAction.
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
134 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
135 * @act: The menu action.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
136 * @callback: The callback.
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
137 */
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
138 void purple_menu_action_set_callback(PurpleMenuAction *act, PurpleCallback callback);
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
139
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
140 /**
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
141 * Set the label to the PurpleMenuAction.
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
142 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
143 * @act: The menu action.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
144 * @data: The data used by this PurpleMenuAction
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
145 */
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
146 void purple_menu_action_set_data(PurpleMenuAction *act, gpointer data);
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
147
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
148 /**
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
149 * Set the children of the PurpleMenuAction.
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
150 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
151 * @act: The menu action.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
152 * @children: The PurpleMenuAtion children
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
153 */
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
154 void purple_menu_action_set_children(PurpleMenuAction *act, GList *children);
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
155
34500
e322f9c8f3e9 Fill comments for E2EE branch
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34498
diff changeset
156 /**
e322f9c8f3e9 Fill comments for E2EE branch
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34498
diff changeset
157 * Sets the icon for the PurpleMenuAction.
e322f9c8f3e9 Fill comments for E2EE branch
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34498
diff changeset
158 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
159 * @act: The menu action.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
160 * @strock: The stock icon identifier.
34500
e322f9c8f3e9 Fill comments for E2EE branch
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34498
diff changeset
161 */
34485
2574bedf42f5 E2EE: make it possible to attach stock icon to PurpleMenuAction
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
162 void purple_menu_action_set_stock_icon(PurpleMenuAction *act,
2574bedf42f5 E2EE: make it possible to attach stock icon to PurpleMenuAction
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
163 const gchar *stock);
2574bedf42f5 E2EE: make it possible to attach stock icon to PurpleMenuAction
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
164
34500
e322f9c8f3e9 Fill comments for E2EE branch
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34498
diff changeset
165 /**
e322f9c8f3e9 Fill comments for E2EE branch
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34498
diff changeset
166 * Gets the stock icon of the PurpleMenuAction.
e322f9c8f3e9 Fill comments for E2EE branch
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34498
diff changeset
167 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
168 * @act: The menu action.
34500
e322f9c8f3e9 Fill comments for E2EE branch
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34498
diff changeset
169 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
170 * Returns: The stock icon identifier.
34500
e322f9c8f3e9 Fill comments for E2EE branch
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34498
diff changeset
171 */
34485
2574bedf42f5 E2EE: make it possible to attach stock icon to PurpleMenuAction
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
172 const gchar *
2574bedf42f5 E2EE: make it possible to attach stock icon to PurpleMenuAction
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
173 purple_menu_action_get_stock_icon(PurpleMenuAction *act);
2574bedf42f5 E2EE: make it possible to attach stock icon to PurpleMenuAction
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
174
32287
c8cf9b704a49 Hide-a-PurpleMenuAction.
Jorge Villaseñor <masca@cpw.pidgin.im>
parents: 32159
diff changeset
175 /**
22133
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
176 * Set the appropriate presence values for the currently playing song.
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
177 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
178 * @title: The title of the song, %NULL to unset the value.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
179 * @artist: The artist of the song, can be %NULL.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
180 * @album: The album of the song, can be %NULL.
22133
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
181 */
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
182 void purple_util_set_current_song(const char *title, const char *artist,
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
183 const char *album);
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
184
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
185 /**
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
186 * Format song information.
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
187 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
188 * @title: The title of the song, %NULL to unset the value.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
189 * @artist: The artist of the song, can be %NULL.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
190 * @album: The album of the song, can be %NULL.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
191 * @unused: Currently unused, must be %NULL.
22133
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
192 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
193 * Returns: The formatted string. The caller must g_free the returned string.
22133
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
194 */
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
195 char * purple_util_format_song_info(const char *title, const char *artist,
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
196 const char *album, gpointer unused);
6eb22afb9701 Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 22015
diff changeset
197
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
198 /**************************************************************************/
21238
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
199 /** @name Utility Subsystem */
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
200 /**************************************************************************/
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
201 /*@{*/
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
202
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
203 /**
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
204 * Initializes the utility subsystem.
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
205 */
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
206 void purple_util_init(void);
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
207
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
208 /**
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
209 * Uninitializes the util subsystem.
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
210 */
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
211 void purple_util_uninit(void);
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
212
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
213 /*@}*/
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
214
cd326828c870 Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@pidgin.im>
parents: 20226
diff changeset
215 /**************************************************************************/
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
216 /** @name Base16 Functions */
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
217 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
218 /*@{*/
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
219
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
220 /**
11127
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
221 * Converts a chunk of binary data to its base-16 equivalent.
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
222 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
223 * @data: The data to convert.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
224 * @len: The length of the data.
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
225 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
226 * Returns: The base-16 string in the ASCII encoding. Must be
11127
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
227 * g_free'd when no longer needed.
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
228 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
229 * @see purple_base16_decode()
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
230 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
231 gchar *purple_base16_encode(const guchar *data, gsize len);
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
232
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
233 /**
11127
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
234 * Converts an ASCII string of base-16 encoded data to
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
235 * the binary equivalent.
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
236 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
237 * @str: The base-16 string to convert to raw data.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
238 * @ret_len: The length of the returned data. You can
11127
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
239 * pass in NULL if you're sure that you know
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
240 * the length of the decoded data, or if you
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
241 * know you'll be able to use strlen to
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
242 * determine the length, etc.
5451
3b9fea899f61 [gaim-migrate @ 5839]
Nathan Walp <nwalp@pidgin.im>
parents: 5426
diff changeset
243 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
244 * Returns: The raw data. Must be g_free'd when no longer needed.
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
245 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
246 * @see purple_base16_encode()
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
247 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
248 guchar *purple_base16_decode(const char *str, gsize *ret_len);
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
249
17389
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
250 /**
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
251 * Converts a chunk of binary data to a chunked base-16 representation
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
252 * (handy for key fingerprints)
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
253 *
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
254 * Example output: 01:23:45:67:89:AB:CD:EF
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
255 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
256 * @data: The data to convert.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
257 * @len: The length of the data.
17389
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
258 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
259 * Returns: The base-16 string in the ASCII chunked encoding. Must be
17389
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
260 * g_free'd when no longer needed.
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
261 */
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
262 gchar *purple_base16_encode_chunked(const guchar *data, gsize len);
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
263
125a4df6d42c - Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents: 16557
diff changeset
264
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
265 /*@}*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
266
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
267 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
268 /** @name Base64 Functions */
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
269 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
270 /*@{*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
271
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
272 /**
11127
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
273 * Converts a chunk of binary data to its base-64 equivalent.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
274 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
275 * @data: The data to convert.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
276 * @len: The length of the data.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
277 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
278 * Returns: The base-64 string in the ASCII encoding. Must be
11127
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
279 * g_free'd when no longer needed.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
280 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
281 * @see purple_base64_decode()
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
282 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
283 gchar *purple_base64_encode(const guchar *data, gsize len);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
284
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
285 /**
11127
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
286 * Converts an ASCII string of base-64 encoded data to
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
287 * the binary equivalent.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
288 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
289 * @str: The base-64 string to convert to raw data.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
290 * @ret_len: The length of the returned data. You can
11127
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
291 * pass in NULL if you're sure that you know
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
292 * the length of the decoded data, or if you
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
293 * know you'll be able to use strlen to
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
294 * determine the length, etc.
5e539d9d26a4 [gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents: 10871
diff changeset
295 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
296 * Returns: The raw data. Must be g_free'd when no longer needed.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
297 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
298 * @see purple_base64_encode()
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
299 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
300 guchar *purple_base64_decode(const char *str, gsize *ret_len);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
301
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
302 /*@}*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
303
7679
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
304 /**************************************************************************/
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
305 /** @name Quoted Printable Functions */
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
306 /**************************************************************************/
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
307 /*@{*/
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
308
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
309 /**
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
310 * Converts a quoted printable string back to its readable equivalent.
11132
eeb2afd70f70 [gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents: 11127
diff changeset
311 * What is a quoted printable string, you ask? It's an encoding used
eeb2afd70f70 [gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents: 11127
diff changeset
312 * to transmit binary data as ASCII. It's intended purpose is to send
23325
a374a26fe217 Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@pidgin.im>
parents: 23289
diff changeset
313 * emails containing non-ASCII characters. Wikipedia has a pretty good
11132
eeb2afd70f70 [gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents: 11127
diff changeset
314 * explanation. Also see RFC 2045.
7679
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
315 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
316 * @str: The quoted printable ASCII string to convert to raw data.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
317 * @ret_len: The length of the returned data.
11132
eeb2afd70f70 [gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents: 11127
diff changeset
318 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
319 * Returns: The readable string. Must be g_free'd when no longer needed.
7679
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
320 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
321 guchar *purple_quotedp_decode(const char *str, gsize *ret_len);
7679
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
322
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
323 /*@}*/
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
324
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
325 /**************************************************************************/
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
326 /** @name MIME Functions */
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
327 /**************************************************************************/
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
328 /*@{*/
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
329
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
330 /**
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
331 * Converts a MIME header field string back to its readable equivalent
8432
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
332 * according to RFC 2047. Basically, a header is plain ASCII and can
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
333 * contain any number of sections called "encoded-words." The format
7821
d15fc781c318 [gaim-migrate @ 8473]
Mark Doliner <markdoliner@pidgin.im>
parents: 7679
diff changeset
334 * of an encoded word is =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?=
d15fc781c318 [gaim-migrate @ 8473]
Mark Doliner <markdoliner@pidgin.im>
parents: 7679
diff changeset
335 * =? designates the beginning of the encoded-word
d15fc781c318 [gaim-migrate @ 8473]
Mark Doliner <markdoliner@pidgin.im>
parents: 7679
diff changeset
336 * ?= designates the end of the encoded-word
11135
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
337 *
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
338 * An encoded word is segmented into three pieces by the use of a
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
339 * question mark. The first piece is the character set, the second
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
340 * piece is the encoding, and the third piece is the encoded text.
7679
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
341 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
342 * @str: The ASCII string, possibly containing any number of
11135
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
343 * encoded-word sections.
7679
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
344 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
345 * Returns: The string, with any encoded-word sections decoded and
11135
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
346 * converted to UTF-8. Must be g_free'd when no longer
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
347 * needed.
7679
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
348 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
349 char *purple_mime_decode_field(const char *str);
7679
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
350
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
351 /*@}*/
c9804d02dcab [gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents: 7675
diff changeset
352
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
353
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
354 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
355 /** @name Date/Time Functions */
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
356 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
357 /*@{*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
358
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
359 /**
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
360 * Formats a time into the specified format.
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
361 *
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
362 * This is essentially strftime(), but it has a static buffer
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
363 * and handles the UTF-8 conversion for the caller.
13120
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
364 *
13153
3e0b91a83516 [gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents: 13120
diff changeset
365 * This function also provides the GNU %z formatter if the underlying C
3e0b91a83516 [gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents: 13120
diff changeset
366 * library doesn't. However, the format string parser is very naive, which
3e0b91a83516 [gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents: 13120
diff changeset
367 * means that conversions specifiers to %z cannot be guaranteed. The GNU
3e0b91a83516 [gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents: 13120
diff changeset
368 * strftime(3) man page describes %z as: 'The time-zone as hour offset from
3e0b91a83516 [gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents: 13120
diff changeset
369 * GMT. Required to emit RFC822-conformant dates
3e0b91a83516 [gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents: 13120
diff changeset
370 * (using "%a, %d %b %Y %H:%M:%S %z"). (GNU)'
3e0b91a83516 [gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents: 13120
diff changeset
371 *
13334
d0d48650f114 [gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents: 13216
diff changeset
372 * On Windows, this function also converts the results for %Z from a timezone
d0d48650f114 [gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents: 13216
diff changeset
373 * name (as returned by the system strftime() %Z format string) to a timezone
d0d48650f114 [gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents: 13216
diff changeset
374 * abbreviation (as is the case on Unix). As with %z, conversion specifiers
d0d48650f114 [gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents: 13216
diff changeset
375 * should not be used.
d0d48650f114 [gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents: 13216
diff changeset
376 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
377 * @format: The format string, in UTF-8
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
378 * @tm: The time to format, or %NULL to use the current local time
13120
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
379 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
380 * Returns: The formatted time, in UTF-8.
13216
2cc737d198f3 [gaim-migrate @ 15579]
Richard Laager <rlaager@pidgin.im>
parents: 13153
diff changeset
381 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
382 * Note: @a format is required to be in UTF-8. This differs from strftime(),
13216
2cc737d198f3 [gaim-migrate @ 15579]
Richard Laager <rlaager@pidgin.im>
parents: 13153
diff changeset
383 * where the format is provided in the locale charset.
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
384 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
385 const char *purple_utf8_strftime(const char *format, const struct tm *tm);
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
386
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
387 /**
18317
6c814e134e56 support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18101
diff changeset
388 * Gets a string representation of the local timezone offset
6c814e134e56 support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18101
diff changeset
389 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
390 * @tm: The time to get the timezone for
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
391 * @iso: TRUE to format the offset according to ISO-8601, FALSE to
18317
6c814e134e56 support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18101
diff changeset
392 * not substitute 'Z' for 0 offset, and to not separate
6c814e134e56 support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18101
diff changeset
393 * hours and minutes with a colon.
6c814e134e56 support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18101
diff changeset
394 */
6c814e134e56 support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18101
diff changeset
395 const char *purple_get_tzoff_str(const struct tm *tm, gboolean iso);
6c814e134e56 support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18101
diff changeset
396
6c814e134e56 support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents: 18101
diff changeset
397 /**
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
398 * Formats a time into the user's preferred short date format.
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
399 *
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
400 * The returned string is stored in a static buffer, so the result
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
401 * should be g_strdup()'d if it's going to be kept.
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
402 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
403 * @tm: The time to format, or %NULL to use the current local time
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
404 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
405 * Returns: The date, formatted as per the user's settings. In the USA this
33758
e176320b17f4 Add examples for the purple_date_format functions
Mark Doliner <mark@kingant.net>
parents: 33537
diff changeset
406 * is something like "02/18/13"
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
407 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
408 const char *purple_date_format_short(const struct tm *tm);
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
409
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
410 /**
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
411 * Formats a time into the user's preferred short date plus time format.
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
412 *
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
413 * The returned string is stored in a static buffer, so the result
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
414 * should be g_strdup()'d if it's going to be kept.
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
415 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
416 * @tm: The time to format, or %NULL to use the current local time
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
417 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
418 * Returns: The timestamp, formatted as per the user's settings. In the USA
33758
e176320b17f4 Add examples for the purple_date_format functions
Mark Doliner <mark@kingant.net>
parents: 33537
diff changeset
419 * this is something like "02/18/13 15:26:44"
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
420 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
421 const char *purple_date_format_long(const struct tm *tm);
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
422
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
423 /**
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
424 * Formats a time into the user's preferred full date and time format.
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
425 *
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
426 * The returned string is stored in a static buffer, so the result
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
427 * should be g_strdup()'d if it's going to be kept.
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
428 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
429 * @tm: The time to format, or %NULL to use the current local time
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
430 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
431 * Returns: The date and time, formatted as per the user's settings. In the
33758
e176320b17f4 Add examples for the purple_date_format functions
Mark Doliner <mark@kingant.net>
parents: 33537
diff changeset
432 * USA this is something like "Mon Feb 18 15:26:44 2013"
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
433 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
434 const char *purple_date_format_full(const struct tm *tm);
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
435
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
436 /**
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
437 * Formats a time into the user's preferred time format.
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
438 *
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
439 * The returned string is stored in a static buffer, so the result
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
440 * should be g_strdup()'d if it's going to be kept.
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
441 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
442 * @tm: The time to format, or %NULL to use the current local time
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
443 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
444 * Returns: The time, formatted as per the user's settings. In the USA this
33758
e176320b17f4 Add examples for the purple_date_format functions
Mark Doliner <mark@kingant.net>
parents: 33537
diff changeset
445 * is something like "15:26:44"
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
446 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
447 const char *purple_time_format(const struct tm *tm);
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
448
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
449 /**
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
450 * Builds a time_t from the supplied information.
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
451 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
452 * @year: The year.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
453 * @month: The month.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
454 * @day: The day.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
455 * @hour: The hour.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
456 * @min: The minute.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
457 * @sec: The second.
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
458 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
459 * Returns: A time_t.
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
460 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
461 time_t purple_time_build(int year, int month, int day, int hour,
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
462 int min, int sec);
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
463
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
464 /** Used by purple_str_to_time to indicate no timezone offset was
13120
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
465 * specified in the timestamp string. */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
466 #define PURPLE_NO_TZ_OFF -500000
13120
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
467
8577
64f25a17f8e4 [gaim-migrate @ 9326]
Nathan Walp <nwalp@pidgin.im>
parents: 8461
diff changeset
468 /**
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
469 * Parses a timestamp in jabber, ISO8601, or MM/DD/YYYY format and returns
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
470 * a time_t.
8577
64f25a17f8e4 [gaim-migrate @ 9326]
Nathan Walp <nwalp@pidgin.im>
parents: 8461
diff changeset
471 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
472 * @timestamp: The timestamp
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
473 * @utc: Assume UTC if no timezone specified
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
474 * @tm: If not %NULL, the caller can get a copy of the
13120
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
475 * struct tm used to calculate the time_t return value.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
476 * @tz_off: If not %NULL, the caller can get a copy of the
13120
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
477 * timezone offset (from UTC) used to calculate the time_t
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
478 * return value. Note: Zero is a valid offset. As such,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
479 * the value of the macro @c PURPLE_NO_TZ_OFF indicates no
13120
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
480 * offset was specified (which means that the local
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
481 * timezone was used in the calculation).
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
482 * @rest: If not %NULL, the caller can get a pointer to the
13120
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
483 * part of @a timestamp left over after parsing is
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
484 * completed, if it's not the end of @a timestamp.
8577
64f25a17f8e4 [gaim-migrate @ 9326]
Nathan Walp <nwalp@pidgin.im>
parents: 8461
diff changeset
485 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
486 * Returns: A time_t.
8577
64f25a17f8e4 [gaim-migrate @ 9326]
Nathan Walp <nwalp@pidgin.im>
parents: 8461
diff changeset
487 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
488 time_t purple_str_to_time(const char *timestamp, gboolean utc,
13120
c25222322810 [gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents: 13105
diff changeset
489 struct tm *tm, long *tz_off, const char **rest);
8577
64f25a17f8e4 [gaim-migrate @ 9326]
Nathan Walp <nwalp@pidgin.im>
parents: 8461
diff changeset
490
33051
2e75223c078e Do some proper parsing of UTS-35 date formats.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32787
diff changeset
491 /**
2e75223c078e Do some proper parsing of UTS-35 date formats.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32787
diff changeset
492 * Formats a datetime according to a UTS-35 Date Format Pattern.
2e75223c078e Do some proper parsing of UTS-35 date formats.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32787
diff changeset
493 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
494 * @format: The formatting string, according to UTS #35
33051
2e75223c078e Do some proper parsing of UTS-35 date formats.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32787
diff changeset
495 * See http://unicode.org/reports/tr35/
2e75223c078e Do some proper parsing of UTS-35 date formats.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32787
diff changeset
496 * (NOTE: not all formats are supported)
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
497 * @len: The length of the formatting string
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
498 * @tm: The time to format, or %NULL to use the current local time
33051
2e75223c078e Do some proper parsing of UTS-35 date formats.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32787
diff changeset
499 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
500 * Returns: The time, formatted as per the user's settings.
33051
2e75223c078e Do some proper parsing of UTS-35 date formats.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32787
diff changeset
501 */
2e75223c078e Do some proper parsing of UTS-35 date formats.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32787
diff changeset
502 char *purple_uts35_to_str(const char *format, size_t len, struct tm *tm);
2e75223c078e Do some proper parsing of UTS-35 date formats.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32787
diff changeset
503
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
504 /*@}*/
4890
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
505
d87a9b5bbe57 [gaim-migrate @ 5220]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
506
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
507 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
508 /** @name Markup Functions */
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
509 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
510 /*@{*/
5826
32bbc37943f4 [gaim-migrate @ 6256]
Sean Egan <seanegan@pidgin.im>
parents: 5563
diff changeset
511
6982
12f08de92674 [gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents: 6861
diff changeset
512 /**
27652
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
513 * Escapes special characters in a plain-text string so they display
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
514 * correctly as HTML. For example, & is replaced with &amp; and < is
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
515 * replaced with &lt;
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
516 *
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
517 * This is exactly the same as g_markup_escape_text(), except that it
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
518 * does not change ' to &apos; because &apos; is not a valid HTML 4 entity,
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
519 * and is displayed literally in IE7.
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
520 */
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
521 gchar *purple_markup_escape_text(const gchar *text, gssize length);
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
522
1929fae118e5 Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <markdoliner@pidgin.im>
parents: 27244
diff changeset
523 /**
11135
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
524 * Finds an HTML tag matching the given name.
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
525 *
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
526 * This locates an HTML tag's start and end, and stores its attributes
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
527 * in a GData hash table. The names of the attributes are lower-cased
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
528 * in the hash table, and the name of the tag is case insensitive.
6982
12f08de92674 [gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents: 6861
diff changeset
529 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
530 * @needle: The name of the tag
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
531 * @haystack: The null-delimited string to search in
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
532 * @start: A pointer to the start of the tag if found
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
533 * @end: A pointer to the end of the tag if found
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
534 * @attributes: The attributes, if the tag was found. This should
14030
23144f1dc950 [gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents: 13785
diff changeset
535 * be freed with g_datalist_clear().
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
536 * Returns: TRUE if the tag was found
6982
12f08de92674 [gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents: 6861
diff changeset
537 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
538 gboolean purple_markup_find_tag(const char *needle, const char *haystack,
7094
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
539 const char **start, const char **end,
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
540 GData **attributes);
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
541
8f9588491993 [gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
542 /**
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
543 * Extracts a field of data from HTML.
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
544 *
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
545 * This is a scary function. See protocols/msn/msn.c and
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
546 * protocols/yahoo/yahoo_profile.c for example usage.
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
547 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
548 * @str: The string to parse.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
549 * @len: The size of str.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
550 * @user_info: The destination PurpleNotifyUserInfo to which the new
15205
f642029b2f97 [gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents: 14708
diff changeset
551 * field info should be added.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
552 * @start_token: The beginning token.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
553 * @skip: The number of characters to skip after the
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
554 * start token.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
555 * @end_token: The ending token.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
556 * @check_value: The value that the last character must meet.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
557 * @no_value_token: The token indicating no value is given.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
558 * @display_name: The short descriptive name to display for this token.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
559 * @is_link: TRUE if this should be a link, or FALSE otherwise.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
560 * @link_prefix: The prefix for the link.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
561 * @format_cb: A callback to format the value before adding it.
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
562 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
563 * Returns: TRUE if successful, or FALSE otherwise.
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
564 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
565 gboolean purple_markup_extract_info_field(const char *str, int len, PurpleNotifyUserInfo *user_info,
7675
8058cedec7a2 [gaim-migrate @ 8319]
Tim Ringenbach <marv@pidgin.im>
parents: 7673
diff changeset
566 const char *start_token, int skip,
8058cedec7a2 [gaim-migrate @ 8319]
Tim Ringenbach <marv@pidgin.im>
parents: 7673
diff changeset
567 const char *end_token, char check_value,
8058cedec7a2 [gaim-migrate @ 8319]
Tim Ringenbach <marv@pidgin.im>
parents: 7673
diff changeset
568 const char *no_value_token,
8058cedec7a2 [gaim-migrate @ 8319]
Tim Ringenbach <marv@pidgin.im>
parents: 7673
diff changeset
569 const char *display_name, gboolean is_link,
13105
8f9c66e4af87 [gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents: 13103
diff changeset
570 const char *link_prefix,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
571 PurpleInfoFieldFormatCallback format_cb);
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
572
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
573 /**
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
574 * Converts HTML markup to XHTML.
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
575 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
576 * @html: The HTML markup.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
577 * @dest_xhtml: The destination XHTML output.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
578 * @dest_plain: The destination plain-text output.
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
579 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
580 void purple_markup_html_to_xhtml(const char *html, char **dest_xhtml,
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
581 char **dest_plain);
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
582
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
583 /**
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
584 * Strips HTML tags from a string.
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
585 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
586 * @str: The string to strip HTML from.
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
587 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
588 * Returns: The new string without HTML. You must g_free this string
22819
7d360024a0df Super minor documentation improvement
Mark Doliner <markdoliner@pidgin.im>
parents: 22769
diff changeset
589 * when finished with it.
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
590 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
591 char *purple_markup_strip_html(const char *str);
7095
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
592
17d2b54254f8 [gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents: 7094
diff changeset
593 /**
7107
903864ff76c3 [gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents: 7106
diff changeset
594 * Adds the necessary HTML code to turn URIs into HTML links in a string.
903864ff76c3 [gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents: 7106
diff changeset
595 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
596 * @str: The string to linkify.
7107
903864ff76c3 [gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents: 7106
diff changeset
597 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
598 * Returns: The new string with all URIs surrounded in standard
22819
7d360024a0df Super minor documentation improvement
Mark Doliner <markdoliner@pidgin.im>
parents: 22769
diff changeset
599 * HTML <a href="whatever"></a> tags. You must g_free this
7d360024a0df Super minor documentation improvement
Mark Doliner <markdoliner@pidgin.im>
parents: 22769
diff changeset
600 * string when finished with it.
7107
903864ff76c3 [gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents: 7106
diff changeset
601 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
602 char *purple_markup_linkify(const char *str);
7107
903864ff76c3 [gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents: 7106
diff changeset
603
8163
8f33bb0f433d [gaim-migrate @ 8875]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
604 /**
29697
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
605 * Unescapes HTML entities to their literal characters in the text.
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
606 * For example "&amp;" is replaced by '&' and so on. Also converts
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
607 * numerical entities (e.g. "&#38;" is also '&').
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
608 *
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
609 * This function currently supports the following named entities:
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
610 * "&amp;", "&lt;", "&gt;", "&copy;", "&quot;", "&reg;", "&apos;"
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
611 *
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
612 * purple_unescape_html() is similar, but also converts "<br>" into "\n".
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
613 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
614 * @text: The string in which to unescape any HTML entities
29329
7a5f2bd8adbb Might as well make this comment accurate.
Paul Aurich <darkrain42@pidgin.im>
parents: 28423
diff changeset
615 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
616 * Returns: The text with HTML entities literalized. You must g_free
29697
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
617 * this string when finished with it.
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
618 *
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
619 * @see purple_unescape_html()
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
620 */
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
621 char *purple_unescape_text(const char *text);
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
622
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
623 /**
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
624 * Unescapes HTML entities to their literal characters and converts
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
625 * "<br>" to "\n". See purple_unescape_text() for more details.
8442
e5d2b1c684bb [gaim-migrate @ 9172]
Tim Ringenbach <marv@pidgin.im>
parents: 8433
diff changeset
626 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
627 * @html: The string in which to unescape any HTML entities
8442
e5d2b1c684bb [gaim-migrate @ 9172]
Tim Ringenbach <marv@pidgin.im>
parents: 8433
diff changeset
628 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
629 * Returns: The text with HTML entities literalized. You must g_free
22819
7d360024a0df Super minor documentation improvement
Mark Doliner <markdoliner@pidgin.im>
parents: 22769
diff changeset
630 * this string when finished with it.
29697
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
631 *
dfeaa83ed16e Combine the three purple_unescape_text()s into one.
Paul Aurich <darkrain42@pidgin.im>
parents: 29696
diff changeset
632 * @see purple_unescape_text()
8442
e5d2b1c684bb [gaim-migrate @ 9172]
Tim Ringenbach <marv@pidgin.im>
parents: 8433
diff changeset
633 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
634 char *purple_unescape_html(const char *html);
8442
e5d2b1c684bb [gaim-migrate @ 9172]
Tim Ringenbach <marv@pidgin.im>
parents: 8433
diff changeset
635
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
636 /**
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
637 * Returns a newly allocated substring of the HTML UTF-8 string "str".
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
638 * The markup is preserved such that the substring will have the same
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
639 * formatting as original string, even though some tags may have been
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
640 * opened before "x", or may close after "y". All open tags are closed
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
641 * at the end of the returned string, in the proper order.
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
642 *
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
643 * Note that x and y are in character offsets, not byte offsets, and
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
644 * are offsets into an unformatted version of str. Because of this,
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
645 * this function may be sensitive to changes in GtkIMHtml and may break
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
646 * when used with other UI's. libpurple users are encouraged to report and
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
647 * work out any problems encountered.
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
648 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
649 * @str: The input NUL terminated, HTML, UTF-8 (or ASCII) string.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
650 * @x: The character offset into an unformatted version of str to
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
651 * begin at.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
652 * @y: The character offset (into an unformatted vesion of str) of
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
653 * one past the last character to include in the slice.
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
654 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
655 * Returns: The HTML slice of string, with all formatting retained.
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
656 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
657 char *purple_markup_slice(const char *str, guint x, guint y);
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
658
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
659 /**
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
660 * Returns a newly allocated string containing the name of the tag
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
661 * located at "tag". Tag is expected to point to a '<', and contain
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
662 * a '>' sometime after that. If there is no '>' and the string is
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
663 * not NUL terminated, this function can be expected to segfault.
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
664 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
665 * @tag: The string starting a HTML tag.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
666 * Returns: A string containing the name of the tag.
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
667 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
668 char *purple_markup_get_tag_name(const char *tag);
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9171
diff changeset
669
16143
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
670 /**
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
671 * Returns a constant string of the character representation of the HTML
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
672 * entity pointed to by @a text. For example, purple_markup_unescape_entity("&amp;")
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
673 * will return "&". The @a text variable is expected to point to an '&',
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
674 * the first character of the entity. If given an unrecognized entity, the function
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
675 * returns %NULL.
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
676 *
16557
b0e9ddccdbb9 Fix purple_util_get_image_extension()'s data param. to be correctly marked as constant.
Daniel Atallah <datallah@pidgin.im>
parents: 16437
diff changeset
677 * Note that this function, unlike purple_unescape_html(), does not search
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
678 * the string for the entity, does not replace the entity, and does not
16143
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
679 * return a newly allocated string.
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
680 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
681 * @text: A string containing an HTML entity.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
682 * @length: If not %NULL, the string length of the entity is stored in this location.
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
683 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
684 * Returns: A constant string containing the character representation of the given entity.
16143
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
685 */
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
686 const char * purple_markup_unescape_entity(const char *text, int *length);
16143
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
687
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
688 /**
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
689 * Returns a newly allocated string containing the value of the CSS property specified
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
690 * in opt. The @a style argument is expected to point to a HTML inline CSS.
16262
1d9b65303dfc Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@pidgin.im>
parents: 16213
diff changeset
691 * The function will seek for the CSS property and return its value.
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
692 *
16262
1d9b65303dfc Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@pidgin.im>
parents: 16213
diff changeset
693 * For example, purple_markup_get_css_property("direction:rtl;color:#dc4d1b;",
1d9b65303dfc Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@pidgin.im>
parents: 16213
diff changeset
694 * "color") would return "#dc4d1b".
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
695 *
16262
1d9b65303dfc Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@pidgin.im>
parents: 16213
diff changeset
696 * On error or if the requested property was not found, the function returns
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
697 * %NULL.
16143
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
698 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
699 * @style: A string containing the inline CSS text.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
700 * @opt: The requested CSS property.
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
701 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
702 * Returns: The value of the requested CSS property.
16143
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
703 */
16144
4e022531d1c9 Patch cleanups:
Richard Laager <rlaager@pidgin.im>
parents: 16143
diff changeset
704 char * purple_markup_get_css_property(const gchar *style, const gchar *opt);
16143
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
705
27234
82035475de62 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 27228
diff changeset
706 /**
82035475de62 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 27228
diff changeset
707 * Check if the given HTML contains RTL text.
82035475de62 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 27228
diff changeset
708 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
709 * @html: The HTML text.
27234
82035475de62 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 27228
diff changeset
710 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
711 * Returns: TRUE if the text contains RTL text, FALSE otherwise.
27234
82035475de62 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 27228
diff changeset
712 */
82035475de62 Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 27228
diff changeset
713 gboolean purple_markup_is_rtl(const char *html);
16143
6393e5b11ff5 Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents: 15884
diff changeset
714
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
715 /*@}*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
716
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
717
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
718 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
719 /** @name Path/Filename Functions */
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
720 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
721 /*@{*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
722
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
723 /**
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
724 * Returns the user's home directory.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
725 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
726 * Returns: The user's home directory.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
727 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
728 * @see purple_user_dir()
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
729 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
730 const gchar *purple_home_dir(void);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
731
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
732 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
733 * Returns the purple settings directory in the user's home directory.
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
734 * This is usually ~/.purple
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
735 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
736 * Returns: The purple settings directory.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
737 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
738 * @see purple_home_dir()
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
739 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
740 const char *purple_user_dir(void);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
741
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
742 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
743 * Define a custom purple settings directory, overriding the default (user's home directory/.purple)
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
744 * @dir: The custom settings directory
8596
6d70d45b8ea6 [gaim-migrate @ 9347]
Daniel Atallah <datallah@pidgin.im>
parents: 8577
diff changeset
745 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
746 void purple_util_set_user_dir(const char *dir);
8596
6d70d45b8ea6 [gaim-migrate @ 9347]
Daniel Atallah <datallah@pidgin.im>
parents: 8577
diff changeset
747
6d70d45b8ea6 [gaim-migrate @ 9347]
Daniel Atallah <datallah@pidgin.im>
parents: 8577
diff changeset
748 /**
7612
4f5211591dbd [gaim-migrate @ 8236]
Ethan Blanton <elb@pidgin.im>
parents: 7564
diff changeset
749 * Builds a complete path from the root, making any directories along
4f5211591dbd [gaim-migrate @ 8236]
Ethan Blanton <elb@pidgin.im>
parents: 7564
diff changeset
750 * the path which do not already exist.
7622
8a983ae9204f [gaim-migrate @ 8246]
Nathan Walp <nwalp@pidgin.im>
parents: 7612
diff changeset
751 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
752 * @path: The path you wish to create. Note that it must start
7612
4f5211591dbd [gaim-migrate @ 8236]
Ethan Blanton <elb@pidgin.im>
parents: 7564
diff changeset
753 * from the root or this function will fail.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
754 * @mode: Unix-style permissions for this directory.
7622
8a983ae9204f [gaim-migrate @ 8246]
Nathan Walp <nwalp@pidgin.im>
parents: 7612
diff changeset
755 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
756 * Returns: 0 for success, nonzero on any error.
7612
4f5211591dbd [gaim-migrate @ 8236]
Ethan Blanton <elb@pidgin.im>
parents: 7564
diff changeset
757 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
758 int purple_build_dir(const char *path, int mode);
7612
4f5211591dbd [gaim-migrate @ 8236]
Ethan Blanton <elb@pidgin.im>
parents: 7564
diff changeset
759
4f5211591dbd [gaim-migrate @ 8236]
Ethan Blanton <elb@pidgin.im>
parents: 7564
diff changeset
760 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
761 * Write a string of data to a file of the given name in the Purple
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
762 * user directory ($HOME/.purple by default). The data is typically
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
763 * a serialized version of one of Purple's config files, such as
10415
faceb835eb87 [gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents: 10414
diff changeset
764 * prefs.xml, accounts.xml, etc. And the string is typically
34935
686fa55b0deb Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents: 34822
diff changeset
765 * obtained using purple_xmlnode_to_formatted_str. However, this function
10415
faceb835eb87 [gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents: 10414
diff changeset
766 * should work fine for saving binary files as well.
10414
6b10b76933e1 [gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents: 10332
diff changeset
767 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
768 * @filename: The basename of the file to write in the purple_user_dir.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
769 * @data: A null-terminated string of data to write.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
770 * @size: The size of the data to save. If data is
10415
faceb835eb87 [gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents: 10414
diff changeset
771 * null-terminated you can pass in -1.
10414
6b10b76933e1 [gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents: 10332
diff changeset
772 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
773 * Returns: TRUE if the file was written successfully. FALSE otherwise.
10414
6b10b76933e1 [gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents: 10332
diff changeset
774 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
775 gboolean purple_util_write_data_to_file(const char *filename, const char *data,
19663
44c4b4ce3cd8 Fix purple_util_write_data_to_file signature.
Daniel Atallah <datallah@pidgin.im>
parents: 19662
diff changeset
776 gssize size);
10414
6b10b76933e1 [gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents: 10332
diff changeset
777
6b10b76933e1 [gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents: 10332
diff changeset
778 /**
19501
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
779 * Write data to a file using the absolute path.
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
780 *
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
781 * This exists for Glib backwards compatibility reasons.
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
782 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
783 * @filename_full: Filename to write to
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
784 * @data: A null-terminated string of data to write.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
785 * @size: The size of the data to save. If data is
19501
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
786 * null-terminated you can pass in -1.
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
787 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
788 * Returns: TRUE if the file was written successfully. FALSE otherwise.
19501
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
789 *
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
790 * @todo Remove this function (use g_file_set_contents instead) when 3.0.0
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
791 * rolls around.
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
792 * @see purple_util_write_data_to_file()
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
793 *
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
794 */
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
795 gboolean
20226
282d0c1feb58 applied changes from 1095e0c294d15e95c8909d270748c5253226bfe6
Luke Schierer <lschiere@pidgin.im>
parents: 20147
diff changeset
796 purple_util_write_data_to_file_absolute(const char *filename_full, const char *data, gssize size);
19501
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
797
4c14c89dcf02 - Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents: 18413
diff changeset
798 /**
10425
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
799 * Read the contents of a given file and parse the results into an
34935
686fa55b0deb Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents: 34822
diff changeset
800 * PurpleXmlNode tree structure. This is intended to be used to read
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
801 * Purple's configuration xml files (prefs.xml, pounces.xml, etc.)
10425
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
802 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
803 * @filename: The basename of the file to open in the purple_user_dir.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
804 * @description: A very short description of the contents of this
10425
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
805 * file. This is used in error messages shown to the
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
806 * user when the file can not be opened. For example,
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
807 * "preferences," or "buddy pounces."
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
808 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
809 * Returns: An PurpleXmlNode tree of the contents of the given file. Or NULL, if
10425
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
810 * the file does not exist or there was an error reading the file.
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
811 */
34935
686fa55b0deb Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents: 34822
diff changeset
812 PurpleXmlNode *purple_util_read_xml_from_file(const char *filename,
10425
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
813 const char *description);
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
814
d82cef15da95 [gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents: 10415
diff changeset
815 /**
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
816 * Creates a temporary file and returns a file pointer to it.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
817 *
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
818 * This is like mkstemp(), but returns a file pointer and uses a
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
819 * pre-set template. It uses the semantics of tempnam() for the
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
820 * directory to use and allocates the space for the file path.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
821 *
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
822 * The caller is responsible for closing the file and removing it when
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
823 * done, as well as freeing the space pointed to by @a path with
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
824 * g_free().
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
825 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
826 * @path: The returned path to the temp file.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
827 * @binary: Text or binary, for platforms where it matters.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
828 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
829 * Returns: A file pointer to the temporary file, or %NULL on failure.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
830 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
831 FILE *purple_mkstemp(char **path, gboolean binary);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
832
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
833 /**
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
834 * Returns an extension corresponding to the image data's file type.
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
835 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
836 * @data: A pointer to the image data
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
837 * @len: The length of the image data
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
838 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
839 * Returns: The appropriate extension, or "icon" if unknown.
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
840 */
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
841 const char *
16557
b0e9ddccdbb9 Fix purple_util_get_image_extension()'s data param. to be correctly marked as constant.
Daniel Atallah <datallah@pidgin.im>
parents: 16437
diff changeset
842 purple_util_get_image_extension(gconstpointer data, size_t len);
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
843
18101
3ce21b5a182c A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents: 17389
diff changeset
844 /**
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
845 * Returns: A hex encoded version of the SHA-1 hash of the data passed
22769
fa73d52f4f67 Documentation changes
Mark Doliner <markdoliner@pidgin.im>
parents: 22468
diff changeset
846 * in with the correct file extention appended. The file
fa73d52f4f67 Documentation changes
Mark Doliner <markdoliner@pidgin.im>
parents: 22468
diff changeset
847 * extension is determined by calling
fa73d52f4f67 Documentation changes
Mark Doliner <markdoliner@pidgin.im>
parents: 22468
diff changeset
848 * purple_util_get_image_extension(). This return value must
fa73d52f4f67 Documentation changes
Mark Doliner <markdoliner@pidgin.im>
parents: 22468
diff changeset
849 * be g_freed by the caller.
18101
3ce21b5a182c A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents: 17389
diff changeset
850 */
3ce21b5a182c A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents: 17389
diff changeset
851 char *purple_util_get_image_filename(gconstpointer image_data, size_t image_len);
3ce21b5a182c A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents: 17389
diff changeset
852
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
853 /*@}*/
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
854
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
855
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
856 /**************************************************************************/
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
857 /** @name Environment Detection Functions */
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
858 /**************************************************************************/
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
859 /*@{*/
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
860
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
861 /**
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
862 * Checks if the given program name is valid and executable.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
863 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
864 * @program: The file name of the application.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
865 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
866 * Returns: TRUE if the program is runable.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
867 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
868 gboolean purple_program_is_valid(const char *program);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
869
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
870 /**
12483
38fc67810cdb [gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents: 12106
diff changeset
871 * Check if running GNOME.
11878
4c2661df91bb [gaim-migrate @ 14169]
Sean Egan <seanegan@pidgin.im>
parents: 11552
diff changeset
872 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
873 * Returns: TRUE if running GNOME, FALSE otherwise.
11878
4c2661df91bb [gaim-migrate @ 14169]
Sean Egan <seanegan@pidgin.im>
parents: 11552
diff changeset
874 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
875 gboolean purple_running_gnome(void);
11878
4c2661df91bb [gaim-migrate @ 14169]
Sean Egan <seanegan@pidgin.im>
parents: 11552
diff changeset
876
4c2661df91bb [gaim-migrate @ 14169]
Sean Egan <seanegan@pidgin.im>
parents: 11552
diff changeset
877 /**
12483
38fc67810cdb [gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents: 12106
diff changeset
878 * Check if running KDE.
38fc67810cdb [gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents: 12106
diff changeset
879 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
880 * Returns: TRUE if running KDE, FALSE otherwise.
12483
38fc67810cdb [gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents: 12106
diff changeset
881 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
882 gboolean purple_running_kde(void);
12483
38fc67810cdb [gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents: 12106
diff changeset
883
38fc67810cdb [gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents: 12106
diff changeset
884 /**
14708
6006e069317c [gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents: 14416
diff changeset
885 * Check if running OS X.
6006e069317c [gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents: 14416
diff changeset
886 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
887 * Returns: TRUE if running OS X, FALSE otherwise.
14708
6006e069317c [gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents: 14416
diff changeset
888 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
889 gboolean purple_running_osx(void);
14708
6006e069317c [gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents: 14416
diff changeset
890
6006e069317c [gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents: 14416
diff changeset
891 /**
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
892 * Returns the IP address from a socket file descriptor.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
893 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
894 * @fd: The socket file descriptor.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
895 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
896 * Returns: The IP address, or %NULL on error.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
897 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
898 char *purple_fd_get_ip(int fd);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
899
30027
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
900 /**
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
901 * Returns the address family of a socket.
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
902 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
903 * @fd: The socket file descriptor.
30027
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
904 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
905 * Returns: The address family of the socket (AF_INET, AF_INET6, etc) or -1
30030
f217427b4035 Oops, I forgot to save this before committing.
Paul Aurich <darkrain42@pidgin.im>
parents: 30027
diff changeset
906 * on error.
30027
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
907 */
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
908 int purple_socket_get_family(int fd);
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
909
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
910 /**
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
911 * Returns TRUE if a socket is capable of speaking IPv4.
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
912 *
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
913 * This is the case for IPv4 sockets and, on some systems, IPv6 sockets
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
914 * (due to the IPv4-mapped address functionality).
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
915 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
916 * @fd: The socket file descriptor
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
917 * Returns: TRUE if a socket can speak IPv4.
30027
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
918 */
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
919 gboolean purple_socket_speaks_ipv4(int fd);
2ab6e591cf72 Add network listen functions that accept a family argument (AF_INET(6?)).
Paul Aurich <darkrain42@pidgin.im>
parents: 29935
diff changeset
920
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
921 /*@}*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
922
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
923
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
924 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
925 /** @name String Functions */
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
926 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
927 /*@{*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
928
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
929 /**
25859
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 24072
diff changeset
930 * Tests two strings for equality.
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 24072
diff changeset
931 *
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 24072
diff changeset
932 * Unlike strcmp(), this function will not crash if one or both of the
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
933 * strings are %NULL.
25859
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 24072
diff changeset
934 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
935 * @left: A string
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
936 * @right: A string to compare with left
25859
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 24072
diff changeset
937 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
938 * Returns: %TRUE if the strings are the same, else %FALSE.
25859
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 24072
diff changeset
939 */
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 24072
diff changeset
940 gboolean purple_strequal(const gchar *left, const gchar *right);
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 24072
diff changeset
941
b42be7bb9dac Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <darkrain42@pidgin.im>
parents: 24072
diff changeset
942 /**
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
943 * Normalizes a string, so that it is suitable for comparison.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
944 *
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
945 * The returned string will point to a static buffer, so if the
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
946 * string is intended to be kept long-term, you <i>must</i>
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
947 * g_strdup() it. Also, calling normalize() twice in the same line
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
948 * will lead to problems.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
949 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
950 * @account: The account the string belongs to, or NULL if you do
10433
04cf48e72655 [gaim-migrate @ 11689]
Mark Doliner <markdoliner@pidgin.im>
parents: 10425
diff changeset
951 * not know the account. If you use NULL, the string
36637
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36581
diff changeset
952 * will still be normalized, but if the protocol uses a
10433
04cf48e72655 [gaim-migrate @ 11689]
Mark Doliner <markdoliner@pidgin.im>
parents: 10425
diff changeset
953 * custom normalization function then the string may
04cf48e72655 [gaim-migrate @ 11689]
Mark Doliner <markdoliner@pidgin.im>
parents: 10425
diff changeset
954 * not be normalized correctly.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
955 * @str: The string to normalize.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
956 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
957 * Returns: A pointer to the normalized version stored in a static buffer.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
958 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
959 const char *purple_normalize(const PurpleAccount *account, const char *str);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
960
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
961 /**
11153
b5c721366f2d [gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents: 11137
diff changeset
962 * Normalizes a string, so that it is suitable for comparison.
b5c721366f2d [gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents: 11137
diff changeset
963 *
36637
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36581
diff changeset
964 * This is one possible implementation for the protocol callback
11153
b5c721366f2d [gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents: 11137
diff changeset
965 * function "normalize." It returns a lowercase and UTF-8
b5c721366f2d [gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents: 11137
diff changeset
966 * normalized version of the string.
b5c721366f2d [gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents: 11137
diff changeset
967 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
968 * @account: The account the string belongs to.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
969 * @str: The string to normalize.
11153
b5c721366f2d [gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents: 11137
diff changeset
970 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
971 * Returns: A pointer to the normalized version stored in a static buffer.
11153
b5c721366f2d [gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents: 11137
diff changeset
972 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
973 const char *purple_normalize_nocase(const PurpleAccount *account, const char *str);
11153
b5c721366f2d [gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents: 11137
diff changeset
974
b5c721366f2d [gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents: 11137
diff changeset
975 /**
33087
182da0516150 Libpurple: username validation support; Pidgin: use it in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33051
diff changeset
976 * Checks, if a string is valid.
182da0516150 Libpurple: username validation support; Pidgin: use it in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33051
diff changeset
977 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
978 * @protocol: The protocol the string belongs to.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
979 * @str: The string to validate.
33087
182da0516150 Libpurple: username validation support; Pidgin: use it in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33051
diff changeset
980 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
981 * Returns: TRUE, if string is valid, otherwise FALSE.
33087
182da0516150 Libpurple: username validation support; Pidgin: use it in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33051
diff changeset
982 */
36544
1bf8b6ef5aea Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents: 36543
diff changeset
983 gboolean purple_validate(const PurpleProtocol *protocol, const char *str);
33087
182da0516150 Libpurple: username validation support; Pidgin: use it in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33051
diff changeset
984
182da0516150 Libpurple: username validation support; Pidgin: use it in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33051
diff changeset
985 /**
7628
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
986 * Compares two strings to see if the first contains the second as
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
987 * a proper prefix.
8432
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
988 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
989 * @s: The string to check.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
990 * @p: The prefix in question.
8432
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
991 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
992 * Returns: TRUE if p is a prefix of s, otherwise FALSE.
7628
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
993 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
994 gboolean purple_str_has_prefix(const char *s, const char *p);
7628
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
995
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
996 /**
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
997 * Compares two strings to see if the second is a proper suffix
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
998 * of the first.
8432
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
999 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1000 * @s: The string to check.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1001 * @x: The suffix in question.
8432
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
1002 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1003 * Returns: TRUE if x is a a suffix of s, otherwise FALSE.
7628
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
1004 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1005 gboolean purple_str_has_suffix(const char *s, const char *x);
7628
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
1006
f76ce1d73e1c [gaim-migrate @ 8252]
Ethan Blanton <elb@pidgin.im>
parents: 7622
diff changeset
1007 /**
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1008 * Duplicates a string and replaces all newline characters from the
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1009 * source string with HTML linebreaks.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1010 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1011 * @src: The source string.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1012 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1013 * Returns: The new string. Must be g_free'd by the caller.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1014 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1015 gchar *purple_strdup_withhtml(const gchar *src);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1016
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1017 /**
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1018 * Ensures that all linefeeds have a matching carriage return.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1019 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1020 * @str: The source string.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1021 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1022 * Returns: The string with carriage returns.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1023 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1024 char *purple_str_add_cr(const char *str);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1025
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1026 /**
11920
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1027 * Strips all instances of the given character from the
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1028 * given string. The string is modified in place. This
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1029 * is useful for stripping new line characters, for example.
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1030 *
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1031 * Example usage:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1032 * purple_str_strip_char(my_dumb_string, '\n');
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1033 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1034 * @str: The string to strip characters from.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1035 * @thechar: The character to strip from the given string.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1036 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1037 void purple_str_strip_char(char *str, char thechar);
11920
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1038
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1039 /**
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1040 * Given a string, this replaces all instances of one character
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1041 * with another. This happens inline (the original string IS
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1042 * modified).
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1043 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1044 * @string: The string from which to replace stuff.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1045 * @delimiter: The character you want replaced.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1046 * @replacement: The character you want inserted in place
11920
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1047 * of the delimiting character.
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1048 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1049 void purple_util_chrreplace(char *string, char delimiter,
11920
be80617ec59b [gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11878
diff changeset
1050 char replacement);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1051
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1052 /**
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1053 * Given a string, this replaces one substring with another
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1054 * and returns a newly allocated string.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1055 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1056 * @string: The string from which to replace stuff.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1057 * @delimiter: The substring you want replaced.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1058 * @replacement: The substring you want inserted in place
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1059 * of the delimiting substring.
8461
920171a59e45 [gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents: 8442
diff changeset
1060 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1061 * Returns: A new string, after performing the substitution.
8461
920171a59e45 [gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents: 8442
diff changeset
1062 * free this with g_free().
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1063 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1064 gchar *purple_strreplace(const char *string, const char *delimiter,
8341
dc43b1acfc1a [gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents: 8163
diff changeset
1065 const char *replacement);
dc43b1acfc1a [gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents: 8163
diff changeset
1066
12813
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1067
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1068 /**
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1069 * Given a string, this replaces any utf-8 substrings in that string with
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1070 * the corresponding numerical character reference, and returns a newly
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1071 * allocated string.
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1072 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1073 * @in: The string which might contain utf-8 substrings
12813
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1074 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1075 * Returns: A new string, with utf-8 replaced with numerical character
12813
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1076 * references, free this with g_free()
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1077 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1078 char *purple_utf8_ncr_encode(const char *in);
12813
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1079
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1080
8341
dc43b1acfc1a [gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents: 8163
diff changeset
1081 /**
9171
2b50af5d8ea6 [gaim-migrate @ 9956]
Tim Ringenbach <marv@pidgin.im>
parents: 9045
diff changeset
1082 * Given a string, this replaces any numerical character references
2b50af5d8ea6 [gaim-migrate @ 9956]
Tim Ringenbach <marv@pidgin.im>
parents: 9045
diff changeset
1083 * in that string with the corresponding actual utf-8 substrings,
2b50af5d8ea6 [gaim-migrate @ 9956]
Tim Ringenbach <marv@pidgin.im>
parents: 9045
diff changeset
1084 * and returns a newly allocated string.
2b50af5d8ea6 [gaim-migrate @ 9956]
Tim Ringenbach <marv@pidgin.im>
parents: 9045
diff changeset
1085 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1086 * @in: The string which might contain numerical character references.
9171
2b50af5d8ea6 [gaim-migrate @ 9956]
Tim Ringenbach <marv@pidgin.im>
parents: 9045
diff changeset
1087 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1088 * Returns: A new string, with numerical character references
9171
2b50af5d8ea6 [gaim-migrate @ 9956]
Tim Ringenbach <marv@pidgin.im>
parents: 9045
diff changeset
1089 * replaced with actual utf-8, free this with g_free().
2b50af5d8ea6 [gaim-migrate @ 9956]
Tim Ringenbach <marv@pidgin.im>
parents: 9045
diff changeset
1090 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1091 char *purple_utf8_ncr_decode(const char *in);
9171
2b50af5d8ea6 [gaim-migrate @ 9956]
Tim Ringenbach <marv@pidgin.im>
parents: 9045
diff changeset
1092
12813
6f67cfa0e6a0 [gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents: 12483
diff changeset
1093
9171
2b50af5d8ea6 [gaim-migrate @ 9956]
Tim Ringenbach <marv@pidgin.im>
parents: 9045
diff changeset
1094 /**
8341
dc43b1acfc1a [gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents: 8163
diff changeset
1095 * Given a string, this replaces one substring with another
dc43b1acfc1a [gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents: 8163
diff changeset
1096 * ignoring case and returns a newly allocated string.
dc43b1acfc1a [gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents: 8163
diff changeset
1097 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1098 * @string: The string from which to replace stuff.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1099 * @delimiter: The substring you want replaced.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1100 * @replacement: The substring you want inserted in place
8341
dc43b1acfc1a [gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents: 8163
diff changeset
1101 * of the delimiting substring.
8461
920171a59e45 [gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents: 8442
diff changeset
1102 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1103 * Returns: A new string, after performing the substitution.
8461
920171a59e45 [gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents: 8442
diff changeset
1104 * free this with g_free().
8341
dc43b1acfc1a [gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents: 8163
diff changeset
1105 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1106 gchar *purple_strcasereplace(const char *string, const char *delimiter,
8341
dc43b1acfc1a [gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents: 8163
diff changeset
1107 const char *replacement);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1109 /**
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1110 * This is like strstr, except that it ignores ASCII case in
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1111 * searching for the substring.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1112 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1113 * @haystack: The string to search in.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1114 * @needle: The substring to find.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1115 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1116 * Returns: the location of the substring if found, or NULL if not
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1117 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1118 const char *purple_strcasestr(const char *haystack, const char *needle);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1119
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1120 /**
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1121 * Returns a string representing a filesize in the appropriate
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1122 * units (MB, KB, GB, etc.)
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1123 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1124 * @size: The size
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1125 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1126 * Returns: The string in units form. This must be freed.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1127 */
32663
1b87b3e98b0a Upgrade PurpleXfer for a 64-bit world.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32597
diff changeset
1128 char *purple_str_size_to_units(goffset size);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1129
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1130 /**
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1131 * Converts seconds into a human-readable form.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1132 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1133 * @sec: The seconds.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1134 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1135 * Returns: A human-readable form, containing days, hours, minutes, and
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1136 * seconds.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1137 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1138 char *purple_str_seconds_to_string(guint sec);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1139
9277
08d5a10f91c6 [gaim-migrate @ 10080]
Tim Ringenbach <marv@pidgin.im>
parents: 9227
diff changeset
1140 /**
08d5a10f91c6 [gaim-migrate @ 10080]
Tim Ringenbach <marv@pidgin.im>
parents: 9227
diff changeset
1141 * Converts a binary string into a NUL terminated ascii string,
08d5a10f91c6 [gaim-migrate @ 10080]
Tim Ringenbach <marv@pidgin.im>
parents: 9227
diff changeset
1142 * replacing nonascii characters and characters below SPACE (including
9307
a446c1ba05ee [gaim-migrate @ 10115]
Gary Kramlich <grim@pidgin.im>
parents: 9284
diff changeset
1143 * NUL) into \\xyy, where yy are two hex digits. Also backslashes are
a446c1ba05ee [gaim-migrate @ 10115]
Gary Kramlich <grim@pidgin.im>
parents: 9284
diff changeset
1144 * changed into two backslashes (\\\\). The returned, newly allocated
a446c1ba05ee [gaim-migrate @ 10115]
Gary Kramlich <grim@pidgin.im>
parents: 9284
diff changeset
1145 * string can be outputted to the console, and must be g_free()d.
9277
08d5a10f91c6 [gaim-migrate @ 10080]
Tim Ringenbach <marv@pidgin.im>
parents: 9227
diff changeset
1146 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1147 * @binary: A string of random data, possibly with embedded NULs
9277
08d5a10f91c6 [gaim-migrate @ 10080]
Tim Ringenbach <marv@pidgin.im>
parents: 9227
diff changeset
1148 * and such.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1149 * @len: The length in bytes of the input string. Must not be 0.
9277
08d5a10f91c6 [gaim-migrate @ 10080]
Tim Ringenbach <marv@pidgin.im>
parents: 9227
diff changeset
1150 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1151 * Returns: A newly allocated ASCIIZ string.
9277
08d5a10f91c6 [gaim-migrate @ 10080]
Tim Ringenbach <marv@pidgin.im>
parents: 9227
diff changeset
1152 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1153 char *purple_str_binary_to_ascii(const unsigned char *binary, guint len);
34145
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33773
diff changeset
1154
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33773
diff changeset
1155 /**
34171
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1156 * Calculates UTF-16 string size (in bytes).
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1157 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1158 * @str: String to check.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1159 * Returns: Number of bytes (including NUL character) that string occupies.
34171
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1160 */
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1161 size_t purple_utf16_size(const gunichar2 *str);
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1162
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1163 /**
34145
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33773
diff changeset
1164 * Fills a NUL-terminated string with zeros and frees it.
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33773
diff changeset
1165 *
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33773
diff changeset
1166 * It should be used to free sensitive data, like passwords.
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33773
diff changeset
1167 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1168 * @str: A NUL-terminated string to free, or a NULL-pointer.
34145
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33773
diff changeset
1169 */
fa72f1e5cd77 Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33773
diff changeset
1170 void purple_str_wipe(gchar *str);
34171
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1171
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1172 /**
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1173 * Fills a NUL-terminated UTF-16 string with zeros and frees it.
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1174 *
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1175 * It should be used to free sensitive data, like passwords.
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1176 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1177 * @str: A NUL-terminated string to free, or a NULL-pointer.
34171
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1178 */
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1179 void purple_utf16_wipe(gunichar2 *str);
a23f3228c465 New keyring: store passwords using Windows credentials
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34145
diff changeset
1180
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1181 /*@}*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1182
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1183
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1184 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1185 /** @name URI/URL Functions */
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1186 /**************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1187 /*@{*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1188
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1189 void purple_got_protocol_handler_uri(const char *uri);
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15482
diff changeset
1190
7107
903864ff76c3 [gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents: 7106
diff changeset
1191 /**
7134
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1192 * Decodes a URL into a plain string.
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1193 *
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1194 * This will change hex codes and such to their ascii equivalents.
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1195 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1196 * @str: The string to translate.
7134
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1197 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1198 * Returns: The resulting string.
7162
dfd30c70acde [gaim-migrate @ 7729]
Nathan Walp <nwalp@pidgin.im>
parents: 7134
diff changeset
1199 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1200 const char *purple_url_decode(const char *str);
7134
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1201
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1202 /**
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1203 * Encodes a URL into an escaped string.
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1204 *
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1205 * This will change non-alphanumeric characters to hex codes.
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1206 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1207 * @str: The string to translate.
7134
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1208 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1209 * Returns: The resulting string.
7134
e999c4697e38 [gaim-migrate @ 7701]
Sean Egan <seanegan@pidgin.im>
parents: 7123
diff changeset
1210 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1211 const char *purple_url_encode(const char *str);
6982
12f08de92674 [gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents: 6861
diff changeset
1212
9045
c665ceb89b85 [gaim-migrate @ 9821]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9000
diff changeset
1213 /**
c665ceb89b85 [gaim-migrate @ 9821]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9000
diff changeset
1214 * Checks if the given email address is syntactically valid.
c665ceb89b85 [gaim-migrate @ 9821]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9000
diff changeset
1215 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1216 * @address: The email address to validate.
9045
c665ceb89b85 [gaim-migrate @ 9821]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9000
diff changeset
1217 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1218 * Returns: True if the email address is syntactically correct.
9045
c665ceb89b85 [gaim-migrate @ 9821]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9000
diff changeset
1219 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1220 gboolean purple_email_is_valid(const char *address);
9045
c665ceb89b85 [gaim-migrate @ 9821]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 9000
diff changeset
1221
9670
4e8cb7ef72ab [gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents: 9642
diff changeset
1222 /**
32597
4918c93aef88 purple_ip_address_is_valid() now checks for an IPv4 or IPv6 address.
Andrew Victor <andrew.victor@mxit.com>
parents: 32596
diff changeset
1223 * Checks if the given IP address is a syntactically valid IPv4 or
4918c93aef88 purple_ip_address_is_valid() now checks for an IPv4 or IPv6 address.
Andrew Victor <andrew.victor@mxit.com>
parents: 32596
diff changeset
1224 * IPv6 address.
4918c93aef88 purple_ip_address_is_valid() now checks for an IPv4 or IPv6 address.
Andrew Victor <andrew.victor@mxit.com>
parents: 32596
diff changeset
1225 * If you specifically want to check for an IPv4 address use
4918c93aef88 purple_ip_address_is_valid() now checks for an IPv4 or IPv6 address.
Andrew Victor <andrew.victor@mxit.com>
parents: 32596
diff changeset
1226 * purple_ipv4_address_is_valid(), or for an IPv6 address use
4918c93aef88 purple_ip_address_is_valid() now checks for an IPv4 or IPv6 address.
Andrew Victor <andrew.victor@mxit.com>
parents: 32596
diff changeset
1227 * purple_ipv6_address_is_valid().
22468
c0f99a22627f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22133
diff changeset
1228 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1229 * @ip: The IP address to validate.
22468
c0f99a22627f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22133
diff changeset
1230 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1231 * Returns: True if the IP address is syntactically correct.
22468
c0f99a22627f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22133
diff changeset
1232 */
c0f99a22627f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22133
diff changeset
1233 gboolean purple_ip_address_is_valid(const char *ip);
c0f99a22627f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22133
diff changeset
1234
c0f99a22627f Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 22133
diff changeset
1235 /**
27727
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1236 * Checks if the given IP address is a syntactically valid IPv4 address.
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1237 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1238 * @ip: The IP address to validate.
27727
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1239 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1240 * Returns: True if the IP address is syntactically correct.
27727
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1241 */
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1242 gboolean purple_ipv4_address_is_valid(const char *ip);
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1243
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1244 /**
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1245 * Checks if the given IP address is a syntactically valid IPv6 address.
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1246 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1247 * @ip: The IP address to validate.
27727
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1248 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1249 * Returns: True if the IP address is syntactically correct.
27727
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1250 */
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1251 gboolean purple_ipv6_address_is_valid(const char *ip);
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1252
0c888674bbfc Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <darkrain42@pidgin.im>
parents: 27653
diff changeset
1253 /**
11135
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1254 * This function extracts a list of URIs from the a "text/uri-list"
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1255 * string. It was "borrowed" from gnome_uri_list_extract_uris
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1256 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1257 * @uri_list: An uri-list in the standard format.
9670
4e8cb7ef72ab [gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents: 9642
diff changeset
1258 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1259 * Returns: A GList containing strings allocated with g_malloc
11135
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1260 * that have been splitted from uri-list.
9670
4e8cb7ef72ab [gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents: 9642
diff changeset
1261 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1262 GList *purple_uri_list_extract_uris(const gchar *uri_list);
9670
4e8cb7ef72ab [gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents: 9642
diff changeset
1263
4e8cb7ef72ab [gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents: 9642
diff changeset
1264 /**
11135
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1265 * This function extracts a list of filenames from a
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1266 * "text/uri-list" string. It was "borrowed" from
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1267 * gnome_uri_list_extract_filenames
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1268 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1269 * @uri_list: A uri-list in the standard format.
9670
4e8cb7ef72ab [gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents: 9642
diff changeset
1270 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1271 * Returns: A GList containing strings allocated with g_malloc that
11135
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1272 * contain the filenames in the uri-list. Note that unlike
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1273 * purple_uri_list_extract_uris() function, this will discard
11135
063678d038f9 [gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents: 11132
diff changeset
1274 * any non-file uri from the result value.
9670
4e8cb7ef72ab [gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents: 9642
diff changeset
1275 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1276 GList *purple_uri_list_extract_filenames(const gchar *uri_list);
9670
4e8cb7ef72ab [gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents: 9642
diff changeset
1277
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1278 /*@}*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1279
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1280 /**************************************************************************
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1281 * UTF8 String Functions
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1282 **************************************************************************/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1283 /*@{*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1284
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1285 /**
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1286 * Attempts to convert a string to UTF-8 from an unknown encoding.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1287 *
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1288 * This function checks the locale and tries sane defaults.
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1289 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1290 * @str: The source string.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1291 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1292 * Returns: The UTF-8 string, or %NULL if it could not be converted.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1293 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1294 gchar *purple_utf8_try_convert(const char *str);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1295
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1296 /**
10258
21cfe876ca17 [gaim-migrate @ 11400]
Ethan Blanton <elb@pidgin.im>
parents: 10203
diff changeset
1297 * Salvages the valid UTF-8 characters from a string, replacing any
21cfe876ca17 [gaim-migrate @ 11400]
Ethan Blanton <elb@pidgin.im>
parents: 10203
diff changeset
1298 * invalid characters with a filler character (currently hardcoded to
21cfe876ca17 [gaim-migrate @ 11400]
Ethan Blanton <elb@pidgin.im>
parents: 10203
diff changeset
1299 * '?').
21cfe876ca17 [gaim-migrate @ 11400]
Ethan Blanton <elb@pidgin.im>
parents: 10203
diff changeset
1300 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1301 * @str: The source string.
10258
21cfe876ca17 [gaim-migrate @ 11400]
Ethan Blanton <elb@pidgin.im>
parents: 10203
diff changeset
1302 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1303 * Returns: A valid UTF-8 string.
10258
21cfe876ca17 [gaim-migrate @ 11400]
Ethan Blanton <elb@pidgin.im>
parents: 10203
diff changeset
1304 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1305 gchar *purple_utf8_salvage(const char *str);
10258
21cfe876ca17 [gaim-migrate @ 11400]
Ethan Blanton <elb@pidgin.im>
parents: 10203
diff changeset
1306
21cfe876ca17 [gaim-migrate @ 11400]
Ethan Blanton <elb@pidgin.im>
parents: 10203
diff changeset
1307 /**
27237
0643ac0e5658 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <darkrain42@pidgin.im>
parents: 27234
diff changeset
1308 * Removes unprintable characters from a UTF-8 string. These characters
0643ac0e5658 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <darkrain42@pidgin.im>
parents: 27234
diff changeset
1309 * (in particular low-ASCII characters) are invalid in XML 1.0 and thus
28384
e167fb02072e Hmm, g_unichar_isgraph is too restrictive in the characters allowed (it munges \t). Change purple_utf8_strip_unprintables to simply remove ASCII control characters instead.
Paul Aurich <darkrain42@pidgin.im>
parents: 27727
diff changeset
1310 * are not allowed in XMPP and are rejected by libxml2 by default.
e167fb02072e Hmm, g_unichar_isgraph is too restrictive in the characters allowed (it munges \t). Change purple_utf8_strip_unprintables to simply remove ASCII control characters instead.
Paul Aurich <darkrain42@pidgin.im>
parents: 27727
diff changeset
1311 *
e167fb02072e Hmm, g_unichar_isgraph is too restrictive in the characters allowed (it munges \t). Change purple_utf8_strip_unprintables to simply remove ASCII control characters instead.
Paul Aurich <darkrain42@pidgin.im>
parents: 27727
diff changeset
1312 * The returned string must be freed by the caller.
27237
0643ac0e5658 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <darkrain42@pidgin.im>
parents: 27234
diff changeset
1313 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1314 * @str: A valid UTF-8 string.
27237
0643ac0e5658 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <darkrain42@pidgin.im>
parents: 27234
diff changeset
1315 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1316 * Returns: A newly allocated UTF-8 string without the unprintable characters.
27237
0643ac0e5658 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <darkrain42@pidgin.im>
parents: 27234
diff changeset
1317 */
0643ac0e5658 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <darkrain42@pidgin.im>
parents: 27234
diff changeset
1318 gchar *purple_utf8_strip_unprintables(const gchar *str);
0643ac0e5658 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <darkrain42@pidgin.im>
parents: 27234
diff changeset
1319
0643ac0e5658 Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <darkrain42@pidgin.im>
parents: 27234
diff changeset
1320 /**
21977
c87889698afb Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <markdoliner@pidgin.im>
parents: 21238
diff changeset
1321 * Return the UTF-8 version of gai_strerror(). It calls gai_strerror()
c87889698afb Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <markdoliner@pidgin.im>
parents: 21238
diff changeset
1322 * then converts the result to UTF-8. This function is analogous to
c87889698afb Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <markdoliner@pidgin.im>
parents: 21238
diff changeset
1323 * g_strerror().
c87889698afb Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <markdoliner@pidgin.im>
parents: 21238
diff changeset
1324 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1325 * @errnum: The error code.
21977
c87889698afb Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <markdoliner@pidgin.im>
parents: 21238
diff changeset
1326 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1327 * Returns: The UTF-8 error message.
21977
c87889698afb Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <markdoliner@pidgin.im>
parents: 21238
diff changeset
1328 */
32737
44c6902e2348 G_CONST_RETURN has been deprecated, use const instead
Gary Kramlich <grim@reaperworld.com>
parents: 32663
diff changeset
1329 const gchar *purple_gai_strerror(gint errnum);
21977
c87889698afb Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <markdoliner@pidgin.im>
parents: 21238
diff changeset
1330
c87889698afb Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <markdoliner@pidgin.im>
parents: 21238
diff changeset
1331 /**
25591
b19ece4232c1 I'm pretty sure this is what we meant here.
Etan Reisner <deryni@pidgin.im>
parents: 24072
diff changeset
1332 * Compares two UTF-8 strings case-insensitively. This comparison is
16213
63bfcae0d7c9 Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents: 16144
diff changeset
1333 * more expensive than a simple g_utf8_collate() comparison because
63bfcae0d7c9 Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents: 16144
diff changeset
1334 * it calls g_utf8_casefold() on each string, which allocates new
63bfcae0d7c9 Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents: 16144
diff changeset
1335 * strings.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1336 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1337 * @a: The first string.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1338 * @b: The second string.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1339 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1340 * Returns: -1 if @a a is less than @a b.
35175
647c1ffb8147 Oops, changed the wrong param in previous commit
Ankit Vani <a@nevitus.org>
parents: 35174
diff changeset
1341 * 0 if @a a is equal to @a b.
647c1ffb8147 Oops, changed the wrong param in previous commit
Ankit Vani <a@nevitus.org>
parents: 35174
diff changeset
1342 * 1 if @a a is greater than @a b.
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1343 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1344 int purple_utf8_strcasecmp(const char *a, const char *b);
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1345
7564
baab99d239d8 [gaim-migrate @ 8180]
Nathan Walp <nwalp@pidgin.im>
parents: 7478
diff changeset
1346 /**
11552
674a2a79943a [gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents: 11501
diff changeset
1347 * Case insensitive search for a word in a string. The needle string
674a2a79943a [gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents: 11501
diff changeset
1348 * must be contained in the haystack string and not be immediately
674a2a79943a [gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents: 11501
diff changeset
1349 * preceded or immediately followed by another alpha-numeric character.
674a2a79943a [gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents: 11501
diff changeset
1350 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1351 * @haystack: The string to search in.
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1352 * @needle: The substring to find.
11552
674a2a79943a [gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents: 11501
diff changeset
1353 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1354 * Returns: TRUE if haystack has the word, otherwise FALSE
11552
674a2a79943a [gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents: 11501
diff changeset
1355 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1356 gboolean purple_utf8_has_word(const char *haystack, const char *needle);
11552
674a2a79943a [gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents: 11501
diff changeset
1357
674a2a79943a [gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents: 11501
diff changeset
1358 /**
13090
aee4ed853ff3 [gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents: 13033
diff changeset
1359 * Prints a UTF-8 message to the given file stream. The function
aee4ed853ff3 [gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents: 13033
diff changeset
1360 * tries to convert the UTF-8 message to user's locale. If this
aee4ed853ff3 [gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents: 13033
diff changeset
1361 * is not possible, the original UTF-8 text will be printed.
aee4ed853ff3 [gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents: 13033
diff changeset
1362 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1363 * @filestream: The file stream (e.g. STDOUT or STDERR)
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1364 * @message: The message to print.
13090
aee4ed853ff3 [gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents: 13033
diff changeset
1365 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1366 void purple_print_utf8_to_console(FILE *filestream, char *message);
13090
aee4ed853ff3 [gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents: 13033
diff changeset
1367
aee4ed853ff3 [gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents: 13033
diff changeset
1368 /**
18413
ae04f38e5b31 Remove static meify from yahoochat.c and replace use of it with
Will Thompson <resiak@pidgin.im>
parents: 18317
diff changeset
1369 * Checks for messages starting (post-HTML) with "/me ", including the space.
7564
baab99d239d8 [gaim-migrate @ 8180]
Nathan Walp <nwalp@pidgin.im>
parents: 7478
diff changeset
1370 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1371 * @message: The message to check
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1372 * @len: The message length, or -1
7564
baab99d239d8 [gaim-migrate @ 8180]
Nathan Walp <nwalp@pidgin.im>
parents: 7478
diff changeset
1373 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1374 * Returns: TRUE if it starts with "/me ", and it has been removed, otherwise
18413
ae04f38e5b31 Remove static meify from yahoochat.c and replace use of it with
Will Thompson <resiak@pidgin.im>
parents: 18317
diff changeset
1375 * FALSE
7564
baab99d239d8 [gaim-migrate @ 8180]
Nathan Walp <nwalp@pidgin.im>
parents: 7478
diff changeset
1376 */
19585
14b519abcc26 Fix some conversion warnings about using negative values with unsigned types. There are more, but these were easy fixes. You may think that I'm changing the API, but I'm really not - it was just wrong.
Daniel Atallah <datallah@pidgin.im>
parents: 18413
diff changeset
1377 gboolean purple_message_meify(char *message, gssize len);
7564
baab99d239d8 [gaim-migrate @ 8180]
Nathan Walp <nwalp@pidgin.im>
parents: 7478
diff changeset
1378
7889
34cc5467bf55 [gaim-migrate @ 8547]
Nathan Walp <nwalp@pidgin.im>
parents: 7821
diff changeset
1379 /**
34cc5467bf55 [gaim-migrate @ 8547]
Nathan Walp <nwalp@pidgin.im>
parents: 7821
diff changeset
1380 * Removes the underscore characters from a string used identify the mnemonic
34cc5467bf55 [gaim-migrate @ 8547]
Nathan Walp <nwalp@pidgin.im>
parents: 7821
diff changeset
1381 * character.
34cc5467bf55 [gaim-migrate @ 8547]
Nathan Walp <nwalp@pidgin.im>
parents: 7821
diff changeset
1382 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1383 * @in: The string to strip
7889
34cc5467bf55 [gaim-migrate @ 8547]
Nathan Walp <nwalp@pidgin.im>
parents: 7821
diff changeset
1384 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1385 * Returns: The stripped string
7889
34cc5467bf55 [gaim-migrate @ 8547]
Nathan Walp <nwalp@pidgin.im>
parents: 7821
diff changeset
1386 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1387 char *purple_text_strip_mnemonic(const char *in);
7889
34cc5467bf55 [gaim-migrate @ 8547]
Nathan Walp <nwalp@pidgin.im>
parents: 7821
diff changeset
1388
7108
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1389 /*@}*/
82655fa54acb [gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents: 7107
diff changeset
1390
8432
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
1391 /**
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
1392 * Adds 8 to something.
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
1393 *
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
1394 * Blame SimGuy.
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
1395 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1396 * @x: The number to add 8 to.
8432
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
1397 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1398 * Returns: x + 8
8432
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
1399 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1400 #define purple_add_eight(x) ((x)+8)
8432
45a8b2b8c1ed [gaim-migrate @ 9162]
Kevin Stange <kstange@pidgin.im>
parents: 8341
diff changeset
1401
9926
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1402 /**
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1403 * Does the reverse of purple_escape_filename
9926
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1404 *
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1405 * This will change hex codes and such to their ascii equivalents.
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1406 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1407 * @str: The string to translate.
9926
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1408 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1409 * Returns: The resulting string.
9926
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1410 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1411 const char *purple_unescape_filename(const char *str);
9926
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1412
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1413 /**
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1414 * Escapes filesystem-unfriendly characters from a filename
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1415 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1416 * @str: The string to translate.
9926
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1417 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1418 * Returns: The resulting string.
9926
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1419 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1420 const char *purple_escape_filename(const char *str);
9926
9957e01fd88a [gaim-migrate @ 10818]
Nathan Walp <nwalp@pidgin.im>
parents: 9670
diff changeset
1421
15482
b943b932a41b Make sure the pounces, buddy-aliases, savedstatuses etc. saved before the aim/icq split works after the split. The util function _gaim_oscar_convert will be removed at a 'suitable' time in the future.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15435
diff changeset
1422 /**
33537
4998e86453d0 GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33440
diff changeset
1423 * Escapes javascript-unfriendly substrings from a string.
4998e86453d0 GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33440
diff changeset
1424 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1425 * @str: The string to escape.
29935
d28b5dcc7554 Remove a bunch of old references to prpl-oscar
Mark Doliner <markdoliner@pidgin.im>
parents: 29697
diff changeset
1426 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1427 * Returns: The javascript-safe string (must be g_free'd after use).
15482
b943b932a41b Make sure the pounces, buddy-aliases, savedstatuses etc. saved before the aim/icq split works after the split. The util function _gaim_oscar_convert will be removed at a 'suitable' time in the future.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 15435
diff changeset
1428 */
33537
4998e86453d0 GTK debug window: append using js, not html
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33440
diff changeset
1429 gchar * purple_escape_js(const gchar *str);
15707
e9d3280caf69 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents: 15678
diff changeset
1430
e9d3280caf69 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents: 15678
diff changeset
1431 /**
e9d3280caf69 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents: 15678
diff changeset
1432 * Restore default signal handlers for signals which might reasonably have
e9d3280caf69 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents: 15678
diff changeset
1433 * handlers. This should be called by a fork()'d child process, since child processes
e9d3280caf69 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents: 15678
diff changeset
1434 * inherit the handlers of the parent.
e9d3280caf69 Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents: 15678
diff changeset
1435 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1436 void purple_restore_default_signal_handlers(void);
16437
7ff7c3405ea2 Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents: 16262
diff changeset
1437
23850
b68e174fffc2 Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23325
diff changeset
1438 /**
b68e174fffc2 Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23325
diff changeset
1439 * Gets the host name of the machine. If it not possible to determine the
b68e174fffc2 Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23325
diff changeset
1440 * host name, "localhost" is returned
b68e174fffc2 Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23325
diff changeset
1441 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1442 * Returns: (TODO const): The hostname
23850
b68e174fffc2 Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23325
diff changeset
1443 */
b68e174fffc2 Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23325
diff changeset
1444 const gchar *purple_get_host_name(void);
b68e174fffc2 Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23325
diff changeset
1445
29538
f1c9c6791e98 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <malu@pidgin.im>
parents: 28423
diff changeset
1446 /**
f1c9c6791e98 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <malu@pidgin.im>
parents: 28423
diff changeset
1447 * Returns a type 4 (random) UUID
f1c9c6791e98 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <malu@pidgin.im>
parents: 28423
diff changeset
1448 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1449 * Returns: A UUID, caller is responsible for freeing it
29538
f1c9c6791e98 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <malu@pidgin.im>
parents: 28423
diff changeset
1450 */
f1c9c6791e98 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <malu@pidgin.im>
parents: 28423
diff changeset
1451 gchar *purple_uuid_random(void);
f1c9c6791e98 Broke out the generation of random UUIDs to its own function
Marcus Lundblad <malu@pidgin.im>
parents: 28423
diff changeset
1452
34479
7d4651f1035e Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
1453 /**
7d4651f1035e Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
1454 * Sets given pointer to NULL.
7d4651f1035e Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
1455 *
7d4651f1035e Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
1456 * Function designed to be used as a GDestroyNotify callback.
7d4651f1035e Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
1457 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1458 * @data: A pointer to variable, which should be set to NULL.
34479
7d4651f1035e Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
1459 */
7d4651f1035e Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
1460 void purple_callback_set_zero(gpointer data);
7d4651f1035e Plugins API: add an option to provide plugin configuration using Request API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34218
diff changeset
1461
35045
bb1643dab0c5 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 35005 34479
diff changeset
1462 /**
34808
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1463 * Creates a new GValue of the specified type.
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1464 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1465 * @type: The type of data to be held by the GValue
34808
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1466 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1467 * Returns: The created GValue
34808
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1468 */
35005
bff56dfca65d Renamed purple_g_value_* to purple_value_*
Ankit Vani <a@nevitus.org>
parents: 34935
diff changeset
1469 GValue *purple_value_new(GType type);
34808
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1470
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1471 /**
34822
5c3970547cda Added purple_g_value_dup() to util
Ankit Vani <a@nevitus.org>
parents: 34808
diff changeset
1472 * Duplicates a GValue.
5c3970547cda Added purple_g_value_dup() to util
Ankit Vani <a@nevitus.org>
parents: 34808
diff changeset
1473 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1474 * @value: The GValue to duplicate
34822
5c3970547cda Added purple_g_value_dup() to util
Ankit Vani <a@nevitus.org>
parents: 34808
diff changeset
1475 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1476 * Returns: The duplicated GValue
34822
5c3970547cda Added purple_g_value_dup() to util
Ankit Vani <a@nevitus.org>
parents: 34808
diff changeset
1477 */
35005
bff56dfca65d Renamed purple_g_value_* to purple_value_*
Ankit Vani <a@nevitus.org>
parents: 34935
diff changeset
1478 GValue *purple_value_dup(GValue *value);
34822
5c3970547cda Added purple_g_value_dup() to util
Ankit Vani <a@nevitus.org>
parents: 34808
diff changeset
1479
5c3970547cda Added purple_g_value_dup() to util
Ankit Vani <a@nevitus.org>
parents: 34808
diff changeset
1480 /**
34808
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1481 * Frees a GValue.
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1482 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1483 * @value: The GValue to free.
34808
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1484 */
35005
bff56dfca65d Renamed purple_g_value_* to purple_value_*
Ankit Vani <a@nevitus.org>
parents: 34935
diff changeset
1485 void purple_value_free(GValue *value);
34808
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1486
442af3e72671 Added purple_g_value_new() and purple_g_value_free() to util
Ankit Vani <a@nevitus.org>
parents: 34614
diff changeset
1487 /**
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1488 * Calculates a session key for HTTP Digest authentation
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1489 *
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1490 * See RFC 2617 for more information.
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1491 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1492 * @algorithm: The hash algorithm to use
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1493 * @username: The username provided by the user
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1494 * @realm: The authentication realm provided by the server
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1495 * @password: The password provided by the user
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1496 * @nonce: The nonce provided by the server
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1497 * @client_nonce: The nonce provided by the client
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1498 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1499 * Returns: The session key, or %NULL if an error occurred.
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1500 */
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1501 gchar *purple_http_digest_calculate_session_key(
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1502 const gchar *algorithm, const gchar *username,
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1503 const gchar *realm, const gchar *password,
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1504 const gchar *nonce, const gchar *client_nonce);
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1505
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1506 /** Calculate a response for HTTP Digest authentication
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1507 *
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1508 * See RFC 2617 for more information.
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1509 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1510 * @algorithm: The hash algorithm to use
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1511 * @method: The HTTP method in use
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1512 * @digest_uri: The URI from the initial request
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1513 * @qop: The "quality of protection"
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1514 * @entity: The entity body
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1515 * @nonce: The nonce provided by the server
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1516 * @nonce_count: The nonce count
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1517 * @client_nonce: The nonce provided by the client
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1518 * @session_key: The session key from purple_cipher_http_digest_calculate_session_key()
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1519 *
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
1520 * Returns: The hashed response, or %NULL if an error occurred.
34533
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1521 */
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1522 gchar *purple_http_digest_calculate_response(
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1523 const gchar *algorithm, const gchar *method,
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1524 const gchar *digest_uri, const gchar *qop,
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1525 const gchar *entity, const gchar *nonce,
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1526 const gchar *nonce_count, const gchar *client_nonce,
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1527 const gchar *session_key);
74b179b1e8ef GObjectify the PurpleCipher structure
Ankit Vani <a@nevitus.org>
parents: 34171
diff changeset
1528
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32737
diff changeset
1529 G_END_DECLS
5944
f19df037ac58 [gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents: 5943
diff changeset
1530
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15707
diff changeset
1531 #endif /* _PURPLE_UTIL_H_ */

mercurial