blob: a88a8f9d1a6c74b0149816683305ab442ffca63b (
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
|
/**
* @file xml.h
* @version 1.0
* @brief header file to support of xml configuration.
*
* @details this file is the header file for the implementation of dynamic registers using xml and several funtionalities for the "pci-tool" line command tool from XML files. the xml part has been implemented using libxml2.
*
* this code was meant to be evolutive as the XML files evolute. In this meaning, most of the xml parsing is realized with XPath expressions(when it was possible), so that changing the xml xould result mainly in changing the XPAth pathes present here.
* @todo cf compilation chain
*/
#ifndef _XML_
#define _XML_
#include <libxml/tree.h>
#include "pcilib.h"
typedef struct{
xmlDocPtr* docs;
xmlNodePtr* xml_banks; /**<pointer to xml nodes of banks in the xml file*/
xmlNodePtr* xml_registers; /**< pointer to xml nodes of registers in the xml file*/
unsigned int nb_registers;
unsigned int nb_new_banks;
}pcilib_xml_context_t;
/**
* this function gets the xml files and validates them, before filling the pcilib_t struct with the registers and banks of those files
*@param[in,out] pci the pcilib_t struct running that gets filled with banks and registers
*@param[in] model the name of the model
*/
int pcilib_init_xml(pcilib_t* pci, char* model);
/** pcilib_clean_xml
* this function free the xml parts of the pcilib_t running, and some libxml ashes
* @param[in] pci the pcilib_t running
*/
void pcilib_free_xml(pcilib_t* pci);
#endif /*_XML_*/
|