diff options
author | Dodji Seketeli <dodji at seketeli dot org> | 2003-06-26 21:13:26 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@src.gnome.org> | 2003-06-26 21:13:26 +0000 |
commit | f898e09f7d2e3c057f1d0866d6d44cfb6f7d1c3c (patch) | |
tree | 668c2e9c3ae771e566d7582de9609da6b133704d | |
parent | c5c2f5311cb851dc1859ddb00d497929c745a279 (diff) | |
download | libcroco-f898e09f7d2e3c057f1d0866d6d44cfb6f7d1c3c.tar.gz |
modified this coding example.
2003-06-26 Dodji Seketeli <dodji at seketeli dot org>
* docs/examples/cssom-example-1.c : modified this coding
example.
Dodji.
-rw-r--r-- | docs/examples/cssom-example-1.c (renamed from docs/examples/cssom-example.c) | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/docs/examples/cssom-example.c b/docs/examples/cssom-example-1.c index 5751840..01e93ed 100644 --- a/docs/examples/cssom-example.c +++ b/docs/examples/cssom-example-1.c @@ -2,7 +2,7 @@ /** *This is an example that shows how to use - *the libcroco css2 parsing library. + *the CSSOM api of the libcroco CSS2 parsing library. * *To compile it using gcc, type * @@ -78,24 +78,17 @@ main (int argc, char **argv) return 0; } - /* - *instanciate a new css object model parser. - */ - parser = cr_om_parser_new (NULL) ; - - if (!parser) - { - fprintf (stderr, - "Arrgh!!! Couldn't instanciate the parser.\n"); - return -1 ; - } - - status = cr_om_parser_parse_file (parser, - argv[i] /*the style sheet - file path*/, - CR_ASCII /*the encoding*/, - &stylesheet) ; + /***************************************************** + *Enough plumbering... now, the real libcroco stuffs. + ***************************************************/ + /* + *What we want here is to simply parse + *a CSS document using the cssom api. + */ + status = cr_om_parser_simply_parse_file (argv[i] /*sheet*/, + CR_ASCII /*the encoding*/, + &stylesheet) ; if (status == CR_OK && stylesheet) { /* @@ -115,9 +108,5 @@ main (int argc, char **argv) stylesheet = NULL ; } - /*free the memory used by the parser*/ - cr_om_parser_destroy (parser) ; - parser = NULL ; - return 0 ; } |