Mercurial > pidgin
annotate libpurple/util.h @ 28710:fed4286634e7
propagate from branch 'im.pidgin.pidgin' (head d2984fa9ffdaa63b01cc1e0d94aec5622cd080c1)
to branch 'im.pidgin.cpw.darkrain42.xmpp.scram' (head a046e925c84f1af65cc0bf41cc8ce55ba7ff3213)
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Tue, 17 Nov 2009 19:23:05 +0000 |
parents | 63cb8c4f3c66 |
children | a8e19b69e6b4 ecd2136ff818 |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 * @file util.h Utility Functions |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * @ingroup core |
20074
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19681
diff
changeset
|
4 */ |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19681
diff
changeset
|
5 |
6bf32c9e15a7
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents:
19681
diff
changeset
|
6 /* purple |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
15822 | 8 * Purple is the legal property of its developers, whose names are too numerous |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19500
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 * |
15822 | 26 * @todo Rename the functions so that they live somewhere in the purple |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 * namespace. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 */ |
15822 | 29 #ifndef _PURPLE_UTIL_H_ |
30 #define _PURPLE_UTIL_H_ | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include <stdio.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 |
28138
63cb8c4f3c66
Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents:
28101
diff
changeset
|
34 /** |
63cb8c4f3c66
Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents:
28101
diff
changeset
|
35 * An opaque structure representing a URL request. Can be used to cancel |
63cb8c4f3c66
Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents:
28101
diff
changeset
|
36 * the request. |
63cb8c4f3c66
Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents:
28101
diff
changeset
|
37 */ |
26438
fd97c0de433d
Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
38 typedef struct _PurpleUtilFetchUrlData PurpleUtilFetchUrlData; |
28138
63cb8c4f3c66
Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents:
28101
diff
changeset
|
39 /** @copydoc _PurpleMenuAction */ |
26438
fd97c0de433d
Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
40 typedef struct _PurpleMenuAction PurpleMenuAction; |
28138
63cb8c4f3c66
Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents:
28101
diff
changeset
|
41 /** @copydoc _PurpleKeyValuePair */ |
26438
fd97c0de433d
Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
42 typedef struct _PurpleKeyValuePair PurpleKeyValuePair; |
fd97c0de433d
Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
43 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "account.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 #include "xmlnode.h" |
18039
c588a4a9d287
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents:
17765
diff
changeset
|
46 #include "notify.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 |
26438
fd97c0de433d
Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
48 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 #ifdef __cplusplus |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 extern "C" { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
51 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 |
26438
fd97c0de433d
Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
53 struct _PurpleMenuAction |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 char *label; |
15822 | 56 PurpleCallback callback; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 gpointer data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 GList *children; |
26438
fd97c0de433d
Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
59 }; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 |
15822 | 61 typedef char *(*PurpleInfoFieldFormatCallback)(const char *field, size_t len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 * A key-value pair. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 * |
15822 | 66 * This is used by, among other things, purple_gtk_combo* functions to pass in a |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 * list of key-value pairs so it can display a user-friendly value. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 */ |
26438
fd97c0de433d
Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
69 struct _PurpleKeyValuePair |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 gchar *key; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 void *value; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 |
26438
fd97c0de433d
Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents:
25947
diff
changeset
|
74 }; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 /** |
15822 | 77 * Creates a new PurpleMenuAction. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 * @param label The text label to display for this action. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 * @param callback The function to be called when the action is used on |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 * the selected item. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 * @param data Additional data to be passed to the callback. |
15822 | 83 * @param children A GList of PurpleMenuActions to be added as a submenu |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 * of the action. |
15822 | 85 * @return The PurpleMenuAction. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 */ |
15822 | 87 PurpleMenuAction *purple_menu_action_new(const char *label, PurpleCallback callback, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 gpointer data, GList *children); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 /** |
15822 | 91 * Frees a PurpleMenuAction |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 * |
15822 | 93 * @param act The PurpleMenuAction to free. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 */ |
15822 | 95 void purple_menu_action_free(PurpleMenuAction *act); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 |
22000
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
97 /** |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
98 * Set the appropriate presence values for the currently playing song. |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
99 * |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
100 * @param title The title of the song, @c NULL to unset the value. |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
101 * @param artist The artist of the song, can be @c NULL. |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
102 * @param album The album of the song, can be @c NULL. |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
103 * @since 2.4.0 |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
104 */ |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
105 void purple_util_set_current_song(const char *title, const char *artist, |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
106 const char *album); |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
107 |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
108 /** |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
109 * Format song information. |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
110 * |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
111 * @param title The title of the song, @c NULL to unset the value. |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
112 * @param artist The artist of the song, can be @c NULL. |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
113 * @param album The album of the song, can be @c NULL. |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
114 * @param unused Currently unused, must be @c NULL. |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
115 * |
28138
63cb8c4f3c66
Fix a bunch of doxygen warnings.
Paul Aurich <paul@darkrain42.org>
parents:
28101
diff
changeset
|
116 * @return The formatted string. The caller must g_free the returned string. |
22000
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
117 * @since 2.4.0 |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
118 */ |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
119 char * purple_util_format_song_info(const char *title, const char *artist, |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
120 const char *album, gpointer unused); |
af0426c34c27
Utility functions to set and format song information. Closes #4398.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21895
diff
changeset
|
121 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
122 /**************************************************************************/ |
21248
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
123 /** @name Utility Subsystem */ |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
124 /**************************************************************************/ |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
125 /*@{*/ |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
126 |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
127 /** |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
128 * Initializes the utility subsystem. |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
129 * |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
130 * @since 2.3.0 |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
131 */ |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
132 void purple_util_init(void); |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
133 |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
134 /** |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
135 * Uninitializes the util subsystem. |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
136 * |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
137 * @since 2.3.0 |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
138 */ |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
139 void purple_util_uninit(void); |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
140 |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
141 /*@}*/ |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
142 |
5915ad785ee7
Add and call a purple_util_uninit() to free user_dir and customer_home_dir
Richard Laager <rlaager@wiktel.com>
parents:
20334
diff
changeset
|
143 /**************************************************************************/ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 /** @name Base16 Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 * Converts a chunk of binary data to its base-16 equivalent. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 * @param data The data to convert. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
152 * @param len The length of the data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 * @return The base-16 string in the ASCII encoding. Must be |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 * g_free'd when no longer needed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 * |
15822 | 157 * @see purple_base16_decode() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 */ |
15822 | 159 gchar *purple_base16_encode(const guchar *data, gsize len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 * Converts an ASCII string of base-16 encoded data to |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 * the binary equivalent. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
164 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 * @param str The base-16 string to convert to raw data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 * @param ret_len The length of the returned data. You can |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 * pass in NULL if you're sure that you know |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 * the length of the decoded data, or if you |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 * know you'll be able to use strlen to |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 * determine the length, etc. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 * @return The raw data. Must be g_free'd when no longer needed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 * |
15822 | 174 * @see purple_base16_encode() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 */ |
15822 | 176 guchar *purple_base16_decode(const char *str, gsize *ret_len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 |
17765
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
178 /** |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
179 * Converts a chunk of binary data to a chunked base-16 representation |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
180 * (handy for key fingerprints) |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
181 * |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
182 * Example output: 01:23:45:67:89:AB:CD:EF |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
183 * |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
184 * @param data The data to convert. |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
185 * @param len The length of the data. |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
186 * |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
187 * @return The base-16 string in the ASCII chunked encoding. Must be |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
188 * g_free'd when no longer needed. |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
189 */ |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
190 gchar *purple_base16_encode_chunked(const guchar *data, gsize len); |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
191 |
ba768014f91f
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16487
diff
changeset
|
192 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 /** @name Base64 Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 * Converts a chunk of binary data to its base-64 equivalent. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 * @param data The data to convert. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 * @param len The length of the data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 * @return The base-64 string in the ASCII encoding. Must be |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 * g_free'd when no longer needed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 * |
15822 | 209 * @see purple_base64_decode() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 */ |
15822 | 211 gchar *purple_base64_encode(const guchar *data, gsize len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 * Converts an ASCII string of base-64 encoded data to |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 * the binary equivalent. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 * @param str The base-64 string to convert to raw data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
218 * @param ret_len The length of the returned data. You can |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 * pass in NULL if you're sure that you know |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 * the length of the decoded data, or if you |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 * know you'll be able to use strlen to |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 * determine the length, etc. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 * @return The raw data. Must be g_free'd when no longer needed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 * |
15822 | 226 * @see purple_base64_encode() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 */ |
15822 | 228 guchar *purple_base64_decode(const char *str, gsize *ret_len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 /** @name Quoted Printable Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 * Converts a quoted printable string back to its readable equivalent. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 * What is a quoted printable string, you ask? It's an encoding used |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 * to transmit binary data as ASCII. It's intended purpose is to send |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23142
diff
changeset
|
241 * emails containing non-ASCII characters. Wikipedia has a pretty good |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 * explanation. Also see RFC 2045. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
243 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 * @param str The quoted printable ASCII string to convert to raw data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 * @param ret_len The length of the returned data. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 * @return The readable string. Must be g_free'd when no longer needed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 */ |
15822 | 249 guchar *purple_quotedp_decode(const char *str, gsize *ret_len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 /** @name MIME Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 * Converts a MIME header field string back to its readable equivalent |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 * according to RFC 2047. Basically, a header is plain ASCII and can |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 * contain any number of sections called "encoded-words." The format |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 * of an encoded word is =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
263 * =? designates the beginning of the encoded-word |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 * ?= designates the end of the encoded-word |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 * An encoded word is segmented into three pieces by the use of a |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 * question mark. The first piece is the character set, the second |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 * piece is the encoding, and the third piece is the encoded text. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 * @param str The ASCII string, possibly containing any number of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 * encoded-word sections. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 * @return The string, with any encoded-word sections decoded and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 * converted to UTF-8. Must be g_free'd when no longer |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 * needed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 */ |
15822 | 277 char *purple_mime_decode_field(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 /** @name Date/Time Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 * Formats a time into the specified format. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 * This is essentially strftime(), but it has a static buffer |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 * and handles the UTF-8 conversion for the caller. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 * This function also provides the GNU %z formatter if the underlying C |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 * library doesn't. However, the format string parser is very naive, which |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 * means that conversions specifiers to %z cannot be guaranteed. The GNU |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 * strftime(3) man page describes %z as: 'The time-zone as hour offset from |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 * GMT. Required to emit RFC822-conformant dates |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 * (using "%a, %d %b %Y %H:%M:%S %z"). (GNU)' |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 * On Windows, this function also converts the results for %Z from a timezone |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 * name (as returned by the system strftime() %Z format string) to a timezone |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
302 * abbreviation (as is the case on Unix). As with %z, conversion specifiers |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 * should not be used. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 * @param format The format string, in UTF-8 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 * @param tm The time to format, or @c NULL to use the current local time |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
307 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 * @return The formatted time, in UTF-8. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 * @note @a format is required to be in UTF-8. This differs from strftime(), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 * where the format is provided in the locale charset. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
312 */ |
15822 | 313 const char *purple_utf8_strftime(const char *format, const struct tm *tm); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
314 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 /** |
18259
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
316 * Gets a string representation of the local timezone offset |
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
317 * |
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
318 * @param tm The time to get the timezone for |
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
319 * @param iso TRUE to format the offset according to ISO-8601, FALSE to |
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
320 * not substitute 'Z' for 0 offset, and to not separate |
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
321 * hours and minutes with a colon. |
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
322 */ |
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
323 const char *purple_get_tzoff_str(const struct tm *tm, gboolean iso); |
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
324 |
c5c265dff90c
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18039
diff
changeset
|
325 /** |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
326 * Formats a time into the user's preferred short date format. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 * The returned string is stored in a static buffer, so the result |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 * should be g_strdup()'d if it's going to be kept. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
330 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
331 * @param tm The time to format, or @c NULL to use the current local time |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
332 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 * @return The date, formatted as per the user's settings. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
334 */ |
15822 | 335 const char *purple_date_format_short(const struct tm *tm); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
338 * Formats a time into the user's preferred short date plus time format. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
339 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 * The returned string is stored in a static buffer, so the result |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
341 * should be g_strdup()'d if it's going to be kept. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 * @param tm The time to format, or @c NULL to use the current local time |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 * @return The timestamp, formatted as per the user's settings. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
346 */ |
15822 | 347 const char *purple_date_format_long(const struct tm *tm); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
348 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
349 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
350 * Formats a time into the user's preferred full date and time format. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 * The returned string is stored in a static buffer, so the result |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 * should be g_strdup()'d if it's going to be kept. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
354 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
355 * @param tm The time to format, or @c NULL to use the current local time |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 * @return The date and time, formatted as per the user's settings. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 */ |
15822 | 359 const char *purple_date_format_full(const struct tm *tm); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
362 * Formats a time into the user's preferred time format. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
363 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
364 * The returned string is stored in a static buffer, so the result |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
365 * should be g_strdup()'d if it's going to be kept. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
367 * @param tm The time to format, or @c NULL to use the current local time |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
368 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
369 * @return The time, formatted as per the user's settings. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
370 */ |
15822 | 371 const char *purple_time_format(const struct tm *tm); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
372 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
373 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
374 * Builds a time_t from the supplied information. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
375 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 * @param year The year. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
377 * @param month The month. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
378 * @param day The day. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
379 * @param hour The hour. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
380 * @param min The minute. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
381 * @param sec The second. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
382 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
383 * @return A time_t. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
384 */ |
15822 | 385 time_t purple_time_build(int year, int month, int day, int hour, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
386 int min, int sec); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
387 |
15822 | 388 /** Used by purple_str_to_time to indicate no timezone offset was |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
389 * specified in the timestamp string. */ |
15822 | 390 #define PURPLE_NO_TZ_OFF -500000 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
391 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
392 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
393 * Parses a timestamp in jabber, ISO8601, or MM/DD/YYYY format and returns |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
394 * a time_t. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
395 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
396 * @param timestamp The timestamp |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
397 * @param utc Assume UTC if no timezone specified |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
398 * @param tm If not @c NULL, the caller can get a copy of the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
399 * struct tm used to calculate the time_t return value. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
400 * @param tz_off If not @c NULL, the caller can get a copy of the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
401 * timezone offset (from UTC) used to calculate the time_t |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
402 * return value. Note: Zero is a valid offset. As such, |
15822 | 403 * the value of the macro @c PURPLE_NO_TZ_OFF indicates no |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
404 * offset was specified (which means that the local |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
405 * timezone was used in the calculation). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
406 * @param rest If not @c NULL, the caller can get a pointer to the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
407 * part of @a timestamp left over after parsing is |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
408 * completed, if it's not the end of @a timestamp. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
409 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
410 * @return A time_t. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
411 */ |
15822 | 412 time_t purple_str_to_time(const char *timestamp, gboolean utc, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
413 struct tm *tm, long *tz_off, const char **rest); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
414 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
415 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
416 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 /** @name Markup Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
420 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
421 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 /** |
27393
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
424 * Escapes special characters in a plain-text string so they display |
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
425 * correctly as HTML. For example, & is replaced with & and < is |
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
426 * replaced with < |
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
427 * |
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
428 * This is exactly the same as g_markup_escape_text(), except that it |
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
429 * does not change ' to ' because ' is not a valid HTML 4 entity, |
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
430 * and is displayed literally in IE7. |
27394
66425e99d741
ChangeLog.API and @since mark purple_markup_escape_text.
Etan Reisner <pidgin@unreliablesource.net>
parents:
27393
diff
changeset
|
431 * |
66425e99d741
ChangeLog.API and @since mark purple_markup_escape_text.
Etan Reisner <pidgin@unreliablesource.net>
parents:
27393
diff
changeset
|
432 * @since 2.6.0 |
27393
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
433 */ |
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
434 gchar *purple_markup_escape_text(const gchar *text, gssize length); |
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
435 |
57fdb7853fc7
Create a purple_markup_escape_text() function and use it in one place
Mark Doliner <mark@kingant.net>
parents:
27025
diff
changeset
|
436 /** |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
437 * Finds an HTML tag matching the given name. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
438 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
439 * This locates an HTML tag's start and end, and stores its attributes |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
440 * in a GData hash table. The names of the attributes are lower-cased |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
441 * in the hash table, and the name of the tag is case insensitive. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
442 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 * @param needle The name of the tag |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
444 * @param haystack The null-delimited string to search in |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
445 * @param start A pointer to the start of the tag if found |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
446 * @param end A pointer to the end of the tag if found |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
447 * @param attributes The attributes, if the tag was found. This should |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
448 * be freed with g_datalist_clear(). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
449 * @return TRUE if the tag was found |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
450 */ |
15822 | 451 gboolean purple_markup_find_tag(const char *needle, const char *haystack, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
452 const char **start, const char **end, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
453 GData **attributes); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
454 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
455 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 * Extracts a field of data from HTML. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 * This is a scary function. See protocols/msn/msn.c and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
459 * protocols/yahoo/yahoo_profile.c for example usage. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
461 * @param str The string to parse. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
462 * @param len The size of str. |
15822 | 463 * @param user_info The destination PurpleNotifyUserInfo to which the new |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
464 * field info should be added. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 * @param start_token The beginning token. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 * @param skip The number of characters to skip after the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
467 * start token. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 * @param end_token The ending token. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
469 * @param check_value The value that the last character must meet. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
470 * @param no_value_token The token indicating no value is given. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
471 * @param display_name The short descriptive name to display for this token. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 * @param is_link TRUE if this should be a link, or FALSE otherwise. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
473 * @param link_prefix The prefix for the link. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 * @param format_cb A callback to format the value before adding it. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
475 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
476 * @return TRUE if successful, or FALSE otherwise. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 */ |
15822 | 478 gboolean purple_markup_extract_info_field(const char *str, int len, PurpleNotifyUserInfo *user_info, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 const char *start_token, int skip, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 const char *end_token, char check_value, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 const char *no_value_token, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
482 const char *display_name, gboolean is_link, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
483 const char *link_prefix, |
15822 | 484 PurpleInfoFieldFormatCallback format_cb); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
486 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
487 * Converts HTML markup to XHTML. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
489 * @param html The HTML markup. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 * @param dest_xhtml The destination XHTML output. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 * @param dest_plain The destination plain-text output. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 */ |
15822 | 493 void purple_markup_html_to_xhtml(const char *html, char **dest_xhtml, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 char **dest_plain); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
497 * Strips HTML tags from a string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 * @param str The string to strip HTML from. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 * |
22676
17d1054cea03
Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents:
22626
diff
changeset
|
501 * @return The new string without HTML. You must g_free this string |
17d1054cea03
Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents:
22626
diff
changeset
|
502 * when finished with it. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 */ |
15822 | 504 char *purple_markup_strip_html(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 * Adds the necessary HTML code to turn URIs into HTML links in a string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 * @param str The string to linkify. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 * |
22676
17d1054cea03
Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents:
22626
diff
changeset
|
511 * @return The new string with all URIs surrounded in standard |
17d1054cea03
Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents:
22626
diff
changeset
|
512 * HTML <a href="whatever"></a> tags. You must g_free this |
17d1054cea03
Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents:
22626
diff
changeset
|
513 * string when finished with it. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 */ |
15822 | 515 char *purple_markup_linkify(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 /** |
26771
e72df47d41fe
Escape all the values when appending them to the Entity Caps verification str.
Paul Aurich <paul@darkrain42.org>
parents:
26438
diff
changeset
|
518 * Unescapes HTML entities to their literal characters. Also translates |
e72df47d41fe
Escape all the values when appending them to the Entity Caps verification str.
Paul Aurich <paul@darkrain42.org>
parents:
26438
diff
changeset
|
519 * "<br>" to "\n". |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 * For example "&" is replaced by '&' and so on. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 * Actually only "&", """, "<" and ">" are currently |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 * supported. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
524 * @param html The string in which to unescape any HTML entities |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 * |
22676
17d1054cea03
Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents:
22626
diff
changeset
|
526 * @return The text with HTML entities literalized. You must g_free |
17d1054cea03
Super minor documentation improvement
Mark Doliner <mark@kingant.net>
parents:
22626
diff
changeset
|
527 * this string when finished with it. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 */ |
15822 | 529 char *purple_unescape_html(const char *html); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
530 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 * Returns a newly allocated substring of the HTML UTF-8 string "str". |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
533 * The markup is preserved such that the substring will have the same |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 * formatting as original string, even though some tags may have been |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 * opened before "x", or may close after "y". All open tags are closed |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 * at the end of the returned string, in the proper order. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
537 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
538 * Note that x and y are in character offsets, not byte offsets, and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
539 * are offsets into an unformatted version of str. Because of this, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 * this function may be sensitive to changes in GtkIMHtml and may break |
15822 | 541 * when used with other UI's. libpurple users are encouraged to report and |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
542 * work out any problems encountered. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
543 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 * @param str The input NUL terminated, HTML, UTF-8 (or ASCII) string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
545 * @param x The character offset into an unformatted version of str to |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
546 * begin at. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
547 * @param y The character offset (into an unformatted vesion of str) of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
548 * one past the last character to include in the slice. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 * @return The HTML slice of string, with all formatting retained. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
551 */ |
15822 | 552 char *purple_markup_slice(const char *str, guint x, guint y); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 * Returns a newly allocated string containing the name of the tag |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 * located at "tag". Tag is expected to point to a '<', and contain |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 * a '>' sometime after that. If there is no '>' and the string is |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 * not NUL terminated, this function can be expected to segfault. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 * @param tag The string starting a HTML tag. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 * @return A string containing the name of the tag. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 */ |
15822 | 563 char *purple_markup_get_tag_name(const char *tag); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
565 /** |
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
566 * Returns a constant string of the character representation of the HTML |
16084 | 567 * entity pointed to by @a text. For example, purple_markup_unescape_entity("&") |
568 * will return "&". The @a text variable is expected to point to an '&', | |
569 * the first character of the entity. If given an unrecognized entity, the function | |
570 * returns @c NULL. | |
571 * | |
16487
b8b2e35ec7c6
Fix purple_util_get_image_extension()'s data param. to be correctly marked as constant.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16375
diff
changeset
|
572 * Note that this function, unlike purple_unescape_html(), does not search |
16084 | 573 * the string for the entity, does not replace the entity, and does not |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
574 * return a newly allocated string. |
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
575 * |
16084 | 576 * @param text A string containing an HTML entity. |
577 * @param length If not @c NULL, the string length of the entity is stored in this location. | |
578 * | |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
579 * @return A constant string containing the character representation of the given entity. |
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
580 */ |
16084 | 581 const char * purple_markup_unescape_entity(const char *text, int *length); |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
582 |
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
583 /** |
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
584 * Returns a newly allocated string containing the value of the CSS property specified |
16084 | 585 * in opt. The @a style argument is expected to point to a HTML inline CSS. |
16201
36b09c6f7957
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents:
16152
diff
changeset
|
586 * The function will seek for the CSS property and return its value. |
16084 | 587 * |
16201
36b09c6f7957
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents:
16152
diff
changeset
|
588 * For example, purple_markup_get_css_property("direction:rtl;color:#dc4d1b;", |
36b09c6f7957
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents:
16152
diff
changeset
|
589 * "color") would return "#dc4d1b". |
16084 | 590 * |
16201
36b09c6f7957
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents:
16152
diff
changeset
|
591 * On error or if the requested property was not found, the function returns |
36b09c6f7957
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@wiktel.com>
parents:
16152
diff
changeset
|
592 * @c NULL. |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
593 * |
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
594 * @param style A string containing the inline CSS text. |
16084 | 595 * @param opt The requested CSS property. |
596 * | |
597 * @return The value of the requested CSS property. | |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
598 */ |
16084 | 599 char * purple_markup_get_css_property(const gchar *style, const gchar *opt); |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
600 |
27012
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
601 /** |
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
602 * Check if the given HTML contains RTL text. |
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
603 * |
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
604 * @param html The HTML text. |
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
605 * |
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
606 * @return TRUE if the text contains RTL text, FALSE otherwise. |
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
607 * |
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
608 * @since 2.6.0 |
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
609 */ |
af4a4ebc6441
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
27009
diff
changeset
|
610 gboolean purple_markup_is_rtl(const char *html); |
16083
f2a4b05407d7
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15822
diff
changeset
|
611 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
616 /** @name Path/Filename Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
617 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
619 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
620 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
621 * Returns the user's home directory. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
622 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
623 * @return The user's home directory. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
624 * |
15822 | 625 * @see purple_user_dir() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
626 */ |
15822 | 627 const gchar *purple_home_dir(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
628 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
629 /** |
15822 | 630 * Returns the purple settings directory in the user's home directory. |
631 * This is usually ~/.purple | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
632 * |
15822 | 633 * @return The purple settings directory. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
634 * |
15822 | 635 * @see purple_home_dir() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 */ |
15822 | 637 const char *purple_user_dir(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 /** |
15822 | 640 * Define a custom purple settings directory, overriding the default (user's home directory/.purple) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 * @param dir The custom settings directory |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 */ |
15822 | 643 void purple_util_set_user_dir(const char *dir); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
646 * Builds a complete path from the root, making any directories along |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
647 * the path which do not already exist. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 * @param path The path you wish to create. Note that it must start |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
650 * from the root or this function will fail. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 * @param mode Unix-style permissions for this directory. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 * @return 0 for success, nonzero on any error. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 */ |
15822 | 655 int purple_build_dir(const char *path, int mode); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
656 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 /** |
15822 | 658 * Write a string of data to a file of the given name in the Purple |
659 * user directory ($HOME/.purple by default). The data is typically | |
660 * a serialized version of one of Purple's config files, such as | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
661 * prefs.xml, accounts.xml, etc. And the string is typically |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 * obtained using xmlnode_to_formatted_str. However, this function |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
663 * should work fine for saving binary files as well. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
664 * |
15822 | 665 * @param filename The basename of the file to write in the purple_user_dir. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
666 * @param data A null-terminated string of data to write. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
667 * @param size The size of the data to save. If data is |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 * null-terminated you can pass in -1. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
669 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
670 * @return TRUE if the file was written successfully. FALSE otherwise. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
671 */ |
15822 | 672 gboolean purple_util_write_data_to_file(const char *filename, const char *data, |
19500
6e4b16081dff
Fix purple_util_write_data_to_file signature.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19499
diff
changeset
|
673 gssize size); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
674 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
675 /** |
19498
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
676 * Write data to a file using the absolute path. |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
677 * |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
678 * This exists for Glib backwards compatibility reasons. |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
679 * |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
680 * @param filename_full Filename to write to |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
681 * @param data A null-terminated string of data to write. |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
682 * @param size The size of the data to save. If data is |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
683 * null-terminated you can pass in -1. |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
684 * |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
685 * @return TRUE if the file was written successfully. FALSE otherwise. |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
686 * |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
687 * @todo Remove this function (use g_file_set_contents instead) when 3.0.0 |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
688 * rolls around. |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
689 * @see purple_util_write_data_to_file() |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
690 * |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
691 */ |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
692 gboolean |
20334
58a57a0ca807
applied changes from 1095e0c294d15e95c8909d270748c5253226bfe6
Luke Schierer <lschiere@pidgin.im>
parents:
20074
diff
changeset
|
693 purple_util_write_data_to_file_absolute(const char *filename_full, const char *data, gssize size); |
19498
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
694 |
7589b218f89a
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18363
diff
changeset
|
695 /** |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
696 * Read the contents of a given file and parse the results into an |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
697 * xmlnode tree structure. This is intended to be used to read |
15822 | 698 * Purple's configuration xml files (prefs.xml, pounces.xml, etc.) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 * |
15822 | 700 * @param filename The basename of the file to open in the purple_user_dir. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
701 * @param description A very short description of the contents of this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 * file. This is used in error messages shown to the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 * user when the file can not be opened. For example, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 * "preferences," or "buddy pounces." |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
705 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 * @return An xmlnode tree of the contents of the given file. Or NULL, if |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
707 * the file does not exist or there was an error reading the file. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
708 */ |
15822 | 709 xmlnode *purple_util_read_xml_from_file(const char *filename, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 const char *description); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
711 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
712 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
713 * Creates a temporary file and returns a file pointer to it. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
714 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 * This is like mkstemp(), but returns a file pointer and uses a |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
716 * pre-set template. It uses the semantics of tempnam() for the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
717 * directory to use and allocates the space for the file path. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 * The caller is responsible for closing the file and removing it when |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 * done, as well as freeing the space pointed to by @a path with |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
721 * g_free(). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
722 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
723 * @param path The returned path to the temp file. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
724 * @param binary Text or binary, for platforms where it matters. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
725 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
726 * @return A file pointer to the temporary file, or @c NULL on failure. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
727 */ |
15822 | 728 FILE *purple_mkstemp(char **path, gboolean binary); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
729 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
730 /** |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
731 * Returns an extension corresponding to the image data's file type. |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
732 * |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
733 * @param data A pointer to the image data |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
734 * @param len The length of the image data |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
735 * |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
736 * @return The appropriate extension, or "icon" if unknown. |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
737 */ |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
738 const char * |
16487
b8b2e35ec7c6
Fix purple_util_get_image_extension()'s data param. to be correctly marked as constant.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16375
diff
changeset
|
739 purple_util_get_image_extension(gconstpointer data, size_t len); |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
740 |
18039
c588a4a9d287
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents:
17765
diff
changeset
|
741 /** |
22311
02eda4bd2b22
Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22000
diff
changeset
|
742 * Returns a SHA-1 hash string of the data passed in. |
02eda4bd2b22
Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22000
diff
changeset
|
743 */ |
02eda4bd2b22
Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22000
diff
changeset
|
744 char *purple_util_get_image_checksum(gconstpointer image_data, size_t image_len); |
02eda4bd2b22
Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22000
diff
changeset
|
745 |
02eda4bd2b22
Apply the custom smiley patches from #1187, from Jorge Villase«Ðo (Masca) and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
22000
diff
changeset
|
746 /** |
22626 | 747 * @return A hex encoded version of the SHA-1 hash of the data passed |
748 * in with the correct file extention appended. The file | |
749 * extension is determined by calling | |
750 * purple_util_get_image_extension(). This return value must | |
751 * be g_freed by the caller. | |
18039
c588a4a9d287
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents:
17765
diff
changeset
|
752 */ |
c588a4a9d287
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents:
17765
diff
changeset
|
753 char *purple_util_get_image_filename(gconstpointer image_data, size_t image_len); |
c588a4a9d287
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@wiktel.com>
parents:
17765
diff
changeset
|
754 |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
755 /*@}*/ |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
756 |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
757 |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
758 /**************************************************************************/ |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
759 /** @name Environment Detection Functions */ |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
760 /**************************************************************************/ |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
761 /*@{*/ |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
762 |
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
763 /** |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
764 * Checks if the given program name is valid and executable. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
765 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
766 * @param program The file name of the application. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
767 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
768 * @return TRUE if the program is runable. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 */ |
15822 | 770 gboolean purple_program_is_valid(const char *program); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
771 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
772 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
773 * Check if running GNOME. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
774 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
775 * @return TRUE if running GNOME, FALSE otherwise. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
776 */ |
15822 | 777 gboolean purple_running_gnome(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
778 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
779 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
780 * Check if running KDE. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
782 * @return TRUE if running KDE, FALSE otherwise. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
783 */ |
15822 | 784 gboolean purple_running_kde(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
786 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
787 * Check if running OS X. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
788 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
789 * @return TRUE if running OS X, FALSE otherwise. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
790 */ |
15822 | 791 gboolean purple_running_osx(void); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
792 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
793 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
794 * Returns the IP address from a socket file descriptor. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
795 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
796 * @param fd The socket file descriptor. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
797 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
798 * @return The IP address, or @c NULL on error. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
799 */ |
15822 | 800 char *purple_fd_get_ip(int fd); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
801 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
802 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
803 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
804 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
805 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
806 /** @name String Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
807 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
808 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
809 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
810 /** |
25894
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
811 * Tests two strings for equality. |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
812 * |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
813 * Unlike strcmp(), this function will not crash if one or both of the |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
814 * strings are @c NULL. |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
815 * |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
816 * @param left A string |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
817 * @param right A string to compare with left |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
818 * |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
819 * @return @c TRUE if the strings are the same, else @c FALSE. |
25921
d25cbbea7fe5
Add @since 2.6.0 doxygen comments to some of our new functions, and
Mark Doliner <mark@kingant.net>
parents:
25894
diff
changeset
|
820 * |
25894
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
821 * @since 2.6.0 |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
822 */ |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
823 gboolean purple_strequal(const gchar *left, const gchar *right); |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
824 |
a6e3cb32cdd2
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 <paul@darkrain42.org>
parents:
23734
diff
changeset
|
825 /** |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 * Normalizes a string, so that it is suitable for comparison. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
827 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
828 * The returned string will point to a static buffer, so if the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 * string is intended to be kept long-term, you <i>must</i> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
830 * g_strdup() it. Also, calling normalize() twice in the same line |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
831 * will lead to problems. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
832 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
833 * @param account The account the string belongs to, or NULL if you do |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 * not know the account. If you use NULL, the string |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
835 * will still be normalized, but if the PRPL uses a |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
836 * custom normalization function then the string may |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
837 * not be normalized correctly. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 * @param str The string to normalize. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 * @return A pointer to the normalized version stored in a static buffer. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
841 */ |
15822 | 842 const char *purple_normalize(const PurpleAccount *account, const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 * Normalizes a string, so that it is suitable for comparison. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
847 * This is one possible implementation for the PRPL callback |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 * function "normalize." It returns a lowercase and UTF-8 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
849 * normalized version of the string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
850 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
851 * @param account The account the string belongs to. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 * @param str The string to normalize. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
853 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 * @return A pointer to the normalized version stored in a static buffer. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 */ |
15822 | 856 const char *purple_normalize_nocase(const PurpleAccount *account, const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
858 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
859 * Compares two strings to see if the first contains the second as |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 * a proper prefix. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
861 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
862 * @param s The string to check. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
863 * @param p The prefix in question. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
864 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
865 * @return TRUE if p is a prefix of s, otherwise FALSE. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 */ |
15822 | 867 gboolean purple_str_has_prefix(const char *s, const char *p); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
868 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
870 * Compares two strings to see if the second is a proper suffix |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
871 * of the first. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
872 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
873 * @param s The string to check. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
874 * @param x The suffix in question. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
876 * @return TRUE if x is a a suffix of s, otherwise FALSE. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
877 */ |
15822 | 878 gboolean purple_str_has_suffix(const char *s, const char *x); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
880 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
881 * Duplicates a string and replaces all newline characters from the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
882 * source string with HTML linebreaks. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
883 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 * @param src The source string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
885 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
886 * @return The new string. Must be g_free'd by the caller. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
887 */ |
15822 | 888 gchar *purple_strdup_withhtml(const gchar *src); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
889 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
890 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
891 * Ensures that all linefeeds have a matching carriage return. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
892 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
893 * @param str The source string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 * @return The string with carriage returns. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 */ |
15822 | 897 char *purple_str_add_cr(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
898 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
900 * Strips all instances of the given character from the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
901 * given string. The string is modified in place. This |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 * is useful for stripping new line characters, for example. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
904 * Example usage: |
15822 | 905 * purple_str_strip_char(my_dumb_string, '\n'); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 * @param str The string to strip characters from. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 * @param thechar The character to strip from the given string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 */ |
15822 | 910 void purple_str_strip_char(char *str, char thechar); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
911 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
913 * Given a string, this replaces all instances of one character |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
914 * with another. This happens inline (the original string IS |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
915 * modified). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
916 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 * @param string The string from which to replace stuff. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 * @param delimiter The character you want replaced. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 * @param replacement The character you want inserted in place |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 * of the delimiting character. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
921 */ |
15822 | 922 void purple_util_chrreplace(char *string, char delimiter, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
923 char replacement); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
924 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
925 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
926 * Given a string, this replaces one substring with another |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
927 * and returns a newly allocated string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
928 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
929 * @param string The string from which to replace stuff. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 * @param delimiter The substring you want replaced. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
931 * @param replacement The substring you want inserted in place |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 * of the delimiting substring. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
933 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
934 * @return A new string, after performing the substitution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
935 * free this with g_free(). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 */ |
15822 | 937 gchar *purple_strreplace(const char *string, const char *delimiter, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 const char *replacement); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
939 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
941 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
942 * Given a string, this replaces any utf-8 substrings in that string with |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
943 * the corresponding numerical character reference, and returns a newly |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 * allocated string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
946 * @param in The string which might contain utf-8 substrings |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 * @return A new string, with utf-8 replaced with numerical character |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
949 * references, free this with g_free() |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
950 */ |
15822 | 951 char *purple_utf8_ncr_encode(const char *in); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
952 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
953 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
954 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
955 * Given a string, this replaces any numerical character references |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 * in that string with the corresponding actual utf-8 substrings, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
957 * and returns a newly allocated string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
958 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
959 * @param in The string which might contain numerical character references. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
960 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
961 * @return A new string, with numerical character references |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
962 * replaced with actual utf-8, free this with g_free(). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
963 */ |
15822 | 964 char *purple_utf8_ncr_decode(const char *in); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
965 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
966 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
967 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
968 * Given a string, this replaces one substring with another |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
969 * ignoring case and returns a newly allocated string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
971 * @param string The string from which to replace stuff. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
972 * @param delimiter The substring you want replaced. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
973 * @param replacement The substring you want inserted in place |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
974 * of the delimiting substring. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
975 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
976 * @return A new string, after performing the substitution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
977 * free this with g_free(). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
978 */ |
15822 | 979 gchar *purple_strcasereplace(const char *string, const char *delimiter, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
980 const char *replacement); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
981 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
982 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
983 * This is like strstr, except that it ignores ASCII case in |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
984 * searching for the substring. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
985 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
986 * @param haystack The string to search in. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
987 * @param needle The substring to find. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
988 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
989 * @return the location of the substring if found, or NULL if not |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
990 */ |
15822 | 991 const char *purple_strcasestr(const char *haystack, const char *needle); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
992 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
993 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
994 * Returns a string representing a filesize in the appropriate |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
995 * units (MB, KB, GB, etc.) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
996 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
997 * @param size The size |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
998 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
999 * @return The string in units form. This must be freed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1000 */ |
15822 | 1001 char *purple_str_size_to_units(size_t size); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1002 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1003 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1004 * Converts seconds into a human-readable form. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1005 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1006 * @param sec The seconds. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1007 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1008 * @return A human-readable form, containing days, hours, minutes, and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1009 * seconds. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1010 */ |
15822 | 1011 char *purple_str_seconds_to_string(guint sec); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1012 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1013 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1014 * Converts a binary string into a NUL terminated ascii string, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 * replacing nonascii characters and characters below SPACE (including |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1016 * NUL) into \\xyy, where yy are two hex digits. Also backslashes are |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1017 * changed into two backslashes (\\\\). The returned, newly allocated |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1018 * string can be outputted to the console, and must be g_free()d. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1019 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1020 * @param binary A string of random data, possibly with embedded NULs |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1021 * and such. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1022 * @param len The length in bytes of the input string. Must not be 0. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1023 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1024 * @return A newly allocated ASCIIZ string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1025 */ |
15822 | 1026 char *purple_str_binary_to_ascii(const unsigned char *binary, guint len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1027 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1029 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1031 /** @name URI/URL Functions */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1032 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1033 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1034 |
15822 | 1035 void purple_got_protocol_handler_uri(const char *uri); |
15612
b0471b2a1de9
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 <daniel.atallah@gmail.com>
parents:
15420
diff
changeset
|
1036 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1037 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1038 * Parses a URL, returning its host, port, file path, username and password. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1039 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1040 * The returned data must be freed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1041 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1042 * @param url The URL to parse. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1043 * @param ret_host The returned host. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1044 * @param ret_port The returned port. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1045 * @param ret_path The returned path. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1046 * @param ret_user The returned username. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1047 * @param ret_passwd The returned password. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1048 */ |
15822 | 1049 gboolean purple_url_parse(const char *url, char **ret_host, int *ret_port, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1050 char **ret_path, char **ret_user, char **ret_passwd); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1051 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1052 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1053 * This is the signature used for functions that act as the callback |
15822 | 1054 * to purple_util_fetch_url() or purple_util_fetch_url_request(). |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1055 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1056 * @param url_data The same value that was returned when you called |
15822 | 1057 * purple_fetch_url() or purple_fetch_url_request(). |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1058 * @param user_data The user data that your code passed into either |
15822 | 1059 * purple_util_fetch_url() or purple_util_fetch_url_request(). |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1060 * @param url_text This will be NULL on error. Otherwise this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1061 * will contain the contents of the URL. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1062 * @param len 0 on error, otherwise this is the length of buf. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1063 * @param error_message If something went wrong then this will contain |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1064 * a descriptive error message, and buf will be |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1065 * NULL and len will be 0. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1066 */ |
15822 | 1067 typedef void (*PurpleUtilFetchUrlCallback)(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, gsize len, const gchar *error_message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1068 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1069 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1070 * Fetches the data from a URL, and passes it to a callback function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1071 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1072 * @param url The URL. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1073 * @param full TRUE if this is the full URL, or FALSE if it's a |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1074 * partial URL. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1075 * @param user_agent The user agent field to use, or NULL. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1076 * @param http11 TRUE if HTTP/1.1 should be used to download the file. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1077 * @param cb The callback function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1078 * @param data The user data to pass to the callback function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1079 */ |
15822 | 1080 #define purple_util_fetch_url(url, full, user_agent, http11, cb, data) \ |
1081 purple_util_fetch_url_request(url, full, user_agent, http11, NULL, \ | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1082 FALSE, cb, data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1083 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1084 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1085 * Fetches the data from a URL, and passes it to a callback function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1086 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1087 * @param url The URL. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1088 * @param full TRUE if this is the full URL, or FALSE if it's a |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1089 * partial URL. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1090 * @param user_agent The user agent field to use, or NULL. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1091 * @param http11 TRUE if HTTP/1.1 should be used to download the file. |
23684
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1092 * @param max_len The maximum number of bytes to retrieve (-1 for unlimited) |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1093 * @param cb The callback function. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1094 * @param data The user data to pass to the callback function. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1095 * @deprecated In 3.0.0, we'll rename this to "purple_util_fetch_url" and get rid of the old one |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1096 */ |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1097 #define purple_util_fetch_url_len(url, full, user_agent, http11, max_len, cb, data) \ |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1098 purple_util_fetch_url_request_len(url, full, user_agent, http11, NULL, \ |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1099 FALSE, max_len, cb, data); |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1100 |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1101 /** |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1102 * Fetches the data from a URL, and passes it to a callback function. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1103 * |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1104 * @param url The URL. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1105 * @param full TRUE if this is the full URL, or FALSE if it's a |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1106 * partial URL. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1107 * @param user_agent The user agent field to use, or NULL. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1108 * @param http11 TRUE if HTTP/1.1 should be used to download the file. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1109 * @param request A HTTP request to send to the server instead of the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1110 * standard GET |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1111 * @param include_headers |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1112 * If TRUE, include the HTTP headers in the response. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1113 * @param callback The callback function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1114 * @param data The user data to pass to the callback function. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1115 */ |
15822 | 1116 PurpleUtilFetchUrlData *purple_util_fetch_url_request(const gchar *url, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1117 gboolean full, const gchar *user_agent, gboolean http11, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1118 const gchar *request, gboolean include_headers, |
15822 | 1119 PurpleUtilFetchUrlCallback callback, gpointer data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1120 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1121 /** |
23684
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1122 * Fetches the data from a URL, and passes it to a callback function. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1123 * |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1124 * @param url The URL. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1125 * @param full TRUE if this is the full URL, or FALSE if it's a |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1126 * partial URL. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1127 * @param user_agent The user agent field to use, or NULL. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1128 * @param http11 TRUE if HTTP/1.1 should be used to download the file. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1129 * @param request A HTTP request to send to the server instead of the |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1130 * standard GET |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1131 * @param include_headers |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1132 * If TRUE, include the HTTP headers in the response. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1133 * @param max_len The maximum number of bytes to retrieve (-1 for unlimited) |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1134 * @param callback The callback function. |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1135 * @param data The user data to pass to the callback function. |
26969
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1136 * @deprecated In 3.0.0, this will go away. |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1137 */ |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1138 PurpleUtilFetchUrlData *purple_util_fetch_url_request_len(const gchar *url, |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1139 gboolean full, const gchar *user_agent, gboolean http11, |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1140 const gchar *request, gboolean include_headers, gssize max_len, |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1141 PurpleUtilFetchUrlCallback callback, gpointer data); |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1142 |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1143 /** |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1144 * Fetches the data from a URL, and passes it to a callback function. |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1145 * |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1146 * @param account The account for which the request is needed, or NULL. |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1147 * @param url The URL. |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1148 * @param full TRUE if this is the full URL, or FALSE if it's a |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1149 * partial URL. |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1150 * @param user_agent The user agent field to use, or NULL. |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1151 * @param http11 TRUE if HTTP/1.1 should be used to download the file. |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1152 * @param request A HTTP request to send to the server instead of the |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1153 * standard GET |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1154 * @param include_headers |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1155 * If TRUE, include the HTTP headers in the response. |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1156 * @param max_len The maximum number of bytes to retrieve (-1 for unlimited) |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1157 * @param callback The callback function. |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1158 * @param data The user data to pass to the callback function. |
23684
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1159 * @deprecated In 3.0.0, we'll rename this to "purple_util_fetch_url_request" and get rid of the old one |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1160 */ |
26969
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1161 PurpleUtilFetchUrlData *purple_util_fetch_url_request_len_with_account( |
f303787f144d
Add yet another URL fetching function. This one takes an account as a
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
26772
diff
changeset
|
1162 PurpleAccount *account, const gchar *url, |
23684
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1163 gboolean full, const gchar *user_agent, gboolean http11, |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1164 const gchar *request, gboolean include_headers, gssize max_len, |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1165 PurpleUtilFetchUrlCallback callback, gpointer data); |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1166 |
de8f2d3e538a
Add temporary purple_util_fetch_url_request_len and purple_util_fetch_url_len
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23538
diff
changeset
|
1167 /** |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1168 * Cancel a pending URL request started with either |
15822 | 1169 * purple_util_fetch_url_request() or purple_util_fetch_url(). |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1170 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1171 * @param url_data The data returned when you initiated the URL fetch. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1172 */ |
15822 | 1173 void purple_util_fetch_url_cancel(PurpleUtilFetchUrlData *url_data); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1174 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1175 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1176 * Decodes a URL into a plain string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1177 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1178 * This will change hex codes and such to their ascii equivalents. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1179 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1180 * @param str The string to translate. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1181 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1182 * @return The resulting string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1183 */ |
15822 | 1184 const char *purple_url_decode(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1185 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1186 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1187 * Encodes a URL into an escaped string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1188 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1189 * This will change non-alphanumeric characters to hex codes. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1190 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1191 * @param str The string to translate. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1192 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1193 * @return The resulting string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1194 */ |
15822 | 1195 const char *purple_url_encode(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1196 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1197 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1198 * Checks if the given email address is syntactically valid. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1199 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1200 * @param address The email address to validate. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1201 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1202 * @return True if the email address is syntactically correct. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1203 */ |
15822 | 1204 gboolean purple_email_is_valid(const char *address); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1205 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1206 /** |
22337
dc47e908965f
Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents:
22000
diff
changeset
|
1207 * Checks if the given IP address is a syntactically valid IPv4 address. |
dc47e908965f
Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents:
22000
diff
changeset
|
1208 * |
22898
3d7e9eff04d0
Assorted cleanups, mostly to the Doxygen comments. I added a few missing
Richard Laager <rlaager@wiktel.com>
parents:
22676
diff
changeset
|
1209 * @param ip The IP address to validate. |
22337
dc47e908965f
Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents:
22000
diff
changeset
|
1210 * |
dc47e908965f
Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents:
22000
diff
changeset
|
1211 * @return True if the IP address is syntactically correct. |
27469
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1212 * @deprecated This function will be replaced with one that validates |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1213 * as either IPv4 or IPv6 in 3.0.0. If you don't want this, |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1214 * behavior, use one of the more specific functions. |
22337
dc47e908965f
Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents:
22000
diff
changeset
|
1215 */ |
dc47e908965f
Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents:
22000
diff
changeset
|
1216 gboolean purple_ip_address_is_valid(const char *ip); |
dc47e908965f
Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents:
22000
diff
changeset
|
1217 |
dc47e908965f
Use connect server as FQDN for SASL auth except when it is an IP address.
Stu Tomlinson <stu@nosnilmot.com>
parents:
22000
diff
changeset
|
1218 /** |
27469
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1219 * Checks if the given IP address is a syntactically valid IPv4 address. |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1220 * |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1221 * @param ip The IP address to validate. |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1222 * |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1223 * @return True if the IP address is syntactically correct. |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1224 * @since 2.6.0 |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1225 */ |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1226 gboolean purple_ipv4_address_is_valid(const char *ip); |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1227 |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1228 /** |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1229 * Checks if the given IP address is a syntactically valid IPv6 address. |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1230 * |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1231 * @param ip The IP address to validate. |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1232 * |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1233 * @return True if the IP address is syntactically correct. |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1234 * @since 2.6.0 |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1235 */ |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1236 gboolean purple_ipv6_address_is_valid(const char *ip); |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1237 |
8c41a23e6b44
Add purple_ipv6_address_is_valid; guess what it does?
Paul Aurich <paul@darkrain42.org>
parents:
27394
diff
changeset
|
1238 /** |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1239 * This function extracts a list of URIs from the a "text/uri-list" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1240 * string. It was "borrowed" from gnome_uri_list_extract_uris |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1241 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1242 * @param uri_list An uri-list in the standard format. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1243 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1244 * @return A GList containing strings allocated with g_malloc |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1245 * that have been splitted from uri-list. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1246 */ |
15822 | 1247 GList *purple_uri_list_extract_uris(const gchar *uri_list); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1248 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1249 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1250 * This function extracts a list of filenames from a |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1251 * "text/uri-list" string. It was "borrowed" from |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1252 * gnome_uri_list_extract_filenames |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1253 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1254 * @param uri_list A uri-list in the standard format. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1255 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1256 * @return A GList containing strings allocated with g_malloc that |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1257 * contain the filenames in the uri-list. Note that unlike |
15822 | 1258 * purple_uri_list_extract_uris() function, this will discard |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1259 * any non-file uri from the result value. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1260 */ |
15822 | 1261 GList *purple_uri_list_extract_filenames(const gchar *uri_list); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1262 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1263 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1264 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1265 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1266 * UTF8 String Functions |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1267 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1268 /*@{*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1269 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1270 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1271 * Attempts to convert a string to UTF-8 from an unknown encoding. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1272 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1273 * This function checks the locale and tries sane defaults. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1274 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1275 * @param str The source string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1276 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1277 * @return The UTF-8 string, or @c NULL if it could not be converted. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1278 */ |
15822 | 1279 gchar *purple_utf8_try_convert(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1280 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1281 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1282 * Salvages the valid UTF-8 characters from a string, replacing any |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1283 * invalid characters with a filler character (currently hardcoded to |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1284 * '?'). |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1285 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1286 * @param str The source string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1287 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1288 * @return A valid UTF-8 string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1289 */ |
15822 | 1290 gchar *purple_utf8_salvage(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1291 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1292 /** |
27019
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1293 * Removes unprintable characters from a UTF-8 string. These characters |
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1294 * (in particular low-ASCII characters) are invalid in XML 1.0 and thus |
28101
c9c038529f38
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 <paul@darkrain42.org>
parents:
27469
diff
changeset
|
1295 * are not allowed in XMPP and are rejected by libxml2 by default. |
c9c038529f38
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 <paul@darkrain42.org>
parents:
27469
diff
changeset
|
1296 * |
c9c038529f38
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 <paul@darkrain42.org>
parents:
27469
diff
changeset
|
1297 * The returned string must be freed by the caller. |
27019
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1298 * |
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1299 * @param str A valid UTF-8 string. |
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1300 * |
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1301 * @return A newly allocated UTF-8 string without the unprintable characters. |
27025 | 1302 * @since 2.6.0 |
27019
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1303 */ |
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1304 gchar *purple_utf8_strip_unprintables(const gchar *str); |
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1305 |
bf9db4c67679
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.
Paul Aurich <paul@darkrain42.org>
parents:
27012
diff
changeset
|
1306 /** |
21862
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1307 * Return the UTF-8 version of gai_strerror(). It calls gai_strerror() |
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1308 * then converts the result to UTF-8. This function is analogous to |
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1309 * g_strerror(). |
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1310 * |
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1311 * @param errnum The error code. |
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1312 * |
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1313 * @return The UTF-8 error message. |
21895
39b078ac8a81
Update the changelogs, and the @since doxy-tags for new functions.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
21862
diff
changeset
|
1314 * @since 2.4.0 |
21862
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1315 */ |
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1316 G_CONST_RETURN gchar *purple_gai_strerror(gint errnum); |
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1317 |
ae58ffd5e929
Create a purple_gai_strerror() function similar to g_str_error() which
Mark Doliner <mark@kingant.net>
parents:
21248
diff
changeset
|
1318 /** |
25448
eece2d17ab65
I'm pretty sure this is what we meant here.
Etan Reisner <pidgin@unreliablesource.net>
parents:
23734
diff
changeset
|
1319 * Compares two UTF-8 strings case-insensitively. This comparison is |
16152
a740afef2daf
Slightly more descriptive
Mark Doliner <mark@kingant.net>
parents:
16084
diff
changeset
|
1320 * more expensive than a simple g_utf8_collate() comparison because |
a740afef2daf
Slightly more descriptive
Mark Doliner <mark@kingant.net>
parents:
16084
diff
changeset
|
1321 * it calls g_utf8_casefold() on each string, which allocates new |
a740afef2daf
Slightly more descriptive
Mark Doliner <mark@kingant.net>
parents:
16084
diff
changeset
|
1322 * strings. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1323 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1324 * @param a The first string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1325 * @param b The second string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1326 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1327 * @return -1 if @a is less than @a b. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1328 * 0 if @a is equal to @a b. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1329 * 1 if @a is greater than @a b. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1330 */ |
15822 | 1331 int purple_utf8_strcasecmp(const char *a, const char *b); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1332 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1333 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1334 * Case insensitive search for a word in a string. The needle string |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1335 * must be contained in the haystack string and not be immediately |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1336 * preceded or immediately followed by another alpha-numeric character. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1337 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1338 * @param haystack The string to search in. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1339 * @param needle The substring to find. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1340 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1341 * @return TRUE if haystack has the word, otherwise FALSE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1342 */ |
15822 | 1343 gboolean purple_utf8_has_word(const char *haystack, const char *needle); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1344 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1345 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1346 * Prints a UTF-8 message to the given file stream. The function |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1347 * tries to convert the UTF-8 message to user's locale. If this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1348 * is not possible, the original UTF-8 text will be printed. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1349 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1350 * @param filestream The file stream (e.g. STDOUT or STDERR) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1351 * @param message The message to print. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1352 */ |
15822 | 1353 void purple_print_utf8_to_console(FILE *filestream, char *message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1354 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1355 /** |
18363
700b642631bc
Remove static meify from yahoochat.c and replace use of it with
Will Thompson <will.thompson@collabora.co.uk>
parents:
18259
diff
changeset
|
1356 * Checks for messages starting (post-HTML) with "/me ", including the space. |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1357 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1358 * @param message The message to check |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1359 * @param len The message length, or -1 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1360 * |
18363
700b642631bc
Remove static meify from yahoochat.c and replace use of it with
Will Thompson <will.thompson@collabora.co.uk>
parents:
18259
diff
changeset
|
1361 * @return TRUE if it starts with "/me ", and it has been removed, otherwise |
700b642631bc
Remove static meify from yahoochat.c and replace use of it with
Will Thompson <will.thompson@collabora.co.uk>
parents:
18259
diff
changeset
|
1362 * FALSE |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1363 */ |
19408
cc36a5aac908
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 <daniel.atallah@gmail.com>
parents:
18363
diff
changeset
|
1364 gboolean purple_message_meify(char *message, gssize len); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1365 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1366 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1367 * Removes the underscore characters from a string used identify the mnemonic |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1368 * character. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1369 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1370 * @param in The string to strip |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1371 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1372 * @return The stripped string |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1373 */ |
15822 | 1374 char *purple_text_strip_mnemonic(const char *in); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1375 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1376 /*@}*/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1377 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1378 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1379 * Adds 8 to something. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1380 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1381 * Blame SimGuy. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1382 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1383 * @param x The number to add 8 to. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1384 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1385 * @return x + 8 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1386 */ |
15822 | 1387 #define purple_add_eight(x) ((x)+8) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1388 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1389 /** |
15822 | 1390 * Does the reverse of purple_escape_filename |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1391 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1392 * This will change hex codes and such to their ascii equivalents. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1393 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1394 * @param str The string to translate. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1395 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1396 * @return The resulting string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1397 */ |
15822 | 1398 const char *purple_unescape_filename(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1399 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1400 /** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1401 * Escapes filesystem-unfriendly characters from a filename |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1402 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1403 * @param str The string to translate. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1404 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1405 * @return The resulting string. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1406 */ |
15822 | 1407 const char *purple_escape_filename(const char *str); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1408 |
15420
6d8728fd3dda
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 <imadil@gmail.com>
parents:
15373
diff
changeset
|
1409 /** |
6d8728fd3dda
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 <imadil@gmail.com>
parents:
15373
diff
changeset
|
1410 * This is added temporarily to assist the split of oscar into aim and icq. |
6d8728fd3dda
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 <imadil@gmail.com>
parents:
15373
diff
changeset
|
1411 * This should not be used by plugins. |
6d8728fd3dda
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 <imadil@gmail.com>
parents:
15373
diff
changeset
|
1412 */ |
15822 | 1413 const char *_purple_oscar_convert(const char *act, const char *protocol); |
15645
61b42cf81aa4
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 <evan.s@dreskin.net>
parents:
15612
diff
changeset
|
1414 |
61b42cf81aa4
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 <evan.s@dreskin.net>
parents:
15612
diff
changeset
|
1415 /** |
61b42cf81aa4
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 <evan.s@dreskin.net>
parents:
15612
diff
changeset
|
1416 * Restore default signal handlers for signals which might reasonably have |
61b42cf81aa4
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 <evan.s@dreskin.net>
parents:
15612
diff
changeset
|
1417 * handlers. This should be called by a fork()'d child process, since child processes |
61b42cf81aa4
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 <evan.s@dreskin.net>
parents:
15612
diff
changeset
|
1418 * inherit the handlers of the parent. |
61b42cf81aa4
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 <evan.s@dreskin.net>
parents:
15612
diff
changeset
|
1419 */ |
15822 | 1420 void purple_restore_default_signal_handlers(void); |
16375
391a79778f89
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@wiktel.com>
parents:
16201
diff
changeset
|
1421 |
23538
399975ad001c
Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23180
diff
changeset
|
1422 /** |
399975ad001c
Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23180
diff
changeset
|
1423 * Gets the host name of the machine. If it not possible to determine the |
399975ad001c
Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23180
diff
changeset
|
1424 * host name, "localhost" is returned |
399975ad001c
Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23180
diff
changeset
|
1425 * |
399975ad001c
Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23180
diff
changeset
|
1426 * @constreturn The hostname |
399975ad001c
Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23180
diff
changeset
|
1427 */ |
399975ad001c
Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23180
diff
changeset
|
1428 const gchar *purple_get_host_name(void); |
399975ad001c
Add purple_get_host_name to get the hostname of the machine.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23180
diff
changeset
|
1429 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1430 #ifdef __cplusplus |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1431 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1432 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1433 |
15822 | 1434 #endif /* _PURPLE_UTIL_H_ */ |