diff options
Diffstat (limited to 'src/cr-om-parser.c')
-rw-r--r-- | src/cr-om-parser.c | 78 |
1 files changed, 52 insertions, 26 deletions
diff --git a/src/cr-om-parser.c b/src/cr-om-parser.c index d1b85e3..c4f9d69 100644 --- a/src/cr-om-parser.c +++ b/src/cr-om-parser.c @@ -3,7 +3,7 @@ /* * This file is part of The Croco Library * - * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org> + * Copyright (C) 2002-2004 Dodji Seketeli * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2.1 of the GNU Lesser General Public @@ -216,11 +216,13 @@ start_font_face (CRDocHandler * a_this) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; g_return_if_fail (a_this); g_return_if_fail (a_this); - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->cur_stmt == NULL); @@ -235,12 +237,14 @@ end_font_face (CRDocHandler * a_this) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; CRStatement *stmts = NULL; g_return_if_fail (a_this); g_return_if_fail (a_this); - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->cur_stmt @@ -276,9 +280,11 @@ end_document (CRDocHandler * a_this) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; g_return_if_fail (a_this); - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); if (!ctxt->stylesheet || ctxt->cur_stmt) @@ -308,10 +314,11 @@ charset (CRDocHandler * a_this, GString * a_charset) GString *charset = NULL; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; g_return_if_fail (a_this); - - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->stylesheet); @@ -342,10 +349,11 @@ start_page (CRDocHandler * a_this, GString * a_page, GString * a_pseudo) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; g_return_if_fail (a_this); - - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->cur_stmt == NULL); @@ -384,11 +392,12 @@ end_page (CRDocHandler * a_this, GString * a_page, GString * a_pseudo_page) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; CRStatement *stmt = NULL; g_return_if_fail (a_this); - - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->cur_stmt && ctxt->cur_stmt->type == AT_PAGE_RULE_STMT @@ -416,10 +425,12 @@ start_media (CRDocHandler * a_this, GList * a_media_list) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; GList *media_list = NULL; g_return_if_fail (a_this); - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt @@ -443,10 +454,12 @@ end_media (CRDocHandler * a_this, GList * a_media_list) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; CRStatement *stmts = NULL; g_return_if_fail (a_this); - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt && ctxt->cur_media_stmt @@ -463,7 +476,9 @@ end_media (CRDocHandler * a_this, GList * a_media_list) ctxt->stylesheet->statements = stmts; stmts = NULL; - a_media_list = NULL; /*compiler happy */ + ctxt->cur_stmt = NULL ; + ctxt->cur_media_stmt = NULL ; + a_media_list = NULL; } static void @@ -475,11 +490,13 @@ import_style (CRDocHandler * a_this, GList * a_media_list, CRStatement *stmt = NULL, *stmt2 = NULL; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; GList *media_list = NULL, *cur = NULL; g_return_if_fail (a_this); - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->stylesheet); @@ -538,10 +555,11 @@ start_selector (CRDocHandler * a_this, CRSelector * a_selector_list) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; g_return_if_fail (a_this); - - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); if (ctxt->cur_stmt) { /*hmm, this should be NULL so free it */ @@ -558,10 +576,11 @@ end_selector (CRDocHandler * a_this, CRSelector * a_selector_list) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; g_return_if_fail (a_this); - - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); g_return_if_fail (ctxt->cur_stmt && ctxt->stylesheet); @@ -611,12 +630,14 @@ property (CRDocHandler * a_this, { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; CRDeclaration *decl = NULL, *decl2 = NULL; GString *str = NULL; g_return_if_fail (a_this); - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); /* @@ -711,10 +732,11 @@ error (CRDocHandler * a_this) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; g_return_if_fail (a_this); - - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK && ctxt); if (ctxt->cur_stmt) { @@ -728,8 +750,10 @@ unrecoverable_error (CRDocHandler * a_this) { enum CRStatus status = CR_OK; ParsingContext *ctxt = NULL; + ParsingContext **ctxtptr = NULL; - status = cr_doc_handler_get_ctxt (a_this, (gpointer *) & ctxt); + ctxtptr = &ctxt; + status = cr_doc_handler_get_ctxt (a_this, (gpointer *) ctxtptr); g_return_if_fail (status == CR_OK); if (ctxt) { @@ -828,14 +852,15 @@ cr_om_parser_parse_buf (CROMParser * a_this, if (status == CR_OK) { CRStyleSheet *result = NULL; + CRStyleSheet **resultptr = NULL; CRDocHandler *sac_handler = NULL; cr_parser_get_sac_handler (PRIVATE (a_this)->parser, &sac_handler); g_return_val_if_fail (sac_handler, CR_ERROR); - + resultptr = &result; status = cr_doc_handler_get_result (sac_handler, - (gpointer *) & result); + (gpointer *) resultptr); g_return_val_if_fail (status == CR_OK, status); if (result) @@ -912,14 +937,15 @@ cr_om_parser_parse_file (CROMParser * a_this, if (status == CR_OK) { CRStyleSheet *result = NULL; + CRStyleSheet **resultptr = NULL; CRDocHandler *sac_handler = NULL; cr_parser_get_sac_handler (PRIVATE (a_this)->parser, &sac_handler); g_return_val_if_fail (sac_handler, CR_ERROR); - + resultptr = &result; status = cr_doc_handler_get_result - (sac_handler, (gpointer *) & result); + (sac_handler, (gpointer *) resultptr); g_return_val_if_fail (status == CR_OK, status); if (result) *a_result = result; |