|
From: Kjell I. <kj...@sp...> - 2015-09-24 09:21:41
|
On 09/24/2015 12:55 AM, Jan Engelhardt wrote: > On Wednesday 2015-09-23 22:11, Mike Rylander wrote: > >> We use the C tm struct to hold parsed timestamps on the way to returning a >> time_t, and the tm_usec field is not available per the standard[1] > The reason libdbi gained 'struct tm' was to support dates before the > epoch. > >> though some C libraries define it. I think a reasonable API extension would >> be a function to read the microseconds part of a timestamp field, separate > >from the time_t value. > > nanoseconds, if anything. Isn't struct timespec standard these days? At least if you have nanosleep() you also have struct timespec. I would suggest adding something like dbi_result_get_timespec() and keep the dbi_result_get_datetime() for compatibility. Also, it should not be impossible to make the source compile on systems where timespec is not available, and not providing a dbi_result_get_timespec() on these systems. --Kjell CONFIDENTIALITY This e-mail and any attachment contain KONGSBERG information which may be proprietary, confidential or subject to export regulations, and is only meant for the intended recipient(s). Any disclosure, copying, distribution or use is prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in error, please delete it immediately from your system and notify the sender properly. |