/* Returns the newly built parser, or NULL if an error arises.  */
CRParser* cr_parser_new_from_buf(guchar *a_buf, gulong a_len, enum CREncoding a_enc, gboolean a_free_buf)
/* Returns the newly built parser, or NULL if an error arises.  */
CRParser* cr_parser_new_from_buf(guchar *a_buf, gulong a_len, enum CREncoding a_enc, gboolean a_free_buf)
{
        CRParser *result = NULL;
        CRInput *input = NULL;
        g_return_val_if_fail (a_buf && a_len, 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;
}