diff src/util.h @ 10415:5b7a74d397cc

[gaim-migrate @ 11665] Ability to save statuses. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 25 Dec 2004 19:54:24 +0000
parents 26eac2362c32
children 9903182f2aac
line wrap: on
line diff
--- a/src/util.h	Sat Dec 25 18:33:27 2004 +0000
+++ b/src/util.h	Sat Dec 25 19:54:24 2004 +0000
@@ -377,18 +377,22 @@
 int gaim_build_dir(const char *path, int mode);
 
 /**
- * Write a null-terminated string of data to a file of the given name
- * in the Gaim user directory ($HOME/.gaim by default).  The data is
- * typically a serialized version of one of Gaim's config files, such
- * as prefs.xml, accounts.xml, etc.  And the string is typically
- * obtained using xmlnode_to_formatted_str.
+ * Write a string of data to a file of the given name in the Gaim
+ * user directory ($HOME/.gaim by default).  The data is typically
+ * a serialized version of one of Gaim's config files, such as
+ * prefs.xml, accounts.xml, etc.  And the string is typically
+ * obtained using xmlnode_to_formatted_str.  However, this function
+ * should work fine for saving binary files as well.
  *
  * @param filename The basename of the file to write in the gaim_user_dir.
  * @param data     A null-terminated string of data to write.
+ * @param size     The size of the data to save.  If data is
+ *                 null-terminated you can pass in -1.
  *
  * @return TRUE if the file was written successfully.  FALSE otherwise.
  */
-gboolean gaim_util_write_xml_file(const char *filename, const char *data);
+gboolean gaim_util_write_data_to_file(const char *filename, const char *data,
+									  size_t size);
 
 /**
  * Creates a temporary file and returns a file pointer to it.