summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet_xml.h
blob: ba8c51a980230b89e8875b4e7c2256ab8cbd98e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef EFREET_XML_H
#define EFREET_XML_H

/**
 * @internal
 * @file efreet_xml.h
 * @brief A simple and fast XML parser
 * @addtogroup Efreet_Xml Efreet_Xml: An XML parser (private)
 * @ingroup Efreet
 *
 * Consider using @ref Eina_Simple_XML_Group instead.
 *
 * @private
 *
 * @{
 */

/**
 * Efreet_Xml_Attributes
 */
typedef struct Efreet_Xml_Attribute Efreet_Xml_Attribute;

/**
 * Efreet_Xml_Attributes
 * @brief Contains information about a given XML attribute
 */
struct Efreet_Xml_Attribute
{
    const char *key;        /**< The attribute key */
    const char *value;      /**< The attribute value */
};

/**
 * Efreet_Xml
 */
typedef struct Efreet_Xml Efreet_Xml;

/**
 * Efreet_Xml
 * @brief Contains the XML tree for a given XML document
 */
struct Efreet_Xml
{
    const char *text;                   /**< The XML text for this node */
    const char *tag;                    /**< The tag for this node */

    Efreet_Xml_Attribute **attributes;  /**< The attributes for this node */

    Eina_List *children;               /**< Child nodes */
};

int efreet_xml_init(void);
void efreet_xml_shutdown(void);

Efreet_Xml *efreet_xml_new(const char *file);
void efreet_xml_del(Efreet_Xml *xml);

const char *efreet_xml_attribute_get(Efreet_Xml *xml, const char *key);

/**
 * @}
 */

#endif