Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

CRParser* cr_parser_new_from_buf ( guchar *  a_buf,
gulong  a_len,
enum CREncoding  a_enc,
gboolean  a_free_buf 
)

Instanciates a new parser from a memory buffer.

Parameters:
a_bufthe buffer to parse.
a_lenthe length of the data in the buffer.
a_encthe encoding of the input buffer a_buf.
a_free_bufif set to TRUE, a_buf will be freed during the destruction of the newly built instance of CRParser. If set to FALSE, it is up to the caller to eventually free it.
Returns:
the newly built parser, or NULL if an error arises.

Definition at line 2762 of file cr-parser.c.

References cr_input_destroy(), and cr_input_new_from_buf().

Referenced by cr_declaration_parse_from_buf(), cr_declaration_parse_list_from_buf(), cr_statement_at_charset_rule_parse_from_buf(), cr_statement_at_import_rule_parse_from_buf(), cr_statement_at_media_rule_parse_from_buf(), cr_statement_at_page_rule_parse_from_buf(), cr_statement_does_buf_parses_against_core(), cr_statement_font_face_rule_parse_from_buf(), cr_statement_ruleset_parse_from_buf(), and cr_term_parse_expression_from_buf().

{
        CRParser *result = NULL;
        CRInput *input = NULL;

        g_return_val_if_fail (a_buf, NULL);

        input = cr_input_new_from_buf (a_buf, a_len, a_enc, a_free_buf);
        g_return_val_if_fail (input, NULL);

        result = cr_parser_new_from_input (input);
        if (!result) {
                cr_input_destroy (input);
                input = NULL;
                return NULL;
        }
        return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index