From: Harlan Stenn Date: Mon, 26 Mar 2001 05:02:35 +0000 (-0000) Subject: Many files: X-Git-Tag: NTP_4_0_99_M~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=674bbeeae11ae3c71dd04af17f9779e47515bdcc;p=thirdparty%2Fntp.git Many files: * include/ntp_if.h: * include/ntp_machine.h: * include/ntp_unixtime.h: * libntp/humandate.c: * libntp/iosignal.c: * libntp/mktime.c: * libntp/prettydate.c: * libntp/systime.c: * libntp/tvtoa.c: * libntp/uglydate.c: * libntp/utvtoa.c: * libparse/clk_computime.c: * libparse/clk_dcf7000.c: * libparse/clk_hopf6021.c: * libparse/clk_meinberg.c: * libparse/clk_rawdcf.c: * libparse/clk_rcc8000.c: * libparse/clk_schmid.c: * libparse/clk_trimtaip.c: * libparse/clk_trimtsip.c: * libparse/clk_varitext.c: * libparse/parse.c: * libparse/parse_conf.c: * ntpd/check_y2k.c: * ntpd/ntp_config.c: * ntpd/ntp_control.c: * ntpd/ntp_intres.c: * ntpd/ntp_io.c: * ntpd/ntp_loopfilter.c: * ntpd/ntp_monitor.c: * ntpd/ntp_proto.c: * ntpd/ntp_refclock.c: * ntpd/ntp_request.c: * ntpd/ntp_resolver.c: * ntpd/ntp_timer.c: * ntpd/ntp_util.c: * ntpd/ntpd.c: * ntpd/refclock_acts.c: * ntpd/refclock_arbiter.c: * ntpd/refclock_arc.c: * ntpd/refclock_as2201.c: * ntpd/refclock_atom.c: * ntpd/refclock_bancomm.c: * ntpd/refclock_chronolog.c: * ntpd/refclock_chu.c: * ntpd/refclock_datum.c: * ntpd/refclock_dumbclock.c: * ntpd/refclock_fg.c: * ntpd/refclock_gpsvme.c: * ntpd/refclock_heath.c: * ntpd/refclock_hpgps.c: * ntpd/refclock_irig.c: * ntpd/refclock_jupiter.c: * ntpd/refclock_leitch.c: * ntpd/refclock_local.c: * ntpd/refclock_msfees.c: * ntpd/refclock_mx4200.c: * ntpd/refclock_nmea.c: * ntpd/refclock_oncore.c: * ntpd/refclock_pcf.c: * ntpd/refclock_pst.c: * ntpd/refclock_shm.c: * ntpd/refclock_tpro.c: * ntpd/refclock_trak.c: * ntpd/refclock_true.c: * ntpd/refclock_ulink.c: * ntpd/refclock_usno.c: * ntpd/refclock_wwv.c: * ntpd/refclock_wwvb.c: * ntpdate/ntpdate.c: * ntpdate/ntptime_config.c: * ntpdate/ntptimeset.c: * ntpdc/ntpdc.c: * ntpdc/ntpdc_ops.c: * ntpq/ntpq.c: * ntpq/ntpq_ops.c: * ntptrace/ntptrace.c: * parseutil/testdcf.c: * util/hist.c: * util/ntp-genkeys.c: * util/ntptime.c: * util/precision.c: * util/tickadj.c: time.h and sys/time.h cleanup. bk: 3abecd6bXaIBhxVvVFEFcf5F5xwWmw --- diff --git a/ChangeLog b/ChangeLog index f986e0921d..76ffc3c2ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,90 @@ +2001-03-25 Harlan Stenn + + * include/ntp_if.h: + * include/ntp_machine.h: + * include/ntp_unixtime.h: + * libntp/humandate.c: + * libntp/iosignal.c: + * libntp/mktime.c: + * libntp/prettydate.c: + * libntp/systime.c: + * libntp/tvtoa.c: + * libntp/uglydate.c: + * libntp/utvtoa.c: + * libparse/clk_computime.c: + * libparse/clk_dcf7000.c: + * libparse/clk_hopf6021.c: + * libparse/clk_meinberg.c: + * libparse/clk_rawdcf.c: + * libparse/clk_rcc8000.c: + * libparse/clk_schmid.c: + * libparse/clk_trimtaip.c: + * libparse/clk_trimtsip.c: + * libparse/clk_varitext.c: + * libparse/parse.c: + * libparse/parse_conf.c: + * ntpd/check_y2k.c: + * ntpd/ntp_config.c: + * ntpd/ntp_control.c: + * ntpd/ntp_intres.c: + * ntpd/ntp_io.c: + * ntpd/ntp_loopfilter.c: + * ntpd/ntp_monitor.c: + * ntpd/ntp_proto.c: + * ntpd/ntp_refclock.c: + * ntpd/ntp_request.c: + * ntpd/ntp_resolver.c: + * ntpd/ntp_timer.c: + * ntpd/ntp_util.c: + * ntpd/ntpd.c: + * ntpd/refclock_acts.c: + * ntpd/refclock_arbiter.c: + * ntpd/refclock_arc.c: + * ntpd/refclock_as2201.c: + * ntpd/refclock_atom.c: + * ntpd/refclock_bancomm.c: + * ntpd/refclock_chronolog.c: + * ntpd/refclock_chu.c: + * ntpd/refclock_datum.c: + * ntpd/refclock_dumbclock.c: + * ntpd/refclock_fg.c: + * ntpd/refclock_gpsvme.c: + * ntpd/refclock_heath.c: + * ntpd/refclock_hpgps.c: + * ntpd/refclock_irig.c: + * ntpd/refclock_jupiter.c: + * ntpd/refclock_leitch.c: + * ntpd/refclock_local.c: + * ntpd/refclock_msfees.c: + * ntpd/refclock_mx4200.c: + * ntpd/refclock_nmea.c: + * ntpd/refclock_oncore.c: + * ntpd/refclock_pcf.c: + * ntpd/refclock_pst.c: + * ntpd/refclock_shm.c: + * ntpd/refclock_tpro.c: + * ntpd/refclock_trak.c: + * ntpd/refclock_true.c: + * ntpd/refclock_ulink.c: + * ntpd/refclock_usno.c: + * ntpd/refclock_wwv.c: + * ntpd/refclock_wwvb.c: + * ntpdate/ntpdate.c: + * ntpdate/ntptime_config.c: + * ntpdate/ntptimeset.c: + * ntpdc/ntpdc.c: + * ntpdc/ntpdc_ops.c: + * ntpq/ntpq.c: + * ntpq/ntpq_ops.c: + * ntptrace/ntptrace.c: + * parseutil/testdcf.c: + * util/hist.c: + * util/ntp-genkeys.c: + * util/ntptime.c: + * util/precision.c: + * util/tickadj.c: + time.h and sys/time.h cleanup. + 2001-03-24 Harlan Stenn * configure.in: '99k19 diff --git a/include/ntp_if.h b/include/ntp_if.h index 0be0156012..91362d8310 100644 --- a/include/ntp_if.h +++ b/include/ntp_if.h @@ -8,12 +8,6 @@ # include "/sys/sync/sema.h" #endif -/* was: defined(SYS_AIX) */ -#if defined(TIME_WITH_SYS_TIME) -# include -# include -#endif - /* was: (defined(SYS_SOLARIS) && !defined(bsd)) || defined(SYS_SUNOS4) */ /* was: defined(SYS_UNIXWARE1) */ #ifdef HAVE_SYS_SOCKIO_H diff --git a/include/ntp_machine.h b/include/ntp_machine.h index 4f7f345d8e..7cac8e1593 100644 --- a/include/ntp_machine.h +++ b/include/ntp_machine.h @@ -6,11 +6,18 @@ #define __ntp_machine #ifdef HAVE_CONFIG_H -#include +# include #endif -#ifdef HAVE_SYS_TIME_H -#include +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif #endif #include "ntp_proto.h" diff --git a/include/ntp_unixtime.h b/include/ntp_unixtime.h index 9dd23f0e8e..bdc080e6ed 100644 --- a/include/ntp_unixtime.h +++ b/include/ntp_unixtime.h @@ -5,8 +5,6 @@ #include "ntp_types.h" -#include - /* gettimeofday() takes two args in BSD and only one in SYSV */ # if defined(HAVE_SYS_TIMERS_H) && defined(HAVE_GETCLOCK) # include diff --git a/libntp/humandate.c b/libntp/humandate.c index f663c9ea25..7995633be4 100644 --- a/libntp/humandate.c +++ b/libntp/humandate.c @@ -2,16 +2,11 @@ * humandate - convert an NTP (or the current) time to something readable */ #include -#include "time.h" #include "ntp_fp.h" -#include "ntp_unixtime.h" /* includes */ +#include "ntp_unixtime.h" /* includes and */ #include "lib_strbuf.h" #include "ntp_stdlib.h" -#ifdef TIME_WITH_SYS_TIME -#include -#endif - static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" diff --git a/libntp/iosignal.c b/libntp/iosignal.c index cb863d4320..3c78d48a0c 100644 --- a/libntp/iosignal.c +++ b/libntp/iosignal.c @@ -3,44 +3,27 @@ * was shamelessly stolen from ntpd. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include "ntp_machine.h" +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_if.h" +#include "ntp_stdlib.h" +#include "iosignal.h" #include #include -#include #ifdef HAVE_SYS_PARAM_H # include #endif /* HAVE_SYS_PARAM_H */ -#ifdef HAVE_SYS_TIME_H -# include -#endif -#if 0 /* Included by ntp_fp.h */ -#ifdef HAVE_NETINET_IN_H -# include -#endif -#endif #ifdef HAVE_SYS_IOCTL_H # include #endif -#if 0 /* Included by ntp_if.h below */ -#ifdef HAVE_SYS_SOCKIO_H /* UXPV: SIOC* #defines (Frank Vance ) */ -# include -#endif -#endif + #include #if _BSDI_VERSION >= 199510 # include #endif -/* 98/06/01 */ -#include "ntp_machine.h" /* 98/06/01 */ -#include "ntpd.h" -#include "ntp_io.h" -#include "ntp_if.h" -#include "ntp_stdlib.h" -#include "iosignal.h" #if defined(HAVE_SIGNALED_IO) static int sigio_block_count = 0; diff --git a/libntp/machines.c b/libntp/machines.c index 32bff0743c..a3dcf2f6ab 100644 --- a/libntp/machines.c +++ b/libntp/machines.c @@ -13,10 +13,6 @@ #include "ntp_stdlib.h" #include "ntp_unixtime.h" -#ifdef HAVE_SYS_TIME_H -#include -#endif - #ifdef HAVE_UNISTD_H #include #endif diff --git a/libntp/mktime.c b/libntp/mktime.c index c7526905b0..b9cd42e720 100644 --- a/libntp/mktime.c +++ b/libntp/mktime.c @@ -60,9 +60,7 @@ * by hand. Sorry about that. */ -#ifdef HAVE_CONFIG_H -#include -#endif +#include "ntp_machine.h" #ifndef DSTMINUTES #define DSTMINUTES 60 @@ -84,12 +82,6 @@ #define TM_YEAR_BASE 1900 #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0) -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#include - extern time_t time(); static int mon_lengths[2][MONSPERYEAR] = { diff --git a/libntp/prettydate.c b/libntp/prettydate.c index 291c17c2c1..9710c84be1 100644 --- a/libntp/prettydate.c +++ b/libntp/prettydate.c @@ -8,10 +8,6 @@ #include "lib_strbuf.h" #include "ntp_stdlib.h" -#ifndef TM_IN_SYS_TIME -#include -#endif - static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" diff --git a/libntp/systime.c b/libntp/systime.c index edaac1e339..e14a4d8d15 100644 --- a/libntp/systime.c +++ b/libntp/systime.c @@ -2,13 +2,13 @@ * systime -- routines to fiddle a UNIX clock. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include "ntp_proto.h" /* for MAX_FREQ */ +#include "ntp_machine.h" +#include "ntp_fp.h" +#include "ntp_syslog.h" +#include "ntp_unixtime.h" +#include "ntp_stdlib.h" -#include -#include -#include #ifdef HAVE_SYS_PARAM_H # include #endif @@ -19,13 +19,6 @@ # include #endif /* HAVE_UTMPX_H */ -#include "ntp_proto.h" /* for MAX_FREQ */ -#include "ntp_machine.h" -#include "ntp_fp.h" -#include "ntp_syslog.h" -#include "ntp_unixtime.h" -#include "ntp_stdlib.h" - int systime_10ms_ticks = 0; /* adj sysclock in 10ms increments */ /* diff --git a/libntp/tvtoa.c b/libntp/tvtoa.c index 6bc72ac8d4..19d4a94ed1 100644 --- a/libntp/tvtoa.c +++ b/libntp/tvtoa.c @@ -1,16 +1,17 @@ /* * tvtoa - return an asciized representation of a struct timeval */ -#include -#include #include "lib_strbuf.h" + #if defined(VMS) -#include "ntp_fp.h" +# include "ntp_fp.h" #endif /* VMS */ #include "ntp_stdlib.h" #include "ntp_unixtime.h" +#include + char * tvtoa( const struct timeval *tv diff --git a/libntp/uglydate.c b/libntp/uglydate.c index fcd3d9f5cf..676a5fdde7 100644 --- a/libntp/uglydate.c +++ b/libntp/uglydate.c @@ -8,9 +8,7 @@ #include "ntp_unixtime.h" #include "lib_strbuf.h" #include "ntp_stdlib.h" -#ifndef TM_IN_SYS_TIME -#include -#endif + char * uglydate( diff --git a/libntp/utvtoa.c b/libntp/utvtoa.c index 79d14ef048..a441c4910f 100644 --- a/libntp/utvtoa.c +++ b/libntp/utvtoa.c @@ -2,11 +2,11 @@ * utvtoa - return an asciized representation of an unsigned struct timeval */ #include -#include #include "lib_strbuf.h" + #if defined(VMS) -#include "ntp_fp.h" +# include "ntp_fp.h" #endif #include "ntp_stdlib.h" #include "ntp_unixtime.h" diff --git a/libparse/clk_computime.c b/libparse/clk_computime.c index 2b19392519..5a155cf35f 100644 --- a/libparse/clk_computime.c +++ b/libparse/clk_computime.c @@ -23,10 +23,6 @@ * */ - -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" diff --git a/libparse/clk_dcf7000.c b/libparse/clk_dcf7000.c index c113ec7a7d..e815e9d324 100644 --- a/libparse/clk_dcf7000.c +++ b/libparse/clk_dcf7000.c @@ -20,9 +20,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_DCF7000) -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" diff --git a/libparse/clk_hopf6021.c b/libparse/clk_hopf6021.c index d55c111ab5..cd1e821851 100644 --- a/libparse/clk_hopf6021.c +++ b/libparse/clk_hopf6021.c @@ -22,9 +22,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_HOPF6021) -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" diff --git a/libparse/clk_meinberg.c b/libparse/clk_meinberg.c index 2e58cf68f7..504ddf14ef 100644 --- a/libparse/clk_meinberg.c +++ b/libparse/clk_meinberg.c @@ -20,9 +20,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_MEINBERG) -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" diff --git a/libparse/clk_rawdcf.c b/libparse/clk_rawdcf.c index c4df5b5bce..65592ce45a 100644 --- a/libparse/clk_rawdcf.c +++ b/libparse/clk_rawdcf.c @@ -20,9 +20,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_RAWDCF) -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" diff --git a/libparse/clk_rcc8000.c b/libparse/clk_rcc8000.c index ecafbde37d..863e5d4655 100644 --- a/libparse/clk_rcc8000.c +++ b/libparse/clk_rcc8000.c @@ -19,9 +19,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_RCC8000) -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" diff --git a/libparse/clk_schmid.c b/libparse/clk_schmid.c index 5fb426833a..8a0beaf673 100644 --- a/libparse/clk_schmid.c +++ b/libparse/clk_schmid.c @@ -20,9 +20,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_SCHMID) -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" diff --git a/libparse/clk_trimtaip.c b/libparse/clk_trimtaip.c index f18aaa0670..21b8420869 100644 --- a/libparse/clk_trimtaip.c +++ b/libparse/clk_trimtaip.c @@ -11,8 +11,6 @@ #endif #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_TRIMTAIP) -#include -#include #include "ntp_fp.h" #include "ntp_unixtime.h" diff --git a/libparse/clk_trimtsip.c b/libparse/clk_trimtsip.c index cbe65f34ad..4e1d98332d 100644 --- a/libparse/clk_trimtsip.c +++ b/libparse/clk_trimtsip.c @@ -12,9 +12,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_TRIMTSIP) -#include -#include - #include "ntp_syslog.h" #include "ntp_types.h" #include "ntp_fp.h" diff --git a/libparse/clk_varitext.c b/libparse/clk_varitext.c index 9236bb4b8c..c5c9059b60 100644 --- a/libparse/clk_varitext.c +++ b/libparse/clk_varitext.c @@ -19,9 +19,6 @@ * */ -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" @@ -29,10 +26,10 @@ #include "parse.h" #ifndef PARSESTREAM -#include "ntp_stdlib.h" -#include +# include "ntp_stdlib.h" +# include #else -#include "sys/parsestreams.h" +# include "sys/parsestreams.h" extern void printf P((const char *, ...)); #endif diff --git a/libparse/parse.c b/libparse/parse.c index 78ff981e54..d3712b6b5b 100644 --- a/libparse/parse.c +++ b/libparse/parse.c @@ -30,9 +30,6 @@ static char rcsid[] = "parse.c,v 4.14 1999/11/28 09:13:52 kardel RELEASE_19991128_A"; #endif -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" diff --git a/libparse/parse_conf.c b/libparse/parse_conf.c index 353775d014..5dc267bc8b 100644 --- a/libparse/parse_conf.c +++ b/libparse/parse_conf.c @@ -26,9 +26,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PARSE) -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" diff --git a/ntpd/check_y2k.c b/ntpd/check_y2k.c index b0a84e1201..f0f4480e75 100644 --- a/ntpd/check_y2k.c +++ b/ntpd/check_y2k.c @@ -31,7 +31,8 @@ # include #endif -#include +#include "ntpd.h" + #ifdef HAVE_UNISTD_H # include #endif @@ -48,7 +49,6 @@ # ifdef HAVE_SYS_IOCTL_H # include # endif /* HAVE_SYS_IOCTL_H */ -# include # if !defined(VMS) /*wjm*/ # include # endif /* VMS */ @@ -94,8 +94,6 @@ # include #endif /* SYS_DOMAINOS */ -#include "ntpd.h" - /* } end definitions lifted from ntpd.c */ #include "ntp_calendar.h" diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index f75695a128..4076d07355 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -5,25 +5,6 @@ # include #endif -#include -#include -#include -#include -#include -#ifndef SIGCHLD -#define SIGCHLD SIGCLD -#endif -#if !defined(VMS) -#ifdef HAVE_SYS_WAIT_H -#include -#endif -#endif /* VMS */ -#include - -#ifdef HAVE_NETINFO -#include -#endif - #include "ntpd.h" #include "ntp_io.h" #include "ntp_unixtime.h" @@ -34,11 +15,28 @@ #include "ntp_cmdargs.h" #ifdef PUBKEY -#include "ntp_crypto.h" +# include "ntp_crypto.h" #endif /* PUBKEY */ +#include +#include +#include +#include +#ifndef SIGCHLD +# define SIGCHLD SIGCLD +#endif +#if !defined(VMS) +# ifdef HAVE_SYS_WAIT_H +# include +# endif +#endif /* VMS */ + +#ifdef HAVE_NETINFO +# include +#endif + #ifdef SYS_WINNT -#include +# include extern HANDLE ResolverThreadHandle; #endif /* SYS_WINNT */ diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c index c6c89a0d09..c48b5425db 100644 --- a/ntpd/ntp_control.c +++ b/ntpd/ntp_control.c @@ -5,18 +5,16 @@ #include #endif -#include -#include -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_control.h" #include "ntp_stdlib.h" +#include +#include +#include + #ifdef PUBKEY #include "ntp_crypto.h" #endif /* PUBKEY */ diff --git a/ntpd/ntp_intres.c b/ntpd/ntp_intres.c index bb575f2097..9653fdd191 100644 --- a/ntpd/ntp_intres.c +++ b/ntpd/ntp_intres.c @@ -20,10 +20,14 @@ # include #endif +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_request.h" +#include "ntp_stdlib.h" +#include "ntp_syslog.h" + #include #include -#include -#include #include #include @@ -35,12 +39,6 @@ # include /* MAXHOSTNAMELEN (often) */ #endif -#include "ntpd.h" -#include "ntp_io.h" -#include "ntp_request.h" -#include "ntp_stdlib.h" -#include "ntp_syslog.h" - #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) /* diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 82f61f6a48..48514fb02c 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -7,15 +7,19 @@ # include #endif +#include "ntp_machine.h" +#include "ntpd.h" +#include "ntp_io.h" +#include "iosignal.h" +#include "ntp_refclock.h" +#include "ntp_if.h" +#include "ntp_stdlib.h" + #include #include -#include #ifdef HAVE_SYS_PARAM_H # include #endif /* HAVE_SYS_PARAM_H */ -#ifdef HAVE_SYS_TIME_H -# include -#endif #ifdef HAVE_NETINET_IN_H # include #endif @@ -37,14 +41,6 @@ # include #endif -#include "ntp_machine.h" -#include "ntpd.h" -#include "ntp_io.h" -#include "iosignal.h" -#include "ntp_refclock.h" -#include "ntp_if.h" -#include "ntp_stdlib.h" - #if defined(VMS) /* most likely UCX-specific */ #include diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index 554ff0d333..8db57dbfee 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -6,19 +6,17 @@ # include #endif +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_unixtime.h" +#include "ntp_stdlib.h" + #include #include -#include - #include #include -#include "ntpd.h" -#include "ntp_io.h" -#include "ntp_unixtime.h" -#include "ntp_stdlib.h" - #if defined(VMS) && defined(VMS_LOCALUNIT) /*wjm*/ #include "ntp_refclock.h" #endif /* VMS */ diff --git a/ntpd/ntp_monitor.c b/ntpd/ntp_monitor.c index 64dfb3ee15..8526aacecf 100644 --- a/ntpd/ntp_monitor.c +++ b/ntpd/ntp_monitor.c @@ -1,23 +1,22 @@ /* * ntp_monitor.c - monitor who is using the ntpd server */ + #ifdef HAVE_CONFIG_H -#include +# include #endif -#include -#include -#include -# ifdef HAVE_SYS_IOCTL_H -# include -# endif -# include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_if.h" #include "ntp_stdlib.h" +#include +#include +#ifdef HAVE_SYS_IOCTL_H +# include +#endif + /* * I'm still not sure I like what I've done here. It certainly consumes * memory like it is going out of style, and also may not be as low diff --git a/ntpd/ntp_proto.c b/ntpd/ntp_proto.c index 3e5e9acc5e..65dfc940c9 100644 --- a/ntpd/ntp_proto.c +++ b/ntpd/ntp_proto.c @@ -5,10 +5,6 @@ #include #endif -#include -#include -#include - #include "ntpd.h" #include "ntp_stdlib.h" #include "ntp_unixtime.h" @@ -16,6 +12,8 @@ #include "ntp_string.h" #include "ntp_crypto.h" +#include + #if defined(VMS) && defined(VMS_LOCALUNIT) /*wjm*/ #include "ntp_refclock.h" #endif diff --git a/ntpd/ntp_refclock.c b/ntpd/ntp_refclock.c index 8faec9790e..317f005b7e 100644 --- a/ntpd/ntp_refclock.c +++ b/ntpd/ntp_refclock.c @@ -5,12 +5,6 @@ # include #endif -#include -#include -#ifdef HAVE_SYS_IOCTL_H -# include -#endif /* HAVE_SYS_IOCTL_H */ - #include "ntpd.h" #include "ntp_io.h" #include "ntp_unixtime.h" @@ -18,6 +12,12 @@ #include "ntp_refclock.h" #include "ntp_stdlib.h" +#include + +#ifdef HAVE_SYS_IOCTL_H +# include +#endif /* HAVE_SYS_IOCTL_H */ + #ifdef REFCLOCK #ifdef TTYCLK diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c index 9dbff283f6..6f5e153032 100644 --- a/ntpd/ntp_request.c +++ b/ntpd/ntp_request.c @@ -5,13 +5,6 @@ # include #endif -#include -#include -#include -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_request.h" @@ -19,6 +12,12 @@ #include "ntp_refclock.h" #include "ntp_if.h" #include "ntp_stdlib.h" + +#include +#include +#include +#include + #include "recvbuff.h" #ifdef KERNEL_PLL diff --git a/ntpd/ntp_resolver.c b/ntpd/ntp_resolver.c index 9fadfd7eb3..84b25838e4 100644 --- a/ntpd/ntp_resolver.c +++ b/ntpd/ntp_resolver.c @@ -39,22 +39,20 @@ # include #endif +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_request.h" +#include "ntp_stdlib.h" +#include "ntp_syslog.h" + #include #include -#include -#include #include #include #include #include -#include "ntpd.h" -#include "ntp_io.h" -#include "ntp_request.h" -#include "ntp_stdlib.h" -#include "ntp_syslog.h" - #define STREQ(a, b) (*(a) == *(b) && strcmp((a), (b)) == 0) /* diff --git a/ntpd/ntp_timer.c b/ntpd/ntp_timer.c index db75b5b861..08eaba57a0 100644 --- a/ntpd/ntp_timer.c +++ b/ntpd/ntp_timer.c @@ -5,17 +5,17 @@ # include #endif +#include "ntp_machine.h" +#include "ntpd.h" +#include "ntp_stdlib.h" + #include -#include -#include #include #include #ifdef HAVE_UNISTD_H # include #endif -#include "ntp_machine.h" -#include "ntpd.h" -#include "ntp_stdlib.h" + #if defined(HAVE_IO_COMPLETION_PORT) # include "ntp_iocompletionport.h" # include "ntp_timer.h" diff --git a/ntpd/ntp_util.c b/ntpd/ntp_util.c index d9c7527d96..34d38a7cd3 100644 --- a/ntpd/ntp_util.c +++ b/ntpd/ntp_util.c @@ -1,17 +1,24 @@ /* * ntp_util.c - stuff I didn't have any other place for */ + #ifdef HAVE_CONFIG_H # include #endif +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_unixtime.h" +#include "ntp_filegen.h" +#include "ntp_if.h" +#include "ntp_stdlib.h" + #include #include #include #ifdef HAVE_SYS_IOCTL_H # include #endif -#include #ifdef HAVE_IEEEFP_H # include @@ -20,13 +27,6 @@ # include #endif -#include "ntpd.h" -#include "ntp_io.h" -#include "ntp_unixtime.h" -#include "ntp_filegen.h" -#include "ntp_if.h" -#include "ntp_stdlib.h" - #ifdef DOSYNCTODR #if !defined(VMS) #include diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index fa2e401809..fab5b6ccc4 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -1,11 +1,15 @@ /* * ntpd.c - main program for the fixed point NTP daemon */ + #ifdef HAVE_CONFIG_H # include #endif -#include +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_stdlib.h" + #ifdef HAVE_UNISTD_H # include #endif @@ -21,7 +25,6 @@ # ifdef HAVE_SYS_IOCTL_H # include # endif /* HAVE_SYS_IOCTL_H */ -# include # ifdef HAVE_SYS_RESOURCE_H # include # endif /* HAVE_SYS_RESOURCE_H */ @@ -68,10 +71,6 @@ # include #endif /* SYS_DOMAINOS */ -#include "ntpd.h" -#include "ntp_io.h" - -#include "ntp_stdlib.h" #include "recvbuff.h" #include "ntp_cmdargs.h" diff --git a/ntpd/refclock_acts.c b/ntpd/refclock_acts.c index e46e37919c..efdf536fe8 100644 --- a/ntpd/refclock_acts.c +++ b/ntpd/refclock_acts.c @@ -9,13 +9,6 @@ #if defined(REFCLOCK) && (defined(CLOCK_ACTS) || defined(CLOCK_PTBACTS)) -#include -#include -#include -#ifdef HAVE_SYS_IOCTL_H -# include -#endif /* HAVE_SYS_IOCTL_H */ - #include "ntpd.h" #include "ntp_io.h" #include "ntp_unixtime.h" @@ -23,6 +16,12 @@ #include "ntp_stdlib.h" #include "ntp_control.h" +#include +#include +#ifdef HAVE_SYS_IOCTL_H +# include +#endif /* HAVE_SYS_IOCTL_H */ + /* MUST BE AFTER LAST #include !!! */ #if defined(CLOCK_ACTS) && defined(CLOCK_PTBACTS) diff --git a/ntpd/refclock_arbiter.c b/ntpd/refclock_arbiter.c index 045a93a1b7..cdbe2ee386 100644 --- a/ntpd/refclock_arbiter.c +++ b/ntpd/refclock_arbiter.c @@ -9,15 +9,14 @@ #if defined(REFCLOCK) && defined(CLOCK_ARBITER) -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_stdlib.h" +#include +#include + /* * This driver supports the Arbiter 1088A/B Satellite Controlled Clock. * The claimed accuracy of this clock is 100 ns relative to the PPS diff --git a/ntpd/refclock_arc.c b/ntpd/refclock_arc.c index 1db8a9a512..c771f478f6 100644 --- a/ntpd/refclock_arc.c +++ b/ntpd/refclock_arc.c @@ -303,10 +303,13 @@ Also note h command which starts a resync to MSF signal. */ +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_refclock.h" +#include "ntp_stdlib.h" #include #include -#include #if defined(HAVE_BSD_TTYS) #include @@ -320,11 +323,6 @@ Also note h command which starts a resync to MSF signal. #include #endif -#include "ntpd.h" -#include "ntp_io.h" -#include "ntp_refclock.h" -#include "ntp_stdlib.h" - /* * This driver supports the ARCRON MSF Radio Controlled Clock */ diff --git a/ntpd/refclock_as2201.c b/ntpd/refclock_as2201.c index 2c104402f0..516f7adc54 100644 --- a/ntpd/refclock_as2201.c +++ b/ntpd/refclock_as2201.c @@ -8,16 +8,15 @@ #if defined(REFCLOCK) && defined(CLOCK_AS2201) -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" +#include +#include + /* * This driver supports the Austron 2200A/2201A GPS Receiver with * Buffered RS-232-C Interface Module. Note that the original 2200/2201 diff --git a/ntpd/refclock_atom.c b/ntpd/refclock_atom.c index fc454efca9..9dd6765167 100644 --- a/ntpd/refclock_atom.c +++ b/ntpd/refclock_atom.c @@ -16,9 +16,6 @@ #if defined(REFCLOCK) && defined(CLOCK_ATOM) -#ifdef HAVE_SYS_TIME_H -# include -#endif #ifdef HAVE_PPSAPI # ifdef HAVE_TIMEPPS_H # include diff --git a/ntpd/refclock_bancomm.c b/ntpd/refclock_bancomm.c index ba9aaf2d68..a3debcb679 100644 --- a/ntpd/refclock_bancomm.c +++ b/ntpd/refclock_bancomm.c @@ -32,12 +32,6 @@ #endif #if defined(REFCLOCK) && defined(CLOCK_BANC) -#include -#include -#include -#include -#include -#include #include "ntpd.h" #include "ntp_io.h" @@ -45,6 +39,10 @@ #include "ntp_unixtime.h" #include "ntp_stdlib.h" +#include +#include +#include + /* STUFF BY RES */ struct btfp_time /* Structure for reading 5 time words */ /* in one ioctl(2) operation. */ diff --git a/ntpd/refclock_chronolog.c b/ntpd/refclock_chronolog.c index 2982ecc984..9273a84fdf 100644 --- a/ntpd/refclock_chronolog.c +++ b/ntpd/refclock_chronolog.c @@ -13,17 +13,15 @@ #if defined(REFCLOCK) && defined(CLOCK_CHRONOLOG) -#include -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" +#include +#include + /* * This driver supports the Chronolog K-series WWVB receiver. * diff --git a/ntpd/refclock_chu.c b/ntpd/refclock_chu.c index 5fd816a943..10fcea5aad 100644 --- a/ntpd/refclock_chu.c +++ b/ntpd/refclock_chu.c @@ -7,17 +7,16 @@ #if defined(REFCLOCK) && defined(CLOCK_CHU) -#include -#include -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" + +#include +#include +#include + #ifdef HAVE_AUDIO #include "audio.h" #endif /* HAVE_AUDIO */ diff --git a/ntpd/refclock_datum.c b/ntpd/refclock_datum.c index 56083dbcfd..db03c95f2c 100644 --- a/ntpd/refclock_datum.c +++ b/ntpd/refclock_datum.c @@ -17,16 +17,15 @@ ** Include Files */ -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" +#include +#include + #if defined(HAVE_BSD_TTYS) #include #endif /* HAVE_BSD_TTYS */ diff --git a/ntpd/refclock_dumbclock.c b/ntpd/refclock_dumbclock.c index 8138d9e66b..c439646f91 100644 --- a/ntpd/refclock_dumbclock.c +++ b/ntpd/refclock_dumbclock.c @@ -14,17 +14,15 @@ #if defined(REFCLOCK) && defined(CLOCK_DUMBCLOCK) -#include -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" +#include +#include + /* * This driver supports a generic dumb clock that only outputs hh:mm:ss, * in local time, no less. diff --git a/ntpd/refclock_fg.c b/ntpd/refclock_fg.c index f1320b010d..655b6bcda1 100644 --- a/ntpd/refclock_fg.c +++ b/ntpd/refclock_fg.c @@ -8,8 +8,6 @@ #if defined(REFCLOCK) && defined(CLOCK_FG) -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" diff --git a/ntpd/refclock_gpsvme.c b/ntpd/refclock_gpsvme.c index b37466b5ee..42eb2f981b 100644 --- a/ntpd/refclock_gpsvme.c +++ b/ntpd/refclock_gpsvme.c @@ -16,19 +16,18 @@ #endif #if defined(REFCLOCK) && defined(CLOCK_GPSVME) -#include -#include -#include -#include -#include -#include -#include "gps.h" #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" + +#include +#include +#include + +#include "gps.h" #include "/etc/conf/h/io.h" /* GLOBAL STUFF BY RES */ diff --git a/ntpd/refclock_heath.c b/ntpd/refclock_heath.c index 9d297d1f87..c1b55aab3f 100644 --- a/ntpd/refclock_heath.c +++ b/ntpd/refclock_heath.c @@ -7,27 +7,18 @@ #if defined(REFCLOCK) && defined(CLOCK_HEATH) +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_refclock.h" +#include "ntp_stdlib.h" + #include #include -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef TM_IN_SYS_TIME -# include -# else -# include -# endif -#endif + #ifdef HAVE_SYS_IOCTL_H # include #endif /* not HAVE_SYS_IOCTL_H */ -#include "ntpd.h" -#include "ntp_io.h" -#include "ntp_refclock.h" -#include "ntp_stdlib.h" - /* * This driver supports the Heath GC-1000 Most Accurate Clock, with * RS232C Output Accessory. This is a WWV/WWVH receiver somewhat less diff --git a/ntpd/refclock_hpgps.c b/ntpd/refclock_hpgps.c index 30aa494068..7a506cfc7f 100644 --- a/ntpd/refclock_hpgps.c +++ b/ntpd/refclock_hpgps.c @@ -1,21 +1,21 @@ /* * refclock_hpgps - clock driver for HP 58503A GPS receiver */ + #ifdef HAVE_CONFIG_H -#include +# include #endif #if defined(REFCLOCK) && defined(CLOCK_HPGPS) -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_stdlib.h" +#include +#include + /* Version 0.1 April 1, 1995 * 0.2 April 25, 1995 * tolerant of missing timecode response prompt and sends diff --git a/ntpd/refclock_irig.c b/ntpd/refclock_irig.c index 13f8e17d36..7efd57edeb 100644 --- a/ntpd/refclock_irig.c +++ b/ntpd/refclock_irig.c @@ -7,19 +7,19 @@ #if defined(REFCLOCK) && defined(CLOCK_IRIG) +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_refclock.h" +#include "ntp_calendar.h" +#include "ntp_stdlib.h" + #include #include -#include #include #ifdef HAVE_SYS_IOCTL_H #include #endif /* HAVE_SYS_IOCTL_H */ -#include "ntpd.h" -#include "ntp_io.h" -#include "ntp_refclock.h" -#include "ntp_calendar.h" -#include "ntp_stdlib.h" #include "audio.h" /* diff --git a/ntpd/refclock_jupiter.c b/ntpd/refclock_jupiter.c index b337e0cff8..483984cceb 100644 --- a/ntpd/refclock_jupiter.c +++ b/ntpd/refclock_jupiter.c @@ -37,10 +37,6 @@ #if defined(REFCLOCK) && defined(CLOCK_JUPITER) && defined(PPS) -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" @@ -48,6 +44,9 @@ #include "ntp_stdlib.h" #include "ntp_calendar.h" +#include +#include + #include "jupiter.h" #include diff --git a/ntpd/refclock_leitch.c b/ntpd/refclock_leitch.c index edee3f805c..42b02fce81 100644 --- a/ntpd/refclock_leitch.c +++ b/ntpd/refclock_leitch.c @@ -1,21 +1,21 @@ /* * refclock_leitch - clock driver for the Leitch CSD-5300 Master Clock */ + #ifdef HAVE_CONFIG_H -#include +# include #endif #if defined(REFCLOCK) && defined(CLOCK_LEITCH) -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_unixtime.h" +#include +#include + #ifdef STREAM #include #if defined(LEITCHCLK) diff --git a/ntpd/refclock_local.c b/ntpd/refclock_local.c index 90fe8c81ed..a3e5773872 100644 --- a/ntpd/refclock_local.c +++ b/ntpd/refclock_local.c @@ -8,14 +8,14 @@ #endif #ifdef REFCLOCK -#include -#include -#include #include "ntpd.h" #include "ntp_refclock.h" #include "ntp_stdlib.h" +#include +#include + #ifdef KERNEL_PLL #include "ntp_syscall.h" #endif diff --git a/ntpd/refclock_msfees.c b/ntpd/refclock_msfees.c index db6c6b17a6..dd1c06db16 100644 --- a/ntpd/refclock_msfees.c +++ b/ntpd/refclock_msfees.c @@ -11,16 +11,13 @@ * (hence probably didn't work). Still in RCS file at cl.cam.ac.uk */ -#include -#ifdef HAVE_SYS_TIME_H -# include -#endif - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_unixtime.h" #include "ntp_calendar.h" + +#include #if defined(HAVE_BSD_TTYS) #include #endif /* HAVE_BSD_TTYS */ diff --git a/ntpd/refclock_mx4200.c b/ntpd/refclock_mx4200.c index 6e85d21e4b..e0e7618669 100644 --- a/ntpd/refclock_mx4200.c +++ b/ntpd/refclock_mx4200.c @@ -49,21 +49,17 @@ #if defined(REFCLOCK) && defined(CLOCK_MX4200) && defined(HAVE_PPSAPI) -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" +#include +#include + #include "mx4200.h" -#ifdef HAVE_SYS_TIME_H -# include -#endif #ifdef HAVE_SYS_TERMIOS_H # include #endif diff --git a/ntpd/refclock_nmea.c b/ntpd/refclock_nmea.c index 119d0417c7..19f8eee15a 100644 --- a/ntpd/refclock_nmea.c +++ b/ntpd/refclock_nmea.c @@ -9,16 +9,14 @@ #if defined(REFCLOCK) && defined(CLOCK_NMEA) -#include -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_stdlib.h" +#include +#include + /* * This driver supports the NMEA GPS Receiver with * diff --git a/ntpd/refclock_oncore.c b/ntpd/refclock_oncore.c index 9c034335c0..3a1de214a8 100644 --- a/ntpd/refclock_oncore.c +++ b/ntpd/refclock_oncore.c @@ -85,10 +85,14 @@ #if defined(REFCLOCK) && defined(CLOCK_ONCORE) && defined(HAVE_PPSAPI) && 0 +#include "ntpd.h" +#include "ntp_io.h" +#include "ntp_unixtime.h" +#include "ntp_refclock.h" +#include "ntp_stdlib.h" + #include #include -#include -#include #include #ifdef ONCORE_SHMEM_STATUS # ifdef HAVE_SYS_MMAN_H @@ -100,11 +104,11 @@ #endif /* ONCORE_SHMEM_STATUS */ #ifdef HAVE_PPSAPI -# ifdef HAVE_TIMEPPS_H -# include +# ifdef HAVE_TIMEPPS_H +# include # else # ifdef HAVE_SYS_TIMEPPS_H -# include +# include # endif # endif #endif @@ -113,14 +117,8 @@ # include #endif -#include "ntpd.h" -#include "ntp_io.h" -#include "ntp_unixtime.h" -#include "ntp_refclock.h" -#include "ntp_stdlib.h" - #ifdef HAVE_SYS_TERMIOS_H -#include +# include #endif #ifdef HAVE_SYS_PPSCLOCK_H diff --git a/ntpd/refclock_pcf.c b/ntpd/refclock_pcf.c index db6a0da463..ff2b28ebee 100644 --- a/ntpd/refclock_pcf.c +++ b/ntpd/refclock_pcf.c @@ -8,8 +8,6 @@ #if defined(REFCLOCK) && defined(CLOCK_PCF) -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" diff --git a/ntpd/refclock_pst.c b/ntpd/refclock_pst.c index 6af4382479..b92a2e077a 100644 --- a/ntpd/refclock_pst.c +++ b/ntpd/refclock_pst.c @@ -8,15 +8,14 @@ #if defined(REFCLOCK) && defined(CLOCK_PST) -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_stdlib.h" +#include +#include + /* * This driver supports the PSTI 1010 and Traconex 1020 WWV/WWVH * Receivers. No specific claim of accuracy is made for these receiver, diff --git a/ntpd/refclock_shm.c b/ntpd/refclock_shm.c index a8094c86ec..bf612848e4 100644 --- a/ntpd/refclock_shm.c +++ b/ntpd/refclock_shm.c @@ -13,12 +13,6 @@ #if defined(REFCLOCK) && defined(CLOCK_SHM) -#undef fileno -#include -#undef fileno -#include -#undef fileno - #include "ntpd.h" #undef fileno #include "ntp_io.h" @@ -29,15 +23,16 @@ #undef fileno #include "ntp_stdlib.h" +#undef fileno +#include +#undef fileno + #ifndef SYS_WINNT -#include -#include -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include #endif /* diff --git a/ntpd/refclock_tpro.c b/ntpd/refclock_tpro.c index a29383a222..159f81745f 100644 --- a/ntpd/refclock_tpro.c +++ b/ntpd/refclock_tpro.c @@ -8,10 +8,6 @@ #if defined(REFCLOCK) && defined(CLOCK_TPRO) -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" @@ -19,6 +15,9 @@ #include "sys/tpro.h" #include "ntp_stdlib.h" +#include +#include + /* * This driver supports the KSI/Odetecs TPRO-S IRIG-B reader and TPRO- * SAT GPS receiver for the Sun Microsystems SBus. It requires that the diff --git a/ntpd/refclock_trak.c b/ntpd/refclock_trak.c index f9b01da9f5..326a8e9262 100644 --- a/ntpd/refclock_trak.c +++ b/ntpd/refclock_trak.c @@ -12,18 +12,15 @@ #if defined(REFCLOCK) && defined(CLOCK_TRAK) && defined(PPS) -#include -#include -#ifdef HAVE_SYS_TIME_H -# include -#endif - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_stdlib.h" #include "ntp_unixtime.h" +#include +#include + #ifdef HAVE_SYS_TERMIOS_H # include #endif diff --git a/ntpd/refclock_true.c b/ntpd/refclock_true.c index b841f72589..3aef785d40 100644 --- a/ntpd/refclock_true.c +++ b/ntpd/refclock_true.c @@ -12,16 +12,15 @@ #if defined(REFCLOCK) && defined(CLOCK_TRUETIME) -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_unixtime.h" #include "ntp_stdlib.h" +#include +#include + /* This should be an atom clock but those are very hard to build. * * The PCL720 from P C Labs has an Intel 8253 lookalike, as well as a bunch diff --git a/ntpd/refclock_ulink.c b/ntpd/refclock_ulink.c index 01ed238d94..12923be75c 100644 --- a/ntpd/refclock_ulink.c +++ b/ntpd/refclock_ulink.c @@ -28,8 +28,6 @@ #include #include -#include -#include #include "ntpd.h" #include "ntp_io.h" diff --git a/ntpd/refclock_usno.c b/ntpd/refclock_usno.c index b66e1606f4..30a13300ba 100644 --- a/ntpd/refclock_usno.c +++ b/ntpd/refclock_usno.c @@ -9,13 +9,6 @@ #if defined(REFCLOCK) && defined(CLOCK_USNO) -#include -#include -#include -#ifdef HAVE_SYS_IOCTL_H -# include -#endif /* HAVE_SYS_IOCTL_H */ - #include "ntpd.h" #include "ntp_io.h" #include "ntp_unixtime.h" @@ -23,6 +16,12 @@ #include "ntp_stdlib.h" #include "ntp_control.h" +#include +#include +#ifdef HAVE_SYS_IOCTL_H +# include +#endif /* HAVE_SYS_IOCTL_H */ + /* * This driver supports the Naval Observatory dialup at +1 202 653 0351. * It is a hacked-up version of the ACTS driver. diff --git a/ntpd/refclock_wwv.c b/ntpd/refclock_wwv.c index 2a6011003f..b1d05c7ca3 100644 --- a/ntpd/refclock_wwv.c +++ b/ntpd/refclock_wwv.c @@ -7,14 +7,6 @@ #if defined(REFCLOCK) && defined(CLOCK_WWV) -#include -#include -#include -#include -#ifdef HAVE_SYS_IOCTL_H -#include -#endif /* HAVE_SYS_IOCTL_H */ - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" @@ -22,6 +14,13 @@ #include "ntp_stdlib.h" #include "audio.h" +#include +#include +#include +#ifdef HAVE_SYS_IOCTL_H +# include +#endif /* HAVE_SYS_IOCTL_H */ + #define ICOM 1 /* undefine to suppress ICOM code */ #ifdef ICOM diff --git a/ntpd/refclock_wwvb.c b/ntpd/refclock_wwvb.c index b169914bfa..0ca9f75ab7 100644 --- a/ntpd/refclock_wwvb.c +++ b/ntpd/refclock_wwvb.c @@ -8,17 +8,15 @@ #if defined(REFCLOCK) && defined(CLOCK_SPECTRACOM) -#include -#include -#include -#include - #include "ntpd.h" #include "ntp_io.h" #include "ntp_refclock.h" #include "ntp_calendar.h" #include "ntp_stdlib.h" +#include +#include + /* * This driver supports the Spectracom Model 8170 and Netclock/2 WWVB * Synchronized Clocks and the Netclock/GPS Master Clock. Both the WWVB diff --git a/ntpdate/ntpdate.c b/ntpdate/ntpdate.c index 2b7fb5b7b2..c8f6024a7c 100644 --- a/ntpdate/ntpdate.c +++ b/ntpdate/ntpdate.c @@ -6,9 +6,16 @@ # include #endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include "ntp_fp.h" +#include "ntp.h" +#include "ntp_io.h" +#include "ntp_unixtime.h" +#include "ntpdate.h" +#include "ntp_string.h" +#include "ntp_syslog.h" +#include "ntp_select.h" +#include "ntp_stdlib.h" + #ifdef HAVE_UNISTD_H # include #endif @@ -26,7 +33,6 @@ # include # endif #endif /* SYS_WINNT */ -#include #ifdef HAVE_SYS_RESOURCE_H # include #endif /* HAVE_SYS_RESOURCE_H */ @@ -42,24 +48,10 @@ struct timeval timeout = {0,0}; struct timeval timeout = {60,0}; #endif - -#if defined(SYS_HPUX) -# include -#endif - #ifdef HAVE_NETINFO #include #endif -#include "ntp_fp.h" -#include "ntp.h" -#include "ntp_io.h" -#include "ntp_unixtime.h" -#include "ntpdate.h" -#include "ntp_string.h" -#include "ntp_syslog.h" -#include "ntp_select.h" -#include "ntp_stdlib.h" #include "recvbuff.h" #ifdef SYS_WINNT diff --git a/ntpdate/ntptime_config.c b/ntpdate/ntptime_config.c index 56f653932c..e784d28034 100644 --- a/ntpdate/ntptime_config.c +++ b/ntpdate/ntptime_config.c @@ -11,15 +11,6 @@ # include #endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#include -#include -#include -#include - #include "ntp_fp.h" #include "ntp.h" #include "ntp_io.h" @@ -29,6 +20,10 @@ #include "ntp_syslog.h" #include "ntp_stdlib.h" +#include +#include +#include + /* * These routines are used to read the configuration file at * startup time. An entry in the file must fit on a single line. diff --git a/ntpdate/ntptimeset.c b/ntpdate/ntptimeset.c index 17cd72cbdb..0077b009a1 100644 --- a/ntpdate/ntptimeset.c +++ b/ntpdate/ntptimeset.c @@ -121,9 +121,17 @@ # include #endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include "ntp_fp.h" +#include "ntp.h" +#include "ntp_io.h" +#include "iosignal.h" +#include "ntp_unixtime.h" +#include "ntpdate.h" +#include "ntp_string.h" +#include "ntp_syslog.h" +#include "ntp_select.h" +#include "ntp_stdlib.h" + #ifdef HAVE_UNISTD_H # include #endif @@ -136,7 +144,7 @@ # include # include #endif /* SYS_WINNT */ -#include + #ifdef HAVE_SYS_RESOURCE_H # include #endif /* HAVE_SYS_RESOURCE_H */ @@ -147,21 +155,6 @@ # include "timers.h" #endif - -#if defined(SYS_HPUX) -# include -#endif - -#include "ntp_fp.h" -#include "ntp.h" -#include "ntp_io.h" -#include "iosignal.h" -#include "ntp_unixtime.h" -#include "ntpdate.h" -#include "ntp_string.h" -#include "ntp_syslog.h" -#include "ntp_select.h" -#include "ntp_stdlib.h" #include "recvbuff.h" #ifdef SYS_WINNT diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index 416468fd5f..d5a24a4c57 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -1,12 +1,16 @@ /* * ntpdc - control and monitor your ntpd daemon */ + +#include "ntpdc.h" +#include "ntp_select.h" +#include "ntp_io.h" +#include "ntp_stdlib.h" + #include #include #include #include -#include -#include #include #ifdef SYS_WINNT @@ -20,11 +24,6 @@ # include #endif /* HAVE_LIBREADLINE */ -#include "ntpdc.h" -#include "ntp_select.h" -#include "ntp_io.h" -#include "ntp_stdlib.h" - #ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/ #define open(name, flags) open(name, flags, 0777) diff --git a/ntpdc/ntpdc_ops.c b/ntpdc/ntpdc_ops.c index 62bddd53ca..10c1e78964 100644 --- a/ntpdc/ntpdc_ops.c +++ b/ntpdc/ntpdc_ops.c @@ -6,10 +6,13 @@ # include #endif +#include "ntpdc.h" +#include "ntp_control.h" +#include "ntp_refclock.h" +#include "ntp_stdlib.h" + #include #include -#include -#include #ifdef HAVE_SYS_TIMEX_H # include #endif @@ -18,11 +21,6 @@ #include #endif -#include "ntpdc.h" -#include "ntp_control.h" -#include "ntp_refclock.h" -#include "ntp_stdlib.h" - #include /* diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index f22f3ec4fc..d632f70fa8 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -1,12 +1,18 @@ /* * ntpq - query an NTP server using mode 6 commands */ + +#include "ntpq.h" +#include "ntp_unixtime.h" +#include "ntp_calendar.h" +#include "ntp_io.h" +#include "ntp_select.h" +#include "ntp_stdlib.h" + #include #include #include #include -#include -#include #include #ifdef SYS_WINNT # include @@ -14,13 +20,6 @@ #define closesocket close #endif /* SYS_WINNT */ -#include "ntpq.h" -#include "ntp_unixtime.h" -#include "ntp_calendar.h" -#include "ntp_io.h" -#include "ntp_select.h" -#include "ntp_stdlib.h" - #ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/ #define open(name, flags) open(name, flags, 0777) diff --git a/ntpq/ntpq_ops.c b/ntpq/ntpq_ops.c index d05570a6ba..8cf1c531ea 100644 --- a/ntpq/ntpq_ops.c +++ b/ntpq/ntpq_ops.c @@ -1,15 +1,14 @@ /* * ntpdc_ops.c - subroutines which are called to perform operations by ntpdc */ -#include -#include -#include -#include -#include #include "ntpq.h" #include "ntp_stdlib.h" +#include +#include +#include + extern char * chosts[]; extern char currenthost[]; extern int numhosts; diff --git a/ntptrace/ntptrace.c b/ntptrace/ntptrace.c index ec1e935632..6fd9ed7b2d 100644 --- a/ntptrace/ntptrace.c +++ b/ntptrace/ntptrace.c @@ -13,22 +13,6 @@ # include #endif -#include -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_IOCTL_H -# include -#endif -#include -#include - -#if defined(SYS_HPUX) -#include -#endif - #include "ntp_fp.h" #include "ntp.h" #include "ntp_io.h" @@ -39,6 +23,17 @@ #include "ntp_select.h" #include "ntp_stdlib.h" #include "recvbuff.h" + +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_IOCTL_H +# include +#endif +#include + /* * only 16 stratums, so this is more than enough. */ diff --git a/parseutil/testdcf.c b/parseutil/testdcf.c index 754ff631fb..afdc89db6a 100644 --- a/parseutil/testdcf.c +++ b/parseutil/testdcf.c @@ -16,14 +16,12 @@ * written consent of the author. */ +#include "ntp_stdlib.h" + #include #include #include #include -#include -#include - -#include "ntp_stdlib.h" /* * state flags diff --git a/util/hist.c b/util/hist.c index ee4e93ad6a..5b11ff1851 100644 --- a/util/hist.c +++ b/util/hist.c @@ -8,14 +8,14 @@ */ #ifdef HAVE_CONFIG_H -#include +# include #endif -#include -#include -#include #include "ntp_types.h" +#include +#include + #define NBUF 100001 /* size of basic histogram */ #define NSRT 20000 /* size of overflow histogram */ #define NCNT (600 * 1000000) /* sample interval (us) */ diff --git a/util/jitter.c b/util/jitter.c index 79f47573f5..462fe126c9 100644 --- a/util/jitter.c +++ b/util/jitter.c @@ -6,8 +6,9 @@ * analysis. From this you can determine the jitter and if the clock ever * runs backwards. */ -#include + #include +#include #define NBUF 20002 diff --git a/util/kern.c b/util/kern.c index 37d9257237..b193d6f57c 100644 --- a/util/kern.c +++ b/util/kern.c @@ -3,6 +3,7 @@ * actual code segments from modified kernel distributions for SunOS, * Ultrix and OSF/1 kernels. These segments do not use any licensed code. */ + #ifdef HAVE_CONFIG_H # include #endif diff --git a/util/ntp-genkeys.c b/util/ntp-genkeys.c index 4d1003088e..d7e44c4360 100644 --- a/util/ntp-genkeys.c +++ b/util/ntp-genkeys.c @@ -6,24 +6,22 @@ # include #endif +#include "ntpd.h" +#include "ntp_stdlib.h" +#include "ntp_string.h" +#include "ntp_filegen.h" +#include "ntp_unixtime.h" +#include "ntp_config.h" + #include -#include #include #include /* PATH_MAX */ -#include /* for umask() and stat() */ -#include +#include #ifdef HAVE_NETINFO #include #endif -#include "ntpd.h" -#include "ntp_stdlib.h" -#include "ntp_string.h" -#include "ntp_filegen.h" -#include "ntp_unixtime.h" -#include "ntp_config.h" - #ifdef PUBKEY # include "ntp_crypto.h" #endif diff --git a/util/ntptime.c b/util/ntptime.c index 2db763d7e1..81bd2beee5 100644 --- a/util/ntptime.c +++ b/util/ntptime.c @@ -9,21 +9,21 @@ * For more information, see the README.kern file in the doc directory * of the xntp3 distribution. */ + #ifdef HAVE_CONFIG_H # include #endif /* HAVE_CONFIG_H */ -#include -#include -#include -#include -#include - #include "ntp_fp.h" #include "ntp_unixtime.h" #include "ntp_syscall.h" #include "ntp_stdlib.h" +#include +#include +#include +#include + #ifdef NTP_SYSCALLS_STD # ifndef SYS_DECOSF1 # define BADCALL -1 /* this is supposed to be a bad syscall */ diff --git a/util/precision.c b/util/precision.c index 0fd3c3a3a7..b1516b34ca 100644 --- a/util/precision.c +++ b/util/precision.c @@ -1,8 +1,7 @@ -#include -#include -#include #include "ntp_unixtime.h" +#include + #define DEFAULT_SYS_PRECISION -99 int default_get_resolution(); diff --git a/util/tickadj.c b/util/tickadj.c index 5ac812142d..4f524b129f 100644 --- a/util/tickadj.c +++ b/util/tickadj.c @@ -13,15 +13,14 @@ # include #endif +#include "ntp_types.h" +#include "l_stdlib.h" + #include -#include #ifdef HAVE_UNISTD_H # include #endif /* HAVE_UNISTD_H */ -#include "ntp_types.h" -#include "l_stdlib.h" - #ifdef HAVE___ADJTIMEX /* Linux */ #include @@ -178,7 +177,6 @@ main( #ifdef NLIST_STRUCT # include #else /* not NLIST_STRUCT */ /* was defined(SYS_AUX3) || defined(SYS_AUX2) */ -# include # include # include # include