Mercurial > pidgin
comparison src/util.h @ 7094:2343c3aa1dec
[gaim-migrate @ 7659]
grab_url() and parse_url() are gone, replaced with gaim_url_fetch() and
gaim_url_parse(). They were also moved to util.[ch].
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 01 Oct 2003 03:01:25 +0000 |
parents | 083d1e4a9c78 |
children | c8bf2da398e3 |
comparison
equal
deleted
inserted
replaced
7093:3650612c7daa | 7094:2343c3aa1dec |
---|---|
3 * @ingroup core | 3 * @ingroup core |
4 * | 4 * |
5 * gaim | 5 * gaim |
6 * | 6 * |
7 * Copyright (C) 2002-2003, Christian Hammond <chipx86@gnupdate.org> | 7 * Copyright (C) 2002-2003, Christian Hammond <chipx86@gnupdate.org> |
8 * | 8 * |
9 * This program is free software; you can redistribute it and/or modify | 9 * This program is free software; you can redistribute it and/or modify |
10 * it under the terms of the GNU General Public License as published by | 10 * it under the terms of the GNU General Public License as published by |
11 * the Free Software Foundation; either version 2 of the License, or | 11 * the Free Software Foundation; either version 2 of the License, or |
12 * (at your option) any later version. | 12 * (at your option) any later version. |
13 * | 13 * |
330 * @param size The size | 330 * @param size The size |
331 */ | 331 */ |
332 char *gaim_get_size_string(size_t size); | 332 char *gaim_get_size_string(size_t size); |
333 | 333 |
334 /** | 334 /** |
335 * Finds a HTML tag matching the given name, locating its start | 335 * Finds a HTML tag matching the given name. |
336 * and end, and storing its attributes in a GData hash table. | 336 * |
337 * The names of the attributes are lower-cased in the hash table, | 337 * This locates an HTML tag's start and end, and stores its attributes |
338 * and the name of the tag is case insensitive. | 338 * in a GData hash table. The names of the attributes are lower-cased |
339 * in the hash table, and the name of the tag is case insensitive. | |
339 * | 340 * |
340 * @param needle the name of the tag | 341 * @param needle the name of the tag |
341 * @param haystack the null-delimited string to search in | 342 * @param haystack the null-delimited string to search in |
342 * @param start a pointer to the start of the tag if found | 343 * @param start a pointer to the start of the tag if found |
343 * @param end a pointer to the end of the tag if found | 344 * @param end a pointer to the end of the tag if found |
344 * @param attributes the attributes, if the tag was found | 345 * @param attributes the attributes, if the tag was found |
345 * @return TRUE if the tag was found | 346 * @return TRUE if the tag was found |
346 */ | 347 */ |
347 gboolean gaim_markup_find_tag(const char *needle, const char *haystack, const char **start, const char **end, GData **attributes); | 348 gboolean gaim_markup_find_tag(const char *needle, const char *haystack, |
349 const char **start, const char **end, | |
350 GData **attributes); | |
351 | |
352 /** | |
353 * Parses a URL, returning its host, port, and file path. | |
354 * | |
355 * The returned data must be freed. | |
356 * | |
357 * @param url The URL to parse. | |
358 * @param ret_host The returned host. | |
359 * @param ret_port The returned port. | |
360 * @param ret_path The returned path. | |
361 */ | |
362 gboolean gaim_url_parse(const char *url, char **ret_host, int *ret_port, | |
363 char **ret_path); | |
364 | |
365 /** | |
366 * Fetches the data from a URL, and passes it to a callback function. | |
367 * | |
368 * @param url The URL. | |
369 * @param full TRUE if this is the full URL, or FALSE if it's a | |
370 * partial URL. | |
371 * @param cb The callback function. | |
372 * @param data The user data to pass to the callback function. | |
373 * @param user_agent The user agent field to use, or NULL. | |
374 * @param http11 TRUE if HTTP/1.1 should be used to download the file. | |
375 */ | |
376 void gaim_url_fetch(const char *url, gboolean full, | |
377 const char *user_agent, gboolean http11, | |
378 void (*cb)(void *, const char *, size_t), | |
379 void *data); | |
348 | 380 |
349 #ifdef __cplusplus | 381 #ifdef __cplusplus |
350 } | 382 } |
351 #endif | 383 #endif |
352 | 384 |