MLib Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#include <mlib.h> struct MParser; #define MPARSERINIT #define MParser_new (name) struct MMarkupParserData; #define MMARKUPPARSERDATAINIT #define MMarkupParserData_new (name) void m_inizialize_parser (MParser *parser
); mpointer m_parsing_from_xml (MMarkupParserData *m_markup_parser_data
);
The "GMarkup" parser is intended to parse a simple markup format that's a subset of XML. This is a small, efficient, easy-to-use parser.
struct MParser { /*< user >*/ mpointer data; /*< m_inizialize_parser() >*/ mchars last_tag; muint n_elements; };
Contiene le informazioni lette attraverso la funzione m_parsing_from_xml()
.
#define MParser_new(name) MParser name = MPARSERINIT
Declare and define a new MParser structure.
|
name of a new MParser structure |
struct MMarkupParserData { MFileString* string_file_xml; void (*start_element) ( GMarkupParseContext* context, mconstchars element_name, mconstchars* attribute_names, mconstchars* attribute_values, mpointer user_data, MError** error ); void (*end_element) ( GMarkupParseContext* context, mconstchars element_name, mpointer user_data, MError** error ); void (*text) ( GMarkupParseContext* context, mconstchars text, msize text_len, mpointer user_data, MError** error ); void (*passthrough) ( GMarkupParseContext* context, mconstchars passthrough_text, msize text_len, mpointer user_data, MError** error ); void (*error) ( GMarkupParseContext* context, MError* error, mpointer user_data ); void (*m_destroy_notify)( mpointer data ); void (*m_inizialize_data)(MParser* parser ); };
Contiene le informazioni da passare alla funzione m_parsing_from_xml()
MFileString * |
struttura contenente un testo letto da file |
Callback to invoke when the opening tag of an element is seen. | |
Callback to invoke when the closing tag of an element is seen. | |
Callback to invoke when some text is seen ( text is always inside an element ) . | |
Callback to invoke for comments, processing instructions and doctype declarations. | |
Callback to invoke when an error occurs. | |
Specifies the type of function which is called when a data element is destroyed. | |
inizializza una struttura MParser |
#define MMARKUPPARSERDATAINIT { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
#define MMarkupParserData_new(name)
Declare and define a new MMarkupParserData structure.
|
name of a new MMarkupParserData structure |
void m_inizialize_parser (MParser *parser
);
Inizializza una struttura MParser
|
dati da inizializzare |
Since 0.0.1
mpointer m_parsing_from_xml (MMarkupParserData *m_markup_parser_data
);
Effettua il parsing da un file.xml
|
contiene le informazioni necessarie al parsing |
Returns : |
l'indirizzo a una struttura indefinita contenente i dati letti nel parsing. |
Since 0.0.1