/* Appends a new declaration to the current declarations list. Returns the declaration list with a_new appended to it, or NULL in case of error.  */
CRDeclaration* cr_declaration_append(CRDeclaration *a_this, CRDeclaration *a_new)
/* Appends a new declaration to the current declarations list. Returns the declaration list with a_new appended to it, or NULL in case of error.  */
CRDeclaration* cr_declaration_append(CRDeclaration *a_this, CRDeclaration *a_new)
{
        CRDeclaration *cur = NULL;
        g_return_val_if_fail (a_new, NULL);
        if (!a_this)
                return a_new;
        for (cur = a_this; cur && cur->next; cur = cur->next) ;
        cur->next = a_new;
        a_new->prev = cur;
        return a_this;
}