Wed, 05 Sep 2007 22:32:14 +0000
propagate from branch 'im.pidgin.pidgin' (head 0853a065e5c3fcb5a6bb13fc23bec44ecf510ecd)
to branch 'im.pidgin.soc.2007.xmpp' (head b273d0db2bdd4a80d0fb22d32fe186e1f496933f)
| 4890 | 1 | /** |
| 2 | * @file util.h Utility Functions | |
|
5034
077678f7b048
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4890
diff
changeset
|
3 | * @ingroup core |
| 4890 | 4 | * |
| 15884 | 5 | * purple |
| 4890 | 6 | * |
| 15884 | 7 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 8 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 9 | * source distribution. | |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
10 | * |
| 4890 | 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | * | |
| 15884 | 25 | * @todo Rename the functions so that they live somewhere in the purple |
| 4890 | 26 | * namespace. |
| 27 | */ | |
| 15884 | 28 | #ifndef _PURPLE_UTIL_H_ |
| 29 | #define _PURPLE_UTIL_H_ | |
| 4890 | 30 | |
|
6474
12d3fe5e5b1b
[gaim-migrate @ 6983]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
31 | #include <stdio.h> |
|
12d3fe5e5b1b
[gaim-migrate @ 6983]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
32 | |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5532
diff
changeset
|
33 | #include "account.h" |
|
10425
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
34 | #include "xmlnode.h" |
|
18101
3ce21b5a182c
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents:
17389
diff
changeset
|
35 | #include "notify.h" |
|
5563
d5a7852aa0cb
[gaim-migrate @ 5965]
Christian Hammond <chipx86@chipx86.com>
parents:
5532
diff
changeset
|
36 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
37 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
38 | extern "C" { |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
39 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
40 | |
| 15884 | 41 | typedef struct _PurpleUtilFetchUrlData PurpleUtilFetchUrlData; |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
42 | |
| 15884 | 43 | typedef struct _PurpleMenuAction |
| 12919 | 44 | { |
| 45 | char *label; | |
| 15884 | 46 | PurpleCallback callback; |
| 12919 | 47 | gpointer data; |
| 48 | GList *children; | |
| 15884 | 49 | } PurpleMenuAction; |
| 12106 | 50 | |
| 15884 | 51 | typedef char *(*PurpleInfoFieldFormatCallback)(const char *field, size_t len); |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
52 | |
| 12106 | 53 | /** |
| 54 | * A key-value pair. | |
| 55 | * | |
| 15884 | 56 | * This is used by, among other things, purple_gtk_combo* functions to pass in a |
| 12106 | 57 | * list of key-value pairs so it can display a user-friendly value. |
| 58 | */ | |
| 15884 | 59 | typedef struct _PurpleKeyValuePair |
| 12106 | 60 | { |
| 61 | gchar *key; | |
| 62 | void *value; | |
| 63 | ||
| 15884 | 64 | } PurpleKeyValuePair; |
| 12106 | 65 | |
| 12919 | 66 | /** |
| 15884 | 67 | * Creates a new PurpleMenuAction. |
|
13103
81ccb40de82b
[gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents:
13090
diff
changeset
|
68 | * |
| 12919 | 69 | * @param label The text label to display for this action. |
| 70 | * @param callback The function to be called when the action is used on | |
| 71 | * the selected item. | |
| 72 | * @param data Additional data to be passed to the callback. | |
| 15884 | 73 | * @param children A GList of PurpleMenuActions to be added as a submenu |
| 12919 | 74 | * of the action. |
| 15884 | 75 | * @return The PurpleMenuAction. |
| 12919 | 76 | */ |
| 15884 | 77 | PurpleMenuAction *purple_menu_action_new(const char *label, PurpleCallback callback, |
| 12919 | 78 | gpointer data, GList *children); |
| 12106 | 79 | |
|
13103
81ccb40de82b
[gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents:
13090
diff
changeset
|
80 | /** |
| 15884 | 81 | * Frees a PurpleMenuAction |
|
13103
81ccb40de82b
[gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents:
13090
diff
changeset
|
82 | * |
| 15884 | 83 | * @param act The PurpleMenuAction to free. |
|
13103
81ccb40de82b
[gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents:
13090
diff
changeset
|
84 | */ |
| 15884 | 85 | void purple_menu_action_free(PurpleMenuAction *act); |
|
13103
81ccb40de82b
[gaim-migrate @ 15464]
Richard Laager <rlaager@pidgin.im>
parents:
13090
diff
changeset
|
86 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
87 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
88 | /** @name Base16 Functions */ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
89 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
90 | /*@{*/ |
| 4890 | 91 | |
| 92 | /** | |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
93 | * Converts a chunk of binary data to its base-16 equivalent. |
| 4890 | 94 | * |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
95 | * @param data The data to convert. |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
96 | * @param len The length of the data. |
| 4890 | 97 | * |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
98 | * @return The base-16 string in the ASCII encoding. Must be |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
99 | * g_free'd when no longer needed. |
| 4890 | 100 | * |
| 15884 | 101 | * @see purple_base16_decode() |
| 4890 | 102 | */ |
| 15884 | 103 | gchar *purple_base16_encode(const guchar *data, gsize len); |
| 4890 | 104 | |
| 105 | /** | |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
106 | * Converts an ASCII string of base-16 encoded data to |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
107 | * the binary equivalent. |
| 4890 | 108 | * |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
109 | * @param str The base-16 string to convert to raw data. |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
110 | * @param ret_len The length of the returned data. You can |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
111 | * pass in NULL if you're sure that you know |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
112 | * the length of the decoded data, or if you |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
113 | * know you'll be able to use strlen to |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
114 | * determine the length, etc. |
| 5451 | 115 | * |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
116 | * @return The raw data. Must be g_free'd when no longer needed. |
| 4890 | 117 | * |
| 15884 | 118 | * @see purple_base16_encode() |
| 4890 | 119 | */ |
| 15884 | 120 | guchar *purple_base16_decode(const char *str, gsize *ret_len); |
| 4890 | 121 | |
|
17389
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
122 | /** |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
123 | * Converts a chunk of binary data to a chunked base-16 representation |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
124 | * (handy for key fingerprints) |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
125 | * |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
126 | * Example output: 01:23:45:67:89:AB:CD:EF |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
127 | * |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
128 | * @param data The data to convert. |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
129 | * @param len The length of the data. |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
130 | * |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
131 | * @return The base-16 string in the ASCII chunked encoding. Must be |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
132 | * g_free'd when no longer needed. |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
133 | */ |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
134 | gchar *purple_base16_encode_chunked(const guchar *data, gsize len); |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
135 | |
|
125a4df6d42c
- Add purple_base16_encode_chunked, which is handy for key fingerprints.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
16557
diff
changeset
|
136 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
137 | /*@}*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
138 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
139 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
140 | /** @name Base64 Functions */ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
141 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
142 | /*@{*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
143 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
144 | /** |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
145 | * Converts a chunk of binary data to its base-64 equivalent. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
146 | * |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
147 | * @param data The data to convert. |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
148 | * @param len The length of the data. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
149 | * |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
150 | * @return The base-64 string in the ASCII encoding. Must be |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
151 | * g_free'd when no longer needed. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
152 | * |
| 15884 | 153 | * @see purple_base64_decode() |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
154 | */ |
| 15884 | 155 | gchar *purple_base64_encode(const guchar *data, gsize len); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
156 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
157 | /** |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
158 | * Converts an ASCII string of base-64 encoded data to |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
159 | * the binary equivalent. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
160 | * |
|
11127
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
161 | * @param str The base-64 string to convert to raw data. |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
162 | * @param ret_len The length of the returned data. You can |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
163 | * pass in NULL if you're sure that you know |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
164 | * the length of the decoded data, or if you |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
165 | * know you'll be able to use strlen to |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
166 | * determine the length, etc. |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
167 | * |
|
5e539d9d26a4
[gaim-migrate @ 13183]
Mark Doliner <markdoliner@pidgin.im>
parents:
10871
diff
changeset
|
168 | * @return The raw data. Must be g_free'd when no longer needed. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
169 | * |
| 15884 | 170 | * @see purple_base64_encode() |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
171 | */ |
| 15884 | 172 | guchar *purple_base64_decode(const char *str, gsize *ret_len); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
173 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
174 | /*@}*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
175 | |
|
7679
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
176 | /**************************************************************************/ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
177 | /** @name Quoted Printable Functions */ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
178 | /**************************************************************************/ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
179 | /*@{*/ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
180 | |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
181 | /** |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
182 | * Converts a quoted printable string back to its readable equivalent. |
|
11132
eeb2afd70f70
[gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents:
11127
diff
changeset
|
183 | * What is a quoted printable string, you ask? It's an encoding used |
|
eeb2afd70f70
[gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents:
11127
diff
changeset
|
184 | * to transmit binary data as ASCII. It's intended purpose is to send |
|
eeb2afd70f70
[gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents:
11127
diff
changeset
|
185 | * e-mails containing non-ASCII characters. Wikipedia has a pretty good |
|
eeb2afd70f70
[gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents:
11127
diff
changeset
|
186 | * explanation. Also see RFC 2045. |
|
7679
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
187 | * |
|
11132
eeb2afd70f70
[gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents:
11127
diff
changeset
|
188 | * @param str The quoted printable ASCII string to convert to raw data. |
|
11501
a8fc92026134
[gaim-migrate @ 13746]
Richard Laager <rlaager@pidgin.im>
parents:
11153
diff
changeset
|
189 | * @param ret_len The length of the returned data. |
|
11132
eeb2afd70f70
[gaim-migrate @ 13189]
Mark Doliner <markdoliner@pidgin.im>
parents:
11127
diff
changeset
|
190 | * |
|
11501
a8fc92026134
[gaim-migrate @ 13746]
Richard Laager <rlaager@pidgin.im>
parents:
11153
diff
changeset
|
191 | * @return The readable string. Must be g_free'd when no longer needed. |
|
7679
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
192 | */ |
| 15884 | 193 | guchar *purple_quotedp_decode(const char *str, gsize *ret_len); |
|
7679
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
194 | |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
195 | /*@}*/ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
196 | |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
197 | /**************************************************************************/ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
198 | /** @name MIME Functions */ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
199 | /**************************************************************************/ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
200 | /*@{*/ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
201 | |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
202 | /** |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
203 | * Converts a MIME header field string back to its readable equivalent |
| 8432 | 204 | * according to RFC 2047. Basically, a header is plain ASCII and can |
| 205 | * contain any number of sections called "encoded-words." The format | |
|
7821
d15fc781c318
[gaim-migrate @ 8473]
Mark Doliner <markdoliner@pidgin.im>
parents:
7679
diff
changeset
|
206 | * of an encoded word is =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= |
|
d15fc781c318
[gaim-migrate @ 8473]
Mark Doliner <markdoliner@pidgin.im>
parents:
7679
diff
changeset
|
207 | * =? designates the beginning of the encoded-word |
|
d15fc781c318
[gaim-migrate @ 8473]
Mark Doliner <markdoliner@pidgin.im>
parents:
7679
diff
changeset
|
208 | * ?= designates the end of the encoded-word |
|
11135
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
209 | * |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
210 | * An encoded word is segmented into three pieces by the use of a |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
211 | * question mark. The first piece is the character set, the second |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
212 | * piece is the encoding, and the third piece is the encoded text. |
|
7679
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
213 | * |
|
11135
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
214 | * @param str The ASCII string, possibly containing any number of |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
215 | * encoded-word sections. |
|
7679
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
216 | * |
|
11135
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
217 | * @return The string, with any encoded-word sections decoded and |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
218 | * converted to UTF-8. Must be g_free'd when no longer |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
219 | * needed. |
|
7679
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
220 | */ |
| 15884 | 221 | char *purple_mime_decode_field(const char *str); |
|
7679
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
222 | |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
223 | /*@}*/ |
|
c9804d02dcab
[gaim-migrate @ 8323]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
7675
diff
changeset
|
224 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
225 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
226 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
227 | /** @name Date/Time Functions */ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
228 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
229 | /*@{*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
230 | |
| 4890 | 231 | /** |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
232 | * Formats a time into the specified format. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
233 | * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
234 | * This is essentially strftime(), but it has a static buffer |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
235 | * and handles the UTF-8 conversion for the caller. |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
236 | * |
|
13153
3e0b91a83516
[gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
237 | * This function also provides the GNU %z formatter if the underlying C |
|
3e0b91a83516
[gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
238 | * library doesn't. However, the format string parser is very naive, which |
|
3e0b91a83516
[gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
239 | * means that conversions specifiers to %z cannot be guaranteed. The GNU |
|
3e0b91a83516
[gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
240 | * strftime(3) man page describes %z as: 'The time-zone as hour offset from |
|
3e0b91a83516
[gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
241 | * GMT. Required to emit RFC822-conformant dates |
|
3e0b91a83516
[gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
242 | * (using "%a, %d %b %Y %H:%M:%S %z"). (GNU)' |
|
3e0b91a83516
[gaim-migrate @ 15515]
Richard Laager <rlaager@pidgin.im>
parents:
13120
diff
changeset
|
243 | * |
|
13334
d0d48650f114
[gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents:
13216
diff
changeset
|
244 | * On Windows, this function also converts the results for %Z from a timezone |
|
d0d48650f114
[gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents:
13216
diff
changeset
|
245 | * name (as returned by the system strftime() %Z format string) to a timezone |
|
d0d48650f114
[gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents:
13216
diff
changeset
|
246 | * abbreviation (as is the case on Unix). As with %z, conversion specifiers |
|
d0d48650f114
[gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents:
13216
diff
changeset
|
247 | * should not be used. |
|
d0d48650f114
[gaim-migrate @ 15703]
Richard Laager <rlaager@pidgin.im>
parents:
13216
diff
changeset
|
248 | * |
|
13216
2cc737d198f3
[gaim-migrate @ 15579]
Richard Laager <rlaager@pidgin.im>
parents:
13153
diff
changeset
|
249 | * @param format The format string, in UTF-8 |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
250 | * @param tm The time to format, or @c NULL to use the current local time |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
251 | * |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
252 | * @return The formatted time, in UTF-8. |
|
13216
2cc737d198f3
[gaim-migrate @ 15579]
Richard Laager <rlaager@pidgin.im>
parents:
13153
diff
changeset
|
253 | * |
|
2cc737d198f3
[gaim-migrate @ 15579]
Richard Laager <rlaager@pidgin.im>
parents:
13153
diff
changeset
|
254 | * @note @a format is required to be in UTF-8. This differs from strftime(), |
|
2cc737d198f3
[gaim-migrate @ 15579]
Richard Laager <rlaager@pidgin.im>
parents:
13153
diff
changeset
|
255 | * where the format is provided in the locale charset. |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
256 | */ |
| 15884 | 257 | const char *purple_utf8_strftime(const char *format, const struct tm *tm); |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
258 | |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
259 | /** |
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
260 | * Gets a string representation of the local timezone offset |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
261 | * |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
262 | * @param tm The time to get the timezone for |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
263 | * @param iso TRUE to format the offset according to ISO-8601, FALSE to |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
264 | * not substitute 'Z' for 0 offset, and to not separate |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
265 | * hours and minutes with a colon. |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
266 | */ |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
267 | const char *purple_get_tzoff_str(const struct tm *tm, gboolean iso); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
268 | |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18101
diff
changeset
|
269 | /** |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
270 | * Formats a time into the user's preferred short date format. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
271 | * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
272 | * The returned string is stored in a static buffer, so the result |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
273 | * should be g_strdup()'d if it's going to be kept. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
274 | * |
|
13785
4ee261bcc567
[gaim-migrate @ 16195]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13357
diff
changeset
|
275 | * @param tm The time to format, or @c NULL to use the current local time |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
276 | * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
277 | * @return The date, formatted as per the user's settings. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
278 | */ |
| 15884 | 279 | const char *purple_date_format_short(const struct tm *tm); |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
280 | |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
281 | /** |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
282 | * Formats a time into the user's preferred short date plus time format. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
283 | * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
284 | * The returned string is stored in a static buffer, so the result |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
285 | * should be g_strdup()'d if it's going to be kept. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
286 | * |
|
13785
4ee261bcc567
[gaim-migrate @ 16195]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13357
diff
changeset
|
287 | * @param tm The time to format, or @c NULL to use the current local time |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
288 | * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
289 | * @return The timestamp, formatted as per the user's settings. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
290 | */ |
| 15884 | 291 | const char *purple_date_format_long(const struct tm *tm); |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
292 | |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
293 | /** |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
294 | * Formats a time into the user's preferred full date and time format. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
295 | * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
296 | * The returned string is stored in a static buffer, so the result |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
297 | * should be g_strdup()'d if it's going to be kept. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
298 | * |
|
13785
4ee261bcc567
[gaim-migrate @ 16195]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13357
diff
changeset
|
299 | * @param tm The time to format, or @c NULL to use the current local time |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
300 | * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
301 | * @return The date and time, formatted as per the user's settings. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
302 | */ |
| 15884 | 303 | const char *purple_date_format_full(const struct tm *tm); |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
304 | |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
305 | /** |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
306 | * Formats a time into the user's preferred time format. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
307 | * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
308 | * The returned string is stored in a static buffer, so the result |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
309 | * should be g_strdup()'d if it's going to be kept. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
310 | * |
|
13785
4ee261bcc567
[gaim-migrate @ 16195]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13357
diff
changeset
|
311 | * @param tm The time to format, or @c NULL to use the current local time |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
312 | * |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
313 | * @return The time, formatted as per the user's settings. |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
314 | */ |
| 15884 | 315 | const char *purple_time_format(const struct tm *tm); |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
316 | |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
317 | /** |
| 4890 | 318 | * Builds a time_t from the supplied information. |
| 319 | * | |
| 320 | * @param year The year. | |
| 321 | * @param month The month. | |
| 322 | * @param day The day. | |
| 323 | * @param hour The hour. | |
| 324 | * @param min The minute. | |
| 325 | * @param sec The second. | |
| 326 | * | |
| 327 | * @return A time_t. | |
| 328 | */ | |
| 15884 | 329 | time_t purple_time_build(int year, int month, int day, int hour, |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
330 | int min, int sec); |
| 4890 | 331 | |
| 15884 | 332 | /** Used by purple_str_to_time to indicate no timezone offset was |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
333 | * specified in the timestamp string. */ |
| 15884 | 334 | #define PURPLE_NO_TZ_OFF -500000 |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
335 | |
| 8577 | 336 | /** |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
337 | * Parses a timestamp in jabber, ISO8601, or MM/DD/YYYY format and returns |
|
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
338 | * a time_t. |
| 8577 | 339 | * |
| 340 | * @param timestamp The timestamp | |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
341 | * @param utc Assume UTC if no timezone specified |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
342 | * @param tm If not @c NULL, the caller can get a copy of the |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
343 | * struct tm used to calculate the time_t return value. |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
344 | * @param tz_off If not @c NULL, the caller can get a copy of the |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
345 | * timezone offset (from UTC) used to calculate the time_t |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
346 | * return value. Note: Zero is a valid offset. As such, |
| 15884 | 347 | * the value of the macro @c PURPLE_NO_TZ_OFF indicates no |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
348 | * offset was specified (which means that the local |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
349 | * timezone was used in the calculation). |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
350 | * @param rest If not @c NULL, the caller can get a pointer to the |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
351 | * part of @a timestamp left over after parsing is |
|
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
352 | * completed, if it's not the end of @a timestamp. |
| 8577 | 353 | * |
| 354 | * @return A time_t. | |
| 355 | */ | |
| 15884 | 356 | time_t purple_str_to_time(const char *timestamp, gboolean utc, |
|
13120
c25222322810
[gaim-migrate @ 15481]
Richard Laager <rlaager@pidgin.im>
parents:
13105
diff
changeset
|
357 | struct tm *tm, long *tz_off, const char **rest); |
| 8577 | 358 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
359 | /*@}*/ |
| 4890 | 360 | |
| 361 | ||
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
362 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
363 | /** @name Markup Functions */ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
364 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
365 | /*@{*/ |
| 5826 | 366 | |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6861
diff
changeset
|
367 | /** |
|
11135
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
368 | * Finds an HTML tag matching the given name. |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
369 | * |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
370 | * This locates an HTML tag's start and end, and stores its attributes |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
371 | * in a GData hash table. The names of the attributes are lower-cased |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
372 | * in the hash table, and the name of the tag is case insensitive. |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6861
diff
changeset
|
373 | * |
|
14030
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13785
diff
changeset
|
374 | * @param needle The name of the tag |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13785
diff
changeset
|
375 | * @param haystack The null-delimited string to search in |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13785
diff
changeset
|
376 | * @param start A pointer to the start of the tag if found |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13785
diff
changeset
|
377 | * @param end A pointer to the end of the tag if found |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13785
diff
changeset
|
378 | * @param attributes The attributes, if the tag was found. This should |
|
23144f1dc950
[gaim-migrate @ 16525]
Mark Doliner <markdoliner@pidgin.im>
parents:
13785
diff
changeset
|
379 | * be freed with g_datalist_clear(). |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6861
diff
changeset
|
380 | * @return TRUE if the tag was found |
|
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6861
diff
changeset
|
381 | */ |
| 15884 | 382 | gboolean purple_markup_find_tag(const char *needle, const char *haystack, |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
383 | const char **start, const char **end, |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
384 | GData **attributes); |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
385 | |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
386 | /** |
|
7095
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
387 | * Extracts a field of data from HTML. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
388 | * |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
389 | * This is a scary function. See protocols/msn/msn.c and |
| 9175 | 390 | * protocols/yahoo/yahoo_profile.c for example usage. |
|
7095
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
391 | * |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
392 | * @param str The string to parse. |
| 7675 | 393 | * @param len The size of str. |
| 15884 | 394 | * @param user_info The destination PurpleNotifyUserInfo to which the new |
|
15205
f642029b2f97
[gaim-migrate @ 17929]
Evan Schoenberg <evands@pidgin.im>
parents:
14708
diff
changeset
|
395 | * field info should be added. |
|
7095
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
396 | * @param start_token The beginning token. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
397 | * @param skip The number of characters to skip after the |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
398 | * start token. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
399 | * @param end_token The ending token. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
400 | * @param check_value The value that the last character must meet. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
401 | * @param no_value_token The token indicating no value is given. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
402 | * @param display_name The short descriptive name to display for this token. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
403 | * @param is_link TRUE if this should be a link, or FALSE otherwise. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
404 | * @param link_prefix The prefix for the link. |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
405 | * @param format_cb A callback to format the value before adding it. |
|
7095
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
406 | * |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
407 | * @return TRUE if successful, or FALSE otherwise. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
408 | */ |
| 15884 | 409 | gboolean purple_markup_extract_info_field(const char *str, int len, PurpleNotifyUserInfo *user_info, |
| 7675 | 410 | const char *start_token, int skip, |
| 411 | const char *end_token, char check_value, | |
| 412 | const char *no_value_token, | |
| 413 | const char *display_name, gboolean is_link, | |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
13103
diff
changeset
|
414 | const char *link_prefix, |
| 15884 | 415 | PurpleInfoFieldFormatCallback format_cb); |
|
7095
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
416 | |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
417 | /** |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
418 | * Converts HTML markup to XHTML. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
419 | * |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
420 | * @param html The HTML markup. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
421 | * @param dest_xhtml The destination XHTML output. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
422 | * @param dest_plain The destination plain-text output. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
423 | */ |
| 15884 | 424 | void purple_markup_html_to_xhtml(const char *html, char **dest_xhtml, |
|
7095
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
425 | char **dest_plain); |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
426 | |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
427 | /** |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
428 | * Strips HTML tags from a string. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
429 | * |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
430 | * @param str The string to strip HTML from. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
431 | * |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
432 | * @return The new string without HTML. This must be freed. |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
433 | */ |
| 15884 | 434 | char *purple_markup_strip_html(const char *str); |
|
7095
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
435 | |
|
17d2b54254f8
[gaim-migrate @ 7660]
Christian Hammond <chipx86@chipx86.com>
parents:
7094
diff
changeset
|
436 | /** |
|
7107
903864ff76c3
[gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents:
7106
diff
changeset
|
437 | * Adds the necessary HTML code to turn URIs into HTML links in a string. |
|
903864ff76c3
[gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents:
7106
diff
changeset
|
438 | * |
|
903864ff76c3
[gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents:
7106
diff
changeset
|
439 | * @param str The string to linkify. |
|
903864ff76c3
[gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents:
7106
diff
changeset
|
440 | * |
|
903864ff76c3
[gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents:
7106
diff
changeset
|
441 | * @return The linkified text. |
|
903864ff76c3
[gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents:
7106
diff
changeset
|
442 | */ |
| 15884 | 443 | char *purple_markup_linkify(const char *str); |
|
7107
903864ff76c3
[gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents:
7106
diff
changeset
|
444 | |
| 8163 | 445 | /** |
| 8442 | 446 | * Unescapes HTML entities to their literal characters. |
| 447 | * For example "&" is replaced by '&' and so on. | |
| 448 | * Actually only "&", """, "<" and ">" are currently | |
| 449 | * supported. | |
| 450 | * | |
| 451 | * @param html The string in which to unescape any HTML entities | |
| 452 | * | |
| 453 | * @return the text with HTML entities literalized | |
| 454 | */ | |
| 15884 | 455 | char *purple_unescape_html(const char *html); |
| 8442 | 456 | |
| 9175 | 457 | /** |
| 458 | * Returns a newly allocated substring of the HTML UTF-8 string "str". | |
| 459 | * The markup is preserved such that the substring will have the same | |
| 460 | * formatting as original string, even though some tags may have been | |
| 461 | * opened before "x", or may close after "y". All open tags are closed | |
| 462 | * at the end of the returned string, in the proper order. | |
| 463 | * | |
| 464 | * Note that x and y are in character offsets, not byte offsets, and | |
| 465 | * are offsets into an unformatted version of str. Because of this, | |
| 466 | * this function may be sensitive to changes in GtkIMHtml and may break | |
| 15884 | 467 | * when used with other UI's. libpurple users are encouraged to report and |
| 9175 | 468 | * work out any problems encountered. |
| 469 | * | |
| 470 | * @param str The input NUL terminated, HTML, UTF-8 (or ASCII) string. | |
| 471 | * @param x The character offset into an unformatted version of str to | |
| 472 | * begin at. | |
| 473 | * @param y The character offset (into an unformatted vesion of str) of | |
| 474 | * one past the last character to include in the slice. | |
| 475 | * | |
| 476 | * @return The HTML slice of string, with all formatting retained. | |
| 477 | */ | |
| 15884 | 478 | char *purple_markup_slice(const char *str, guint x, guint y); |
| 9175 | 479 | |
| 480 | /** | |
| 481 | * Returns a newly allocated string containing the name of the tag | |
| 482 | * located at "tag". Tag is expected to point to a '<', and contain | |
| 483 | * a '>' sometime after that. If there is no '>' and the string is | |
| 484 | * not NUL terminated, this function can be expected to segfault. | |
| 485 | * | |
| 486 | * @param tag The string starting a HTML tag. | |
| 487 | * @return A string containing the name of the tag. | |
| 488 | */ | |
| 15884 | 489 | char *purple_markup_get_tag_name(const char *tag); |
| 9175 | 490 | |
|
16143
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
491 | /** |
|
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
492 | * Returns a constant string of the character representation of the HTML |
| 16144 | 493 | * entity pointed to by @a text. For example, purple_markup_unescape_entity("&") |
| 494 | * will return "&". The @a text variable is expected to point to an '&', | |
| 495 | * the first character of the entity. If given an unrecognized entity, the function | |
| 496 | * returns @c NULL. | |
| 497 | * | |
|
16557
b0e9ddccdbb9
Fix purple_util_get_image_extension()'s data param. to be correctly marked as constant.
Daniel Atallah <datallah@pidgin.im>
parents:
16437
diff
changeset
|
498 | * Note that this function, unlike purple_unescape_html(), does not search |
| 16144 | 499 | * the string for the entity, does not replace the entity, and does not |
|
16143
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
500 | * return a newly allocated string. |
|
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
501 | * |
| 16144 | 502 | * @param text A string containing an HTML entity. |
| 503 | * @param length If not @c NULL, the string length of the entity is stored in this location. | |
| 504 | * | |
|
16143
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
505 | * @return A constant string containing the character representation of the given entity. |
|
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
506 | */ |
| 16144 | 507 | const char * purple_markup_unescape_entity(const char *text, int *length); |
|
16143
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
508 | |
|
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
509 | /** |
|
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
510 | * Returns a newly allocated string containing the value of the CSS property specified |
| 16144 | 511 | * in opt. The @a style argument is expected to point to a HTML inline CSS. |
|
16262
1d9b65303dfc
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@pidgin.im>
parents:
16213
diff
changeset
|
512 | * The function will seek for the CSS property and return its value. |
| 16144 | 513 | * |
|
16262
1d9b65303dfc
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@pidgin.im>
parents:
16213
diff
changeset
|
514 | * For example, purple_markup_get_css_property("direction:rtl;color:#dc4d1b;", |
|
1d9b65303dfc
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@pidgin.im>
parents:
16213
diff
changeset
|
515 | * "color") would return "#dc4d1b". |
| 16144 | 516 | * |
|
16262
1d9b65303dfc
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@pidgin.im>
parents:
16213
diff
changeset
|
517 | * On error or if the requested property was not found, the function returns |
|
1d9b65303dfc
Doxygen updates. This eliminated all the warnings from Doxygen.
Richard Laager <rlaager@pidgin.im>
parents:
16213
diff
changeset
|
518 | * @c NULL. |
|
16143
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
519 | * |
|
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
520 | * @param style A string containing the inline CSS text. |
| 16144 | 521 | * @param opt The requested CSS property. |
| 522 | * | |
| 523 | * @return The value of the requested CSS property. | |
|
16143
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
524 | */ |
| 16144 | 525 | char * purple_markup_get_css_property(const gchar *style, const gchar *opt); |
|
16143
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
526 | |
|
6393e5b11ff5
Patch from shlomil in ticket #78.
Shlomi Loubaton <shlomister@gmail.com>
parents:
15884
diff
changeset
|
527 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
528 | /*@}*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
529 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
530 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
531 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
532 | /** @name Path/Filename Functions */ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
533 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
534 | /*@{*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
535 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
536 | /** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
537 | * Returns the user's home directory. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
538 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
539 | * @return The user's home directory. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
540 | * |
| 15884 | 541 | * @see purple_user_dir() |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
542 | */ |
| 15884 | 543 | const gchar *purple_home_dir(void); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
544 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
545 | /** |
| 15884 | 546 | * Returns the purple settings directory in the user's home directory. |
| 547 | * This is usually ~/.purple | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
548 | * |
| 15884 | 549 | * @return The purple settings directory. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
550 | * |
| 15884 | 551 | * @see purple_home_dir() |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
552 | */ |
| 15884 | 553 | const char *purple_user_dir(void); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
554 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
555 | /** |
| 15884 | 556 | * Define a custom purple settings directory, overriding the default (user's home directory/.purple) |
| 8596 | 557 | * @param dir The custom settings directory |
| 558 | */ | |
| 15884 | 559 | void purple_util_set_user_dir(const char *dir); |
| 8596 | 560 | |
| 561 | /** | |
| 7612 | 562 | * Builds a complete path from the root, making any directories along |
| 563 | * the path which do not already exist. | |
| 7622 | 564 | * |
| 7612 | 565 | * @param path The path you wish to create. Note that it must start |
| 566 | * from the root or this function will fail. | |
| 567 | * @param mode Unix-style permissions for this directory. | |
| 7622 | 568 | * |
| 7612 | 569 | * @return 0 for success, nonzero on any error. |
| 570 | */ | |
| 15884 | 571 | int purple_build_dir(const char *path, int mode); |
| 7612 | 572 | |
| 573 | /** | |
| 15884 | 574 | * Write a string of data to a file of the given name in the Purple |
| 575 | * user directory ($HOME/.purple by default). The data is typically | |
| 576 | * a serialized version of one of Purple's config files, such as | |
|
10415
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10414
diff
changeset
|
577 | * prefs.xml, accounts.xml, etc. And the string is typically |
|
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10414
diff
changeset
|
578 | * obtained using xmlnode_to_formatted_str. However, this function |
|
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10414
diff
changeset
|
579 | * should work fine for saving binary files as well. |
|
10414
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
10332
diff
changeset
|
580 | * |
| 15884 | 581 | * @param filename The basename of the file to write in the purple_user_dir. |
|
10414
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
10332
diff
changeset
|
582 | * @param data A null-terminated string of data to write. |
|
10415
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10414
diff
changeset
|
583 | * @param size The size of the data to save. If data is |
|
faceb835eb87
[gaim-migrate @ 11665]
Mark Doliner <markdoliner@pidgin.im>
parents:
10414
diff
changeset
|
584 | * null-terminated you can pass in -1. |
|
10414
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
10332
diff
changeset
|
585 | * |
|
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
10332
diff
changeset
|
586 | * @return TRUE if the file was written successfully. FALSE otherwise. |
|
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
10332
diff
changeset
|
587 | */ |
| 15884 | 588 | gboolean purple_util_write_data_to_file(const char *filename, const char *data, |
|
19663
44c4b4ce3cd8
Fix purple_util_write_data_to_file signature.
Daniel Atallah <datallah@pidgin.im>
parents:
19662
diff
changeset
|
589 | gssize size); |
|
10414
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
10332
diff
changeset
|
590 | |
|
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
10332
diff
changeset
|
591 | /** |
|
19501
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
592 | * Write data to a file using the absolute path. |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
593 | * |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
594 | * This exists for Glib backwards compatibility reasons. |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
595 | * |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
596 | * @param filename_full Filename to write to |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
597 | * @param data A null-terminated string of data to write. |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
598 | * @param size The size of the data to save. If data is |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
599 | * null-terminated you can pass in -1. |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
600 | * |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
601 | * @return TRUE if the file was written successfully. FALSE otherwise. |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
602 | * |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
603 | * @todo Remove this function (use g_file_set_contents instead) when 3.0.0 |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
604 | * rolls around. |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
605 | * @see purple_util_write_data_to_file() |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
606 | * |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
607 | */ |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
608 | gboolean |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
609 | purple_util_write_data_to_file_absolute(const char *filename_full, const char *data, size_t size); |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
610 | |
|
4c14c89dcf02
- Add purple_util_write_data_to_file_absolute; glib's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18413
diff
changeset
|
611 | /** |
|
10425
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
612 | * Read the contents of a given file and parse the results into an |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
613 | * xmlnode tree structure. This is intended to be used to read |
| 15884 | 614 | * Purple's configuration xml files (prefs.xml, pounces.xml, etc.) |
|
10425
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
615 | * |
| 15884 | 616 | * @param filename The basename of the file to open in the purple_user_dir. |
|
10425
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
617 | * @param description A very short description of the contents of this |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
618 | * file. This is used in error messages shown to the |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
619 | * user when the file can not be opened. For example, |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
620 | * "preferences," or "buddy pounces." |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
621 | * |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
622 | * @return An xmlnode tree of the contents of the given file. Or NULL, if |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
623 | * the file does not exist or there was an error reading the file. |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
624 | */ |
| 15884 | 625 | xmlnode *purple_util_read_xml_from_file(const char *filename, |
|
10425
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
626 | const char *description); |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
627 | |
|
d82cef15da95
[gaim-migrate @ 11677]
Mark Doliner <markdoliner@pidgin.im>
parents:
10415
diff
changeset
|
628 | /** |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
629 | * Creates a temporary file and returns a file pointer to it. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
630 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
631 | * This is like mkstemp(), but returns a file pointer and uses a |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
632 | * pre-set template. It uses the semantics of tempnam() for the |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
633 | * directory to use and allocates the space for the file path. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
634 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
635 | * The caller is responsible for closing the file and removing it when |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
636 | * done, as well as freeing the space pointed to by @a path with |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
637 | * g_free(). |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
638 | * |
|
10203
21d6c11a53c6
[gaim-migrate @ 11324]
Herman Bloggs <herman@bluedigits.com>
parents:
9926
diff
changeset
|
639 | * @param path The returned path to the temp file. |
|
21d6c11a53c6
[gaim-migrate @ 11324]
Herman Bloggs <herman@bluedigits.com>
parents:
9926
diff
changeset
|
640 | * @param binary Text or binary, for platforms where it matters. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
641 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
642 | * @return A file pointer to the temporary file, or @c NULL on failure. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
643 | */ |
| 15884 | 644 | FILE *purple_mkstemp(char **path, gboolean binary); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
645 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
646 | /** |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
647 | * Returns an extension corresponding to the image data's file type. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
648 | * |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
649 | * @param data A pointer to the image data |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
650 | * @param len The length of the image data |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
651 | * |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
652 | * @return The appropriate extension, or "icon" if unknown. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
653 | */ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
654 | const char * |
|
16557
b0e9ddccdbb9
Fix purple_util_get_image_extension()'s data param. to be correctly marked as constant.
Daniel Atallah <datallah@pidgin.im>
parents:
16437
diff
changeset
|
655 | purple_util_get_image_extension(gconstpointer data, size_t len); |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
656 | |
|
18101
3ce21b5a182c
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents:
17389
diff
changeset
|
657 | /** |
|
3ce21b5a182c
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents:
17389
diff
changeset
|
658 | * Returns a SHA-1 hash string of the data passed in with the correct file |
|
3ce21b5a182c
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents:
17389
diff
changeset
|
659 | * extention appended. |
|
3ce21b5a182c
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents:
17389
diff
changeset
|
660 | */ |
|
3ce21b5a182c
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents:
17389
diff
changeset
|
661 | char *purple_util_get_image_filename(gconstpointer image_data, size_t image_len); |
|
3ce21b5a182c
A patch from David Grohmann (dave1g) to log embedded images.
Richard Laager <rlaager@pidgin.im>
parents:
17389
diff
changeset
|
662 | |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
663 | /*@}*/ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
664 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
665 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
666 | /**************************************************************************/ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
667 | /** @name Environment Detection Functions */ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
668 | /**************************************************************************/ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
669 | /*@{*/ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
670 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
671 | /** |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
672 | * Checks if the given program name is valid and executable. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
673 | * |
|
7303
b7b02c31b5bb
[gaim-migrate @ 7887]
Christian Hammond <chipx86@chipx86.com>
parents:
7261
diff
changeset
|
674 | * @param program The file name of the application. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
675 | * |
|
12483
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
676 | * @return TRUE if the program is runable. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
677 | */ |
| 15884 | 678 | gboolean purple_program_is_valid(const char *program); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
679 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
680 | /** |
|
12483
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
681 | * Check if running GNOME. |
| 11878 | 682 | * |
|
12483
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
683 | * @return TRUE if running GNOME, FALSE otherwise. |
| 11878 | 684 | */ |
| 15884 | 685 | gboolean purple_running_gnome(void); |
| 11878 | 686 | |
| 687 | /** | |
|
12483
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
688 | * Check if running KDE. |
|
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
689 | * |
|
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
690 | * @return TRUE if running KDE, FALSE otherwise. |
|
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
691 | */ |
| 15884 | 692 | gboolean purple_running_kde(void); |
|
12483
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
693 | |
|
38fc67810cdb
[gaim-migrate @ 14795]
Richard Laager <rlaager@pidgin.im>
parents:
12106
diff
changeset
|
694 | /** |
|
14708
6006e069317c
[gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents:
14416
diff
changeset
|
695 | * Check if running OS X. |
|
6006e069317c
[gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents:
14416
diff
changeset
|
696 | * |
|
6006e069317c
[gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents:
14416
diff
changeset
|
697 | * @return TRUE if running OS X, FALSE otherwise. |
|
6006e069317c
[gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents:
14416
diff
changeset
|
698 | */ |
| 15884 | 699 | gboolean purple_running_osx(void); |
|
14708
6006e069317c
[gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents:
14416
diff
changeset
|
700 | |
|
6006e069317c
[gaim-migrate @ 17392]
Evan Schoenberg <evands@pidgin.im>
parents:
14416
diff
changeset
|
701 | /** |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
702 | * Returns the IP address from a socket file descriptor. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
703 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
704 | * @param fd The socket file descriptor. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
705 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
706 | * @return The IP address, or @c NULL on error. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
707 | */ |
| 15884 | 708 | char *purple_fd_get_ip(int fd); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
709 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
710 | /*@}*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
711 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
712 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
713 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
714 | /** @name String Functions */ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
715 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
716 | /*@{*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
717 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
718 | /** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
719 | * Normalizes a string, so that it is suitable for comparison. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
720 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
721 | * The returned string will point to a static buffer, so if the |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
722 | * string is intended to be kept long-term, you <i>must</i> |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
723 | * g_strdup() it. Also, calling normalize() twice in the same line |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
724 | * will lead to problems. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
725 | * |
|
10433
04cf48e72655
[gaim-migrate @ 11689]
Mark Doliner <markdoliner@pidgin.im>
parents:
10425
diff
changeset
|
726 | * @param account The account the string belongs to, or NULL if you do |
|
04cf48e72655
[gaim-migrate @ 11689]
Mark Doliner <markdoliner@pidgin.im>
parents:
10425
diff
changeset
|
727 | * not know the account. If you use NULL, the string |
|
04cf48e72655
[gaim-migrate @ 11689]
Mark Doliner <markdoliner@pidgin.im>
parents:
10425
diff
changeset
|
728 | * will still be normalized, but if the PRPL uses a |
|
04cf48e72655
[gaim-migrate @ 11689]
Mark Doliner <markdoliner@pidgin.im>
parents:
10425
diff
changeset
|
729 | * custom normalization function then the string may |
|
04cf48e72655
[gaim-migrate @ 11689]
Mark Doliner <markdoliner@pidgin.im>
parents:
10425
diff
changeset
|
730 | * not be normalized correctly. |
| 7261 | 731 | * @param str The string to normalize. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
732 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
733 | * @return A pointer to the normalized version stored in a static buffer. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
734 | */ |
| 15884 | 735 | const char *purple_normalize(const PurpleAccount *account, const char *str); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
736 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
737 | /** |
|
11153
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
738 | * Normalizes a string, so that it is suitable for comparison. |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
739 | * |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
740 | * This is one possible implementation for the PRPL callback |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
741 | * function "normalize." It returns a lowercase and UTF-8 |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
742 | * normalized version of the string. |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
743 | * |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
744 | * @param account The account the string belongs to. |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
745 | * @param str The string to normalize. |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
746 | * |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
747 | * @return A pointer to the normalized version stored in a static buffer. |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
748 | */ |
| 15884 | 749 | const char *purple_normalize_nocase(const PurpleAccount *account, const char *str); |
|
11153
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
750 | |
|
b5c721366f2d
[gaim-migrate @ 13235]
Evan Schoenberg <evands@pidgin.im>
parents:
11137
diff
changeset
|
751 | /** |
| 7628 | 752 | * Compares two strings to see if the first contains the second as |
| 753 | * a proper prefix. | |
| 8432 | 754 | * |
| 7628 | 755 | * @param s The string to check. |
| 756 | * @param p The prefix in question. | |
| 8432 | 757 | * |
| 7628 | 758 | * @return TRUE if p is a prefix of s, otherwise FALSE. |
| 759 | */ | |
| 15884 | 760 | gboolean purple_str_has_prefix(const char *s, const char *p); |
| 7628 | 761 | |
| 762 | /** | |
| 763 | * Compares two strings to see if the second is a proper suffix | |
| 764 | * of the first. | |
| 8432 | 765 | * |
| 7628 | 766 | * @param s The string to check. |
| 767 | * @param x The suffix in question. | |
| 8432 | 768 | * |
| 7628 | 769 | * @return TRUE if x is a a suffix of s, otherwise FALSE. |
| 770 | */ | |
| 15884 | 771 | gboolean purple_str_has_suffix(const char *s, const char *x); |
| 7628 | 772 | |
| 773 | /** | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
774 | * Duplicates a string and replaces all newline characters from the |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
775 | * source string with HTML linebreaks. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
776 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
777 | * @param src The source string. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
778 | * |
|
8341
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
779 | * @return The new string. Must be g_free'd by the caller. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
780 | */ |
| 15884 | 781 | gchar *purple_strdup_withhtml(const gchar *src); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
782 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
783 | /** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
784 | * Ensures that all linefeeds have a matching carriage return. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
785 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
786 | * @param str The source string. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
787 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
788 | * @return The string with carriage returns. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
789 | */ |
| 15884 | 790 | char *purple_str_add_cr(const char *str); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
791 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
792 | /** |
|
11920
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
793 | * Strips all instances of the given character from the |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
794 | * given string. The string is modified in place. This |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
795 | * is useful for stripping new line characters, for example. |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
796 | * |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
797 | * Example usage: |
| 15884 | 798 | * purple_str_strip_char(my_dumb_string, '\n'); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
799 | * |
|
11920
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
800 | * @param str The string to strip characters from. |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
801 | * @param thechar The character to strip from the given string. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
802 | */ |
| 15884 | 803 | void purple_str_strip_char(char *str, char thechar); |
|
11920
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
804 | |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
805 | /** |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
806 | * Given a string, this replaces all instances of one character |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
807 | * with another. This happens inline (the original string IS |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
808 | * modified). |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
809 | * |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
810 | * @param string The string from which to replace stuff. |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
811 | * @param delimiter The character you want replaced. |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
812 | * @param replacement The character you want inserted in place |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
813 | * of the delimiting character. |
|
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
814 | */ |
| 15884 | 815 | void purple_util_chrreplace(char *string, char delimiter, |
|
11920
be80617ec59b
[gaim-migrate @ 14211]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11878
diff
changeset
|
816 | char replacement); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
817 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
818 | /** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
819 | * Given a string, this replaces one substring with another |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
820 | * and returns a newly allocated string. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
821 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
822 | * @param string The string from which to replace stuff. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
823 | * @param delimiter The substring you want replaced. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
824 | * @param replacement The substring you want inserted in place |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
825 | * of the delimiting substring. |
|
8461
920171a59e45
[gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents:
8442
diff
changeset
|
826 | * |
|
920171a59e45
[gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents:
8442
diff
changeset
|
827 | * @return A new string, after performing the substitution. |
|
920171a59e45
[gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents:
8442
diff
changeset
|
828 | * free this with g_free(). |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
829 | */ |
| 15884 | 830 | gchar *purple_strreplace(const char *string, const char *delimiter, |
|
8341
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
831 | const char *replacement); |
|
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
832 | |
|
12813
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
833 | |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
834 | /** |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
835 | * Given a string, this replaces any utf-8 substrings in that string with |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
836 | * the corresponding numerical character reference, and returns a newly |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
837 | * allocated string. |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
838 | * |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
839 | * @param in The string which might contain utf-8 substrings |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
840 | * |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
841 | * @return A new string, with utf-8 replaced with numerical character |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
842 | * references, free this with g_free() |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
843 | */ |
| 15884 | 844 | char *purple_utf8_ncr_encode(const char *in); |
|
12813
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
845 | |
|
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
846 | |
|
8341
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
847 | /** |
| 9171 | 848 | * Given a string, this replaces any numerical character references |
| 849 | * in that string with the corresponding actual utf-8 substrings, | |
| 850 | * and returns a newly allocated string. | |
| 851 | * | |
| 852 | * @param in The string which might contain numerical character references. | |
| 853 | * | |
| 854 | * @return A new string, with numerical character references | |
| 855 | * replaced with actual utf-8, free this with g_free(). | |
| 856 | */ | |
| 15884 | 857 | char *purple_utf8_ncr_decode(const char *in); |
| 9171 | 858 | |
|
12813
6f67cfa0e6a0
[gaim-migrate @ 15161]
Christopher O'Brien <siege@pidgin.im>
parents:
12483
diff
changeset
|
859 | |
| 9171 | 860 | /** |
|
8341
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
861 | * Given a string, this replaces one substring with another |
|
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
862 | * ignoring case and returns a newly allocated string. |
|
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
863 | * |
|
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
864 | * @param string The string from which to replace stuff. |
|
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
865 | * @param delimiter The substring you want replaced. |
|
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
866 | * @param replacement The substring you want inserted in place |
|
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
867 | * of the delimiting substring. |
|
8461
920171a59e45
[gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents:
8442
diff
changeset
|
868 | * |
|
920171a59e45
[gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents:
8442
diff
changeset
|
869 | * @return A new string, after performing the substitution. |
|
920171a59e45
[gaim-migrate @ 9191]
Mark Doliner <markdoliner@pidgin.im>
parents:
8442
diff
changeset
|
870 | * free this with g_free(). |
|
8341
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
871 | */ |
| 15884 | 872 | gchar *purple_strcasereplace(const char *string, const char *delimiter, |
|
8341
dc43b1acfc1a
[gaim-migrate @ 9065]
Mark Doliner <markdoliner@pidgin.im>
parents:
8163
diff
changeset
|
873 | const char *replacement); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
874 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
875 | /** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
876 | * This is like strstr, except that it ignores ASCII case in |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
877 | * searching for the substring. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
878 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
879 | * @param haystack The string to search in. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
880 | * @param needle The substring to find. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
881 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
882 | * @return the location of the substring if found, or NULL if not |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
883 | */ |
| 15884 | 884 | const char *purple_strcasestr(const char *haystack, const char *needle); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
885 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
886 | /** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
887 | * Returns a string representing a filesize in the appropriate |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
888 | * units (MB, KB, GB, etc.) |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
889 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
890 | * @param size The size |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
891 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
892 | * @return The string in units form. This must be freed. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
893 | */ |
| 15884 | 894 | char *purple_str_size_to_units(size_t size); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
895 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
896 | /** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
897 | * Converts seconds into a human-readable form. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
898 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
899 | * @param sec The seconds. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
900 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
901 | * @return A human-readable form, containing days, hours, minutes, and |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
902 | * seconds. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
903 | */ |
| 15884 | 904 | char *purple_str_seconds_to_string(guint sec); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
905 | |
| 9277 | 906 | /** |
| 907 | * Converts a binary string into a NUL terminated ascii string, | |
| 908 | * replacing nonascii characters and characters below SPACE (including | |
| 9307 | 909 | * NUL) into \\xyy, where yy are two hex digits. Also backslashes are |
| 910 | * changed into two backslashes (\\\\). The returned, newly allocated | |
| 911 | * string can be outputted to the console, and must be g_free()d. | |
| 9277 | 912 | * |
| 913 | * @param binary A string of random data, possibly with embedded NULs | |
| 914 | * and such. | |
| 915 | * @param len The length in bytes of the input string. Must not be 0. | |
| 916 | * | |
| 917 | * @return A newly allocated ASCIIZ string. | |
| 918 | */ | |
| 15884 | 919 | char *purple_str_binary_to_ascii(const unsigned char *binary, guint len); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
920 | /*@}*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
921 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
922 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
923 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
924 | /** @name URI/URL Functions */ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
925 | /**************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
926 | /*@{*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
927 | |
| 15884 | 928 | void purple_got_protocol_handler_uri(const char *uri); |
|
15678
7434ef155a3a
Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents:
15482
diff
changeset
|
929 | |
|
7107
903864ff76c3
[gaim-migrate @ 7672]
Christian Hammond <chipx86@chipx86.com>
parents:
7106
diff
changeset
|
930 | /** |
| 9227 | 931 | * Parses a URL, returning its host, port, file path, username and password. |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
932 | * |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
933 | * The returned data must be freed. |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
934 | * |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
935 | * @param url The URL to parse. |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
936 | * @param ret_host The returned host. |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
937 | * @param ret_port The returned port. |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
938 | * @param ret_path The returned path. |
| 9227 | 939 | * @param ret_user The returned username. |
| 940 | * @param ret_passwd The returned password. | |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
941 | */ |
| 15884 | 942 | gboolean purple_url_parse(const char *url, char **ret_host, int *ret_port, |
| 9227 | 943 | char **ret_path, char **ret_user, char **ret_passwd); |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
944 | |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
945 | /** |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
946 | * This is the signature used for functions that act as the callback |
| 15884 | 947 | * to purple_util_fetch_url() or purple_util_fetch_url_request(). |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
948 | * |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
949 | * @param url_data The same value that was returned when you called |
| 15884 | 950 | * purple_fetch_url() or purple_fetch_url_request(). |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
951 | * @param user_data The user data that your code passed into either |
| 15884 | 952 | * purple_util_fetch_url() or purple_util_fetch_url_request(). |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
953 | * @param url_text This will be NULL on error. Otherwise this |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
954 | * will contain the contents of the URL. |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
955 | * @param len 0 on error, otherwise this is the length of buf. |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
956 | * @param error_message If something went wrong then this will contain |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
957 | * a descriptive error message, and buf will be |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
958 | * NULL and len will be 0. |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
959 | */ |
| 15884 | 960 | typedef void (*PurpleUtilFetchUrlCallback)(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, gsize len, const gchar *error_message); |
|
12887
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
961 | |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
962 | /** |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
963 | * Fetches the data from a URL, and passes it to a callback function. |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
964 | * |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
965 | * @param url The URL. |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
966 | * @param full TRUE if this is the full URL, or FALSE if it's a |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
967 | * partial URL. |
| 9284 | 968 | * @param user_agent The user agent field to use, or NULL. |
| 969 | * @param http11 TRUE if HTTP/1.1 should be used to download the file. | |
|
7094
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
970 | * @param cb The callback function. |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
971 | * @param data The user data to pass to the callback function. |
|
8f9588491993
[gaim-migrate @ 7659]
Christian Hammond <chipx86@chipx86.com>
parents:
6982
diff
changeset
|
972 | */ |
| 15884 | 973 | #define purple_util_fetch_url(url, full, user_agent, http11, cb, data) \ |
| 974 | purple_util_fetch_url_request(url, full, user_agent, http11, NULL, \ | |
|
12887
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
975 | FALSE, cb, data); |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
976 | |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
977 | /** |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
978 | * Fetches the data from a URL, and passes it to a callback function. |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
979 | * |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
980 | * @param url The URL. |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
981 | * @param full TRUE if this is the full URL, or FALSE if it's a |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
982 | * partial URL. |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
983 | * @param user_agent The user agent field to use, or NULL. |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
984 | * @param http11 TRUE if HTTP/1.1 should be used to download the file. |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
985 | * @param request A HTTP request to send to the server instead of the |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
986 | * standard GET |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
987 | * @param include_headers |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
988 | * If TRUE, include the HTTP headers in the response. |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
989 | * @param callback The callback function. |
|
12887
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
990 | * @param data The user data to pass to the callback function. |
|
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
991 | */ |
| 15884 | 992 | PurpleUtilFetchUrlData *purple_util_fetch_url_request(const gchar *url, |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
993 | gboolean full, const gchar *user_agent, gboolean http11, |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
994 | const gchar *request, gboolean include_headers, |
| 15884 | 995 | PurpleUtilFetchUrlCallback callback, gpointer data); |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
996 | |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
997 | /** |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
998 | * Cancel a pending URL request started with either |
| 15884 | 999 | * purple_util_fetch_url_request() or purple_util_fetch_url(). |
|
14416
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
1000 | * |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
1001 | * @param url_data The data returned when you initiated the URL fetch. |
|
c95ffd983a39
[gaim-migrate @ 17060]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
1002 | */ |
| 15884 | 1003 | void purple_util_fetch_url_cancel(PurpleUtilFetchUrlData *url_data); |
|
12887
4235bbee17b1
[gaim-migrate @ 15240]
Daniel Atallah <datallah@pidgin.im>
parents:
12813
diff
changeset
|
1004 | |
| 7134 | 1005 | /** |
| 1006 | * Decodes a URL into a plain string. | |
| 1007 | * | |
| 1008 | * This will change hex codes and such to their ascii equivalents. | |
| 1009 | * | |
| 1010 | * @param str The string to translate. | |
| 1011 | * | |
| 1012 | * @return The resulting string. | |
| 7162 | 1013 | */ |
| 15884 | 1014 | const char *purple_url_decode(const char *str); |
| 7134 | 1015 | |
| 1016 | /** | |
| 1017 | * Encodes a URL into an escaped string. | |
| 1018 | * | |
| 1019 | * This will change non-alphanumeric characters to hex codes. | |
| 1020 | * | |
| 1021 | * @param str The string to translate. | |
| 1022 | * | |
| 1023 | * @return The resulting string. | |
| 1024 | */ | |
| 15884 | 1025 | const char *purple_url_encode(const char *str); |
|
6982
12f08de92674
[gaim-migrate @ 7538]
Mark Doliner <markdoliner@pidgin.im>
parents:
6861
diff
changeset
|
1026 | |
| 9045 | 1027 | /** |
| 1028 | * Checks if the given email address is syntactically valid. | |
| 1029 | * | |
| 1030 | * @param address The email address to validate. | |
| 1031 | * | |
| 1032 | * @return True if the email address is syntactically correct. | |
| 1033 | */ | |
| 15884 | 1034 | gboolean purple_email_is_valid(const char *address); |
| 9045 | 1035 | |
|
9670
4e8cb7ef72ab
[gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents:
9642
diff
changeset
|
1036 | /** |
|
11135
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1037 | * This function extracts a list of URIs from the a "text/uri-list" |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1038 | * string. It was "borrowed" from gnome_uri_list_extract_uris |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1039 | * |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1040 | * @param uri_list An uri-list in the standard format. |
|
9670
4e8cb7ef72ab
[gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents:
9642
diff
changeset
|
1041 | * |
|
11135
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1042 | * @return A GList containing strings allocated with g_malloc |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1043 | * that have been splitted from uri-list. |
|
9670
4e8cb7ef72ab
[gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents:
9642
diff
changeset
|
1044 | */ |
| 15884 | 1045 | GList *purple_uri_list_extract_uris(const gchar *uri_list); |
|
9670
4e8cb7ef72ab
[gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents:
9642
diff
changeset
|
1046 | |
|
4e8cb7ef72ab
[gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents:
9642
diff
changeset
|
1047 | /** |
|
11135
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1048 | * This function extracts a list of filenames from a |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1049 | * "text/uri-list" string. It was "borrowed" from |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1050 | * gnome_uri_list_extract_filenames |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1051 | * |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1052 | * @param uri_list A uri-list in the standard format. |
|
9670
4e8cb7ef72ab
[gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents:
9642
diff
changeset
|
1053 | * |
|
11135
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1054 | * @return A GList containing strings allocated with g_malloc that |
|
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1055 | * contain the filenames in the uri-list. Note that unlike |
| 15884 | 1056 | * purple_uri_list_extract_uris() function, this will discard |
|
11135
063678d038f9
[gaim-migrate @ 13196]
Mark Doliner <markdoliner@pidgin.im>
parents:
11132
diff
changeset
|
1057 | * any non-file uri from the result value. |
|
9670
4e8cb7ef72ab
[gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents:
9642
diff
changeset
|
1058 | */ |
| 15884 | 1059 | GList *purple_uri_list_extract_filenames(const gchar *uri_list); |
|
9670
4e8cb7ef72ab
[gaim-migrate @ 10522]
Daniel Atallah <datallah@pidgin.im>
parents:
9642
diff
changeset
|
1060 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1061 | /*@}*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1062 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1063 | /************************************************************************** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1064 | * UTF8 String Functions |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1065 | **************************************************************************/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1066 | /*@{*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1067 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1068 | /** |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1069 | * Attempts to convert a string to UTF-8 from an unknown encoding. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1070 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1071 | * This function checks the locale and tries sane defaults. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1072 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1073 | * @param str The source string. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1074 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1075 | * @return The UTF-8 string, or @c NULL if it could not be converted. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1076 | */ |
| 15884 | 1077 | gchar *purple_utf8_try_convert(const char *str); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1078 | |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1079 | /** |
| 10258 | 1080 | * Salvages the valid UTF-8 characters from a string, replacing any |
| 1081 | * invalid characters with a filler character (currently hardcoded to | |
| 1082 | * '?'). | |
| 1083 | * | |
| 1084 | * @param str The source string. | |
| 1085 | * | |
| 1086 | * @return A valid UTF-8 string. | |
| 1087 | */ | |
| 15884 | 1088 | gchar *purple_utf8_salvage(const char *str); |
| 10258 | 1089 | |
| 1090 | /** | |
|
16213
63bfcae0d7c9
Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents:
16144
diff
changeset
|
1091 | * Compares two UTF-8 strings case-insensitively. This string is |
|
63bfcae0d7c9
Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents:
16144
diff
changeset
|
1092 | * more expensive than a simple g_utf8_collate() comparison because |
|
63bfcae0d7c9
Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents:
16144
diff
changeset
|
1093 | * it calls g_utf8_casefold() on each string, which allocates new |
|
63bfcae0d7c9
Slightly more descriptive
Mark Doliner <markdoliner@pidgin.im>
parents:
16144
diff
changeset
|
1094 | * strings. |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1095 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1096 | * @param a The first string. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1097 | * @param b The second string. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1098 | * |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1099 | * @return -1 if @a is less than @a b. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1100 | * 0 if @a is equal to @a b. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1101 | * 1 if @a is greater than @a b. |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1102 | */ |
| 15884 | 1103 | int purple_utf8_strcasecmp(const char *a, const char *b); |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1104 | |
| 7564 | 1105 | /** |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1106 | * Case insensitive search for a word in a string. The needle string |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1107 | * must be contained in the haystack string and not be immediately |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1108 | * preceded or immediately followed by another alpha-numeric character. |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1109 | * |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1110 | * @param haystack The string to search in. |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1111 | * @param needle The substring to find. |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1112 | * |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1113 | * @return TRUE if haystack has the word, otherwise FALSE |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1114 | */ |
| 15884 | 1115 | gboolean purple_utf8_has_word(const char *haystack, const char *needle); |
|
11552
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1116 | |
|
674a2a79943a
[gaim-migrate @ 13812]
Casey Harkins <charkins@pidgin.im>
parents:
11501
diff
changeset
|
1117 | /** |
|
13090
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13033
diff
changeset
|
1118 | * Prints a UTF-8 message to the given file stream. The function |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13033
diff
changeset
|
1119 | * tries to convert the UTF-8 message to user's locale. If this |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13033
diff
changeset
|
1120 | * is not possible, the original UTF-8 text will be printed. |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13033
diff
changeset
|
1121 | * |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13033
diff
changeset
|
1122 | * @param filestream The file stream (e.g. STDOUT or STDERR) |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13033
diff
changeset
|
1123 | * @param message The message to print. |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13033
diff
changeset
|
1124 | */ |
| 15884 | 1125 | void purple_print_utf8_to_console(FILE *filestream, char *message); |
|
13090
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13033
diff
changeset
|
1126 | |
|
aee4ed853ff3
[gaim-migrate @ 15451]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
13033
diff
changeset
|
1127 | /** |
|
18413
ae04f38e5b31
Remove static meify from yahoochat.c and replace use of it with
Will Thompson <resiak@pidgin.im>
parents:
18317
diff
changeset
|
1128 | * Checks for messages starting (post-HTML) with "/me ", including the space. |
| 7564 | 1129 | * |
| 1130 | * @param message The message to check | |
| 1131 | * @param len The message length, or -1 | |
| 1132 | * | |
|
18413
ae04f38e5b31
Remove static meify from yahoochat.c and replace use of it with
Will Thompson <resiak@pidgin.im>
parents:
18317
diff
changeset
|
1133 | * @return TRUE if it starts with "/me ", and it has been removed, otherwise |
|
ae04f38e5b31
Remove static meify from yahoochat.c and replace use of it with
Will Thompson <resiak@pidgin.im>
parents:
18317
diff
changeset
|
1134 | * FALSE |
| 7564 | 1135 | */ |
|
19585
14b519abcc26
Fix some conversion warnings about using negative values with unsigned types. There are more, but these were easy fixes. You may think that I'm changing the API, but I'm really not - it was just wrong.
Daniel Atallah <datallah@pidgin.im>
parents:
18413
diff
changeset
|
1136 | gboolean purple_message_meify(char *message, gssize len); |
| 7564 | 1137 | |
| 7889 | 1138 | /** |
| 1139 | * Removes the underscore characters from a string used identify the mnemonic | |
| 1140 | * character. | |
| 1141 | * | |
| 1142 | * @param in The string to strip | |
| 1143 | * | |
| 1144 | * @return The stripped string | |
| 1145 | */ | |
| 15884 | 1146 | char *purple_text_strip_mnemonic(const char *in); |
| 7889 | 1147 | |
|
7108
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1148 | /*@}*/ |
|
82655fa54acb
[gaim-migrate @ 7673]
Christian Hammond <chipx86@chipx86.com>
parents:
7107
diff
changeset
|
1149 | |
| 8432 | 1150 | /** |
| 1151 | * Adds 8 to something. | |
| 1152 | * | |
| 1153 | * Blame SimGuy. | |
| 1154 | * | |
| 9000 | 1155 | * @param x The number to add 8 to. |
| 8432 | 1156 | * |
| 9000 | 1157 | * @return x + 8 |
| 8432 | 1158 | */ |
| 15884 | 1159 | #define purple_add_eight(x) ((x)+8) |
| 8432 | 1160 | |
| 9926 | 1161 | /** |
| 15884 | 1162 | * Does the reverse of purple_escape_filename |
| 9926 | 1163 | * |
| 1164 | * This will change hex codes and such to their ascii equivalents. | |
| 1165 | * | |
| 1166 | * @param str The string to translate. | |
| 1167 | * | |
| 1168 | * @return The resulting string. | |
| 1169 | */ | |
| 15884 | 1170 | const char *purple_unescape_filename(const char *str); |
| 9926 | 1171 | |
| 1172 | /** | |
| 1173 | * Escapes filesystem-unfriendly characters from a filename | |
| 1174 | * | |
| 1175 | * @param str The string to translate. | |
| 1176 | * | |
| 1177 | * @return The resulting string. | |
| 1178 | */ | |
| 15884 | 1179 | const char *purple_escape_filename(const char *str); |
| 9926 | 1180 | |
|
15482
b943b932a41b
Make sure the pounces, buddy-aliases, savedstatuses etc. saved before the aim/icq split works after the split. The util function _gaim_oscar_convert will be removed at a 'suitable' time in the future.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
1181 | /** |
|
b943b932a41b
Make sure the pounces, buddy-aliases, savedstatuses etc. saved before the aim/icq split works after the split. The util function _gaim_oscar_convert will be removed at a 'suitable' time in the future.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
1182 | * This is added temporarily to assist the split of oscar into aim and icq. |
|
b943b932a41b
Make sure the pounces, buddy-aliases, savedstatuses etc. saved before the aim/icq split works after the split. The util function _gaim_oscar_convert will be removed at a 'suitable' time in the future.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
1183 | * This should not be used by plugins. |
|
b943b932a41b
Make sure the pounces, buddy-aliases, savedstatuses etc. saved before the aim/icq split works after the split. The util function _gaim_oscar_convert will be removed at a 'suitable' time in the future.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
1184 | */ |
| 15884 | 1185 | const char *_purple_oscar_convert(const char *act, const char *protocol); |
|
15707
e9d3280caf69
Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents:
15678
diff
changeset
|
1186 | |
|
e9d3280caf69
Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents:
15678
diff
changeset
|
1187 | /** |
|
e9d3280caf69
Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents:
15678
diff
changeset
|
1188 | * Restore default signal handlers for signals which might reasonably have |
|
e9d3280caf69
Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents:
15678
diff
changeset
|
1189 | * handlers. This should be called by a fork()'d child process, since child processes |
|
e9d3280caf69
Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents:
15678
diff
changeset
|
1190 | * inherit the handlers of the parent. |
|
e9d3280caf69
Restore default signal handlers in fork()'d children. This adds a gaim_restore_default_signal_handlers() utility function since children are made in multiple places.
Evan Schoenberg <evands@pidgin.im>
parents:
15678
diff
changeset
|
1191 | */ |
| 15884 | 1192 | void purple_restore_default_signal_handlers(void); |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
16262
diff
changeset
|
1193 | |
|
5944
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
1194 | #ifdef __cplusplus |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
1195 | } |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
1196 | #endif |
|
f19df037ac58
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
1197 | |
| 15884 | 1198 | #endif /* _PURPLE_UTIL_H_ */ |