diff options
-rw-r--r-- | dive.c | 4 | ||||
-rw-r--r-- | dive.h | 3 |
2 files changed, 7 insertions, 0 deletions
@@ -2272,6 +2272,10 @@ struct picture* dive_add_picture(struct dive *d, char *picture) uint dive_get_picture_count(struct dive *d) { + uint i = 0; + FOR_EACH_PICTURE( d ) + i++; + return i; } void dive_remove_picture(struct dive *d, char *picture) @@ -289,6 +289,9 @@ struct picture { struct picture *next; }; +#define FOR_EACH_PICTURE( DIVE ) \ + for(struct picture *picture = DIVE->picture_list; picture; picture = picture->next) + extern struct picture *dive_add_picture(struct dive *d, char *picture); extern void dive_remove_picture(struct dive *d, char *picture); extern uint dive_get_picture_count(struct dive *d); |