X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=dive.c;h=c913e9476798e518861d2cdf7c47185caba0dfb6;hb=18b8247cb357a9a716846854e451e306b752e542;hp=0341d09928cd4ef9ad9a974858a17c037db55a4c;hpb=9dce78c89fe77a107af7a8c962da19780485c3e2;p=ext%2Fsubsurface.git diff --git a/dive.c b/dive.c index 0341d09..c913e94 100644 --- a/dive.c +++ b/dive.c @@ -26,6 +26,24 @@ void add_event(struct dive *dive, int time, int type, int flags, int value, cons while (*p) p = &(*p)->next; *p = ev; + remember_event(name); +} + +double get_temp_units(unsigned int mk, const char **units) +{ + double deg; + const char *unit; + + if (output_units.temperature == FAHRENHEIT) { + deg = mkelvin_to_F(mk); + unit = UTF8_DEGREE "F"; + } else { + deg = mkelvin_to_C(mk); + unit = UTF8_DEGREE "C"; + } + if (units) + *units = unit; + return deg; } double get_depth_units(unsigned int mm, int *frac, const char **units) @@ -240,6 +258,14 @@ struct dive *fixup_dive(struct dive *dive) update_temperature(&dive->watertemp, mintemp); update_depth(&dive->maxdepth, maxdepth); + add_people(dive->buddy); + add_people(dive->divemaster); + add_location(dive->location); + for (i = 0; i < MAX_CYLINDERS; i++) { + cylinder_type_t *type = &dive->cylinder[i].type; + add_cylinder_description(type); + } + return dive; }