diff src/util.h @ 10425:9903182f2aac

[gaim-migrate @ 11677] Added a util function to read an xml file and parse it into an xmlnode tree Changed accounts.xml reading to use xmlnode's committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 26 Dec 2004 22:52:52 +0000
parents 5b7a74d397cc
children f7f06cb69d5e
line wrap: on
line diff
--- a/src/util.h	Sun Dec 26 18:58:36 2004 +0000
+++ b/src/util.h	Sun Dec 26 22:52:52 2004 +0000
@@ -31,6 +31,7 @@
 #include <stdio.h>
 
 #include "account.h"
+#include "xmlnode.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -395,6 +396,23 @@
 									  size_t size);
 
 /**
+ * Read the contents of a given file and parse the results into an
+ * xmlnode tree structure.  This is intended to be used to read
+ * Gaim's configuration xml files (prefs.xml, pounces.xml, etc.)
+ *
+ * @param filename    The basename of the file to open in the gaim_user_dir.
+ * @param 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."
+ *
+ * @return An xmlnode tree of the contents of the given file.  Or NULL, if
+ *         the file does not exist or there was an error reading the file.
+ */
+xmlnode *gaim_util_read_xml_from_file(const char *filename,
+									  const char *description);
+
+/**
  * Creates a temporary file and returns a file pointer to it.
  *
  * This is like mkstemp(), but returns a file pointer and uses a