static void duration(char *buffer, void *_time) { /* DivingLog 5.08 (and maybe other versions) appear to sometimes * store the dive time as 44.00 instead of 44:00; * This attempts to parse this in a fairly robust way */ if (!strchr(buffer,':') && strchr(buffer,'.')) { char *mybuffer = strdup(buffer); char *dot = strchr(mybuffer,'.'); *dot = ':'; sampletime(mybuffer, _time); } else { sampletime(buffer, _time); } }
static void eventtime(char *buffer, void *_duration) { duration_t *duration = _duration; sampletime(buffer, duration); if (sample) duration->seconds += sample->time.seconds; }
static void duration(char *buffer, void *_time) { sampletime(buffer, _time); }