Logo Search packages:      
Sourcecode: inkscape version File versions

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.

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
CR_OK upon successfull completion, an error code otherwise.

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

References cr_doc_handler_get_result(), cr_parser_get_sac_handler(), cr_parser_new(), and cr_parser_parse_buf().

Referenced by cr_om_parser_simply_parse_buf().


        enum CRStatus status = CR_OK;

        g_return_val_if_fail (a_this && a_result, CR_BAD_PARAM_ERROR);

        if (!PRIVATE (a_this)->parser) {
                PRIVATE (a_this)->parser = cr_parser_new (NULL);

        status = cr_parser_parse_buf (PRIVATE (a_this)->parser,
                                      a_buf, a_len, a_enc);

        if (status == CR_OK) {
                CRStyleSheet *result = NULL;
                CRStyleSheet **resultptr = NULL;
                CRDocHandler *sac_handler = NULL;

                cr_parser_get_sac_handler (PRIVATE (a_this)->parser,
                g_return_val_if_fail (sac_handler, CR_ERROR);
            resultptr = &result;
                status = cr_doc_handler_get_result (sac_handler,
                                                    (gpointer *) resultptr);
                g_return_val_if_fail (status == CR_OK, status);

                if (result)
                        *a_result = result;

        return status;

Generated by  Doxygen 1.6.0   Back to index