Last change
on this file since 4716 was
4716,
checked in by Jean-Yves Lamoureux, 10 years ago
|
- Initial commit
-This line, and those below, will be ignored--
A gaycko/tests
A gaycko/tests/lnx.html
A gaycko/tests/html.html
A gaycko/tests/simple.html
A gaycko/configure.ac
A gaycko/src
A gaycko/src/dom
A gaycko/src/dom/dom.c
A gaycko/src/dom/dom.h
A gaycko/src/helpers
A gaycko/src/helpers/str.c
A gaycko/src/helpers/str.h
A gaycko/src/gaycko.h
A gaycko/src/parsing
A gaycko/src/parsing/parse.h
A gaycko/src/parsing/parse.c
A gaycko/src/io
A gaycko/src/io/file.c
A gaycko/src/io/http.c
A gaycko/src/io/file.h
A gaycko/src/io/http.h
A gaycko/src/io/io.c
A gaycko/src/io/io.h
A gaycko/src/Makefile.am
A gaycko/src/gaycko.c
A gaycko/Makefile.am
AM gaycko/bootstrap
|
File size:
1.0 KB
|
Line | |
---|
1 | #ifndef _DOM_H |
---|
2 | #define _DOM_H |
---|
3 | |
---|
4 | #include <libxml/parser.h> |
---|
5 | #include <libxml/xinclude.h> |
---|
6 | #include <libxml/tree.h> |
---|
7 | #include <libxml/xmlIO.h> |
---|
8 | #include <libxml/HTMLparser.h> |
---|
9 | |
---|
10 | |
---|
11 | typedef enum { |
---|
12 | ELEM_UNKNOW = 0, |
---|
13 | ELEM_TEXT, |
---|
14 | ELEM_HTML, |
---|
15 | ELEM_HEAD, |
---|
16 | ELEM_TITLE, |
---|
17 | ELEM_META, |
---|
18 | ELEM_BODY, |
---|
19 | ELEM_H1, |
---|
20 | ELEM_BR, |
---|
21 | ELEM_P, |
---|
22 | ELEM_IMG, |
---|
23 | }elementType; |
---|
24 | |
---|
25 | struct gAttribute_ { |
---|
26 | char *name; |
---|
27 | char *value; |
---|
28 | }; |
---|
29 | typedef struct gAttribute_ gAttribute; |
---|
30 | |
---|
31 | typedef struct gElement_ gElement; |
---|
32 | struct gElement_ { |
---|
33 | elementType type; |
---|
34 | char *name; |
---|
35 | unsigned int level; |
---|
36 | |
---|
37 | unsigned int attribute_count; |
---|
38 | gAttribute *attributes; |
---|
39 | char *text; |
---|
40 | |
---|
41 | unsigned int children_count; |
---|
42 | gElement **children; |
---|
43 | |
---|
44 | gElement *parent; |
---|
45 | }; |
---|
46 | |
---|
47 | |
---|
48 | struct gDOM_ { |
---|
49 | gElement *root; |
---|
50 | }; |
---|
51 | |
---|
52 | typedef struct gDOM_ gDOM; |
---|
53 | |
---|
54 | |
---|
55 | gDOM *gaycko_convert_dom(htmlDocPtr doc); |
---|
56 | gElement* explore(gElement **elem, htmlNodePtr element, unsigned int level , gElement *parent); |
---|
57 | gElement *add_element(htmlNodePtr node); |
---|
58 | void pretty_print(gElement *elem); |
---|
59 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.