Commit b00bcb47 authored by Eric S. Raymond's avatar Eric S. Raymond

Use C99 bools everywhere it is both possible and safe.

Patch reviewed by Hal Murray.  Care was taken with issues like changing
structure lengths used for I/O (a non-no) and relying on bool true to be
identically 1 rather than unspecified nonzero.
parent b3810cf9
......@@ -38,11 +38,11 @@ typedef void (input_handler_t)(l_fp *);
#define USING_SIGIO() using_sigio
extern int using_sigio;
extern bool using_sigio;
extern void block_sigio (void);
extern void unblock_sigio (void);
extern int init_clock_sig (struct refclockio *);
extern bool init_clock_sig (struct refclockio *);
extern void init_socket_sig (int);
extern void set_signal (input_handler_t *);
......@@ -52,7 +52,7 @@ extern void set_signal (input_handler_t *);
#else /* !HAVE_SIGNALED_IO follows */
# define BLOCKIO() do {} while (0)
# define UNBLOCKIO() do {} while (0)
# define USING_SIGIO() FALSE
# define USING_SIGIO() false
#endif
#endif /* IOSIGNAL_H */
......@@ -16,7 +16,7 @@
typedef char libbufstr[LIB_BUFLENGTH];
extern libbufstr lib_stringbuf[LIB_NUMBUF];
extern int lib_nextbuf;
extern int lib_inited;
extern bool lib_inited;
/*
......@@ -27,6 +27,6 @@ extern int lib_inited;
ZERO(lib_stringbuf[lib_nextbuf]); \
(bufp) = &lib_stringbuf[lib_nextbuf++][0]; \
lib_nextbuf %= COUNTOF(lib_stringbuf); \
} while (FALSE)
} while (false)
#endif /* LIB_STRBUF_H */
......@@ -99,10 +99,10 @@ extern void calysto_assert(unsigned char cnd); /* check whether this holds */
#define DEBUG_INVARIANT(x) INVARIANT(x)
#define DEBUG_ENSURE(x) ENSURE(x)
# else
#define DEBUG_REQUIRE(x) do {} while (FALSE)
#define DEBUG_INSIST(x) do {} while (FALSE)
#define DEBUG_INVARIANT(x) do {} while (FALSE)
#define DEBUG_ENSURE(x) do {} while (FALSE)
#define DEBUG_REQUIRE(x) do {} while (false)
#define DEBUG_INSIST(x) do {} while (false)
#define DEBUG_INVARIANT(x) do {} while (false)
#define DEBUG_ENSURE(x) do {} while (false)
# endif
#endif /* NTP_ASSERT_H */
......@@ -222,7 +222,7 @@ ntpcal_date_to_rd(const struct calendar * /* jt */);
* for regular years and a non-zero value for leap years.
*/
extern ntpcal_split
ntpcal_split_eradays(int32_t /* days */, int/*BOOL*/ * /* isleapyear */);
ntpcal_split_eradays(int32_t /* days */, bool * /* isleapyear */);
/*
* Given a number of elapsed days in a year and a leap year indicator,
......@@ -231,14 +231,14 @@ ntpcal_split_eradays(int32_t /* days */, int/*BOOL*/ * /* isleapyear */);
* 'res.rem'.
*/
extern ntpcal_split
ntpcal_split_yeardays(int32_t /* eyd */, int/*BOOL*/ /* isleapyear */);
ntpcal_split_yeardays(int32_t /* eyd */, bool /* isleapyear */);
/*
* Convert a RataDie number into the date part of a 'struct
* calendar'. Return 0 if the year is regular year, !0 if the year is
* a leap year.
*/
extern int/*BOOL*/
extern bool
ntpcal_rd_to_date(struct calendar * /* jt */, int32_t /* rd */);
/*
......@@ -246,7 +246,7 @@ ntpcal_rd_to_date(struct calendar * /* jt */, int32_t /* rd */);
* tm'. Return 0 if the year is regular year, !0 if the year is a leap
* year.
*/
extern int/*BOOL*/
extern bool
ntpcal_rd_to_tm(struct tm * /* utm */, int32_t /* rd */);
/*
......
......@@ -44,8 +44,8 @@
extern int cmdline_server_count;
extern char ** cmdline_servers;
/* set to zero if admin doesn't want memory locked */
extern int do_memlock;
/* set to false if admin doesn't want memory locked */
extern bool do_memlock;
typedef struct int_range_tag {
int first;
......
......@@ -79,13 +79,13 @@ typedef u_int32 u_fp;
do { \
(hi) = ntohl(ni); \
(hf) = ntohl(nf); \
} while (FALSE)
} while (false)
#define HTONL_MFP(hi, hf, ni, nf) \
do { \
(ni) = htonl(hi); \
(nf) = htonl(hf); \
} while (FALSE)
} while (false)
#define HTONL_FP(h, n) \
HTONL_MFP((h)->l_ui, (h)->l_uf, (n)->l_ui, (n)->l_uf)
......@@ -98,7 +98,7 @@ typedef u_int32 u_fp;
do { \
(nts)->l_ui = 0; \
(nts)->l_uf = htonl(uf); \
} while (FALSE)
} while (false)
/*
* Conversions between the two fixed point types
......@@ -124,20 +124,20 @@ typedef u_int32 u_fp;
do { \
(v_f) = ~(v_f) + 1u; \
(v_i) = ~(v_i) + ((v_f) == 0); \
} while (FALSE)
} while (false)
#define M_NEGM(r_i, r_f, a_i, a_f) /* r = -a */ \
do { \
(r_f) = ~(a_f) + 1u; \
(r_i) = ~(a_i) + ((r_f) == 0); \
} while (FALSE)
} while (false)
#define M_ADD(r_i, r_f, a_i, a_f) /* r += a */ \
do { \
u_int32 add_t = (r_f); \
(r_f) += (a_f); \
(r_i) += (a_i) + ((u_int32)(r_f) < add_t); \
} while (FALSE)
} while (false)
#define M_ADD3(r_o, r_i, r_f, a_o, a_i, a_f) /* r += a, three word */ \
do { \
......@@ -151,39 +151,39 @@ typedef u_int32 u_fp;
(r_i) += (a_i); \
add_c |= ((u_int32)(r_i) < add_t); \
(r_o) += (a_o) + add_c; \
} while (FALSE)
} while (false)
#define M_SUB(r_i, r_f, a_i, a_f) /* r -= a */ \
do { \
u_int32 sub_t = (r_f); \
(r_f) -= (a_f); \
(r_i) -= (a_i) + ((u_int32)(r_f) > sub_t); \
} while (FALSE)
} while (false)
#define M_RSHIFTU(v_i, v_f) /* v >>= 1, v is unsigned */ \
do { \
(v_f) = ((u_int32)(v_f) >> 1) | ((u_int32)(v_i) << 31); \
(v_i) = ((u_int32)(v_i) >> 1); \
} while (FALSE)
} while (false)
#define M_RSHIFT(v_i, v_f) /* v >>= 1, v is signed */ \
do { \
(v_f) = ((u_int32)(v_f) >> 1) | ((u_int32)(v_i) << 31); \
(v_i) = ((u_int32)(v_i) >> 1) | ((u_int32)(v_i) & 0x80000000); \
} while (FALSE)
} while (false)
#define M_LSHIFT(v_i, v_f) /* v <<= 1 */ \
do { \
(v_i) = ((u_int32)(v_i) << 1) | ((u_int32)(v_f) >> 31); \
(v_f) = ((u_int32)(v_f) << 1); \
} while (FALSE)
} while (false)
#define M_LSHIFT3(v_o, v_i, v_f) /* v <<= 1, with overflow */ \
do { \
(v_o) = ((u_int32)(v_o) << 1) | ((u_int32)(v_i) >> 31); \
(v_i) = ((u_int32)(v_i) << 1) | ((u_int32)(v_f) >> 31); \
(v_f) = ((u_int32)(v_f) << 1); \
} while (FALSE)
} while (false)
#define M_ADDUF(r_i, r_f, uf) /* r += uf, uf is u_int32 fraction */ \
M_ADD((r_i), (r_f), 0, (uf)) /* let optimizer worry about it */
......@@ -291,7 +291,7 @@ typedef u_int32 u_fp;
} \
(r_uf) = (u_int32)q_tmp; \
(r_ui) = (u_int32)(q_tmp >> 32); \
} while (FALSE)
} while (false)
#define M_LFPTOD(r_ui, r_uf, d) /* l_fp to double */ \
do { \
......@@ -309,7 +309,7 @@ typedef u_int32 u_fp;
d_tmp = -d_tmp; \
} \
(d) = d_tmp; \
} while (FALSE)
} while (false)
#else /* use only 32 bit unsigned values */
......@@ -347,13 +347,13 @@ typedef u_int32 u_fp;
extern char * dofptoa (u_fp, int, short, int);
extern char * dolfptoa (u_int32, u_int32, int, short, int);
extern int atolfp (const char *, l_fp *);
extern bool atolfp (const char *, l_fp *);
extern int buftvtots (const char *, l_fp *);
extern char * fptoa (s_fp, short);
extern char * fptoms (s_fp, short);
extern int hextolfp (const char *, l_fp *);
extern bool hextolfp (const char *, l_fp *);
extern void gpstolfp (int, int, unsigned long, l_fp *);
extern int mstolfp (const char *, l_fp *);
extern bool mstolfp (const char *, l_fp *);
extern char * prettydate (l_fp *);
extern char * gmprettydate (l_fp *);
extern char * uglydate (l_fp *);
......@@ -411,13 +411,13 @@ extern CRITICAL_SECTION get_systime_cs;
init_win_precise_time()
#else /* !SYS_WINNT follows */
# define INIT_GET_SYSTIME_CRITSEC() \
do {} while (FALSE)
do {} while (false)
# define ENTER_GET_SYSTIME_CRITSEC() \
do {} while (FALSE)
do {} while (false)
# define LEAVE_GET_SYSTIME_CRITSEC() \
do {} while (FALSE)
do {} while (false)
# define INIT_WIN_PRECISE_TIME() \
do {} while (FALSE)
do {} while (false)
#endif
#endif /* NTP_FP_H */
......@@ -106,7 +106,7 @@
#ifndef NTP_LISTS_H
#define NTP_LISTS_H
#include "ntp_types.h" /* TRUE and FALSE */
#include "ntp_types.h" /* true and false */
#include "ntp_assert.h"
#ifdef DEBUG
......@@ -120,7 +120,7 @@
* list.
*/
#ifndef NTP_DEBUG_LISTS_H
#define MAYBE_Z_LISTS(p) do { } while (FALSE)
#define MAYBE_Z_LISTS(p) do { } while (false)
#else
#define MAYBE_Z_LISTS(p) (p) = NULL
#endif
......@@ -129,7 +129,7 @@
do { \
(pentry)->nextlink = (listhead); \
(listhead) = (pentry); \
} while (FALSE)
} while (false)
#define LINK_TAIL_SLIST(listhead, pentry, nextlink, entrytype) \
do { \
......@@ -141,7 +141,7 @@ do { \
\
(pentry)->nextlink = NULL; \
*pptail = (pentry); \
} while (FALSE)
} while (false)
#define LINK_SORT_SLIST_CURRENT() (*ppentry)
#define L_S_S_CUR() LINK_SORT_SLIST_CURRENT()
......@@ -152,7 +152,7 @@ do { \
entrytype **ppentry; \
\
ppentry = &(listhead); \
while (TRUE) { \
while (true) { \
if (NULL == *ppentry || (beforecur)) { \
(pentry)->nextlink = *ppentry; \
*ppentry = (pentry); \
......@@ -165,7 +165,7 @@ do { \
break; \
} \
} \
} while (FALSE)
} while (false)
#define UNLINK_HEAD_SLIST(punlinked, listhead, nextlink) \
do { \
......@@ -174,7 +174,7 @@ do { \
(listhead) = (punlinked)->nextlink; \
MAYBE_Z_LISTS((punlinked)->nextlink); \
} \
} while (FALSE)
} while (false)
#define UNLINK_EXPR_SLIST_CURRENT() (*ppentry)
#define U_E_S_CUR() UNLINK_EXPR_SLIST_CURRENT()
......@@ -202,7 +202,7 @@ do { \
} else { \
(punlinked) = NULL; \
} \
} while (FALSE)
} while (false)
#define UNLINK_SLIST(punlinked, listhead, ptounlink, nextlink, \
entrytype) \
......@@ -219,7 +219,7 @@ do { \
NTP_INSIST(pentry != pentry->nextlink); \
NTP_INSIST((listhead) != pentry->nextlink); \
} \
} while (FALSE)
} while (false)
/*
* FIFO
......@@ -241,7 +241,7 @@ struct { \
* are NULL with each operation.
*/
#if !defined(NTP_DEBUG_LISTS_H)
#define CHECK_FIFO_CONSISTENCY(anchor) do { } while (FALSE)
#define CHECK_FIFO_CONSISTENCY(anchor) do { } while (false)
#else
#define CHECK_FIFO_CONSISTENCY(anchor) \
check_gen_fifo_consistency(&(anchor))
......@@ -276,7 +276,7 @@ do { \
} \
\
CHECK_FIFO_CONSISTENCY(anchor); \
} while (FALSE)
} while (false)
#define UNLINK_FIFO(punlinked, anchor, nextlink) \
do { \
......@@ -293,7 +293,7 @@ do { \
MAYBE_Z_LISTS((punlinked)->nextlink); \
CHECK_FIFO_CONSISTENCY(anchor); \
} \
} while (FALSE)
} while (false)
#define UNLINK_MID_FIFO(punlinked, anchor, tounlink, nextlink, \
entrytype) \
......@@ -325,7 +325,7 @@ do { \
} else { \
(punlinked) = NULL; \
} \
} while (FALSE)
} while (false)
#define CONCAT_FIFO(f1, f2, nextlink) \
do { \
......@@ -347,7 +347,7 @@ do { \
MAYBE_Z_LISTS((f2).phead); \
MAYBE_Z_LISTS((f2).pptail); \
} \
} while (FALSE)
} while (false)
/*
* DLIST
......@@ -362,7 +362,7 @@ struct { \
do { \
(listhead).link.f = &(listhead); \
(listhead).link.b = &(listhead); \
} while (FALSE)
} while (false)
#define HEAD_DLIST(listhead, link) \
( \
......@@ -398,7 +398,7 @@ do { \
(pentry)->link.b = &(listhead); \
(listhead).link.f->link.b = (pentry); \
(listhead).link.f = (pentry); \
} while (FALSE)
} while (false)
#define LINK_TAIL_DLIST(listhead, pentry, link) \
do { \
......@@ -406,7 +406,7 @@ do { \
(pentry)->link.f = &(listhead); \
(listhead).link.b->link.f = (pentry); \
(listhead).link.b = (pentry); \
} while (FALSE)
} while (false)
#define UNLINK_DLIST(ptounlink, link) \
do { \
......@@ -414,7 +414,7 @@ do { \
(ptounlink)->link.f->link.b = (ptounlink)->link.b; \
MAYBE_Z_LISTS((ptounlink)->link.b); \
MAYBE_Z_LISTS((ptounlink)->link.f); \
} while (FALSE)
} while (false)
#define ITER_DLIST_BEGIN(listhead, iter, link, entrytype) \
{ \
......@@ -422,7 +422,7 @@ do { \
\
for ((iter) = (listhead).link.f; \
(iter) != &(listhead) \
&& ((i_dl_nextiter = (iter)->link.f), TRUE); \
&& ((i_dl_nextiter = (iter)->link.f), true); \
(iter) = i_dl_nextiter) {
#define ITER_DLIST_END() \
} \
......@@ -434,7 +434,7 @@ do { \
\
for ((iter) = (listhead).link.b; \
(iter) != &(listhead) \
&& ((i_dl_nextiter = (iter)->link.b), TRUE); \
&& ((i_dl_nextiter = (iter)->link.b), true); \
(iter) = i_dl_nextiter) {
#define REV_ITER_DLIST_END() \
} \
......
......@@ -102,7 +102,7 @@ struct refclockio {
int datalen; /* length of data */
int fd; /* file descriptor */
u_long recvcount; /* count of receive completions */
int active; /* nonzero when in use */
bool active; /* true when in use */
#ifdef HAVE_IO_COMPLETION_PORT
void * device_context; /* device-related data for i/o subsystem */
......@@ -204,7 +204,7 @@ struct refclockproc {
#define NOFLAGS 0 /* flag for null flags */
struct refclock {
int (*clock_start) (int, struct peer *);
bool (*clock_start) (int, struct peer *);
void (*clock_shutdown) (int, struct peer *);
void (*clock_poll) (int, struct peer *);
void (*clock_control) (int, const struct refclockstat *,
......@@ -217,7 +217,7 @@ struct refclock {
/*
* Function prototypes
*/
extern int io_addclock (struct refclockio *);
extern bool io_addclock (struct refclockio *);
extern void io_closeclock (struct refclockio *);
#ifdef REFCLOCK
......@@ -227,17 +227,17 @@ extern void refclock_control(sockaddr_u *,
const struct refclockstat *,
struct refclockstat *);
extern int refclock_open (char *, u_int, u_int);
extern int refclock_setup (int, u_int, u_int);
extern bool refclock_setup (int, u_int, u_int);
extern void refclock_timer (struct peer *);
extern void refclock_transmit(struct peer *);
extern int refclock_process(struct refclockproc *);
extern int refclock_process_f(struct refclockproc *, double);
extern bool refclock_process(struct refclockproc *);
extern bool refclock_process_f(struct refclockproc *, double);
extern void refclock_process_offset(struct refclockproc *, l_fp,
l_fp, double);
extern void refclock_report (struct peer *, int);
extern int refclock_gtlin (struct recvbuf *, char *, int, l_fp *);
extern int refclock_gtraw (struct recvbuf *, char *, int, l_fp *);
extern int indicate_refclock_packet(struct refclockio *,
extern bool indicate_refclock_packet(struct refclockio *,
struct recvbuf *);
extern void process_refclock_packet(struct recvbuf *);
#endif /* REFCLOCK */
......
......@@ -66,9 +66,9 @@ extern int authdecrypt (keyid_t, u_int32 *, int, int);
extern int authencrypt (keyid_t, u_int32 *, int);
extern int authhavekey (keyid_t);
extern int authistrusted (keyid_t);
extern int authreadkeys (const char *);
extern bool authreadkeys (const char *);
extern void authtrust (keyid_t, u_long);
extern int authusekey (keyid_t, int, const u_char *);
extern bool authusekey (keyid_t, int, const u_char *);
/*
* Based on the NTP timestamp, calculate the NTP timestamp of
......@@ -101,32 +101,32 @@ extern u_int32 addr2refid (sockaddr_u *);
#ifndef EREALLOC_CALLSITE /* ntp_malloc.h defines */
extern void * ereallocz (void *, size_t, size_t, int);
#define erealloczsite(p, n, o, z, f, l) ereallocz(p, n, o, (z))
#define emalloc(n) ereallocz(NULL, n, 0, FALSE)
#define emalloc_zero(c) ereallocz(NULL, (c), 0, TRUE)
#define erealloc(p, c) ereallocz(p, (c), 0, FALSE)
#define erealloc_zero(p, n, o) ereallocz(p, n, (o), TRUE)
#define emalloc(n) ereallocz(NULL, n, 0, false)
#define emalloc_zero(c) ereallocz(NULL, (c), 0, true)
#define erealloc(p, c) ereallocz(p, (c), 0, false)
#define erealloc_zero(p, n, o) ereallocz(p, n, (o), true)
extern char * estrdup_impl (const char *);
#define estrdup(s) estrdup_impl(s)
#else
extern void * ereallocz (void *, size_t, size_t, int,
const char *, int);
#define erealloczsite ereallocz
#define emalloc(c) ereallocz(NULL, (c), 0, FALSE, \
#define emalloc(c) ereallocz(NULL, (c), 0, false, \
__FILE__, __LINE__)
#define emalloc_zero(c) ereallocz(NULL, (c), 0, TRUE, \
#define emalloc_zero(c) ereallocz(NULL, (c), 0, true, \
__FILE__, __LINE__)
#define erealloc(p, c) ereallocz(p, (c), 0, FALSE, \
#define erealloc(p, c) ereallocz(p, (c), 0, false, \
__FILE__, __LINE__)
#define erealloc_zero(p, n, o) ereallocz(p, n, (o), TRUE, \
#define erealloc_zero(p, n, o) ereallocz(p, n, (o), true, \
__FILE__, __LINE__)
extern char * estrdup_impl (const char *, const char *, int);
#define estrdup(s) estrdup_impl((s), __FILE__, __LINE__)
#endif
extern int atoint (const char *, long *);
extern int atouint (const char *, u_long *);
extern int hextoint (const char *, u_long *);
extern bool atoint (const char *, long *);
extern bool atouint (const char *, u_long *);
extern bool hextoint (const char *, u_long *);
extern const char * humanlogtime (void);
extern const char * humantime (time_t);
extern char * mfptoa (u_int32, u_int32, short);
......@@ -148,12 +148,12 @@ extern const char * sockporttoa(const sockaddr_u *);
extern u_short sock_hash (const sockaddr_u *);
extern int sockaddr_masktoprefixlen(const sockaddr_u *);
extern const char * socktohost (const sockaddr_u *);
extern int octtoint (const char *, u_long *);
extern bool octtoint (const char *, u_long *);
extern u_long ranp2 (int);
extern const char *refnumtoa (sockaddr_u *);
extern const char *refid_str (u_int32, int);
extern int decodenetnum (const char *, sockaddr_u *);
extern bool decodenetnum (const char *, sockaddr_u *);
extern const char * FindConfig (const char *);
......@@ -204,7 +204,7 @@ extern pset_tod_using set_tod_using;
#ifdef OPENSSL
extern void ssl_init (void);
extern void ssl_check_version (void);
extern int ssl_init_done;
extern bool ssl_init_done;
#define INIT_SSL() \
do { \
if (!ssl_init_done) \
......@@ -257,9 +257,14 @@ extern char * ntp_strerror (int e);
extern double sys_tick; /* tick size or time to read */
extern double measured_tick; /* non-overridable sys_tick */
extern double sys_fuzz; /* min clock read latency */
extern int trunc_os_clock; /* sys_tick > measured_tick */
extern bool trunc_os_clock; /* sys_tick > measured_tick */
/* version.c */
extern const char *Version; /* version declaration */
/* use these as return values for sort-comparison functions */
#define COMPARE_GREATERTHAN 1
#define COMPARE_EQUAL 0
#define COMPARE_LESSTHAN -1
#endif /* NTP_STDLIB_H */
......@@ -16,11 +16,11 @@ extern void msyslog();
#endif /* VMS */
#include <stdio.h>
extern int syslogit;
extern int msyslog_term; /* duplicate to stdout/err */
extern int msyslog_term_pid;
extern int msyslog_include_timestamp;
extern FILE * syslog_file; /* if syslogit is FALSE, log to
extern bool syslogit;
extern bool msyslog_term; /* duplicate to stdout/err */
extern bool msyslog_term_pid;
extern bool msyslog_include_timestamp;
extern FILE * syslog_file; /* if syslogit is false, log to
this file and not syslog */
extern char * syslog_fname;
extern char * syslog_abs_fname;
......@@ -80,6 +80,6 @@ extern u_int32 ntp_syslogmask;
do { \
NLOG(NLOG_##nlog_suffix) /* like "if (...) */ \
msyslog msl_args; \
} while (FALSE)
} while (false)
#endif /* NTP_SYSLOG_H */
......@@ -18,12 +18,12 @@
#include <limits.h>
#include "ntp_machine.h"
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#else
typedef int bool;
#define true 1
#define false 0
#endif
/*
......
......@@ -57,14 +57,14 @@ typedef HANDLE sem_ref;
*/
#ifdef WORK_FORK
typedef struct blocking_child_tag {
int reusable;
bool reusable;
int pid;
int req_write_pipe; /* parent */
int resp_read_pipe;
void * resp_read_ctx;
int req_read_pipe; /* child */
int resp_write_pipe;
int ispipe;
bool ispipe;
} blocking_child;
#elif defined(WORK_THREAD)
typedef struct blocking_child_tag {
......@@ -132,7 +132,7 @@ extern void worker_idle_timer_fired(void);
extern void interrupt_worker_sleep(void);
extern int req_child_exit(blocking_child *);
#ifndef HAVE_IO_COMPLETION_PORT
extern int pipe_socketpair(int fds[2], int *is_pipe);
extern int pipe_socketpair(int fds[2], bool *is_pipe);
extern void close_all_beyond(int);
extern void close_all_except(int);
extern void kill_asyncio (int);
......
......@@ -60,9 +60,9 @@ extern char * saveconfigdir; /* ntpq saveconfig output directory */
extern void getconfig (int, char **);
extern void ctl_clr_stats (void);
extern int ctlclrtrap (sockaddr_u *, struct interface *, int);
extern bool ctlclrtrap (sockaddr_u *, struct interface *, int);
extern u_short ctlpeerstatus (struct peer *);
extern int ctlsettrap (sockaddr_u *, struct interface *, int, int);
extern bool ctlsettrap (sockaddr_u *, struct interface *, int, int);
extern u_short ctlsysstatus (void);
extern void init_control (void);
extern void process_control (struct recvbuf *, int);
......@@ -241,7 +241,7 @@ extern void proto_clr_stats (void);
/* ntp_refclock.c */
#ifdef REFCLOCK
extern int refclock_newpeer (struct peer *);
extern bool refclock_newpeer (struct peer *);
extern void refclock_unpeer (struct peer *);
extern void refclock_receive (struct peer *);
extern void refclock_transmit (struct peer *);
......@@ -397,15 +397,15 @@ extern int pll_status; /* status bits for kernel pll */
/*
* Clock state machine control flags
*/
extern int ntp_enable; /* clock discipline enabled */
extern int pll_control; /* kernel support available */
extern int kern_enable; /* kernel support enabled */
extern int hardpps_enable; /* kernel PPS discipline enabled */
extern int ext_enable; /* external clock enabled */
extern int cal_enable; /* refclock calibrate enable */
extern int allow_panic; /* allow panic correction (-g) */
extern int force_step_once; /* always step time once at startup (-G) */
extern int mode_ntpdate; /* exit on first clock set (-q) */
extern bool ntp_enable; /* clock discipline enabled */
extern bool pll_control; /* kernel support available */
extern bool kern_enable; /* kernel support enabled */
extern bool hardpps_enable; /* kernel PPS discipline enabled */
extern bool ext_enable; /* external clock enabled */
extern bool cal_enable; /* refclock calibrate enable */
extern bool allow_panic; /* allow panic correction (-g) */
extern bool force_step_once; /* always step time once at startup (-G) */
extern bool mode_ntpdate; /* exit on first clock set (-q) */
extern int peer_ntpdate; /* count of ntpdate peers */
/*
......@@ -476,7 +476,7 @@ extern struct peer *sys_peer; /* current peer */
*/
extern int sys_bclient; /* we set our time to broadcasts */
extern double sys_bdelay; /* broadcast client default delay */
extern int sys_authenticate; /* requre authentication for config */
extern bool sys_authenticate; /* requre authentication for config */
extern l_fp sys_authdelay; /* authentication delay */
extern u_long sys_epoch; /* last clock update time */
extern keyid_t sys_private; /* private value for session seed */
......@@ -524,7 +524,7 @@ extern void send_via_ntp_signd(struct recvbuf *, int, keyid_t, int,
#endif
/* ntp_timer.c */
extern volatile int alarm_flag; /* alarm flag */
extern volatile bool alarm_flag; /* alarm flag */
extern volatile u_long alarm_overflow;
extern u_long current_time; /* seconds since startup */
extern u_long timer_timereset;
......@@ -536,17 +536,17 @@ HANDLE WaitableTimerHandle;
/* ntp_util.c */
extern char statsdir[MAXFILENAME];
extern int stats_control; /* write stats to fileset? */
extern bool stats_control; /* write stats to fileset? */
extern int stats_write_period; /* # of seconds between writes. */
extern double stats_write_tolerance;
extern double wander_threshold;
/* ntpd.c */
extern int nofork; /* no-fork flag */
extern int initializing; /* initializing flag */
extern bool nofork; /* no-fork flag */
extern bool initializing; /* initializing flag */