comparison 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
comparison
equal deleted inserted replaced
10414:26eac2362c32 10415:5b7a74d397cc
375 * @return 0 for success, nonzero on any error. 375 * @return 0 for success, nonzero on any error.
376 */ 376 */
377 int gaim_build_dir(const char *path, int mode); 377 int gaim_build_dir(const char *path, int mode);
378 378
379 /** 379 /**
380 * Write a null-terminated string of data to a file of the given name 380 * Write a string of data to a file of the given name in the Gaim
381 * in the Gaim user directory ($HOME/.gaim by default). The data is 381 * user directory ($HOME/.gaim by default). The data is typically
382 * typically a serialized version of one of Gaim's config files, such 382 * a serialized version of one of Gaim's config files, such as
383 * as prefs.xml, accounts.xml, etc. And the string is typically 383 * prefs.xml, accounts.xml, etc. And the string is typically
384 * obtained using xmlnode_to_formatted_str. 384 * obtained using xmlnode_to_formatted_str. However, this function
385 * should work fine for saving binary files as well.
385 * 386 *
386 * @param filename The basename of the file to write in the gaim_user_dir. 387 * @param filename The basename of the file to write in the gaim_user_dir.
387 * @param data A null-terminated string of data to write. 388 * @param data A null-terminated string of data to write.
389 * @param size The size of the data to save. If data is
390 * null-terminated you can pass in -1.
388 * 391 *
389 * @return TRUE if the file was written successfully. FALSE otherwise. 392 * @return TRUE if the file was written successfully. FALSE otherwise.
390 */ 393 */
391 gboolean gaim_util_write_xml_file(const char *filename, const char *data); 394 gboolean gaim_util_write_data_to_file(const char *filename, const char *data,
395 size_t size);
392 396
393 /** 397 /**
394 * Creates a temporary file and returns a file pointer to it. 398 * Creates a temporary file and returns a file pointer to it.
395 * 399 *
396 * This is like mkstemp(), but returns a file pointer and uses a 400 * This is like mkstemp(), but returns a file pointer and uses a