--- a/libpurple/util.h Wed Aug 07 21:44:01 2024 -0500 +++ b/libpurple/util.h Wed Aug 07 21:46:03 2024 -0500 @@ -65,26 +65,6 @@ /**************************************************************************/ /** - * purple_util_write_data_to_cache_file: - * @filename: The basename of the file to write in the purple_cache_dir. - * @data: A string of data to write. - * @size: The size of the data to save. If data is - * null-terminated you can pass in -1. - * - * Write a string of data to a file of the given name in the Purple - * cache directory ($HOME/.cache/purple by default). - * - * See purple_util_write_data_to_file() - * - * Returns: TRUE if the file was written successfully. FALSE otherwise. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -gboolean -purple_util_write_data_to_cache_file(const char *filename, const char *data, gssize size); - -/** * purple_util_write_data_to_config_file: * @filename: The basename of the file to write in the purple_config_dir. * @data: A string of data to write. @@ -105,47 +85,6 @@ purple_util_write_data_to_config_file(const char *filename, const char *data, gssize size); /** - * purple_util_write_data_to_data_file: - * @filename: The basename of the file to write in the purple_data_dir. - * @data: A string of data to write. - * @size: The size of the data to save. If data is - * null-terminated you can pass in -1. - * - * Write a string of data to a file of the given name in the Purple - * data directory ($HOME/.local/share/purple by default). - * - * See purple_util_write_data_to_file() - * - * Returns: TRUE if the file was written successfully. FALSE otherwise. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -gboolean -purple_util_write_data_to_data_file(const char *filename, const char *data, gssize size); - -/** - * purple_util_read_xml_from_cache_file: - * @filename: The basename of the file to open in the purple_cache_dir. - * @description: A very short description of the contents of this - * file. This is used in error messages shown to the - * user when the file can not be opened. For example, - * "preferences," or "buddy pounces." - * - * Read the contents of a given file and parse the results into an - * PurpleXmlNode tree structure. This is intended to be used to read - * Purple's cache xml files (xmpp-caps.xml, etc.) - * - * Returns: An PurpleXmlNode tree of the contents of the given file. Or NULL, if - * the file does not exist or there was an error reading the file. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -PurpleXmlNode * -purple_util_read_xml_from_cache_file(const char *filename, const char *description); - -/** * purple_util_read_xml_from_config_file: * @filename: The basename of the file to open in the purple_config_dir. * @description: A very short description of the contents of this @@ -166,27 +105,6 @@ PurpleXmlNode * purple_util_read_xml_from_config_file(const char *filename, const char *description); -/** - * purple_util_read_xml_from_data_file: - * @filename: The basename of the file to open in the purple_data_dir. - * @description: A very short description of the contents of this - * file. This is used in error messages shown to the - * user when the file can not be opened. For example, - * "preferences," or "buddy pounces." - * - * Read the contents of a given file and parse the results into an - * PurpleXmlNode tree structure. This is intended to be used to read - * Purple's cache xml files (accounts.xml, etc.) - * - * Returns: An PurpleXmlNode tree of the contents of the given file. Or NULL, if - * the file does not exist or there was an error reading the file. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -PurpleXmlNode * -purple_util_read_xml_from_data_file(const char *filename, const char *description); - /**************************************************************************/ /* Environment Detection Functions */ /**************************************************************************/ @@ -203,18 +121,6 @@ PURPLE_AVAILABLE_IN_ALL gboolean purple_running_gnome(void); -/** - * purple_running_kde: - * - * Check if running KDE. - * - * Returns: TRUE if running KDE, FALSE otherwise. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -gboolean purple_running_kde(void); - /**************************************************************************/ /* String Functions */ /**************************************************************************/ @@ -280,34 +186,6 @@ const char *purple_normalize(PurpleAccount *account, const char *str); /** - * purple_validate: - * @protocol: The protocol the string belongs to. - * @str: The string to validate. - * - * Checks, if a string is valid. - * - * Returns: TRUE, if string is valid, otherwise FALSE. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -gboolean purple_validate(PurpleProtocol *protocol, const char *str); - -/** - * purple_strdup_withhtml: - * @src: The source string. - * - * Duplicates a string and replaces all newline characters from the - * source string with HTML linebreaks. - * - * Returns: The new string. Must be g_free'd by the caller. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -gchar *purple_strdup_withhtml(const gchar *src); - -/** * purple_str_strip_char: * @str: The string to strip characters from. * @thechar: The character to strip from the given string. @@ -325,23 +203,6 @@ void purple_str_strip_char(char *str, char thechar); /** - * purple_util_chrreplace: - * @string: The string from which to replace stuff. - * @delimiter: The character you want replaced. - * @replacement: The character you want inserted in place - * of the delimiting character. - * - * Given a string, this replaces all instances of one character - * with another. This happens inline (the original string IS - * modified). - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -void purple_util_chrreplace(char *string, char delimiter, - char replacement); - -/** * purple_strreplace: * @string: The string from which to replace stuff. * @delimiter: The substring you want replaced. @@ -361,20 +222,6 @@ const char *replacement); /** - * purple_str_seconds_to_string: - * @sec: The seconds. - * - * Converts seconds into a human-readable form. - * - * Returns: A human-readable form, containing days, hours, minutes, and - * seconds. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -char *purple_str_seconds_to_string(guint sec); - -/** * purple_str_wipe: * @str: A NUL-terminated string to free, or a NULL-pointer. * @@ -422,21 +269,6 @@ void purple_got_protocol_handler_uri(const char *uri); /** - * purple_url_encode: - * @str: The string to translate. - * - * Encodes a URL into an escaped string. - * - * This will change non-alphanumeric characters to hex codes. - * - * Returns: The resulting string. - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -const char *purple_url_encode(const char *str); - -/** * purple_email_is_valid: * @address: The email address to validate. * @@ -469,23 +301,6 @@ gchar *purple_utf8_try_convert(const char *str); /** - * purple_utf8_strip_unprintables: - * @str: A valid UTF-8 string. - * - * Removes unprintable characters from a UTF-8 string. These characters - * (in particular low-ASCII characters) are invalid in XML 1.0 and thus - * are not allowed in XMPP and are rejected by libxml2 by default. - * - * The returned string must be freed by the caller. - * - * Returns: A newly allocated UTF-8 string without the unprintable characters. - * - * Since: 2.6 - */ -PURPLE_AVAILABLE_IN_2_6 -gchar *purple_utf8_strip_unprintables(const gchar *str); - -/** * purple_utf8_strcasecmp: * @a: The first string. * @b: The second string. @@ -505,36 +320,6 @@ int purple_utf8_strcasecmp(const char *a, const char *b); /** - * purple_utf8_has_word: - * @haystack: The string to search in. - * @needle: The substring to find. - * - * Case insensitive search for a word in a string. The needle string - * must be contained in the haystack string and not be immediately - * preceded or immediately followed by another alphanumeric character. - * - * Returns: TRUE if haystack has the word, otherwise FALSE - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -gboolean purple_utf8_has_word(const char *haystack, const char *needle); - -/** - * purple_text_strip_mnemonic: - * @in: The string to strip - * - * Removes the underscore characters from a string used identify the mnemonic - * character. - * - * Returns: The stripped string - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -char *purple_text_strip_mnemonic(const char *in); - -/** * purple_escape_filename: * @str: The string to translate. * @@ -547,43 +332,6 @@ PURPLE_AVAILABLE_IN_ALL const char *purple_escape_filename(const char *str); -/** - * purple_value_new: - * @type: The type of data to be held by the GValue - * - * Creates a new GValue of the specified type. - * - * Returns: The created GValue - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -GValue *purple_value_new(GType type); - -/** - * purple_value_dup: - * @value: The GValue to duplicate - * - * Duplicates a GValue. - * - * Returns: The duplicated GValue - * - * Since: 2.0 - */ -PURPLE_AVAILABLE_IN_ALL -GValue *purple_value_dup(GValue *value); - -/** - * purple_value_free: - * @value: The GValue to free. - * - * Frees a GValue. - * - * Since: 3.0 - */ -PURPLE_AVAILABLE_IN_3_0 -void purple_value_free(GValue *value); - G_END_DECLS #endif /* PURPLE_UTIL_H */