/* Returns CR_OK upon successful completion, an error code otherwise.  */
enum CRStatus cr_parser_parse_buf(CRParser *a_this, const guchar *a_buf, gulong a_len, enum CREncoding a_enc)
/* Returns CR_OK upon successful completion, an error code otherwise.  */
enum CRStatus cr_parser_parse_buf(CRParser *a_this, const guchar *a_buf, gulong a_len, enum CREncoding a_enc)
{
        enum CRStatus status = CR_ERROR;
        CRTknzr *tknzr = NULL;
        g_return_val_if_fail (a_this && PRIVATE (a_this)
                              && a_buf, CR_BAD_PARAM_ERROR);
        tknzr = cr_tknzr_new_from_buf ((guchar*)a_buf, a_len, a_enc, FALSE);
        g_return_val_if_fail (tknzr != NULL, CR_ERROR);
        status = cr_parser_set_tknzr (a_this, tknzr);
        g_return_val_if_fail (status == CR_OK, CR_ERROR);
        status = cr_parser_parse (a_this);
        return status;
}