Mercurial > pidgin.yaz
comparison libpurple/util.h @ 27950:fb593c327870
propagate from branch 'im.pidgin.pidgin' (head e155acab29d005538351633111052f094e5f5f98)
to branch 'im.pidgin.pidgin.yaz' (head 9a2679f1f093d6f68ab515aa5278606fb451449a)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 12 Jun 2009 05:27:34 +0000 |
parents | cfa78428d8b2 6bd7b3e06233 |
children | 85fa979b08c2 |
comparison
equal
deleted
inserted
replaced
27949:a4a2090fd976 | 27950:fb593c327870 |
---|---|
504 * | 504 * |
505 * @param html The string in which to unescape any HTML entities | 505 * @param html The string in which to unescape any HTML entities |
506 * | 506 * |
507 * @return The text with HTML entities literalized. You must g_free | 507 * @return The text with HTML entities literalized. You must g_free |
508 * this string when finished with it. | 508 * this string when finished with it. |
509 * | |
510 * @see purple_escape_html | |
511 */ | 509 */ |
512 char *purple_unescape_html(const char *html); | 510 char *purple_unescape_html(const char *html); |
513 | 511 |
514 /** | 512 /** |
515 * Returns a newly allocated substring of the HTML UTF-8 string "str". | 513 * Returns a newly allocated substring of the HTML UTF-8 string "str". |
579 * | 577 * |
580 * @return The value of the requested CSS property. | 578 * @return The value of the requested CSS property. |
581 */ | 579 */ |
582 char * purple_markup_get_css_property(const gchar *style, const gchar *opt); | 580 char * purple_markup_get_css_property(const gchar *style, const gchar *opt); |
583 | 581 |
582 /** | |
583 * Check if the given HTML contains RTL text. | |
584 * | |
585 * @param html The HTML text. | |
586 * | |
587 * @return TRUE if the text contains RTL text, FALSE otherwise. | |
588 * | |
589 * @since 2.6.0 | |
590 */ | |
591 gboolean purple_markup_is_rtl(const char *html); | |
584 | 592 |
585 /*@}*/ | 593 /*@}*/ |
586 | 594 |
587 | 595 |
588 /**************************************************************************/ | 596 /**************************************************************************/ |
1092 PurpleUtilFetchUrlCallback callback, gpointer data); | 1100 PurpleUtilFetchUrlCallback callback, gpointer data); |
1093 | 1101 |
1094 /** | 1102 /** |
1095 * Fetches the data from a URL, and passes it to a callback function. | 1103 * Fetches the data from a URL, and passes it to a callback function. |
1096 * | 1104 * |
1105 * @param url The URL. | |
1106 * @param full TRUE if this is the full URL, or FALSE if it's a | |
1107 * partial URL. | |
1108 * @param user_agent The user agent field to use, or NULL. | |
1109 * @param http11 TRUE if HTTP/1.1 should be used to download the file. | |
1110 * @param request A HTTP request to send to the server instead of the | |
1111 * standard GET | |
1112 * @param include_headers | |
1113 * If TRUE, include the HTTP headers in the response. | |
1114 * @param max_len The maximum number of bytes to retrieve (-1 for unlimited) | |
1115 * @param callback The callback function. | |
1116 * @param data The user data to pass to the callback function. | |
1117 * @deprecated In 3.0.0, this will go away. | |
1118 */ | |
1119 PurpleUtilFetchUrlData *purple_util_fetch_url_request_len(const gchar *url, | |
1120 gboolean full, const gchar *user_agent, gboolean http11, | |
1121 const gchar *request, gboolean include_headers, gssize max_len, | |
1122 PurpleUtilFetchUrlCallback callback, gpointer data); | |
1123 | |
1124 /** | |
1125 * Fetches the data from a URL, and passes it to a callback function. | |
1126 * | |
1127 * @param account The account for which the request is needed, or NULL. | |
1097 * @param url The URL. | 1128 * @param url The URL. |
1098 * @param full TRUE if this is the full URL, or FALSE if it's a | 1129 * @param full TRUE if this is the full URL, or FALSE if it's a |
1099 * partial URL. | 1130 * partial URL. |
1100 * @param user_agent The user agent field to use, or NULL. | 1131 * @param user_agent The user agent field to use, or NULL. |
1101 * @param http11 TRUE if HTTP/1.1 should be used to download the file. | 1132 * @param http11 TRUE if HTTP/1.1 should be used to download the file. |
1106 * @param max_len The maximum number of bytes to retrieve (-1 for unlimited) | 1137 * @param max_len The maximum number of bytes to retrieve (-1 for unlimited) |
1107 * @param callback The callback function. | 1138 * @param callback The callback function. |
1108 * @param data The user data to pass to the callback function. | 1139 * @param data The user data to pass to the callback function. |
1109 * @deprecated In 3.0.0, we'll rename this to "purple_util_fetch_url_request" and get rid of the old one | 1140 * @deprecated In 3.0.0, we'll rename this to "purple_util_fetch_url_request" and get rid of the old one |
1110 */ | 1141 */ |
1111 PurpleUtilFetchUrlData *purple_util_fetch_url_request_len(const gchar *url, | 1142 PurpleUtilFetchUrlData *purple_util_fetch_url_request_len_with_account( |
1143 PurpleAccount *account, const gchar *url, | |
1112 gboolean full, const gchar *user_agent, gboolean http11, | 1144 gboolean full, const gchar *user_agent, gboolean http11, |
1113 const gchar *request, gboolean include_headers, gssize max_len, | 1145 const gchar *request, gboolean include_headers, gssize max_len, |
1114 PurpleUtilFetchUrlCallback callback, gpointer data); | 1146 PurpleUtilFetchUrlCallback callback, gpointer data); |
1115 | 1147 |
1116 /** | 1148 /** |
1212 * @param str The source string. | 1244 * @param str The source string. |
1213 * | 1245 * |
1214 * @return A valid UTF-8 string. | 1246 * @return A valid UTF-8 string. |
1215 */ | 1247 */ |
1216 gchar *purple_utf8_salvage(const char *str); | 1248 gchar *purple_utf8_salvage(const char *str); |
1249 | |
1250 /** | |
1251 * Removes unprintable characters from a UTF-8 string. These characters | |
1252 * (in particular low-ASCII characters) are invalid in XML 1.0 and thus | |
1253 * are not allowed in XMPP and are rejected by libxml2 by default. This | |
1254 * function uses g_unichar_isprint to determine what characters should | |
1255 * be stripped. The returned string must be freed by the caller. | |
1256 * | |
1257 * @param str A valid UTF-8 string. | |
1258 * | |
1259 * @return A newly allocated UTF-8 string without the unprintable characters. | |
1260 * @since 2.6.0 | |
1261 * | |
1262 * @see g_unichar_isprint | |
1263 */ | |
1264 gchar *purple_utf8_strip_unprintables(const gchar *str); | |
1217 | 1265 |
1218 /** | 1266 /** |
1219 * Return the UTF-8 version of gai_strerror(). It calls gai_strerror() | 1267 * Return the UTF-8 version of gai_strerror(). It calls gai_strerror() |
1220 * then converts the result to UTF-8. This function is analogous to | 1268 * then converts the result to UTF-8. This function is analogous to |
1221 * g_strerror(). | 1269 * g_strerror(). |