#include <stdio.h>
#include <glib.h>
#include "cr-utils.h"
#include "cr-rgb.h"
#include "cr-num.h"
#include "cr-string.h"
Go to the source code of this file.
Data Structures | |
struct | _CRTerm |
An abstraction of a css2 term as defined in the CSS2 spec in appendix D.1: term ::= [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* | TIME S* | FREQ S* | function ] | STRING S* | IDENT S* | URI S* | RGB S* | UNICODERANGE S* | hexcolor. More... | |
Typedefs | |
typedef _CRTerm | CRTerm |
Enumerations | |
enum | CRTermType { TERM_NO_TYPE = 0, TERM_NUMBER, TERM_FUNCTION, TERM_STRING, TERM_IDENT, TERM_URI, TERM_RGB, TERM_UNICODERANGE, TERM_HASH } |
enum | UnaryOperator { NO_UNARY_UOP = 0, PLUS_UOP, MINUS_UOP, EMPTY_UNARY_UOP } |
enum | Operator { NO_OP = 0, DIVIDE, COMMA } |
Functions | |
CRTerm * | cr_term_parse_expression_from_buf (const guchar *a_buf, enum CREncoding a_encoding) |
Parses an expresion as defined by the css2 spec and builds the expression as a list of terms. | |
CRTerm * | cr_term_new (void) |
Instanciate a CRTerm. | |
enum CRStatus | cr_term_set_number (CRTerm *a_this, CRNum *a_num) |
enum CRStatus | cr_term_set_function (CRTerm *a_this, CRString *a_func_name, CRTerm *a_func_param) |
enum CRStatus | cr_term_set_string (CRTerm *a_this, CRString *a_str) |
enum CRStatus | cr_term_set_ident (CRTerm *a_this, CRString *a_str) |
enum CRStatus | cr_term_set_uri (CRTerm *a_this, CRString *a_str) |
enum CRStatus | cr_term_set_rgb (CRTerm *a_this, CRRgb *a_rgb) |
enum CRStatus | cr_term_set_hash (CRTerm *a_this, CRString *a_str) |
CRTerm * | cr_term_append_term (CRTerm *a_this, CRTerm *a_new_term) |
Appends a new term to the current list of CRTerm. | |
CRTerm * | cr_term_prepend_term (CRTerm *a_this, CRTerm *a_new_term) |
Prepends a term to the list of terms represented by a_this. | |
guchar * | cr_term_to_string (CRTerm *a_this) |
Serializes the expression represented by the chained instances of #CRterm. | |
guchar * | cr_term_one_to_string (CRTerm *a_this) |
void | cr_term_dump (CRTerm *a_this, FILE *a_fp) |
Dumps the expression (a list of terms connected by operators) to a file. | |
int | cr_term_nr_values (CRTerm *a_this) |
Return the number of terms in the expression. | |
CRTerm * | cr_term_get_from_list (CRTerm *a_this, int itemnr) |
Use an index to get a CRTerm from the expression. | |
void | cr_term_ref (CRTerm *a_this) |
Increments the reference counter of the current instance of CRTerm.*. | |
gboolean | cr_term_unref (CRTerm *a_this) |
Decrements the ref count of the current instance of CRTerm. | |
void | cr_term_destroy (CRTerm *a_term) |
The destructor of the the CRTerm class. |
Definition in file cr-term.h.
|
|
|
|
|
|
|
|
Appends a new term to the current list of CRTerm.
Definition at line 235 of file cr-term.c. References CRTerm, _CRTerm::next, and _CRTerm::prev. Referenced by cr_parser_parse_declaration(), cr_parser_parse_expr(), and cr_parser_parse_term(). |
|
The destructor of the the CRTerm class.
Definition at line 776 of file cr-term.c. References CRTerm, and _CRTerm::next. Referenced by cr_declaration_destroy(), cr_declaration_parse_from_buf(), cr_declaration_parse_list_from_buf(), cr_parser_parse_declaration(), cr_parser_parse_expr(), cr_parser_parse_font_face(), cr_parser_parse_page(), cr_parser_parse_term(), cr_rgb_parse_from_buf(), cr_term_parse_expression_from_buf(), and cr_term_unref(). |
|
Dumps the expression (a list of terms connected by operators) to a file. TODO: finish the dump. The dump of some type of terms have not yet been implemented.
Definition at line 680 of file cr-term.c. References cr_term_to_string(), and CRTerm. |
|
Use an index to get a CRTerm from the expression.
Definition at line 720 of file cr-term.c. References CRTerm, and _CRTerm::next. |
|
Instanciate a CRTerm.
Definition at line 85 of file cr-term.c. References cr_utils_trace_info, and CRTerm. Referenced by cr_parser_parse_term(). |
|
Return the number of terms in the expression.
Definition at line 700 of file cr-term.c. References CRTerm, and _CRTerm::next. |
|
Definition at line 476 of file cr-term.c. References COMMA, _CRTerm::content, cr_num_to_string(), cr_rgb_to_string(), cr_term_to_string(), CRTerm, DIVIDE, _CRTerm::ext_content, _CRTerm::func_param, MINUS_UOP, NO_OP, _CRTerm::num, PLUS_UOP, _CRTerm::prev, _CRTerm::rgb, _CRTerm::str, _CRString::stryng, TERM_FUNCTION, TERM_HASH, TERM_IDENT, TERM_NUMBER, TERM_RGB, TERM_STRING, TERM_UNICODERANGE, and TERM_URI. |
|
Parses an expresion as defined by the css2 spec and builds the expression as a list of terms.
Definition at line 106 of file cr-term.c. References cr_parser_destroy(), cr_parser_new_from_buf(), cr_parser_parse_expr(), cr_parser_try_to_skip_spaces_and_comments(), cr_term_destroy(), CRParser, CRStatus, and CRTerm. |
|
Prepends a term to the list of terms represented by a_this.
Definition at line 261 of file cr-term.c. References CRTerm, _CRTerm::next, and _CRTerm::prev. |
|
Increments the reference counter of the current instance of CRTerm.*.
Definition at line 739 of file cr-term.c. References CRTerm, and _CRTerm::ref_count. Referenced by cr_declaration_new(), cr_parser_parse_font_face(), cr_parser_parse_page(), and cr_parser_parse_ruleset(). |
|
Definition at line 153 of file cr-term.c. References _CRTerm::content, CR_BAD_PARAM_ERROR, CRString, CRTerm, _CRTerm::ext_content, _CRTerm::func_param, and _CRTerm::str. Referenced by cr_parser_parse_term(). |
|
Definition at line 215 of file cr-term.c. References _CRTerm::content, CR_BAD_PARAM_ERROR, CRString, CRTerm, and _CRTerm::str. Referenced by cr_parser_parse_term(). |
|
Definition at line 179 of file cr-term.c. References _CRTerm::content, CR_BAD_PARAM_ERROR, CRString, CRTerm, and _CRTerm::str. Referenced by cr_parser_parse_term(). |
|
Definition at line 141 of file cr-term.c. References _CRTerm::content, CR_BAD_PARAM_ERROR, CRNum, CRTerm, and _CRTerm::num. Referenced by cr_parser_parse_term(). |
|
Definition at line 203 of file cr-term.c. References _CRTerm::content, CR_BAD_PARAM_ERROR, CRTerm, and _CRTerm::rgb. Referenced by cr_parser_parse_term(). |
|
Definition at line 167 of file cr-term.c. References _CRTerm::content, CR_BAD_PARAM_ERROR, CRString, CRTerm, and _CRTerm::str. Referenced by cr_parser_parse_term(). |
|
Definition at line 191 of file cr-term.c. References _CRTerm::content, CR_BAD_PARAM_ERROR, CRString, CRTerm, and _CRTerm::str. Referenced by cr_parser_parse_term(). |
|
Serializes the expression represented by the chained instances of #CRterm.
Definition at line 279 of file cr-term.c. References COMMA, _CRTerm::content, cr_num_to_string(), cr_rgb_to_string(), cr_term_to_string(), CRTerm, DIVIDE, _CRTerm::ext_content, _CRTerm::func_param, MINUS_UOP, _CRTerm::next, NO_OP, _CRTerm::num, PLUS_UOP, _CRTerm::prev, _CRTerm::rgb, _CRTerm::str, _CRString::stryng, TERM_FUNCTION, TERM_HASH, TERM_IDENT, TERM_NUMBER, TERM_RGB, TERM_STRING, TERM_UNICODERANGE, and TERM_URI. Referenced by cr_declaration_to_string(), cr_term_dump(), cr_term_one_to_string(), and cr_term_to_string(). |
|
Decrements the ref count of the current instance of CRTerm. If the ref count reaches zero, the instance is destroyed.
Definition at line 754 of file cr-term.c. References cr_term_destroy(), CRTerm, and _CRTerm::ref_count. Referenced by cr_parser_parse_font_face(), cr_parser_parse_page(), and cr_parser_parse_ruleset(). |