1
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
4
* This file is part of The Croco Library
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.
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.
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
20
* Author: Dodji Seketeli
21
* Look at file COPYRIGHTS for copyright information
30
* We're disabling this #include for Inkscape: see comment in libcroco.h.
31
//#include "libcroco-config.h"
38
*The Croco library basic types definitions
39
*And global definitions.
43
*The status type returned
44
*by the methods of the croco library.
49
CR_INSTANCIATION_FAILED_ERROR,
50
CR_UNKNOWN_TYPE_ERROR,
51
CR_UNKNOWN_PROP_ERROR,
52
CR_UNKNOWN_PROP_VAL_ERROR,
53
CR_UNEXPECTED_POSITION_SCHEME,
54
CR_START_OF_INPUT_ERROR,
55
CR_END_OF_INPUT_ERROR,
56
CR_OUTPUT_TOO_SHORT_ERROR,
57
CR_INPUT_TOO_SHORT_ERROR,
58
CR_OUT_OF_BOUNDS_ERROR,
59
CR_EMPTY_PARSER_INPUT_ERROR,
61
CR_ENCODING_NOT_FOUND_ERROR,
64
CR_NO_ROOT_NODE_ERROR,
66
CR_OUT_OF_MEMORY_ERROR,
67
CR_PSEUDO_CLASS_SEL_HANDLER_NOT_FOUND_ERROR,
68
CR_BAD_PSEUDO_CLASS_SEL_HANDLER_ERROR,
70
CR_FILE_NOT_FOUND_ERROR,
71
CR_VALUE_NOT_FOUND_ERROR
76
*cr_input_seek_position() ;
89
CR_UCS_4 = 1/*Must be not NULL*/,
95
CR_AUTO/*should be the last one*/
101
#define CROCO_LOG_DOMAIN "LIBCROCO"
104
#define cr_utils_trace(a_log_level, a_msg) \
105
g_log (CROCO_LOG_DOMAIN, \
106
G_LOG_LEVEL_CRITICAL, \
107
"file %s: line %d (%s): %s\n", \
110
__PRETTY_FUNCTION__, \
114
#define cr_utils_trace(a_log_level, a_msg) \
115
g_log (CROCO_LOG_DOMAIN, \
116
G_LOG_LEVEL_CRITICAL, \
117
"file %s: line %d: %s\n", \
124
*Traces an info message.
125
*The file, line and enclosing function
126
*of the message will be automatically
127
*added to the message.
128
*@param a_msg the msg to trace.
130
#define cr_utils_trace_info(a_msg) \
131
cr_utils_trace (G_LOG_LEVEL_INFO, a_msg)
134
*Trace a debug message.
135
*The file, line and enclosing function
136
*of the message will be automatically
137
*added to the message.
138
*@param a_msg the msg to trace.
140
#define cr_utils_trace_debug(a_msg) \
141
cr_utils_trace (G_LOG_LEVEL_DEBUG, a_msg) ;
144
/****************************
145
*Encoding transformations and
147
****************************/
150
cr_utils_read_char_from_utf8_buf (const guchar * a_in, gulong a_in_len,
151
guint32 *a_out, gulong *a_consumed) ;
154
cr_utils_ucs1_to_utf8 (const guchar *a_in, gulong *a_in_len,
155
guchar *a_out, gulong *a_out_len) ;
158
cr_utils_utf8_to_ucs1 (const guchar * a_in, gulong * a_in_len,
159
guchar *a_out, gulong *a_out_len) ;
162
cr_utils_ucs4_to_utf8 (const guint32 *a_in, gulong *a_in_len,
163
guchar *a_out, gulong *a_out_len) ;
166
cr_utils_utf8_str_len_as_ucs4 (const guchar *a_in_start,
167
const guchar *a_in_end,
170
cr_utils_ucs1_str_len_as_utf8 (const guchar *a_in_start,
171
const guchar *a_in_end,
174
cr_utils_utf8_str_len_as_ucs1 (const guchar *a_in_start,
175
const guchar *a_in_end,
178
cr_utils_ucs4_str_len_as_utf8 (const guint32 *a_in_start,
179
const guint32 *a_in_end,
183
cr_utils_ucs1_str_to_utf8 (const guchar *a_in_start,
189
cr_utils_utf8_str_to_ucs1 (const guchar * a_in_start,
195
cr_utils_utf8_to_ucs4 (const guchar * a_in,
197
guint32 *a_out, gulong *a_out_len) ;
200
cr_utils_ucs4_str_to_utf8 (const guint32 *a_in,
202
guchar **a_out, gulong *a_out_len) ;
205
cr_utils_utf8_str_to_ucs4 (const guchar * a_in,
211
/*****************************************
212
*CSS basic types identification utilities
213
*****************************************/
216
cr_utils_is_newline (guint32 a_char) ;
219
cr_utils_is_white_space (guint32 a_char) ;
222
cr_utils_is_nonascii (guint32 a_char) ;
225
cr_utils_is_hexa_char (guint32 a_char) ;
228
/**********************************
229
*Miscellaneous utility functions
230
***********************************/
233
cr_utils_dump_n_chars (guchar a_char,
238
cr_utils_dump_n_chars2 (guchar a_char,
242
cr_utils_dup_glist_of_string (GList *a_list) ;
245
cr_utils_dup_glist_of_cr_string (GList * a_list_of_strings) ;
249
#endif /*__CR_DEFS_H__*/