util.h
Go to the documentation of this file.
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
* @todo Rename the functions so that they live somewhere in the purple
* namespace.
*/
#ifndef _PURPLE_UTIL_H_
#define _PURPLE_UTIL_H_
#include <stdio.h>
typedef struct _PurpleUtilFetchUrlData PurpleUtilFetchUrlData;
typedef struct _PurpleMenuAction PurpleMenuAction;
typedef struct _PurpleKeyValuePair PurpleKeyValuePair;
#include "account.h"
#include "signals.h"
#include "xmlnode.h"
#include "notify.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _PurpleMenuAction
{
char *label;
PurpleCallback callback;
gpointer data;
GList *children;
};
typedef char *(*PurpleInfoFieldFormatCallback)(const char *field, size_t len);
struct _PurpleKeyValuePair
{
gchar *key;
void *value;
};
PurpleMenuAction *purple_menu_action_new(const char *label, PurpleCallback callback,
gpointer data, GList *children);
void purple_menu_action_free(PurpleMenuAction *act);
void purple_util_set_current_song(const char *title, const char *artist,
const char *album);
char * purple_util_format_song_info(const char *title, const char *artist,
const char *album, gpointer unused);
/**************************************************************************/
/**************************************************************************/
void purple_util_init(void);
void purple_util_uninit(void);
/**************************************************************************/
/**************************************************************************/
gchar *purple_base16_encode(const guchar *data, gsize len);
guchar *purple_base16_decode(const char *str, gsize *ret_len);
gchar *purple_base16_encode_chunked(const guchar *data, gsize len);
/**************************************************************************/
/**************************************************************************/
gchar *purple_base64_encode(const guchar *data, gsize len);
guchar *purple_base64_decode(const char *str, gsize *ret_len);
/**************************************************************************/
/**************************************************************************/
guchar *purple_quotedp_decode(const char *str, gsize *ret_len);
/**************************************************************************/
/**************************************************************************/
char *purple_mime_decode_field(const char *str);
/**************************************************************************/
/**************************************************************************/
const char *purple_utf8_strftime(const char *format, const struct tm *tm);
const char *purple_get_tzoff_str(const struct tm *tm, gboolean iso);
const char *purple_date_format_short(const struct tm *tm);
const char *purple_date_format_long(const struct tm *tm);
const char *purple_date_format_full(const struct tm *tm);
const char *purple_time_format(const struct tm *tm);
time_t purple_time_build(int year, int month, int day, int hour,
int min, int sec);
#define PURPLE_NO_TZ_OFF -500000
time_t purple_str_to_time(const char *timestamp, gboolean utc,
struct tm *tm, long *tz_off, const char **rest);
/**************************************************************************/
/**************************************************************************/
gchar *purple_markup_escape_text(const gchar *text, gssize length);
gboolean purple_markup_find_tag(const char *needle, const char *haystack,
const char **start, const char **end,
GData **attributes);
gboolean purple_markup_extract_info_field(const char *str, int len, PurpleNotifyUserInfo *user_info,
const char *start_token, int skip,
const char *end_token, char check_value,
const char *no_value_token,
const char *display_name, gboolean is_link,
const char *link_prefix,
PurpleInfoFieldFormatCallback format_cb);
void purple_markup_html_to_xhtml(const char *html, char **dest_xhtml,
char **dest_plain);
char *purple_markup_strip_html(const char *str);
char *purple_markup_linkify(const char *str);
char *purple_unescape_text(const char *text);
char *purple_unescape_html(const char *html);
char *purple_markup_slice(const char *str, guint x, guint y);
char *purple_markup_get_tag_name(const char *tag);
const char * purple_markup_unescape_entity(const char *text, int *length);
char * purple_markup_get_css_property(const gchar *style, const gchar *opt);
gboolean purple_markup_is_rtl(const char *html);
/**************************************************************************/
/**************************************************************************/
const gchar *purple_home_dir(void);
const char *purple_user_dir(void);
void purple_util_set_user_dir(const char *dir);
int purple_build_dir(const char *path, int mode);
gboolean purple_util_write_data_to_file(const char *filename, const char *data,
gssize size);
gboolean
purple_util_write_data_to_file_absolute(const char *filename_full, const char *data, gssize size);
xmlnode *purple_util_read_xml_from_file(const char *filename,
const char *description);
FILE *purple_mkstemp(char **path, gboolean binary);
const char *
purple_util_get_image_extension(gconstpointer data, size_t len);
char *purple_util_get_image_checksum(gconstpointer image_data, size_t image_len);
char *purple_util_get_image_filename(gconstpointer image_data, size_t image_len);
/**************************************************************************/
/**************************************************************************/
gboolean purple_program_is_valid(const char *program);
gboolean purple_running_gnome(void);
gboolean purple_running_kde(void);
gboolean purple_running_osx(void);
char *purple_fd_get_ip(int fd);
int purple_socket_get_family(int fd);
gboolean purple_socket_speaks_ipv4(int fd);
/**************************************************************************/
/**************************************************************************/
gboolean purple_strequal(const gchar *left, const gchar *right);
const char *purple_normalize(const PurpleAccount *account, const char *str);
const char *purple_normalize_nocase(const PurpleAccount *account, const char *str);
gboolean purple_str_has_prefix(const char *s, const char *p);
gboolean purple_str_has_suffix(const char *s, const char *x);
gchar *purple_strdup_withhtml(const gchar *src);
char *purple_str_add_cr(const char *str);
void purple_str_strip_char(char *str, char thechar);
void purple_util_chrreplace(char *string, char delimiter,
char replacement);
gchar *purple_strreplace(const char *string, const char *delimiter,
const char *replacement);
char *purple_utf8_ncr_encode(const char *in);
char *purple_utf8_ncr_decode(const char *in);
gchar *purple_strcasereplace(const char *string, const char *delimiter,
const char *replacement);
const char *purple_strcasestr(const char *haystack, const char *needle);
char *purple_str_size_to_units(size_t size);
char *purple_str_seconds_to_string(guint sec);
char *purple_str_binary_to_ascii(const unsigned char *binary, guint len);
/**************************************************************************/
/**************************************************************************/
void purple_got_protocol_handler_uri(const char *uri);
gboolean purple_url_parse(const char *url, char **ret_host, int *ret_port,
char **ret_path, char **ret_user, char **ret_passwd);
typedef void (*PurpleUtilFetchUrlCallback)(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, gsize len, const gchar *error_message);
#define purple_util_fetch_url(url, full, user_agent, http11, cb, data) \
purple_util_fetch_url_request(url, full, user_agent, http11, NULL, \
FALSE, cb, data);
#define purple_util_fetch_url_len(url, full, user_agent, http11, max_len, cb, data) \
purple_util_fetch_url_request_len(url, full, user_agent, http11, NULL, \
FALSE, max_len, cb, data);
PurpleUtilFetchUrlData *purple_util_fetch_url_request(const gchar *url,
gboolean full, const gchar *user_agent, gboolean http11,
const gchar *request, gboolean include_headers,
PurpleUtilFetchUrlCallback callback, gpointer data);
PurpleUtilFetchUrlData *purple_util_fetch_url_request_len(const gchar *url,
gboolean full, const gchar *user_agent, gboolean http11,
const gchar *request, gboolean include_headers, gssize max_len,
PurpleUtilFetchUrlCallback callback, gpointer data);
PurpleUtilFetchUrlData *purple_util_fetch_url_request_len_with_account(
PurpleAccount *account, const gchar *url,
gboolean full, const gchar *user_agent, gboolean http11,
const gchar *request, gboolean include_headers, gssize max_len,
PurpleUtilFetchUrlCallback callback, gpointer data);
void purple_util_fetch_url_cancel(PurpleUtilFetchUrlData *url_data);
const char *purple_url_decode(const char *str);
const char *purple_url_encode(const char *str);
gboolean purple_email_is_valid(const char *address);
gboolean purple_ip_address_is_valid(const char *ip);
gboolean purple_ipv4_address_is_valid(const char *ip);
gboolean purple_ipv6_address_is_valid(const char *ip);
GList *purple_uri_list_extract_uris(const gchar *uri_list);
GList *purple_uri_list_extract_filenames(const gchar *uri_list);
/**************************************************************************
* UTF8 String Functions
**************************************************************************/
gchar *purple_utf8_try_convert(const char *str);
gchar *purple_utf8_salvage(const char *str);
gchar *purple_utf8_strip_unprintables(const gchar *str);
G_CONST_RETURN gchar *purple_gai_strerror(gint errnum);
int purple_utf8_strcasecmp(const char *a, const char *b);
gboolean purple_utf8_has_word(const char *haystack, const char *needle);
void purple_print_utf8_to_console(FILE *filestream, char *message);
gboolean purple_message_meify(char *message, gssize len);
char *purple_text_strip_mnemonic(const char *in);
#define purple_add_eight(x) ((x)+8)
const char *purple_unescape_filename(const char *str);
const char *purple_escape_filename(const char *str);
const char *_purple_oscar_convert(const char *act, const char *protocol);
void purple_restore_default_signal_handlers(void);
const gchar *purple_get_host_name(void);
gchar *purple_uuid_random(void);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_UTIL_H_ */
notify.h
Notification API.
purple_utf8_ncr_encode
char * purple_utf8_ncr_encode(const char *in)
Given a string, this replaces any utf-8 substrings in that string with the corresponding numerical ch...
purple_url_decode
const char * purple_url_decode(const char *str)
Decodes a URL into a plain string.
purple_utf8_ncr_decode
char * purple_utf8_ncr_decode(const char *in)
Given a string, this replaces any numerical character references in that string with the correspondin...
purple_markup_get_tag_name
char * purple_markup_get_tag_name(const char *tag)
Returns a newly allocated string containing the name of the tag located at "tag". ...
purple_home_dir
const gchar * purple_home_dir(void)
Returns the user&#39;s home directory.
purple_markup_html_to_xhtml
void purple_markup_html_to_xhtml(const char *html, char **dest_xhtml, char **dest_plain)
Converts HTML markup to XHTML.
purple_message_meify
gboolean purple_message_meify(char *message, gssize len)
Checks for messages starting (post-HTML) with "/me ", including the space.
purple_str_size_to_units
char * purple_str_size_to_units(size_t size)
Returns a string representing a filesize in the appropriate units (MB, KB, GB, etc.)
purple_uri_list_extract_uris
GList * purple_uri_list_extract_uris(const gchar *uri_list)
This function extracts a list of URIs from the a "text/uri-list" string.
purple_time_format
const char * purple_time_format(const struct tm *tm)
Formats a time into the user&#39;s preferred time format.
purple_util_fetch_url_request
PurpleUtilFetchUrlData * purple_util_fetch_url_request(const gchar *url, gboolean full, const gchar *user_agent, gboolean http11, const gchar *request, gboolean include_headers, PurpleUtilFetchUrlCallback callback, gpointer data)
Fetches the data from a URL, and passes it to a callback function.
purple_markup_slice
char * purple_markup_slice(const char *str, guint x, guint y)
Returns a newly allocated substring of the HTML UTF-8 string "str".
PurpleUtilFetchUrlData
struct _PurpleUtilFetchUrlData PurpleUtilFetchUrlData
An opaque structure representing a URL request.
Definition: util.h:38
purple_utf8_strcasecmp
int purple_utf8_strcasecmp(const char *a, const char *b)
Compares two UTF-8 strings case-insensitively.
purple_util_uninit
void purple_util_uninit(void)
Uninitializes the util subsystem.
purple_ip_address_is_valid
gboolean purple_ip_address_is_valid(const char *ip)
Checks if the given IP address is a syntactically valid IPv4 address.
purple_build_dir
int purple_build_dir(const char *path, int mode)
Builds a complete path from the root, making any directories along the path which do not already exis...
purple_menu_action_free
void purple_menu_action_free(PurpleMenuAction *act)
Frees a PurpleMenuAction.
purple_time_build
time_t purple_time_build(int year, int month, int day, int hour, int min, int sec)
Builds a time_t from the supplied information.
purple_util_read_xml_from_file
xmlnode * purple_util_read_xml_from_file(const char *filename, const char *description)
Read the contents of a given file and parse the results into an xmlnode tree structure.
purple_util_chrreplace
void purple_util_chrreplace(char *string, char delimiter, char replacement)
Given a string, this replaces all instances of one character with another.
purple_print_utf8_to_console
void purple_print_utf8_to_console(FILE *filestream, char *message)
Prints a UTF-8 message to the given file stream.
purple_util_format_song_info
char * purple_util_format_song_info(const char *title, const char *artist, const char *album, gpointer unused)
Format song information.
purple_socket_speaks_ipv4
gboolean purple_socket_speaks_ipv4(int fd)
Returns TRUE if a socket is capable of speaking IPv4.
purple_util_fetch_url_request_len
PurpleUtilFetchUrlData * purple_util_fetch_url_request_len(const gchar *url, gboolean full, const gchar *user_agent, gboolean http11, const gchar *request, gboolean include_headers, gssize max_len, PurpleUtilFetchUrlCallback callback, gpointer data)
Fetches the data from a URL, and passes it to a callback function.
purple_normalize
const char * purple_normalize(const PurpleAccount *account, const char *str)
Normalizes a string, so that it is suitable for comparison.
purple_str_add_cr
char * purple_str_add_cr(const char *str)
Ensures that all linefeeds have a matching carriage return.
purple_mime_decode_field
char * purple_mime_decode_field(const char *str)
Converts a MIME header field string back to its readable equivalent according to RFC 2047...
purple_markup_find_tag
gboolean purple_markup_find_tag(const char *needle, const char *haystack, const char **start, const char **end, GData **attributes)
Finds an HTML tag matching the given name.
purple_email_is_valid
gboolean purple_email_is_valid(const char *address)
Checks if the given email address is syntactically valid.
purple_markup_strip_html
char * purple_markup_strip_html(const char *str)
Strips HTML tags from a string.
purple_str_binary_to_ascii
char * purple_str_binary_to_ascii(const unsigned char *binary, guint len)
Converts a binary string into a NUL terminated ascii string, replacing nonascii characters and charac...
_PurpleAccount
Structure representing an account.
Definition: account.h:126
purple_quotedp_decode
guchar * purple_quotedp_decode(const char *str, gsize *ret_len)
Converts a quoted printable string back to its readable equivalent.
purple_base16_encode
gchar * purple_base16_encode(const guchar *data, gsize len)
Converts a chunk of binary data to its base-16 equivalent.
purple_running_kde
gboolean purple_running_kde(void)
Check if running KDE.
purple_markup_is_rtl
gboolean purple_markup_is_rtl(const char *html)
Check if the given HTML contains RTL text.
purple_date_format_long
const char * purple_date_format_long(const struct tm *tm)
Formats a time into the user&#39;s preferred short date plus time format.
purple_markup_get_css_property
char * purple_markup_get_css_property(const gchar *style, const gchar *opt)
Returns a newly allocated string containing the value of the CSS property specified in opt...
purple_strequal
gboolean purple_strequal(const gchar *left, const gchar *right)
Tests two strings for equality.
purple_util_set_user_dir
void purple_util_set_user_dir(const char *dir)
Define a custom purple settings directory, overriding the default (user&#39;s home directory/.purple)
xmlnode.h
XML DOM functions.
purple_unescape_html
char * purple_unescape_html(const char *html)
Unescapes HTML entities to their literal characters and converts "<br>" to "\n".
purple_unescape_filename
const char * purple_unescape_filename(const char *str)
Does the reverse of purple_escape_filename.
purple_url_encode
const char * purple_url_encode(const char *str)
Encodes a URL into an escaped string.
purple_ipv4_address_is_valid
gboolean purple_ipv4_address_is_valid(const char *ip)
Checks if the given IP address is a syntactically valid IPv4 address.
purple_running_osx
gboolean purple_running_osx(void)
Check if running OS X.
_xmlnode
Definition: xmlnode.h:49
purple_menu_action_new
PurpleMenuAction * purple_menu_action_new(const char *label, PurpleCallback callback, gpointer data, GList *children)
Creates a new PurpleMenuAction.
purple_strreplace
gchar * purple_strreplace(const char *string, const char *delimiter, const char *replacement)
Given a string, this replaces one substring with another and returns a newly allocated string...
purple_util_get_image_extension
const char * purple_util_get_image_extension(gconstpointer data, size_t len)
Returns an extension corresponding to the image data&#39;s file type.
purple_utf8_try_convert
gchar * purple_utf8_try_convert(const char *str)
Attempts to convert a string to UTF-8 from an unknown encoding.
purple_ipv6_address_is_valid
gboolean purple_ipv6_address_is_valid(const char *ip)
Checks if the given IP address is a syntactically valid IPv6 address.
purple_util_get_image_filename
char * purple_util_get_image_filename(gconstpointer image_data, size_t image_len)
purple_escape_filename
const char * purple_escape_filename(const char *str)
Escapes filesystem-unfriendly characters from a filename.
purple_str_has_prefix
gboolean purple_str_has_prefix(const char *s, const char *p)
Compares two strings to see if the first contains the second as a proper prefix.
_PurpleKeyValuePair
A key-value pair.
Definition: util.h:70
purple_normalize_nocase
const char * purple_normalize_nocase(const PurpleAccount *account, const char *str)
Normalizes a string, so that it is suitable for comparison.
purple_socket_get_family
int purple_socket_get_family(int fd)
Returns the address family of a socket.
purple_uri_list_extract_filenames
GList * purple_uri_list_extract_filenames(const gchar *uri_list)
This function extracts a list of filenames from a "text/uri-list" string.
purple_restore_default_signal_handlers
void purple_restore_default_signal_handlers(void)
Restore default signal handlers for signals which might reasonably have handlers. ...
purple_markup_extract_info_field
gboolean purple_markup_extract_info_field(const char *str, int len, PurpleNotifyUserInfo *user_info, const char *start_token, int skip, const char *end_token, char check_value, const char *no_value_token, const char *display_name, gboolean is_link, const char *link_prefix, PurpleInfoFieldFormatCallback format_cb)
Extracts a field of data from HTML.
purple_markup_escape_text
gchar * purple_markup_escape_text(const gchar *text, gssize length)
Escapes special characters in a plain-text string so they display correctly as HTML.
purple_util_write_data_to_file_absolute
gboolean purple_util_write_data_to_file_absolute(const char *filename_full, const char *data, gssize size)
Write data to a file using the absolute path.
purple_utf8_has_word
gboolean purple_utf8_has_word(const char *haystack, const char *needle)
Case insensitive search for a word in a string.
purple_str_has_suffix
gboolean purple_str_has_suffix(const char *s, const char *x)
Compares two strings to see if the second is a proper suffix of the first.
PurpleUtilFetchUrlCallback
void(* PurpleUtilFetchUrlCallback)(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, gsize len, const gchar *error_message)
This is the signature used for functions that act as the callback to purple_util_fetch_url() or purpl...
Definition: util.h:1110
purple_base64_decode
guchar * purple_base64_decode(const char *str, gsize *ret_len)
Converts an ASCII string of base-64 encoded data to the binary equivalent.
purple_util_set_current_song
void purple_util_set_current_song(const char *title, const char *artist, const char *album)
Set the appropriate presence values for the currently playing song.
purple_fd_get_ip
char * purple_fd_get_ip(int fd)
Returns the IP address from a socket file descriptor.
purple_utf8_strftime
const char * purple_utf8_strftime(const char *format, const struct tm *tm)
Formats a time into the specified format.
purple_str_seconds_to_string
char * purple_str_seconds_to_string(guint sec)
Converts seconds into a human-readable form.
purple_markup_unescape_entity
const char * purple_markup_unescape_entity(const char *text, int *length)
Returns a constant string of the character representation of the HTML entity pointed to by text...
purple_utf8_strip_unprintables
gchar * purple_utf8_strip_unprintables(const gchar *str)
Removes unprintable characters from a UTF-8 string.
account.h
Account API.
purple_date_format_full
const char * purple_date_format_full(const struct tm *tm)
Formats a time into the user&#39;s preferred full date and time format.
purple_str_to_time
time_t purple_str_to_time(const char *timestamp, gboolean utc, struct tm *tm, long *tz_off, const char **rest)
Parses a timestamp in jabber, ISO8601, or MM/DD/YYYY format and returns a time_t. ...
purple_base16_encode_chunked
gchar * purple_base16_encode_chunked(const guchar *data, gsize len)
Converts a chunk of binary data to a chunked base-16 representation (handy for key fingerprints) ...
purple_str_strip_char
void purple_str_strip_char(char *str, char thechar)
Strips all instances of the given character from the given string.
purple_running_gnome
gboolean purple_running_gnome(void)
Check if running GNOME.
purple_program_is_valid
gboolean purple_program_is_valid(const char *program)
Checks if the given program name is valid and executable.
purple_util_fetch_url_cancel
void purple_util_fetch_url_cancel(PurpleUtilFetchUrlData *url_data)
Cancel a pending URL request started with either purple_util_fetch_url_request() or purple_util_fetch...
purple_unescape_text
char * purple_unescape_text(const char *text)
Unescapes HTML entities to their literal characters in the text.
purple_mkstemp
FILE * purple_mkstemp(char **path, gboolean binary)
Creates a temporary file and returns a file pointer to it.
purple_strcasereplace
gchar * purple_strcasereplace(const char *string, const char *delimiter, const char *replacement)
Given a string, this replaces one substring with another ignoring case and returns a newly allocated ...
purple_strcasestr
const char * purple_strcasestr(const char *haystack, const char *needle)
This is like strstr, except that it ignores ASCII case in searching for the substring.
purple_util_init
void purple_util_init(void)
Initializes the utility subsystem.
signals.h
Signal API.
purple_base64_encode
gchar * purple_base64_encode(const guchar *data, gsize len)
Converts a chunk of binary data to its base-64 equivalent.
purple_uuid_random
gchar * purple_uuid_random(void)
Returns a type 4 (random) UUID.
purple_user_dir
const char * purple_user_dir(void)
Returns the purple settings directory in the user&#39;s home directory.
purple_gai_strerror
G_CONST_RETURN gchar * purple_gai_strerror(gint errnum)
Return the UTF-8 version of gai_strerror().
purple_get_host_name
const gchar * purple_get_host_name(void)
Gets the host name of the machine.
purple_get_tzoff_str
const char * purple_get_tzoff_str(const struct tm *tm, gboolean iso)
Gets a string representation of the local timezone offset.
purple_utf8_salvage
gchar * purple_utf8_salvage(const char *str)
Salvages the valid UTF-8 characters from a string, replacing any invalid characters with a filler cha...
purple_util_fetch_url_request_len_with_account
PurpleUtilFetchUrlData * purple_util_fetch_url_request_len_with_account(PurpleAccount *account, const gchar *url, gboolean full, const gchar *user_agent, gboolean http11, const gchar *request, gboolean include_headers, gssize max_len, PurpleUtilFetchUrlCallback callback, gpointer data)
Fetches the data from a URL, and passes it to a callback function.
purple_text_strip_mnemonic
char * purple_text_strip_mnemonic(const char *in)
Removes the underscore characters from a string used identify the mnemonic character.
purple_util_get_image_checksum
char * purple_util_get_image_checksum(gconstpointer image_data, size_t image_len)
Returns a SHA-1 hash string of the data passed in.
purple_markup_linkify
char * purple_markup_linkify(const char *str)
Adds the necessary HTML code to turn URIs into HTML links in a string.
purple_util_write_data_to_file
gboolean purple_util_write_data_to_file(const char *filename, const char *data, gssize size)
Write a string of data to a file of the given name in the Purple user directory ($HOME/.purple by default).
purple_base16_decode
guchar * purple_base16_decode(const char *str, gsize *ret_len)
Converts an ASCII string of base-16 encoded data to the binary equivalent.
_purple_oscar_convert
const char * _purple_oscar_convert(const char *act, const char *protocol)
This is added temporarily to assist the split of oscar into aim and icq.
purple_date_format_short
const char * purple_date_format_short(const struct tm *tm)
Formats a time into the user&#39;s preferred short date format.
purple_strdup_withhtml
gchar * purple_strdup_withhtml(const gchar *src)
Duplicates a string and replaces all newline characters from the source string with HTML linebreaks...
purple_url_parse
gboolean purple_url_parse(const char *url, char **ret_host, int *ret_port, char **ret_path, char **ret_user, char **ret_passwd)
Parses a URL, returning its host, port, file path, username and password.