PageRenderTime 57ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/cssed-0.4.0/libcroco/parser/cr-parser-input.h

#
C Header | 162 lines | 103 code | 38 blank | 21 comment | 0 complexity | f7f942760a12186eb358706c76121be5 MD5 | raw file
Possible License(s): GPL-2.0
  1. /* -*- Mode: C; indent-tabs-mode: ni; c-basic-offset: 8 -*- */
  2. /*
  3. * This file is part of The Croco Library
  4. *
  5. * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of version 2.1 of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  19. * USA
  20. */
  21. #ifndef __CR_PARSER_INPUT_H__
  22. #define __CR_PARSER_INPUT_H__
  23. #include "cr-input.h"
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. typedef struct _CRParserInput CRParserInput ;
  28. typedef struct _CRParserInputPriv CRParserInputPriv ;
  29. struct _CRParserInput
  30. {
  31. CRParserInputPriv *priv ;
  32. } ;
  33. typedef struct _CRParserInputPos CRParserInputPos ;
  34. struct _CRParserInputPos
  35. {
  36. CRInputPos input_pos ;
  37. /*not used yet*/
  38. glong stack_size ;
  39. } ;
  40. CRParserInput *
  41. cr_parser_input_new_from_uri (gchar *a_uri, enum CREncoding) ;
  42. void
  43. cr_parser_input_ref (CRParserInput *a_this) ;
  44. gboolean
  45. cr_parser_input_unref (CRParserInput *a_this) ;
  46. void
  47. cr_parser_input_destroy (CRParserInput *a_this) ;
  48. enum CRStatus
  49. cr_parser_input_push_input (CRParserInput *a_this,
  50. CRInput *a_input) ;
  51. enum CRStatus
  52. cr_parser_input_pop_input (CRParserInput *a_this) ;
  53. CRInput *
  54. cr_parser_input_peek_input (CRParserInput *a_this) ;
  55. enum CRStatus
  56. cr_parser_input_get_byte_addr (CRParserInput *a_this,
  57. gulong a_offset,
  58. guchar **a_addr) ;
  59. enum CRStatus
  60. cr_parser_input_get_cur_byte_addr (CRParserInput *a_this,
  61. guchar **a_addr) ;
  62. enum CRStatus
  63. cr_parser_input_read_byte (CRParserInput *a_this,
  64. guchar * a_byte) ;
  65. enum CRStatus
  66. cr_parser_input_read_char (CRParserInput *a_this,
  67. guint32 * a_byte) ;
  68. enum CRStatus
  69. cr_parser_input_get_end_of_file (CRParserInput *a_this,
  70. gboolean *a_eof) ;
  71. enum CRStatus
  72. cr_parser_input_consume_char (CRParserInput *a_this,
  73. guint32 a_char) ;
  74. enum CRStatus
  75. cr_parser_input_consume_chars (CRParserInput *a_this,
  76. guint32 a_char,
  77. glong *a_nb_char) ;
  78. enum CRStatus
  79. cr_parser_input_consume_spaces (CRParserInput *a_this,
  80. glong *a_nb_char) ;
  81. enum CRStatus
  82. cr_parser_input_peek_byte (CRParserInput *a_this,
  83. enum CRSeekPos a_origin,
  84. gulong a_offset, guchar *a_byte) ;
  85. enum CRStatus
  86. cr_parser_input_peek_char (CRParserInput *a_this,
  87. guint32 *a_char) ;
  88. glong
  89. cr_parser_input_get_nb_bytes_left (CRParserInput *a_this) ;
  90. enum CRStatus
  91. cr_parser_input_seek_index (CRParserInput *a_this,
  92. enum CRSeekPos a_origin,
  93. gint a_pos) ;
  94. enum CRStatus
  95. cr_parser_input_get_cur_pos (CRParserInput *a_this,
  96. CRParserInputPos *a_pos) ;
  97. enum CRStatus
  98. cr_parser_input_set_cur_pos (CRParserInput *a_this,
  99. CRParserInputPos *a_pos) ;
  100. enum CRStatus
  101. cr_parser_input_set_line_num (CRParserInput *a_this,
  102. glong a_line) ;
  103. enum CRStatus
  104. cr_parser_input_set_col_num (CRParserInput *a_this,
  105. glong a_col) ;
  106. enum CRStatus
  107. cr_parser_input_incr_line_num (CRParserInput *a_this,
  108. glong a_increment) ;
  109. enum CRStatus
  110. cr_parser_input_incr_col_num (CRParserInput *a_this,
  111. glong a_increment) ;
  112. enum CRStatus
  113. cr_parser_input_get_col_num (CRParserInput *a_this,
  114. glong *a_col) ;
  115. enum CRStatus
  116. cr_parser_input_get_line_num (CRParserInput *a_this,
  117. glong *a_line) ;
  118. enum CRStatus
  119. cr_parser_input_get_cur_index (CRParserInput *a_this,
  120. glong *a_index) ;
  121. #ifdef __cplusplus
  122. } /*extern "C" {*/
  123. #endif
  124. #endif /*__CR_PARSER_INPUT_H__*/