cr-parser.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
  2. /*
  3. * This file is part of The Croco Library
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of version 2.1 of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  17. * USA
  18. *
  19. * Author: Dodji Seketeli
  20. * See COPYRIGHTS file for copyrights information.
  21. */
  22. #ifndef __CR_PARSER_H__
  23. #define __CR_PARSER_H__
  24. #include <glib.h>
  25. #include "cr-input.h"
  26. #include "cr-tknzr.h"
  27. #include "cr-utils.h"
  28. #include "cr-doc-handler.h"
  29. G_BEGIN_DECLS
  30. /**
  31. *@file
  32. *The declaration file
  33. *of the #CRParser class.
  34. */
  35. typedef struct _CRParser CRParser ;
  36. typedef struct _CRParserPriv CRParserPriv ;
  37. /**
  38. *The implementation of
  39. *the SAC parser.
  40. *The Class is opaque
  41. *and must be manipulated through
  42. *the provided methods.
  43. */
  44. struct _CRParser {
  45. CRParserPriv *priv ;
  46. } ;
  47. CRParser * cr_parser_new (CRTknzr *a_tknzr) ;
  48. CRParser * cr_parser_new_from_buf (guchar *a_buf, gulong a_len,
  49. enum CREncoding a_enc,
  50. gboolean a_free_buf) ;
  51. CRParser * cr_parser_new_from_file (const guchar *a_file_uri,
  52. enum CREncoding a_enc) ;
  53. CRParser * cr_parser_new_from_input (CRInput *a_input) ;
  54. enum CRStatus cr_parser_set_tknzr (CRParser *a_this, CRTknzr *a_tknzr) ;
  55. enum CRStatus cr_parser_get_tknzr (CRParser *a_this, CRTknzr **a_tknzr) ;
  56. enum CRStatus cr_parser_get_parsing_location (CRParser const *a_this, CRParsingLocation *a_loc) ;
  57. enum CRStatus cr_parser_try_to_skip_spaces_and_comments (CRParser *a_this) ;
  58. enum CRStatus cr_parser_set_sac_handler (CRParser *a_this,
  59. CRDocHandler *a_handler) ;
  60. enum CRStatus cr_parser_get_sac_handler (CRParser *a_this,
  61. CRDocHandler **a_handler) ;
  62. enum CRStatus cr_parser_set_use_core_grammar (CRParser *a_this,
  63. gboolean a_use_core_grammar) ;
  64. enum CRStatus cr_parser_get_use_core_grammar (CRParser const *a_this,
  65. gboolean *a_use_core_grammar) ;
  66. enum CRStatus cr_parser_parse (CRParser *a_this) ;
  67. enum CRStatus cr_parser_parse_file (CRParser *a_this,
  68. const guchar *a_file_uri,
  69. enum CREncoding a_enc) ;
  70. enum CRStatus cr_parser_parse_buf (CRParser *a_this, const guchar *a_buf,
  71. gulong a_len, enum CREncoding a_enc) ;
  72. enum CRStatus cr_parser_set_default_sac_handler (CRParser *a_this) ;
  73. enum CRStatus cr_parser_parse_term (CRParser *a_this, CRTerm **a_term) ;
  74. enum CRStatus cr_parser_parse_expr (CRParser *a_this, CRTerm **a_expr) ;
  75. enum CRStatus cr_parser_parse_prio (CRParser *a_this, CRString **a_prio) ;
  76. enum CRStatus cr_parser_parse_declaration (CRParser *a_this, CRString **a_property,
  77. CRTerm **a_expr, gboolean *a_important) ;
  78. enum CRStatus cr_parser_parse_statement_core (CRParser *a_this) ;
  79. enum CRStatus cr_parser_parse_ruleset (CRParser *a_this) ;
  80. enum CRStatus cr_parser_parse_import (CRParser *a_this, GList ** a_media_list,
  81. CRString **a_import_string,
  82. CRParsingLocation *a_location) ;
  83. enum CRStatus cr_parser_parse_media (CRParser *a_this) ;
  84. enum CRStatus cr_parser_parse_page (CRParser *a_this) ;
  85. enum CRStatus cr_parser_parse_charset (CRParser *a_this, CRString **a_value,
  86. CRParsingLocation *a_charset_sym_location) ;
  87. enum CRStatus cr_parser_parse_font_face (CRParser *a_this) ;
  88. void cr_parser_destroy (CRParser *a_this) ;
  89. G_END_DECLS
  90. #endif /*__CR_PARSER_H__*/