/* Returns the new list with the new statement prepended, or NULL in case of an error.  */
CRStatement* cr_statement_prepend(CRStatement *a_this, CRStatement *a_new)
/* Returns the new list with the new statement prepended, or NULL in case of an error.  */
CRStatement* cr_statement_prepend(CRStatement *a_this, CRStatement *a_new)
{
        CRStatement *cur = NULL;
        g_return_val_if_fail (a_new, NULL);
        if (!a_this)
                return a_new;
        a_new->next = a_this;
        a_this->prev = a_new;
        for (cur = a_new; cur && cur->prev; cur = cur->prev) ;
        return cur;
}