Function

Purpleutil_read_xml_from_config_file

unstable since: 3.0

Declaration [src]

PurpleXmlNode*
purple_util_read_xml_from_config_file (
  const char* filename,
  const char* description
)

Description [src]

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 config xml files (prefs.xml, pounces.xml, etc.).

Available since: 3.0

Parameters

filename

Type: const char*

The basename of the file to open in the purple_config_dir.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
description

Type: const char*

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.”.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: PurpleXmlNode

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.

The caller of the function takes ownership of the data, and is responsible for freeing it.