/* Returns CRStatement at position itemnr, if itemnr > number of statements - 1, it will return NULL.  */
CRStatement* cr_statement_get_from_list(CRStatement *a_this, int itemnr)
/* Returns CRStatement at position itemnr, if itemnr > number of statements - 1, it will return NULL.  */
CRStatement* cr_statement_get_from_list(CRStatement *a_this, int itemnr)
{
        CRStatement *cur = NULL;
        int nr = 0;
        g_return_val_if_fail (a_this, NULL);
        for (cur = a_this; cur; cur = cur->next)
                if (nr++ == itemnr)
                        return cur;
        return NULL;
}