Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

cr-om-parser.c File Reference

The definition of the CSS Object Model Parser. More...

#include <string.h>
#include "cr-utils.h"
#include "cr-om-parser.h"

Go to the source code of this file.

Data Structures

struct  _CROMParserPriv
struct  _ParsingContext

Defines

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

Typedefs

typedef _ParsingContext ParsingContext

Functions

CROMParsercr_om_parser_new (CRInput *a_input)
 Constructor of the CROMParser.
enum CRStatus cr_om_parser_parse_buf (CROMParser *a_this, const guchar *a_buf, gulong a_len, enum CREncoding a_enc, CRStyleSheet **a_result)
 Parses the content of an in memory buffer.
enum CRStatus cr_om_parser_simply_parse_buf (const guchar *a_buf, gulong a_len, enum CREncoding a_enc, CRStyleSheet **a_result)
 The simpler way to parse an in memory css2 buffer.
enum CRStatus cr_om_parser_parse_file (CROMParser *a_this, const guchar *a_file_uri, enum CREncoding a_enc, CRStyleSheet **a_result)
 Parses a css2 stylesheet contained in a file.
enum CRStatus cr_om_parser_simply_parse_file (const guchar *a_file_path, enum CREncoding a_enc, CRStyleSheet **a_result)
 The simpler method to parse a css2 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)
 Parses three sheets located by their paths and build a cascade.
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)
 Parses three sheets located by their paths and build a cascade.
void cr_om_parser_destroy (CROMParser *a_this)
 Destructor of the CROMParser.


Detailed Description

The definition of the CSS Object Model Parser.

This parser uses (and sits) the SAC api of libcroco defined in cr-parser.h and cr-doc-handler.h

Definition in file cr-om-parser.c.


Define Documentation

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

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


Typedef Documentation

typedef struct _ParsingContext ParsingContext
 

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


Function Documentation

void cr_om_parser_destroy CROMParser a_this  ) 
 

Destructor of the CROMParser.

Parameters:
a_this the current instance of CROMParser.

Definition at line 1079 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().

CROMParser* cr_om_parser_new CRInput a_input  ) 
 

Constructor of the CROMParser.

Parameters:
a_input the input stream.
Returns:
the newly built instance of CROMParser.

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

References cr_om_parser_destroy(), cr_parser_new_from_input(), cr_utils_trace_info, CRInput, CROMParser, CROMParserPriv, CRStatus, 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
 

Parses the content of an in memory buffer.

Parameters:
a_this the current instance of CROMParser.
a_buf the in memory buffer to parse.
a_len the length of the in memory buffer in number of bytes.
a_enc the encoding of the in memory buffer.
a_result out parameter the resulting style sheet
Returns:
CR_OK upon successfull completion, an error code otherwise.

Definition at line 825 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(), CRDocHandler, CRStatus, CRStyleSheet, 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
 

Parses a css2 stylesheet contained in a file.

Parameters:
a_this the current instance of the cssom parser.
a_file_uri the uri of the file. (only local file paths are suppported so far)
a_enc the encoding of the file.
a_result out parameter. A pointer the build css object model.
CR_OK upon successfull completion, an error code otherwise.

Definition at line 910 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(), CRDocHandler, CRStatus, CRStyleSheet, 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
 

Parses three sheets located by their paths and build a cascade.

Parameters:
a_this the current instance of CROMParser
a_author_path the path to the author stylesheet
a_user_path the path to the user stylesheet
a_ua_path the path to the User Agent stylesheet
a_result out parameter. The resulting cascade if the parsing was okay
Returns:
CR_OK upon successful completion, an error code otherwise

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

References CR_BAD_PARAM_ERROR, cr_cascade_new(), cr_om_parser_parse_file(), cr_stylesheet_unref(), CRCascade, CRStatus, and CRStyleSheet.

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
 

The simpler way to parse an in memory css2 buffer.

Parameters:
a_buf the css2 in memory buffer.
a_len the length of the in memory buffer.
a_enc the encoding of the in memory buffer.
a_result out parameter. The resulting css2 style sheet.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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

References cr_om_parser_destroy(), cr_om_parser_new(), cr_om_parser_parse_buf(), cr_utils_trace_info, CROMParser, CRStatus, and CRStyleSheet.

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

The simpler method to parse a css2 file.

Parameters:
a_file_path the css2 local file path.
a_enc the file encoding.
a_result out parameter. The returned css stylesheet. Must be freed by the caller using cr_stylesheet_destroy.
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 957 of file cr-om-parser.c.

References cr_om_parser_destroy(), cr_om_parser_new(), cr_om_parser_parse_file(), cr_utils_trace_info, CROMParser, CRStatus, and CRStyleSheet.

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
 

Parses three sheets located by their paths and build a cascade.

Parameters:
a_author_path the path to the author stylesheet
a_user_path the path to the user stylesheet
a_ua_path the path to the User Agent stylesheet
a_result out parameter. The resulting cascade if the parsing was okay
Returns:
CR_OK upon successful completion, an error code otherwise

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

References cr_om_parser_destroy(), cr_om_parser_new(), cr_om_parser_parse_paths_to_cascade(), cr_utils_trace_info, CRCascade, CROMParser, and CRStatus.


Generated on Fri Oct 29 08:29:13 2004 for Libcroco by  doxygen 1.3.9.1