+
+ if (!verbose)
+ return;
+
+ for (i = 0; i < dive->samples; i++) {
+ struct sample *s = dive->sample + i;
+
+ printf("%4d:%02d: %3d ft, %2d C, %4d PSI\n",
+ s->time.seconds / 60,
+ s->time.seconds % 60,
+ to_feet(s->depth),
+ to_C(s->temperature),
+ to_PSI(s->tankpressure));
+ }
+}
+
+static int sortfn(const void *_a, const void *_b)
+{
+ const struct dive *a = *(void **)_a;
+ const struct dive *b = *(void **)_b;
+
+ if (a->when < b->when)
+ return -1;
+ if (a->when > b->when)
+ return 1;
+ return 0;
+}
+
+static void report_dives(void)
+{
+ int i;
+ qsort(dive_table, nr_dives, sizeof(struct dive *), sortfn);
+
+ for (i = 0; i < nr_dives; i++)
+ show_dive(i+1, dive_table[i]);