#include "cr-utils.h"
Go to the source code of this file.
Functions | |
enum CRStatus | cr_utils_utf8_str_len_as_ucs4 (const guchar *a_in_start, const guchar *a_in_end, gulong *a_len) |
Given an utf8 string buffer, calculates the length of this string if it was encoded in ucs4. | |
enum CRStatus | cr_utils_ucs4_str_len_as_utf8 (const guint32 *a_in_start, const guint32 *a_in_end, gulong *a_len) |
Given an ucs4 string, this function returns the size (in bytes) this string would have occupied if it was encoded in utf-8. | |
enum CRStatus | cr_utils_ucs1_str_len_as_utf8 (const guchar *a_in_start, const guchar *a_in_end, gulong *a_len) |
Given an ucsA string, this function returns the size (in bytes) this string would have occupied if it was encoded in utf-8. | |
enum CRStatus | cr_utils_utf8_to_ucs4 (const guchar *a_in, gulong *a_in_len, guint32 *a_out, gulong *a_out_len) |
Converts an utf8 buffer into an ucs4 buffer. | |
enum CRStatus | cr_utils_read_char_from_utf8_buf (const guchar *a_in, gulong a_in_len, guint32 *a_out, gulong *a_consumed) |
Reads a character from an utf8 buffer. | |
enum CRStatus | cr_utils_utf8_str_len_as_ucs1 (const guchar *a_in_start, const guchar *a_in_end, gulong *a_len) |
enum CRStatus | cr_utils_utf8_str_to_ucs4 (const guchar *a_in, gulong *a_in_len, guint32 **a_out, gulong *a_out_len) |
Converts an utf8 string into an ucs4 string. | |
enum CRStatus | cr_utils_ucs4_to_utf8 (const guint32 *a_in, gulong *a_in_len, guchar *a_out, gulong *a_out_len) |
Converts an ucs4 buffer into an utf8 buffer. | |
enum CRStatus | cr_utils_ucs4_str_to_utf8 (const guint32 *a_in, gulong *a_in_len, guchar **a_out, gulong *a_out_len) |
Converts an ucs4 string into an utf8 string. | |
enum CRStatus | cr_utils_ucs1_to_utf8 (const guchar *a_in, gulong *a_in_len, guchar *a_out, gulong *a_out_len) |
Converts an ucs1 buffer into an utf8 buffer. | |
enum CRStatus | cr_utils_ucs1_str_to_utf8 (const guchar *a_in, gulong *a_in_len, guchar **a_out, gulong *a_out_len) |
Converts an ucs1 string into an utf8 string. | |
enum CRStatus | cr_utils_utf8_to_ucs1 (const guchar *a_in, gulong *a_in_len, guchar *a_out, gulong *a_out_len) |
Converts an utf8 buffer into an ucs1 buffer. | |
enum CRStatus | cr_utils_utf8_str_to_ucs1 (const guchar *a_in, gulong *a_in_len, guchar **a_out, gulong *a_out_len) |
Converts an utf8 buffer into an ucs1 buffer. | |
gboolean | cr_utils_is_white_space (guint32 a_char) |
Returns TRUE if a_char is a white space as defined in the css spec in chap 4.1.1. | |
gboolean | cr_utils_is_newline (guint32 a_char) |
Returns true if the character is a newline as defined in the css spec in the chap 4.1.1. | |
gboolean | cr_utils_is_hexa_char (guint32 a_char) |
returns TRUE if the char is part of an hexa num char: i.e hexa_char ::= [0-9A-F] | |
gboolean | cr_utils_is_nonascii (guint32 a_char) |
Returns true if the character is a nonascii character (as defined in the css spec chap 4.1.1):. | |
void | cr_utils_dump_n_chars (guchar a_char, FILE *a_fp, glong a_nb) |
Dumps a character a_nb times on a file. | |
void | cr_utils_dump_n_chars2 (guchar a_char, GString *a_string, glong a_nb) |
gdouble | cr_utils_n_to_0_dot_n (glong a_n) |
GList * | cr_dup_glist_of_string (GList *a_list_of_strings) |
Duplicates a list of GString instances. |
Note that troughout this file I will refer to the CSS SPECIFICATIONS DOCUMENTATION written by the w3c guys. You can find that document at http://www.w3.org/TR/REC-CSS2/ .
Definition in file cr-utils.c.
|
Duplicates a list of GString instances.
Definition at line 1475 of file cr-utils.c. |
|
Dumps a character a_nb times on a file.
Definition at line 1430 of file cr-utils.c. |
|
Definition at line 1441 of file cr-utils.c. Referenced by cr_box_to_string(), and cr_declaration_to_string(). |
|
returns TRUE if the char is part of an hexa num char: i.e hexa_char ::= [0-9A-F]
Definition at line 1392 of file cr-utils.c. |
|
Returns true if the character is a newline as defined in the css spec in the chap 4.1.1.
nl ::=
Definition at line 1373 of file cr-utils.c. |
|
Returns true if the character is a nonascii character (as defined in the css spec chap 4.1.1):. nonascii ::= [^-]
Definition at line 1413 of file cr-utils.c. Referenced by cr_tknzr_get_next_token(). |
|
Returns TRUE if a_char is a white space as defined in the css spec in chap 4.1.1.
white-space ::= ' '| ||
Definition at line 1347 of file cr-utils.c. Referenced by cr_input_consume_white_spaces(). |
|
Definition at line 1456 of file cr-utils.c. |
|
Reads a character from an utf8 buffer. Actually decode the next character code (unicode character code) and returns it.
Definition at line 493 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_END_OF_INPUT_ERROR, CR_OK, and CRStatus. Referenced by cr_input_peek_char(), and cr_input_read_char(). |
|
Given an ucsA string, this function returns the size (in bytes) this string would have occupied if it was encoded in utf-8.
Definition at line 272 of file cr-utils.c. References CR_BAD_PARAM_ERROR, and CR_OK. Referenced by cr_utils_ucs1_str_to_utf8(). |
|
Converts an ucs1 string into an utf8 string.
Definition at line 1068 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_OK, cr_utils_ucs1_str_len_as_utf8(), cr_utils_ucs1_to_utf8(), and CRStatus. |
|
Converts an ucs1 buffer into an utf8 buffer. The caller must know the size of the resulting buffer and allocate it prior to calling this function.
Definition at line 1009 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_OK, and CRStatus. Referenced by cr_utils_ucs1_str_to_utf8(). |
|
Given an ucs4 string, this function returns the size (in bytes) this string would have occupied if it was encoded in utf-8.
Definition at line 214 of file cr-utils.c. References CR_BAD_PARAM_ERROR, and CR_OK. Referenced by cr_utils_ucs4_str_to_utf8(). |
|
Converts an ucs4 string into an utf8 string.
Definition at line 965 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_OK, cr_utils_ucs4_str_len_as_utf8(), cr_utils_ucs4_to_utf8(), and CRStatus. |
|
Converts an ucs4 buffer into an utf8 buffer.
Definition at line 854 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_ENCODING_ERROR, CR_OK, and CRStatus. Referenced by cr_utils_ucs4_str_to_utf8(). |
|
Definition at line 651 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_ENCODING_ERROR, and CR_OK. |
|
Given an utf8 string buffer, calculates the length of this string if it was encoded in ucs4.
Definition at line 74 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_ENCODING_ERROR, and CR_OK. Referenced by cr_utils_utf8_str_to_ucs1(), and cr_utils_utf8_str_to_ucs4(). |
|
Converts an utf8 buffer into an ucs1 buffer.
Definition at line 1299 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_OK, cr_utils_utf8_str_len_as_ucs4(), cr_utils_utf8_to_ucs1(), and CRStatus. |
|
Converts an utf8 string into an ucs4 string.
Definition at line 812 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_OK, cr_utils_utf8_str_len_as_ucs4(), cr_utils_utf8_to_ucs4(), and CRStatus. |
|
Converts an utf8 buffer into an ucs1 buffer. The caller must know the size of the resulting converted buffer, and allocated it prior to calling this function.
Definition at line 1129 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_ENCODING_ERROR, CR_OK, and CRStatus. Referenced by cr_utils_utf8_str_to_ucs1(). |
|
Converts an utf8 buffer into an ucs4 buffer.
Definition at line 318 of file cr-utils.c. References CR_BAD_PARAM_ERROR, CR_OK, and CRStatus. Referenced by cr_utils_utf8_str_to_ucs4(). |