Libcroco
Data Structures | Typedefs | Enumerations | Functions
cr-parsing-location.h File Reference

The declaration of the CRParsingLocation object. More...

#include "cr-utils.h"

Go to the source code of this file.

Data Structures

struct  _CRParsingLocation
 

Typedefs

typedef struct _CRParsingLocation CRParsingLocation
 

Enumerations

enum  CRParsingLocationSerialisationMask { DUMP_LINE = 1, DUMP_COLUMN = 1 << 1, DUMP_BYTE_OFFSET = 1 << 2 }
 

Functions

CRParsingLocationcr_parsing_location_new (void)
 @CRParsingLocation: More...
 
enum CRStatus cr_parsing_location_init (CRParsingLocation *a_this)
 cr_parsing_location_init: @a_this: the current instance of CRParsingLocation. More...
 
enum CRStatus cr_parsing_location_copy (CRParsingLocation *a_to, CRParsingLocation const *a_from)
 cr_parsing_location_copy: @a_to: the destination of the copy. More...
 
gchar * cr_parsing_location_to_string (CRParsingLocation const *a_this, enum CRParsingLocationSerialisationMask a_mask)
 cr_parsing_location_to_string: @a_this: the current instance of CRParsingLocation. More...
 
void cr_parsing_location_dump (CRParsingLocation const *a_this, enum CRParsingLocationSerialisationMask a_mask, FILE *a_fp)
 cr_parsing_location_dump: @a_this: current instance of CRParsingLocation @a_mask: the serialization mask. More...
 
void cr_parsing_location_destroy (CRParsingLocation *a_this)
 cr_parsing_location_destroy: @a_this: the current instance of CRParsingLocation. More...
 

Detailed Description

The declaration of the CRParsingLocation object.

This object keeps track of line/column/byte offset/ at which the parsing of a given CSS construction appears.

Definition in file cr-parsing-location.h.

Typedef Documentation

◆ CRParsingLocation

Definition at line 38 of file cr-parsing-location.h.

Enumeration Type Documentation

◆ CRParsingLocationSerialisationMask

Enumerator
DUMP_LINE 
DUMP_COLUMN 
DUMP_BYTE_OFFSET 

Definition at line 46 of file cr-parsing-location.h.

Function Documentation

◆ cr_parsing_location_copy()

enum CRStatus cr_parsing_location_copy ( CRParsingLocation a_to,
CRParsingLocation const *  a_from 
)

cr_parsing_location_copy: @a_to: the destination of the copy.

Must be allocated by the caller. @a_from: the source of the copy.

Copies an instance of CRParsingLocation into another one.

Returns CR_OK upon succesful completion, an error code otherwise.

Definition at line 84 of file cr-parsing-location.c.

References CR_BAD_PARAM_ERROR, and CR_OK.

Referenced by cr_parser_parse_charset(), cr_parser_parse_font_face(), cr_parser_parse_media(), cr_parser_parse_page(), cr_statement_at_import_rule_parse_from_buf(), and cr_string_dup().

◆ cr_parsing_location_destroy()

void cr_parsing_location_destroy ( CRParsingLocation a_this)

cr_parsing_location_destroy: @a_this: the current instance of CRParsingLocation.

Must have been allocated with cr_parsing_location_new().

Destroys the current instance of CRParsingLocation

Definition at line 167 of file cr-parsing-location.c.

◆ cr_parsing_location_dump()

void cr_parsing_location_dump ( CRParsingLocation const *  a_this,
enum CRParsingLocationSerialisationMask  a_mask,
FILE *  a_fp 
)

cr_parsing_location_dump: @a_this: current instance of CRParsingLocation @a_mask: the serialization mask.

@a_fp: the file pointer to dump the parsing location to.

Definition at line 144 of file cr-parsing-location.c.

References cr_parsing_location_to_string().

◆ cr_parsing_location_init()

enum CRStatus cr_parsing_location_init ( CRParsingLocation a_this)

cr_parsing_location_init: @a_this: the current instance of CRParsingLocation.

Initializes the an instance of #CRparsingLocation.

Returns CR_OK upon succesful completion, an error code otherwise.

Definition at line 64 of file cr-parsing-location.c.

References CR_BAD_PARAM_ERROR, and CR_OK.

Referenced by cr_parsing_location_new().

◆ cr_parsing_location_new()

CRParsingLocation* cr_parsing_location_new ( void  )

@CRParsingLocation:

Definition of the #CRparsingLocation class. cr_parsing_location_new: Instanciates a new parsing location.

Returns the newly instanciated CRParsingLocation. Must be freed by cr_parsing_location_destroy()

Definition at line 42 of file cr-parsing-location.c.

References cr_parsing_location_init(), and cr_utils_trace_info.

◆ cr_parsing_location_to_string()

gchar* cr_parsing_location_to_string ( CRParsingLocation const *  a_this,
enum CRParsingLocationSerialisationMask  a_mask 
)

cr_parsing_location_to_string: @a_this: the current instance of CRParsingLocation.

@a_mask: a bitmap that defines which parts of the parsing location are to be serialized (line, column or byte offset)

Returns the serialized string or NULL in case of an error.

Definition at line 102 of file cr-parsing-location.c.

References _CRParsingLocation::byte_offset, _CRParsingLocation::column, DUMP_BYTE_OFFSET, DUMP_COLUMN, DUMP_LINE, and _CRParsingLocation::line.

Referenced by cr_parsing_location_dump().