diff options
Diffstat (limited to 'src/day.c')
-rw-r--r-- | src/day.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -695,20 +695,25 @@ int day_paste_item(struct day_item *p, long date) } /* Returns the position corresponding to a given item. */ -int day_get_position(struct day_item *needle) +int day_get_position_by_aptev_ptr(union aptev_ptr aptevp) { int n = 0; VECTOR_FOREACH(&day_items, n) { struct day_item *p = VECTOR_NTH(&day_items, n); /* Compare pointers. */ - if (p->item.ev == needle->item.ev) + if (p->item.ev == aptevp.ev) return n; } return -1; } +int day_get_position(struct day_item *needle) +{ + return day_get_position_by_aptev_ptr(needle->item); +} + /* Returns a structure containing the selected item. */ struct day_item *day_get_item(int item_number) { |