| 660 | } |
| 661 | |
| 662 | int imd_cursor_init(const struct imd *imd, struct imd_cursor *cursor) |
| 663 | { |
| 664 | if (imd == NULL || cursor == NULL) |
| 665 | return -1; |
| 666 | |
| 667 | memset(cursor, 0, sizeof(*cursor)); |
| 668 | |
| 669 | cursor->imdr[0] = &imd->lg; |
| 670 | cursor->imdr[1] = &imd->sm; |
| 671 | |
| 672 | return 0; |
| 673 | } |
| 674 | |
| 675 | const struct imd_entry *imd_cursor_next(struct imd_cursor *cursor) |
| 676 | { |