cr-parsing-location.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 the COPYRIGHTS file for copyright information.
  21. */
  22. #ifndef __CR_PARSING_LOCATION_H__
  23. #define __CR_PARSING_LOCATION_H__
  24. #include "cr-utils.h"
  25. G_BEGIN_DECLS
  26. /**
  27. *@file
  28. *The declaration of the CRParsingLocation
  29. *object. This object keeps track of line/column/byte offset/
  30. *at which the parsing of a given CSS construction appears.
  31. */
  32. typedef struct _CRParsingLocation CRParsingLocation;
  33. struct _CRParsingLocation {
  34. guint line ;
  35. guint column ;
  36. guint byte_offset ;
  37. } ;
  38. enum CRParsingLocationSerialisationMask {
  39. DUMP_LINE = 1,
  40. DUMP_COLUMN = 1 << 1,
  41. DUMP_BYTE_OFFSET = 1 << 2
  42. } ;
  43. CRParsingLocation * cr_parsing_location_new (void) ;
  44. enum CRStatus cr_parsing_location_init (CRParsingLocation *a_this) ;
  45. enum CRStatus cr_parsing_location_copy (CRParsingLocation *a_to,
  46. CRParsingLocation const *a_from) ;
  47. gchar * cr_parsing_location_to_string (CRParsingLocation const *a_this,
  48. enum CRParsingLocationSerialisationMask a_mask) ;
  49. void cr_parsing_location_dump (CRParsingLocation const *a_this,
  50. enum CRParsingLocationSerialisationMask a_mask,
  51. FILE *a_fp) ;
  52. void cr_parsing_location_destroy (CRParsingLocation *a_this) ;
  53. G_END_DECLS
  54. #endif