1285612Sdelphij/*
2181834Sroberto *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.h)
3285612Sdelphij *
4330567Sgordon *  It has been AutoGen-ed  February 27, 2018 at 05:13:17 PM by AutoGen 5.18.5
5181834Sroberto *  From the definitions    ntpd-opts.def
6181834Sroberto *  and the template file   options
7181834Sroberto *
8285612Sdelphij * Generated from AutoOpts 41:0:16 templates.
9181834Sroberto *
10285612Sdelphij *  AutoOpts is a copyrighted work.  This header file is not encumbered
11285612Sdelphij *  by AutoOpts licensing, but is provided under the licensing terms chosen
12285612Sdelphij *  by the ntpd author or copyright holder.  AutoOpts is
13285612Sdelphij *  licensed under the terms of the LGPL.  The redistributable library
14285612Sdelphij *  (``libopts'') is licensed under the terms of either the LGPL or, at the
15285612Sdelphij *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
16285612Sdelphij *  for details.
17181834Sroberto *
18285612Sdelphij * The ntpd program is copyrighted and licensed
19285612Sdelphij * under the following terms:
20181834Sroberto *
21316722Sdelphij *  Copyright (C) 1992-2017 The University of Delaware and Network Time Foundation, all rights reserved.
22285612Sdelphij *  This is free software. It is licensed for use, modification and
23285612Sdelphij *  redistribution under the terms of the NTP License, copies of which
24285612Sdelphij *  can be seen at:
25285612Sdelphij *    <http://ntp.org/license>
26285612Sdelphij *    <http://opensource.org/licenses/ntp-license.php>
27285612Sdelphij *
28285612Sdelphij *  Permission to use, copy, modify, and distribute this software and its
29285612Sdelphij *  documentation for any purpose with or without fee is hereby granted,
30285612Sdelphij *  provided that the above copyright notice appears in all copies and that
31285612Sdelphij *  both the copyright notice and this permission notice appear in
32285612Sdelphij *  supporting documentation, and that the name The University of Delaware not be used in
33285612Sdelphij *  advertising or publicity pertaining to distribution of the software
34285612Sdelphij *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
35285612Sdelphij *  representations about the suitability this software for any purpose. It
36285612Sdelphij *  is provided "as is" without express or implied warranty.
37181834Sroberto */
38285612Sdelphij/**
39181834Sroberto *  This file contains the programmatic interface to the Automated
40181834Sroberto *  Options generated for the ntpd program.
41181834Sroberto *  These macros are documented in the AutoGen info file in the
42181834Sroberto *  "AutoOpts" chapter.  Please refer to that doc for usage help.
43181834Sroberto */
44181834Sroberto#ifndef AUTOOPTS_NTPD_OPTS_H_GUARD
45285612Sdelphij#define AUTOOPTS_NTPD_OPTS_H_GUARD 1
46181834Sroberto#include "config.h"
47181834Sroberto#include <autoopts/options.h>
48181834Sroberto
49285612Sdelphij/**
50181834Sroberto *  Ensure that the library used for compiling this generated header is at
51181834Sroberto *  least as new as the version current when the header template was released
52181834Sroberto *  (not counting patch version increments).  Also ensure that the oldest
53181834Sroberto *  tolerable version is at least as old as what was current when the header
54181834Sroberto *  template was released.
55181834Sroberto */
56285612Sdelphij#define AO_TEMPLATE_VERSION 167936
57181834Sroberto#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
58181834Sroberto || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
59181834Sroberto# error option template version mismatches autoopts/options.h header
60181834Sroberto  Choke Me.
61181834Sroberto#endif
62181834Sroberto
63285612Sdelphij/**
64285612Sdelphij *  Enumeration of each option type for ntpd
65181834Sroberto */
66181834Srobertotypedef enum {
67285612Sdelphij    INDEX_OPT_IPV4              =  0,
68285612Sdelphij    INDEX_OPT_IPV6              =  1,
69285612Sdelphij    INDEX_OPT_AUTHREQ           =  2,
70285612Sdelphij    INDEX_OPT_AUTHNOREQ         =  3,
71285612Sdelphij    INDEX_OPT_BCASTSYNC         =  4,
72285612Sdelphij    INDEX_OPT_CONFIGFILE        =  5,
73285612Sdelphij    INDEX_OPT_DEBUG_LEVEL       =  6,
74285612Sdelphij    INDEX_OPT_SET_DEBUG_LEVEL   =  7,
75285612Sdelphij    INDEX_OPT_DRIFTFILE         =  8,
76285612Sdelphij    INDEX_OPT_PANICGATE         =  9,
77285612Sdelphij    INDEX_OPT_FORCE_STEP_ONCE   = 10,
78285612Sdelphij    INDEX_OPT_JAILDIR           = 11,
79285612Sdelphij    INDEX_OPT_INTERFACE         = 12,
80285612Sdelphij    INDEX_OPT_KEYFILE           = 13,
81285612Sdelphij    INDEX_OPT_LOGFILE           = 14,
82285612Sdelphij    INDEX_OPT_NOVIRTUALIPS      = 15,
83285612Sdelphij    INDEX_OPT_MODIFYMMTIMER     = 16,
84285612Sdelphij    INDEX_OPT_NOFORK            = 17,
85285612Sdelphij    INDEX_OPT_NICE              = 18,
86285612Sdelphij    INDEX_OPT_PIDFILE           = 19,
87285612Sdelphij    INDEX_OPT_PRIORITY          = 20,
88285612Sdelphij    INDEX_OPT_QUIT              = 21,
89285612Sdelphij    INDEX_OPT_PROPAGATIONDELAY  = 22,
90285612Sdelphij    INDEX_OPT_SAVECONFIGQUIT    = 23,
91285612Sdelphij    INDEX_OPT_STATSDIR          = 24,
92285612Sdelphij    INDEX_OPT_TRUSTEDKEY        = 25,
93285612Sdelphij    INDEX_OPT_USER              = 26,
94285612Sdelphij    INDEX_OPT_UPDATEINTERVAL    = 27,
95285612Sdelphij    INDEX_OPT_VAR               = 28,
96285612Sdelphij    INDEX_OPT_DVAR              = 29,
97285612Sdelphij    INDEX_OPT_WAIT_SYNC         = 30,
98285612Sdelphij    INDEX_OPT_SLEW              = 31,
99285612Sdelphij    INDEX_OPT_USEPCC            = 32,
100285612Sdelphij    INDEX_OPT_PCCFREQ           = 33,
101285612Sdelphij    INDEX_OPT_MDNS              = 34,
102285612Sdelphij    INDEX_OPT_VERSION           = 35,
103285612Sdelphij    INDEX_OPT_HELP              = 36,
104285612Sdelphij    INDEX_OPT_MORE_HELP         = 37
105181834Sroberto} teOptIndex;
106285612Sdelphij/** count of all options for ntpd */
107285612Sdelphij#define OPTION_CT    38
108285612Sdelphij/** ntpd version */
109330567Sgordon#define NTPD_VERSION       "4.2.8p11"
110285612Sdelphij/** Full ntpd version text */
111330567Sgordon#define NTPD_FULL_VERSION  "ntpd 4.2.8p11"
112181834Sroberto
113285612Sdelphij/**
114181834Sroberto *  Interface defines for all options.  Replace "n" with the UPPER_CASED
115181834Sroberto *  option name (as in the teOptIndex enumeration above).
116285612Sdelphij *  e.g. HAVE_OPT(IPV4)
117181834Sroberto */
118181834Sroberto#define         DESC(n) (ntpdOptions.pOptDesc[INDEX_OPT_## n])
119285612Sdelphij/** 'true' if an option has been specified in any way */
120181834Sroberto#define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
121285612Sdelphij/** The string argument to an option. The argument type must be \"string\". */
122181834Sroberto#define      OPT_ARG(n) (DESC(n).optArg.argString)
123285612Sdelphij/** Mask the option state revealing how an option was specified.
124285612Sdelphij *  It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
125285612Sdelphij * \a OPTST_DEFINED, \a OPTST_RESET or zero.
126285612Sdelphij */
127181834Sroberto#define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
128285612Sdelphij/** Count of option's occurrances *on the command line*. */
129181834Sroberto#define    COUNT_OPT(n) (DESC(n).optOccCt)
130285612Sdelphij/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
131181834Sroberto#define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
132285612Sdelphij/** 'true' if \a HAVE_OPT would yield 'false'. */
133181834Sroberto#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
134285612Sdelphij/** 'true' if OPTST_DISABLED bit not set. */
135181834Sroberto#define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
136285612Sdelphij/** number of stacked option arguments.
137285612Sdelphij *  Valid only for stacked option arguments. */
138181834Sroberto#define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
139285612Sdelphij/** stacked argument vector.
140285612Sdelphij *  Valid only for stacked option arguments. */
141181834Sroberto#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
142285612Sdelphij/** Reset an option. */
143181834Sroberto#define    CLEAR_OPT(n) STMTS( \
144181834Sroberto                DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
145285612Sdelphij                if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
146181834Sroberto                    DESC(n).fOptState |= OPTST_DISABLED; \
147181834Sroberto                DESC(n).optCookie = NULL )
148285612Sdelphij/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
149285612Sdelphij/**
150285612Sdelphij *  Enumeration of ntpd exit codes
151285612Sdelphij */
152285612Sdelphijtypedef enum {
153285612Sdelphij    NTPD_EXIT_SUCCESS         = 0,
154285612Sdelphij    NTPD_EXIT_FAILURE         = 1,
155285612Sdelphij    NTPD_EXIT_USAGE_ERROR     = 64,
156285612Sdelphij    NTPD_EXIT_LIBOPTS_FAILURE = 70
157285612Sdelphij}   ntpd_exit_code_t;
158285612Sdelphij/** @} */
159285612Sdelphij/**
160181834Sroberto *  Make sure there are no #define name conflicts with the option names
161181834Sroberto */
162181834Sroberto#ifndef     NO_OPTION_NAME_WARNINGS
163181834Sroberto# ifdef    IPV4
164181834Sroberto#  warning undefining IPV4 due to option name conflict
165181834Sroberto#  undef   IPV4
166181834Sroberto# endif
167181834Sroberto# ifdef    IPV6
168181834Sroberto#  warning undefining IPV6 due to option name conflict
169181834Sroberto#  undef   IPV6
170181834Sroberto# endif
171181834Sroberto# ifdef    AUTHREQ
172181834Sroberto#  warning undefining AUTHREQ due to option name conflict
173181834Sroberto#  undef   AUTHREQ
174181834Sroberto# endif
175181834Sroberto# ifdef    AUTHNOREQ
176181834Sroberto#  warning undefining AUTHNOREQ due to option name conflict
177181834Sroberto#  undef   AUTHNOREQ
178181834Sroberto# endif
179181834Sroberto# ifdef    BCASTSYNC
180181834Sroberto#  warning undefining BCASTSYNC due to option name conflict
181181834Sroberto#  undef   BCASTSYNC
182181834Sroberto# endif
183181834Sroberto# ifdef    CONFIGFILE
184181834Sroberto#  warning undefining CONFIGFILE due to option name conflict
185181834Sroberto#  undef   CONFIGFILE
186181834Sroberto# endif
187181834Sroberto# ifdef    DEBUG_LEVEL
188181834Sroberto#  warning undefining DEBUG_LEVEL due to option name conflict
189181834Sroberto#  undef   DEBUG_LEVEL
190181834Sroberto# endif
191181834Sroberto# ifdef    SET_DEBUG_LEVEL
192181834Sroberto#  warning undefining SET_DEBUG_LEVEL due to option name conflict
193181834Sroberto#  undef   SET_DEBUG_LEVEL
194181834Sroberto# endif
195181834Sroberto# ifdef    DRIFTFILE
196181834Sroberto#  warning undefining DRIFTFILE due to option name conflict
197181834Sroberto#  undef   DRIFTFILE
198181834Sroberto# endif
199181834Sroberto# ifdef    PANICGATE
200181834Sroberto#  warning undefining PANICGATE due to option name conflict
201181834Sroberto#  undef   PANICGATE
202181834Sroberto# endif
203285612Sdelphij# ifdef    FORCE_STEP_ONCE
204285612Sdelphij#  warning undefining FORCE_STEP_ONCE due to option name conflict
205285612Sdelphij#  undef   FORCE_STEP_ONCE
206285612Sdelphij# endif
207181834Sroberto# ifdef    JAILDIR
208181834Sroberto#  warning undefining JAILDIR due to option name conflict
209181834Sroberto#  undef   JAILDIR
210181834Sroberto# endif
211181834Sroberto# ifdef    INTERFACE
212181834Sroberto#  warning undefining INTERFACE due to option name conflict
213181834Sroberto#  undef   INTERFACE
214181834Sroberto# endif
215181834Sroberto# ifdef    KEYFILE
216181834Sroberto#  warning undefining KEYFILE due to option name conflict
217181834Sroberto#  undef   KEYFILE
218181834Sroberto# endif
219181834Sroberto# ifdef    LOGFILE
220181834Sroberto#  warning undefining LOGFILE due to option name conflict
221181834Sroberto#  undef   LOGFILE
222181834Sroberto# endif
223181834Sroberto# ifdef    NOVIRTUALIPS
224181834Sroberto#  warning undefining NOVIRTUALIPS due to option name conflict
225181834Sroberto#  undef   NOVIRTUALIPS
226181834Sroberto# endif
227181834Sroberto# ifdef    MODIFYMMTIMER
228181834Sroberto#  warning undefining MODIFYMMTIMER due to option name conflict
229181834Sroberto#  undef   MODIFYMMTIMER
230181834Sroberto# endif
231181834Sroberto# ifdef    NOFORK
232181834Sroberto#  warning undefining NOFORK due to option name conflict
233181834Sroberto#  undef   NOFORK
234181834Sroberto# endif
235181834Sroberto# ifdef    NICE
236181834Sroberto#  warning undefining NICE due to option name conflict
237181834Sroberto#  undef   NICE
238181834Sroberto# endif
239181834Sroberto# ifdef    PIDFILE
240181834Sroberto#  warning undefining PIDFILE due to option name conflict
241181834Sroberto#  undef   PIDFILE
242181834Sroberto# endif
243181834Sroberto# ifdef    PRIORITY
244181834Sroberto#  warning undefining PRIORITY due to option name conflict
245181834Sroberto#  undef   PRIORITY
246181834Sroberto# endif
247181834Sroberto# ifdef    QUIT
248181834Sroberto#  warning undefining QUIT due to option name conflict
249181834Sroberto#  undef   QUIT
250181834Sroberto# endif
251181834Sroberto# ifdef    PROPAGATIONDELAY
252181834Sroberto#  warning undefining PROPAGATIONDELAY due to option name conflict
253181834Sroberto#  undef   PROPAGATIONDELAY
254181834Sroberto# endif
255285612Sdelphij# ifdef    SAVECONFIGQUIT
256285612Sdelphij#  warning undefining SAVECONFIGQUIT due to option name conflict
257285612Sdelphij#  undef   SAVECONFIGQUIT
258181834Sroberto# endif
259181834Sroberto# ifdef    STATSDIR
260181834Sroberto#  warning undefining STATSDIR due to option name conflict
261181834Sroberto#  undef   STATSDIR
262181834Sroberto# endif
263181834Sroberto# ifdef    TRUSTEDKEY
264181834Sroberto#  warning undefining TRUSTEDKEY due to option name conflict
265181834Sroberto#  undef   TRUSTEDKEY
266181834Sroberto# endif
267181834Sroberto# ifdef    USER
268181834Sroberto#  warning undefining USER due to option name conflict
269181834Sroberto#  undef   USER
270181834Sroberto# endif
271285612Sdelphij# ifdef    UPDATEINTERVAL
272285612Sdelphij#  warning undefining UPDATEINTERVAL due to option name conflict
273285612Sdelphij#  undef   UPDATEINTERVAL
274285612Sdelphij# endif
275181834Sroberto# ifdef    VAR
276181834Sroberto#  warning undefining VAR due to option name conflict
277181834Sroberto#  undef   VAR
278181834Sroberto# endif
279181834Sroberto# ifdef    DVAR
280181834Sroberto#  warning undefining DVAR due to option name conflict
281181834Sroberto#  undef   DVAR
282181834Sroberto# endif
283285612Sdelphij# ifdef    WAIT_SYNC
284285612Sdelphij#  warning undefining WAIT_SYNC due to option name conflict
285285612Sdelphij#  undef   WAIT_SYNC
286285612Sdelphij# endif
287181834Sroberto# ifdef    SLEW
288181834Sroberto#  warning undefining SLEW due to option name conflict
289181834Sroberto#  undef   SLEW
290181834Sroberto# endif
291285612Sdelphij# ifdef    USEPCC
292285612Sdelphij#  warning undefining USEPCC due to option name conflict
293285612Sdelphij#  undef   USEPCC
294285612Sdelphij# endif
295285612Sdelphij# ifdef    PCCFREQ
296285612Sdelphij#  warning undefining PCCFREQ due to option name conflict
297285612Sdelphij#  undef   PCCFREQ
298285612Sdelphij# endif
299285612Sdelphij# ifdef    MDNS
300285612Sdelphij#  warning undefining MDNS due to option name conflict
301285612Sdelphij#  undef   MDNS
302285612Sdelphij# endif
303181834Sroberto#else  /* NO_OPTION_NAME_WARNINGS */
304181834Sroberto# undef IPV4
305181834Sroberto# undef IPV6
306181834Sroberto# undef AUTHREQ
307181834Sroberto# undef AUTHNOREQ
308181834Sroberto# undef BCASTSYNC
309181834Sroberto# undef CONFIGFILE
310181834Sroberto# undef DEBUG_LEVEL
311181834Sroberto# undef SET_DEBUG_LEVEL
312181834Sroberto# undef DRIFTFILE
313181834Sroberto# undef PANICGATE
314285612Sdelphij# undef FORCE_STEP_ONCE
315181834Sroberto# undef JAILDIR
316181834Sroberto# undef INTERFACE
317181834Sroberto# undef KEYFILE
318181834Sroberto# undef LOGFILE
319181834Sroberto# undef NOVIRTUALIPS
320181834Sroberto# undef MODIFYMMTIMER
321181834Sroberto# undef NOFORK
322181834Sroberto# undef NICE
323181834Sroberto# undef PIDFILE
324181834Sroberto# undef PRIORITY
325181834Sroberto# undef QUIT
326181834Sroberto# undef PROPAGATIONDELAY
327285612Sdelphij# undef SAVECONFIGQUIT
328181834Sroberto# undef STATSDIR
329181834Sroberto# undef TRUSTEDKEY
330181834Sroberto# undef USER
331285612Sdelphij# undef UPDATEINTERVAL
332181834Sroberto# undef VAR
333181834Sroberto# undef DVAR
334285612Sdelphij# undef WAIT_SYNC
335181834Sroberto# undef SLEW
336285612Sdelphij# undef USEPCC
337285612Sdelphij# undef PCCFREQ
338285612Sdelphij# undef MDNS
339181834Sroberto#endif  /*  NO_OPTION_NAME_WARNINGS */
340181834Sroberto
341285612Sdelphij/**
342181834Sroberto *  Interface defines for specific options.
343285612Sdelphij * @{
344181834Sroberto */
345181834Sroberto#define VALUE_OPT_IPV4           '4'
346181834Sroberto#define VALUE_OPT_IPV6           '6'
347181834Sroberto#define VALUE_OPT_AUTHREQ        'a'
348181834Sroberto#define VALUE_OPT_AUTHNOREQ      'A'
349181834Sroberto#define VALUE_OPT_BCASTSYNC      'b'
350181834Sroberto#define VALUE_OPT_CONFIGFILE     'c'
351181834Sroberto#define VALUE_OPT_DEBUG_LEVEL    'd'
352181834Sroberto#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
353285612Sdelphij
354285612Sdelphij#define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
355181834Sroberto#define VALUE_OPT_DRIFTFILE      'f'
356181834Sroberto#define VALUE_OPT_PANICGATE      'g'
357285612Sdelphij#define VALUE_OPT_FORCE_STEP_ONCE 'G'
358181834Sroberto#define VALUE_OPT_JAILDIR        'i'
359181834Sroberto#define VALUE_OPT_INTERFACE      'I'
360181834Sroberto#define VALUE_OPT_KEYFILE        'k'
361181834Sroberto#define VALUE_OPT_LOGFILE        'l'
362181834Sroberto#define VALUE_OPT_NOVIRTUALIPS   'L'
363181834Sroberto#define VALUE_OPT_MODIFYMMTIMER  'M'
364181834Sroberto#define VALUE_OPT_NOFORK         'n'
365181834Sroberto#define VALUE_OPT_NICE           'N'
366181834Sroberto#define VALUE_OPT_PIDFILE        'p'
367181834Sroberto#define VALUE_OPT_PRIORITY       'P'
368285612Sdelphij
369181834Sroberto#define OPT_VALUE_PRIORITY       (DESC(PRIORITY).optArg.argInt)
370181834Sroberto#define VALUE_OPT_QUIT           'q'
371181834Sroberto#define VALUE_OPT_PROPAGATIONDELAY 'r'
372285612Sdelphij#define VALUE_OPT_SAVECONFIGQUIT 0x1001
373181834Sroberto#define VALUE_OPT_STATSDIR       's'
374181834Sroberto#define VALUE_OPT_TRUSTEDKEY     't'
375181834Sroberto#define VALUE_OPT_USER           'u'
376285612Sdelphij#define VALUE_OPT_UPDATEINTERVAL 'U'
377285612Sdelphij
378285612Sdelphij#define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
379285612Sdelphij#define VALUE_OPT_VAR            0x1002
380285612Sdelphij#define VALUE_OPT_DVAR           0x1003
381285612Sdelphij#define VALUE_OPT_WAIT_SYNC      'w'
382285612Sdelphij#ifdef HAVE_WORKING_FORK
383285612Sdelphij#define OPT_VALUE_WAIT_SYNC      (DESC(WAIT_SYNC).optArg.argInt)
384285612Sdelphij#endif /* HAVE_WORKING_FORK */
385181834Sroberto#define VALUE_OPT_SLEW           'x'
386285612Sdelphij#define VALUE_OPT_USEPCC         0x1004
387285612Sdelphij#define VALUE_OPT_PCCFREQ        0x1005
388285612Sdelphij#define VALUE_OPT_MDNS           'm'
389285612Sdelphij/** option flag (value) for help-value option */
390181834Sroberto#define VALUE_OPT_HELP          '?'
391285612Sdelphij/** option flag (value) for more-help-value option */
392181834Sroberto#define VALUE_OPT_MORE_HELP     '!'
393285612Sdelphij/** option flag (value) for version-value option */
394285612Sdelphij#define VALUE_OPT_VERSION       0x1006
395181834Sroberto/*
396181834Sroberto *  Interface defines not associated with particular options
397181834Sroberto */
398285612Sdelphij#define ERRSKIP_OPTERR  STMTS(ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP)
399285612Sdelphij#define ERRSTOP_OPTERR  STMTS(ntpdOptions.fOptSet |= OPTPROC_ERRSTOP)
400181834Sroberto#define RESTART_OPT(n)  STMTS( \
401181834Sroberto                ntpdOptions.curOptIdx = (n); \
402181834Sroberto                ntpdOptions.pzCurOpt  = NULL )
403181834Sroberto#define START_OPT       RESTART_OPT(1)
404285612Sdelphij#define USAGE(c)        (*ntpdOptions.pUsageProc)(&ntpdOptions, c)
405181834Sroberto
406285612Sdelphij#ifdef  __cplusplus
407285612Sdelphijextern "C" {
408285612Sdelphij#endif
409285612Sdelphij
410285612Sdelphij
411181834Sroberto/* * * * * *
412181834Sroberto *
413181834Sroberto *  Declare the ntpd option descriptor.
414181834Sroberto */
415285612Sdelphijextern tOptions ntpdOptions;
416181834Sroberto
417285612Sdelphij#if defined(ENABLE_NLS)
418285612Sdelphij# ifndef _
419285612Sdelphij#   include <stdio.h>
420285612Sdelphij#   ifndef HAVE_GETTEXT
421285612Sdelphij      extern char * gettext(char const *);
422285612Sdelphij#   else
423285612Sdelphij#     include <libintl.h>
424285612Sdelphij#   endif
425181834Sroberto
426285612Sdelphij# ifndef ATTRIBUTE_FORMAT_ARG
427285612Sdelphij#   define ATTRIBUTE_FORMAT_ARG(_a)
428285612Sdelphij# endif
429181834Sroberto
430285612Sdelphijstatic inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
431285612Sdelphijstatic inline char* aoGetsText(char const* pz) {
432285612Sdelphij    if (pz == NULL) return NULL;
433285612Sdelphij    return (char*)gettext(pz);
434285612Sdelphij}
435285612Sdelphij#   define _(s)  aoGetsText(s)
436285612Sdelphij# endif /* _() */
437285612Sdelphij
438285612Sdelphij# define OPT_NO_XLAT_CFG_NAMES  STMTS(ntpdOptions.fOptSet |= \
439285612Sdelphij                                    OPTPROC_NXLAT_OPT_CFG;)
440285612Sdelphij# define OPT_NO_XLAT_OPT_NAMES  STMTS(ntpdOptions.fOptSet |= \
441285612Sdelphij                                    OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
442285612Sdelphij
443285612Sdelphij# define OPT_XLAT_CFG_NAMES     STMTS(ntpdOptions.fOptSet &= \
444285612Sdelphij                                  ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
445285612Sdelphij# define OPT_XLAT_OPT_NAMES     STMTS(ntpdOptions.fOptSet &= \
446285612Sdelphij                                  ~OPTPROC_NXLAT_OPT;)
447285612Sdelphij
448285612Sdelphij#else   /* ENABLE_NLS */
449285612Sdelphij# define OPT_NO_XLAT_CFG_NAMES
450285612Sdelphij# define OPT_NO_XLAT_OPT_NAMES
451285612Sdelphij
452285612Sdelphij# define OPT_XLAT_CFG_NAMES
453285612Sdelphij# define OPT_XLAT_OPT_NAMES
454285612Sdelphij
455285612Sdelphij# ifndef _
456285612Sdelphij#   define _(_s)  _s
457285612Sdelphij# endif
458285612Sdelphij#endif  /* ENABLE_NLS */
459285612Sdelphij
460181834Sroberto#ifdef  __cplusplus
461181834Sroberto}
462181834Sroberto#endif
463181834Sroberto#endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
464285612Sdelphij
465181834Sroberto/* ntpd-opts.h ends here */
466