/* Returns #CRDeclaration at position itemnr, if itemnr > number of declarations - 1, it will return NULL.  */
CRDeclaration* cr_declaration_get_from_list(CRDeclaration *a_this, int itemnr)
/* Returns #CRDeclaration at position itemnr, if itemnr > number of declarations - 1, it will return NULL.  */
CRDeclaration* cr_declaration_get_from_list(CRDeclaration *a_this, int itemnr)
{
        CRDeclaration *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;
}