- DEBUG2("step cursor. Current=%.*s",
- xbt_dynar_get_as(cursor->key_lens,cursor->pos_len,int),
- xbt_dynar_get_as(cursor->keys,cursor->pos,char *));
- xbt_dynar_cursor_step(cursor->keys, &cursor->pos);
- xbt_dynar_cursor_step(cursor->key_lens, &cursor->pos_len);
+ current = cursor->current;
+ line = cursor->line;
+
+ if (cursor->dict != NULL) {
+
+ if (current != NULL) {
+ DEBUG0("current is not null, take the next element");
+ current = current->next;
+ DEBUG1("next element: %p", current);
+ }
+
+ while (current == NULL && ++line <= cursor->dict->table_size) {
+ DEBUG0("current is NULL, take the next line");
+ current = cursor->dict->table[line];
+ DEBUG1("element in the next line: %p", current);
+ }
+ DEBUG2("search finished, current = %p, line = %d", current, line);
+
+ cursor->current = current;
+ cursor->line = line;
+ }