003 File Manager
Current Path:
/usr/src/contrib/ntp/include
usr
/
src
/
contrib
/
ntp
/
include
/
📁
..
📄
Makefile.am
(1.2 KB)
📄
Makefile.in
(24.68 KB)
📄
README
(157 B)
📄
adjtime.h
(1.96 KB)
📄
ascii.h
(2.78 KB)
📄
audio.h
(283 B)
📄
binio.h
(3.26 KB)
📄
declcond.h
(803 B)
📄
gps.h
(2.84 KB)
📄
hopf6039.h
(3.51 KB)
📄
icom.h
(2.33 KB)
📄
ieee754io.h
(2.94 KB)
📄
intreswork.h
(808 B)
📄
iosignal.h
(1.46 KB)
📁
isc
📄
l_stdlib.h
(4.8 KB)
📄
lib_strbuf.h
(674 B)
📄
libntp.h
(436 B)
📄
libssl_compat.h
(4.25 KB)
📄
mbg_gps166.h
(36.84 KB)
📄
mx4200.h
(2.15 KB)
📄
ntif.h
(2.86 KB)
📄
ntp.h
(33.52 KB)
📄
ntp_assert.h
(2.73 KB)
📄
ntp_calendar.h
(14.99 KB)
📄
ntp_calgps.h
(4.02 KB)
📄
ntp_cmdargs.h
(38 B)
📄
ntp_config.h
(8.33 KB)
📄
ntp_control.h
(5.66 KB)
📄
ntp_crypto.h
(6.61 KB)
📄
ntp_datum.h
(1.07 KB)
📄
ntp_debug.h
(635 B)
📄
ntp_filegen.h
(1.76 KB)
📄
ntp_fp.h
(13.37 KB)
📄
ntp_if.h
(651 B)
📄
ntp_intres.h
(1.77 KB)
📄
ntp_io.h
(1.82 KB)
📄
ntp_keyacc.h
(658 B)
📄
ntp_libopts.h
(330 B)
📄
ntp_lineedit.h
(251 B)
📄
ntp_lists.h
(12.09 KB)
📄
ntp_machine.h
(7.18 KB)
📄
ntp_malloc.h
(1.18 KB)
📄
ntp_md5.h
(1.32 KB)
📄
ntp_net.h
(6.61 KB)
📄
ntp_prio_q.h
(1.93 KB)
📄
ntp_proto.h
(95 B)
📄
ntp_psl.h
(342 B)
📄
ntp_random.h
(402 B)
📄
ntp_refclock.h
(7.81 KB)
📄
ntp_request.h
(30.83 KB)
📄
ntp_rfc2553.h
(8.46 KB)
📄
ntp_select.h
(1.02 KB)
📄
ntp_stdlib.h
(9.83 KB)
📄
ntp_string.h
(708 B)
📄
ntp_syscall.h
(1.17 KB)
📄
ntp_syslog.h
(2.94 KB)
📄
ntp_tty.h
(2.61 KB)
📄
ntp_types.h
(7.21 KB)
📄
ntp_unixtime.h
(1.6 KB)
📄
ntp_worker.h
(5.54 KB)
📄
ntp_workimpl.h
(749 B)
📄
ntpd.h
(20.67 KB)
📄
ntpsim.h
(3.85 KB)
📄
parse.h
(14.58 KB)
📄
parse_conf.h
(2.76 KB)
📄
rc_cmdlength.h
(83 B)
📄
recvbuff.h
(3.84 KB)
📄
refclock_atom.h
(449 B)
📄
refidsmear.h
(89 B)
📄
safecast.h
(1.04 KB)
📄
ssl_applink.c
(2.1 KB)
📄
timepps-SCO.h
(11.67 KB)
📄
timepps-Solaris.h
(13.24 KB)
📄
timepps-SunOS.h
(11.78 KB)
📄
timespecops.h
(4.82 KB)
📄
timetoa.h
(2.62 KB)
📄
timevalops.h
(8.33 KB)
📄
timexsup.h
(1.37 KB)
📄
trimble.h
(8.01 KB)
📄
vint64ops.h
(1.05 KB)
Editing: timetoa.h
/* * timetoa.h -- time_t related string formatting * * Written by Juergen Perlinger (perlinger@ntp.org) for the NTP project. * The contents of 'html/copyright.html' apply. * * Printing a 'time_t' has some portability pitfalls, due to it's opaque * base type. The only requirement imposed by the standard is that it * must be a numeric type. For all practical purposes it's a signed int, * and 32 bits are common. * * Since the UN*X time epoch will cause a signed integer overflow for * 32-bit signed int values in the year 2038, implementations slowly * move to 64bit base types for time_t, even in 32-bit environments. In * such an environment sizeof(time_t) could be bigger than sizeof(long) * and the commonly used idiom of casting to long leads to truncation. * * As the printf() family has no standardised type specifier for time_t, * guessing the right output format specifier is a bit troublesome and * best done with the help of the preprocessor and "config.h". */ #ifndef TIMETOA_H #define TIMETOA_H #include "ntp_fp.h" #include "ntp_stdlib.h" #include "ntp_unixtime.h" /* * Given the size of time_t, guess what can be used as an unsigned value * to hold a time_t and the printf() format specifcation. * * These should be used with the string constant concatenation feature * of the compiler like this: * * printf("a time stamp: %" TIME_FORMAT " and more\n", a_time_t_value); * * It's not exactly nice, but there's not much leeway once we want to * use the printf() family on time_t values. */ #if SIZEOF_TIME_T <= SIZEOF_INT typedef unsigned int u_time; #define TIME_FORMAT "d" #define UTIME_FORMAT "u" #elif SIZEOF_TIME_T <= SIZEOF_LONG typedef unsigned long u_time; #define TIME_FORMAT "ld" #define UTIME_FORMAT "lu" #elif defined(SIZEOF_LONG_LONG) && SIZEOF_TIME_T <= SIZEOF_LONG_LONG typedef unsigned long long u_time; #define TIME_FORMAT "lld" #define UTIME_FORMAT "llu" #else #include "GRONK: what size has a time_t here?" #endif /* * general fractional time stamp formatting. * * secs - integral seconds of time stamp * frac - fractional units * prec - log10 of units per second (3=milliseconds, 6=microseconds,..) * or in other words: the count of decimal digits required. * If prec is < 0, abs(prec) is taken for the precision and secs * is treated as an unsigned value. * * The function will eventually normalise the fraction and adjust the * seconds accordingly. * * This function uses the string buffer library for the return value, * so do not keep the resulting pointers around. */ extern const char * format_time_fraction(time_t secs, long frac, int prec); #endif /* !defined(TIMETOA_H) */
Upload File
Create Folder