mbgtools-lx
4.2.8
|
Go to the source code of this file.
Macros | |
#define | _TIMEUTIL |
Functions | |
int | snprint_gmtime_error (char *s, size_t max_len, int mbg_errno, time_t t, const char *calling_fnc) |
int | snprint_utc_offs (char *s, size_t max_len, const char *info, long utc_offs) |
Print a UTC offset into a string. More... | |
int | snprint_time_t_to_iso (time_t tstamp, int offs_hours, char *buf, size_t len) |
static __mbg_inline int | __to_iso_frac (time_t tstamp, int offset, time_t frac, const char *fmt, char *buf, size_t max_len) |
int | snprint_time_t_to_iso_ms (time_t tstamp, int offs_hours, time_t frac, char *buf, size_t len) |
int | snprint_time_t_to_iso_us (time_t tstamp, int offs_hours, time_t frac, char *buf, size_t len) |
int | snprint_time_t_to_iso_ns (time_t tstamp, int offs_hours, time_t frac, char *buf, size_t len) |
int | snprint_ntp_tstamp_to_iso_ms (const NTP_TSTAMP *ts, char *buf, size_t len) |
int | snprint_ntp_tstamp_to_iso_us (const NTP_TSTAMP *ts, char *buf, size_t len) |
int | snprint_ntp_tstamp_to_iso_ns (const NTP_TSTAMP *ts, char *buf, size_t len) |
#define _TIMEUTIL |
Definition at line 41 of file timeutil.c.
|
static |
Definition at line 270 of file timeutil.c.
References _int_from_size_t, snprint_time_t_to_iso(), and snprintf_safe().
Referenced by snprint_time_t_to_iso_ms(), snprint_time_t_to_iso_ns(), and snprint_time_t_to_iso_us().
int snprint_gmtime_error | ( | char * | s, |
size_t | max_len, | ||
int | mbg_errno, | ||
time_t | t, | ||
const char * | calling_fnc | ||
) |
Definition at line 55 of file timeutil.c.
References _int_from_size_t, check_precise_time_api(), FILETIME, HNS_PER_SEC, mbg_clock_gettime(), mbg_clock_settime(), mbg_strerror(), NSEC_PER_SEC, and snprintf_safe().
Referenced by delta_timespec_ll_ns(), mbg_snprint_hr_tstamp(), and show_utc_info().
int snprint_ntp_tstamp_to_iso_ms | ( | const NTP_TSTAMP * | ts, |
char * | buf, | ||
size_t | len | ||
) |
Definition at line 322 of file timeutil.c.
References bin_frac_32_to_msec, cvt_to_time_t(), NTP_TSTAMP::fractions, NTP_SEC_BIAS, NTP_TSTAMP::seconds, and snprint_time_t_to_iso_ms().
Referenced by delta_timespec_ll_ns().
int snprint_ntp_tstamp_to_iso_ns | ( | const NTP_TSTAMP * | ts, |
char * | buf, | ||
size_t | len | ||
) |
Definition at line 346 of file timeutil.c.
References bin_frac_32_to_nsec, cvt_to_time_t(), NTP_TSTAMP::fractions, NTP_SEC_BIAS, NTP_TSTAMP::seconds, and snprint_time_t_to_iso_ns().
Referenced by delta_timespec_ll_ns().
int snprint_ntp_tstamp_to_iso_us | ( | const NTP_TSTAMP * | ts, |
char * | buf, | ||
size_t | len | ||
) |
Definition at line 334 of file timeutil.c.
References bin_frac_32_to_usec, cvt_to_time_t(), NTP_TSTAMP::fractions, NTP_SEC_BIAS, NTP_TSTAMP::seconds, and snprint_time_t_to_iso_us().
Referenced by delta_timespec_ll_ns().
int snprint_time_t_to_iso | ( | time_t | tstamp, |
int | offs_hours, | ||
char * | buf, | ||
size_t | len | ||
) |
Definition at line 243 of file timeutil.c.
References _int_from_size_t, mbg_gmtime(), mbg_rc_is_error, SECS_PER_HOUR, and snprintf_safe().
Referenced by __to_iso_frac(), and delta_timespec_ll_ns().
int snprint_time_t_to_iso_ms | ( | time_t | tstamp, |
int | offs_hours, | ||
time_t | frac, | ||
char * | buf, | ||
size_t | len | ||
) |
Definition at line 283 of file timeutil.c.
References __to_iso_frac(), and MSEC_PER_SEC.
Referenced by delta_timespec_ll_ns(), and snprint_ntp_tstamp_to_iso_ms().
int snprint_time_t_to_iso_ns | ( | time_t | tstamp, |
int | offs_hours, | ||
time_t | frac, | ||
char * | buf, | ||
size_t | len | ||
) |
Definition at line 309 of file timeutil.c.
References __to_iso_frac(), and NSEC_PER_SEC.
Referenced by delta_timespec_ll_ns(), and snprint_ntp_tstamp_to_iso_ns().
int snprint_time_t_to_iso_us | ( | time_t | tstamp, |
int | offs_hours, | ||
time_t | frac, | ||
char * | buf, | ||
size_t | len | ||
) |
Definition at line 296 of file timeutil.c.
References __to_iso_frac(), and USEC_PER_SEC.
Referenced by delta_timespec_ll_ns(), and snprint_ntp_tstamp_to_iso_us().
int snprint_utc_offs | ( | char * | s, |
size_t | max_len, | ||
const char * | info, | ||
long | utc_offs | ||
) |
Print a UTC offset into a string.
Format of the string is "[info]+hh[:mm[:ss]]h"
[out] | s | Address of a string buffer to be filled. |
[in] | max_len | Size of the string buffer. |
[in] | info | An optional info string to be prepended, may be NULL. |
[in] | utc_offs | The UTC offset to be printed, in [s]. |
Definition at line 211 of file timeutil.c.
References _int_from_size_t, MINS_PER_HOUR, SECS_PER_HOUR, sn_cpy_str_safe(), and snprintf_safe().
Referenced by delta_timespec_ll_ns(), get_tz_name(), mbg_snprint_hr_time(), and show_time_and_status().