Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / sntp / header.h
blobb7b2aee4d933b184beb0abbc63206f8fc34ad6c4
1 /* $NetBSD: header.h,v 1.2 2003/12/04 16:23:38 drochner Exp $ */
3 /* Copyright (C) 1996 N.M. Maclaren
4 Copyright (C) 1996 The University of Cambridge
6 This includes all of the 'safe' headers and definitions used across modules.
7 No changes should be needed for any system that is even remotely like Unix. */
11 #include <ctype.h>
12 #include <errno.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 #include <time.h>
20 #define VERSION "1.6" /* Just the version string */
21 #define MAX_SOCKETS 10 /* Maximum number of addresses */
23 #ifndef LOCKNAME
24 # define LOCKNAME "/etc/sntp.pid" /* Stores the pid */
25 #endif
26 #ifndef SAVENAME
27 # define SAVENAME "/etc/sntp.state" /* Stores the recovery state */
28 #endif
32 /* Defined in main.c */
34 #define op_client 1 /* Behave as a challenge client */
35 #define op_listen 2 /* Behave as a listening client */
37 extern const char *argv0;
39 extern int verbose, operation;
41 extern const char *lockname;
43 extern void fatal (int syserr, const char *message, const char *insert);
47 /* Defined in unix.c */
49 extern void do_nothing (int seconds);
51 extern int ftty (FILE *file);
53 extern void set_lock (int lock);
55 extern void log_message (const char *message);
59 /* Defined in internet.c */
61 /* extern void find_address (struct in_addr *address, int *port, char *hostname,
62 int timespan); */
64 #define PREF_FAM_INET 1
65 #define PREF_FAM_INET6 2
66 extern void preferred_family(int);
69 /* Defined in socket.c */
71 extern void open_socket (int which, char *hostnames, int timespan);
73 extern void write_socket (int which, void *packet, int length);
75 extern int read_socket (int which, void *packet, int length, int waiting);
77 extern int flush_socket (int which);
79 extern void close_socket (int which);
83 /* Defined in timing.c */
85 extern double current_time (double offset);
87 extern time_t convert_time (double value, int *millisecs);
89 extern void adjust_time (double difference, int immediate, double ignore);