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