1 /* -*- Mode: C; indent-tabs-mode: ni; c-basic-offset: 8 -*- */
3 /*
4 * This file is part of The Croco Library
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of version 2.1 of the GNU Lesser General Public
8 * License as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 * USA
19 *
20 * Author: Dodji Seketeli.
21 * See the COPYRIGHTS file for copyright information.
22 */
24 #ifndef __CR_PARSING_LOCATION_H__
25 #define __CR_PARSING_LOCATION_H__
27 #include "cr-utils.h"
29 G_BEGIN_DECLS
31 /**
32 *@file
33 *The declaration of the CRParsingLocation
34 *object. This object keeps track of line/column/byte offset/
35 *at which the parsing of a given CSS construction appears.
36 */
38 typedef struct _CRParsingLocation CRParsingLocation;
39 struct _CRParsingLocation {
40 guint line ;
41 guint column ;
42 guint byte_offset ;
43 } ;
46 enum CRParsingLocationSerialisationMask {
47 DUMP_LINE = 1,
48 DUMP_COLUMN = 1 << 1,
49 DUMP_BYTE_OFFSET = 1 << 2
50 } ;
52 CRParsingLocation * cr_parsing_location_new (void) ;
54 enum CRStatus cr_parsing_location_init (CRParsingLocation *a_this) ;
56 enum CRStatus cr_parsing_location_copy (CRParsingLocation *a_to,
57 CRParsingLocation *a_from) ;
59 gchar * cr_parsing_location_to_string (CRParsingLocation *a_this,
60 enum CRParsingLocationSerialisationMask a_mask) ;
61 void cr_parsing_location_dump (CRParsingLocation *a_this,
62 enum CRParsingLocationSerialisationMask a_mask,
63 FILE *a_fp) ;
65 void cr_parsing_location_destroy (CRParsingLocation *a_this) ;
69 G_END_DECLS
70 #endif