Libcroco
Data Structures | Defines | Typedefs | Functions
cr-om-parser.c File Reference
#include <string.h>
#include "cr-utils.h"
#include "cr-om-parser.h"

Go to the source code of this file.

Data Structures

struct  _CROMParserPriv
 : More...
struct  _ParsingContext

Defines

#define PRIVATE(a_this)   ((a_this)->priv)

Typedefs

typedef struct _ParsingContext ParsingContext

Functions

CROMParsercr_om_parser_new (CRInput *a_input)
 cr_om_parser_new: : the input stream.
enum CRStatus cr_om_parser_parse_buf (CROMParser *a_this, const guchar *a_buf, gulong a_len, enum CREncoding a_enc, CRStyleSheet **a_result)
 cr_om_parser_parse_buf: : the current instance of CROMParser.
enum CRStatus cr_om_parser_simply_parse_buf (const guchar *a_buf, gulong a_len, enum CREncoding a_enc, CRStyleSheet **a_result)
 cr_om_parser_simply_parse_buf: : the css2 in memory buffer.
enum CRStatus cr_om_parser_parse_file (CROMParser *a_this, const guchar *a_file_uri, enum CREncoding a_enc, CRStyleSheet **a_result)
 cr_om_parser_parse_file: : the current instance of the cssom parser.
enum CRStatus cr_om_parser_simply_parse_file (const guchar *a_file_path, enum CREncoding a_enc, CRStyleSheet **a_result)
 cr_om_parser_simply_parse_file: : the css2 local file path.
enum CRStatus cr_om_parser_parse_paths_to_cascade (CROMParser *a_this, const guchar *a_author_path, const guchar *a_user_path, const guchar *a_ua_path, enum CREncoding a_encoding, CRCascade **a_result)
 cr_om_parser_parse_paths_to_cascade: : the current instance of CROMParser : the path to the author stylesheet : the path to the user stylesheet : the path to the User Agent stylesheet : the encoding of the sheets.
enum CRStatus cr_om_parser_simply_parse_paths_to_cascade (const guchar *a_author_path, const guchar *a_user_path, const guchar *a_ua_path, enum CREncoding a_encoding, CRCascade **a_result)
 cr_om_parser_simply_parse_paths_to_cascade: : the path to the author stylesheet : the path to the user stylesheet : the path to the User Agent stylesheet : the encoding of the sheets.
void cr_om_parser_destroy (CROMParser *a_this)
 cr_om_parser_destroy: : the current instance of CROMParser.

Define Documentation

#define PRIVATE (   a_this)    ((a_this)->priv)

Typedef Documentation

Definition at line 47 of file cr-om-parser.c.


Function Documentation

void cr_om_parser_destroy ( CROMParser a_this)

cr_om_parser_destroy: : the current instance of CROMParser.

Destructor of the CROMParser.

Definition at line 1124 of file cr-om-parser.c.

References cr_parser_destroy(), and PRIVATE.

Referenced by cr_om_parser_new(), cr_om_parser_simply_parse_buf(), cr_om_parser_simply_parse_file(), and cr_om_parser_simply_parse_paths_to_cascade().

cr_om_parser_new: : the input stream.

Constructor of the CROMParser. Returns the newly built instance of CROMParser.

Definition at line 793 of file cr-om-parser.c.

References CR_OK, cr_om_parser_destroy(), cr_parser_new_from_input(), cr_utils_trace_info, and PRIVATE.

Referenced by cr_om_parser_simply_parse_buf(), cr_om_parser_simply_parse_file(), and cr_om_parser_simply_parse_paths_to_cascade().

enum CRStatus cr_om_parser_parse_buf ( CROMParser a_this,
const guchar *  a_buf,
gulong  a_len,
enum CREncoding  a_enc,
CRStyleSheet **  a_result 
)

cr_om_parser_parse_buf: : the current instance of CROMParser.

: the in memory buffer to parse. : the length of the in memory buffer in number of bytes. : the encoding of the in memory buffer. : out parameter the resulting style sheet

Parses the content of an in memory buffer.

Returns CR_OK upon successfull completion, an error code otherwise.

Definition at line 852 of file cr-om-parser.c.

References CR_BAD_PARAM_ERROR, cr_doc_handler_get_result(), CR_ERROR, CR_OK, cr_parser_get_sac_handler(), cr_parser_new(), cr_parser_parse_buf(), and PRIVATE.

Referenced by cr_om_parser_simply_parse_buf().

enum CRStatus cr_om_parser_parse_file ( CROMParser a_this,
const guchar *  a_file_uri,
enum CREncoding  a_enc,
CRStyleSheet **  a_result 
)

cr_om_parser_parse_file: : the current instance of the cssom parser.

: the uri of the file. (only local file paths are suppported so far) : the encoding of the file. : out parameter. A pointer the build css object model.

Parses a css2 stylesheet contained in a file.

Returns CR_OK upon succesful completion, an error code otherwise.

Definition at line 942 of file cr-om-parser.c.

References CR_BAD_PARAM_ERROR, cr_doc_handler_get_result(), CR_ERROR, CR_OK, cr_parser_get_sac_handler(), cr_parser_new_from_file(), cr_parser_parse_file(), and PRIVATE.

Referenced by cr_om_parser_parse_paths_to_cascade(), and cr_om_parser_simply_parse_file().

enum CRStatus cr_om_parser_parse_paths_to_cascade ( CROMParser a_this,
const guchar *  a_author_path,
const guchar *  a_user_path,
const guchar *  a_ua_path,
enum CREncoding  a_encoding,
CRCascade **  a_result 
)

cr_om_parser_parse_paths_to_cascade: : the current instance of CROMParser : the path to the author stylesheet : the path to the user stylesheet : the path to the User Agent stylesheet : the encoding of the sheets.

: out parameter. The resulting cascade if the parsing was okay

Parses three sheets located by their paths and build a cascade

Returns CR_OK upon successful completion, an error code otherwise

Definition at line 1031 of file cr-om-parser.c.

References CR_BAD_PARAM_ERROR, cr_cascade_new(), CR_ERROR, CR_OK, cr_om_parser_parse_file(), and cr_stylesheet_unref().

Referenced by cr_om_parser_simply_parse_paths_to_cascade().

enum CRStatus cr_om_parser_simply_parse_buf ( const guchar *  a_buf,
gulong  a_len,
enum CREncoding  a_enc,
CRStyleSheet **  a_result 
)

cr_om_parser_simply_parse_buf: : the css2 in memory buffer.

: the length of the in memory buffer. : the encoding of the in memory buffer. : out parameter. The resulting css2 style sheet.

The simpler way to parse an in memory css2 buffer.

Returns CR_OK upon successfull completion, an error code otherwise.

Definition at line 901 of file cr-om-parser.c.

References CR_ERROR, CR_OK, cr_om_parser_destroy(), cr_om_parser_new(), cr_om_parser_parse_buf(), and cr_utils_trace_info.

enum CRStatus cr_om_parser_simply_parse_file ( const guchar *  a_file_path,
enum CREncoding  a_enc,
CRStyleSheet **  a_result 
)

cr_om_parser_simply_parse_file: : the css2 local file path.

: the file encoding. : out parameter. The returned css stylesheet. Must be freed by the caller using cr_stylesheet_destroy.

The simpler method to parse a css2 file.

Returns CR_OK upon successfull completion, an error code otherwise. Note that this method uses cr_om_parser_parse_file() so both methods have the same return values.

Definition at line 992 of file cr-om-parser.c.

References CR_ERROR, CR_OK, cr_om_parser_destroy(), cr_om_parser_new(), cr_om_parser_parse_file(), and cr_utils_trace_info.

enum CRStatus cr_om_parser_simply_parse_paths_to_cascade ( const guchar *  a_author_path,
const guchar *  a_user_path,
const guchar *  a_ua_path,
enum CREncoding  a_encoding,
CRCascade **  a_result 
)

cr_om_parser_simply_parse_paths_to_cascade: : the path to the author stylesheet : the path to the user stylesheet : the path to the User Agent stylesheet : the encoding of the sheets.

: out parameter. The resulting cascade if the parsing was okay

Parses three sheets located by their paths and build a cascade

Returns CR_OK upon successful completion, an error code otherwise

Definition at line 1090 of file cr-om-parser.c.

References CR_ERROR, CR_OK, cr_om_parser_destroy(), cr_om_parser_new(), cr_om_parser_parse_paths_to_cascade(), and cr_utils_trace_info.