summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-06-02 17:07:26 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-02 23:57:51 -0700
commitdfac5e93c4ae3e9538e554cb32b5a8a1db22da99 (patch)
tree944a2d8f6cb9d23b832789e656df705a3e3990d2 /dive.c
parentcfa51c6526c8e178f675456330ef890e4e2bb2f8 (diff)
downloadsubsurface-dfac5e93c4ae3e9538e554cb32b5a8a1db22da99.tar.gz
Add a FOR_EACH_PICTURE macro and the code for picture_count.
Add the FOR_EACH_PICTURE macro and the code for picture count. This uses C99 - but I will keep it like this and wait for dirk to scream at me. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index 3b448e503..f1e113d05 100644
--- a/dive.c
+++ b/dive.c
@@ -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)