- if (gras_dynar_length((*cursor)->keys) <= (*cursor)->pos) {
- gras_dict_cursor_free(*cursor);
- *cursor=NULL;
- return FALSE;
- }
-
- *key = gras_dynar_get_as((*cursor)->keys, (*cursor)->pos, char*);
- key_len = gras_dynar_get_as((*cursor)->key_lens, (*cursor)->pos_len, int);
-
- errcode = gras_dictelm_get_ext((*cursor)->head, *key, key_len, data);
- if (errcode == mismatch_error) {
- gras_dict_cursor_free(*cursor);
- *cursor=NULL;
+ current = (*cursor)->current;
+ if (current == NULL) { /* no data left */
+ xbt_dict_cursor_free(cursor);