1290001Sglebius/*
2181834Sroberto *  EDIT THIS FILE WITH CAUTION  (ntpd-opts.h)
3290001Sglebius *
4310419Sdelphij *  It has been AutoGen-ed  November 21, 2016 at 07:59:42 AM by AutoGen 5.18.5
5181834Sroberto *  From the definitions    ntpd-opts.def
6181834Sroberto *  and the template file   options
7181834Sroberto *
8290001Sglebius * Generated from AutoOpts 41:0:16 templates.
9181834Sroberto *
10290001Sglebius *  AutoOpts is a copyrighted work.  This header file is not encumbered
11290001Sglebius *  by AutoOpts licensing, but is provided under the licensing terms chosen
12290001Sglebius *  by the ntpd author or copyright holder.  AutoOpts is
13290001Sglebius *  licensed under the terms of the LGPL.  The redistributable library
14290001Sglebius *  (``libopts'') is licensed under the terms of either the LGPL or, at the
15290001Sglebius *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
16290001Sglebius *  for details.
17181834Sroberto *
18290001Sglebius * The ntpd program is copyrighted and licensed
19290001Sglebius * under the following terms:
20181834Sroberto *
21294905Sdelphij *  Copyright (C) 1992-2016 The University of Delaware and Network Time Foundation, all rights reserved.
22290001Sglebius *  This is free software. It is licensed for use, modification and
23290001Sglebius *  redistribution under the terms of the NTP License, copies of which
24290001Sglebius *  can be seen at:
25290001Sglebius *    <http://ntp.org/license>
26290001Sglebius *    <http://opensource.org/licenses/ntp-license.php>
27290001Sglebius *
28290001Sglebius *  Permission to use, copy, modify, and distribute this software and its
29290001Sglebius *  documentation for any purpose with or without fee is hereby granted,
30290001Sglebius *  provided that the above copyright notice appears in all copies and that
31290001Sglebius *  both the copyright notice and this permission notice appear in
32290001Sglebius *  supporting documentation, and that the name The University of Delaware not be used in
33290001Sglebius *  advertising or publicity pertaining to distribution of the software
34290001Sglebius *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
35290001Sglebius *  representations about the suitability this software for any purpose. It
36290001Sglebius *  is provided "as is" without express or implied warranty.
37181834Sroberto */
38290001Sglebius/**
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
45290001Sglebius#define AUTOOPTS_NTPD_OPTS_H_GUARD 1
46181834Sroberto#include "config.h"
47181834Sroberto#include <autoopts/options.h>
48181834Sroberto
49290001Sglebius/**
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 */
56290001Sglebius#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
63290001Sglebius/**
64290001Sglebius *  Enumeration of each option type for ntpd
65181834Sroberto */
66181834Srobertotypedef enum {
67290001Sglebius    INDEX_OPT_IPV4              =  0,
68290001Sglebius    INDEX_OPT_IPV6              =  1,
69290001Sglebius    INDEX_OPT_AUTHREQ           =  2,
70290001Sglebius    INDEX_OPT_AUTHNOREQ         =  3,
71290001Sglebius    INDEX_OPT_BCASTSYNC         =  4,
72290001Sglebius    INDEX_OPT_CONFIGFILE        =  5,
73290001Sglebius    INDEX_OPT_DEBUG_LEVEL       =  6,
74290001Sglebius    INDEX_OPT_SET_DEBUG_LEVEL   =  7,
75290001Sglebius    INDEX_OPT_DRIFTFILE         =  8,
76290001Sglebius    INDEX_OPT_PANICGATE         =  9,
77290001Sglebius    INDEX_OPT_FORCE_STEP_ONCE   = 10,
78290001Sglebius    INDEX_OPT_JAILDIR           = 11,
79290001Sglebius    INDEX_OPT_INTERFACE         = 12,
80290001Sglebius    INDEX_OPT_KEYFILE           = 13,
81290001Sglebius    INDEX_OPT_LOGFILE           = 14,
82290001Sglebius    INDEX_OPT_NOVIRTUALIPS      = 15,
83290001Sglebius    INDEX_OPT_MODIFYMMTIMER     = 16,
84290001Sglebius    INDEX_OPT_NOFORK            = 17,
85290001Sglebius    INDEX_OPT_NICE              = 18,
86290001Sglebius    INDEX_OPT_PIDFILE           = 19,
87290001Sglebius    INDEX_OPT_PRIORITY          = 20,
88290001Sglebius    INDEX_OPT_QUIT              = 21,
89290001Sglebius    INDEX_OPT_PROPAGATIONDELAY  = 22,
90290001Sglebius    INDEX_OPT_SAVECONFIGQUIT    = 23,
91290001Sglebius    INDEX_OPT_STATSDIR          = 24,
92290001Sglebius    INDEX_OPT_TRUSTEDKEY        = 25,
93290001Sglebius    INDEX_OPT_USER              = 26,
94290001Sglebius    INDEX_OPT_UPDATEINTERVAL    = 27,
95290001Sglebius    INDEX_OPT_VAR               = 28,
96290001Sglebius    INDEX_OPT_DVAR              = 29,
97290001Sglebius    INDEX_OPT_WAIT_SYNC         = 30,
98290001Sglebius    INDEX_OPT_SLEW              = 31,
99290001Sglebius    INDEX_OPT_USEPCC            = 32,
100290001Sglebius    INDEX_OPT_PCCFREQ           = 33,
101290001Sglebius    INDEX_OPT_MDNS              = 34,
102290001Sglebius    INDEX_OPT_VERSION           = 35,
103290001Sglebius    INDEX_OPT_HELP              = 36,
104290001Sglebius    INDEX_OPT_MORE_HELP         = 37
105181834Sroberto} teOptIndex;
106290001Sglebius/** count of all options for ntpd */
107290001Sglebius#define OPTION_CT    38
108290001Sglebius/** ntpd version */
109310419Sdelphij#define NTPD_VERSION       "4.2.8p9"
110290001Sglebius/** Full ntpd version text */
111310419Sdelphij#define NTPD_FULL_VERSION  "ntpd 4.2.8p9"
112181834Sroberto
113290001Sglebius/**
114181834Sroberto *  Interface defines for all options.  Replace "n" with the UPPER_CASED
115181834Sroberto *  option name (as in the teOptIndex enumeration above).
116290001Sglebius *  e.g. HAVE_OPT(IPV4)
117181834Sroberto */
118181834Sroberto#define         DESC(n) (ntpdOptions.pOptDesc[INDEX_OPT_## n])
119290001Sglebius/** 'true' if an option has been specified in any way */
120181834Sroberto#define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
121290001Sglebius/** The string argument to an option. The argument type must be \"string\". */
122181834Sroberto#define      OPT_ARG(n) (DESC(n).optArg.argString)
123290001Sglebius/** Mask the option state revealing how an option was specified.
124290001Sglebius *  It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
125290001Sglebius * \a OPTST_DEFINED, \a OPTST_RESET or zero.
126290001Sglebius */
127181834Sroberto#define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
128290001Sglebius/** Count of option's occurrances *on the command line*. */
129181834Sroberto#define    COUNT_OPT(n) (DESC(n).optOccCt)
130290001Sglebius/** mask of \a OPTST_SET and \a OPTST_DEFINED. */
131181834Sroberto#define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
132290001Sglebius/** 'true' if \a HAVE_OPT would yield 'false'. */
133181834Sroberto#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
134290001Sglebius/** 'true' if OPTST_DISABLED bit not set. */
135181834Sroberto#define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
136290001Sglebius/** number of stacked option arguments.
137290001Sglebius *  Valid only for stacked option arguments. */
138181834Sroberto#define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
139290001Sglebius/** stacked argument vector.
140290001Sglebius *  Valid only for stacked option arguments. */
141181834Sroberto#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
142290001Sglebius/** Reset an option. */
143181834Sroberto#define    CLEAR_OPT(n) STMTS( \
144181834Sroberto                DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
145290001Sglebius                if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
146181834Sroberto                    DESC(n).fOptState |= OPTST_DISABLED; \
147181834Sroberto                DESC(n).optCookie = NULL )
148290001Sglebius/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
149290001Sglebius/**
150290001Sglebius *  Enumeration of ntpd exit codes
151290001Sglebius */
152290001Sglebiustypedef enum {
153290001Sglebius    NTPD_EXIT_SUCCESS         = 0,
154290001Sglebius    NTPD_EXIT_FAILURE         = 1,
155290001Sglebius    NTPD_EXIT_USAGE_ERROR     = 64,
156290001Sglebius    NTPD_EXIT_LIBOPTS_FAILURE = 70
157290001Sglebius}   ntpd_exit_code_t;
158290001Sglebius/** @} */
159290001Sglebius/**
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
203290001Sglebius# ifdef    FORCE_STEP_ONCE
204290001Sglebius#  warning undefining FORCE_STEP_ONCE due to option name conflict
205290001Sglebius#  undef   FORCE_STEP_ONCE
206290001Sglebius# 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
255290001Sglebius# ifdef    SAVECONFIGQUIT
256290001Sglebius#  warning undefining SAVECONFIGQUIT due to option name conflict
257290001Sglebius#  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
271290001Sglebius# ifdef    UPDATEINTERVAL
272290001Sglebius#  warning undefining UPDATEINTERVAL due to option name conflict
273290001Sglebius#  undef   UPDATEINTERVAL
274290001Sglebius# 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
283290001Sglebius# ifdef    WAIT_SYNC
284290001Sglebius#  warning undefining WAIT_SYNC due to option name conflict
285290001Sglebius#  undef   WAIT_SYNC
286290001Sglebius# endif
287181834Sroberto# ifdef    SLEW
288181834Sroberto#  warning undefining SLEW due to option name conflict
289181834Sroberto#  undef   SLEW
290181834Sroberto# endif
291290001Sglebius# ifdef    USEPCC
292290001Sglebius#  warning undefining USEPCC due to option name conflict
293290001Sglebius#  undef   USEPCC
294290001Sglebius# endif
295290001Sglebius# ifdef    PCCFREQ
296290001Sglebius#  warning undefining PCCFREQ due to option name conflict
297290001Sglebius#  undef   PCCFREQ
298290001Sglebius# endif
299290001Sglebius# ifdef    MDNS
300290001Sglebius#  warning undefining MDNS due to option name conflict
301290001Sglebius#  undef   MDNS
302290001Sglebius# 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
314290001Sglebius# 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
327290001Sglebius# undef SAVECONFIGQUIT
328181834Sroberto# undef STATSDIR
329181834Sroberto# undef TRUSTEDKEY
330181834Sroberto# undef USER
331290001Sglebius# undef UPDATEINTERVAL
332181834Sroberto# undef VAR
333181834Sroberto# undef DVAR
334290001Sglebius# undef WAIT_SYNC
335181834Sroberto# undef SLEW
336290001Sglebius# undef USEPCC
337290001Sglebius# undef PCCFREQ
338290001Sglebius# undef MDNS
339181834Sroberto#endif  /*  NO_OPTION_NAME_WARNINGS */
340181834Sroberto
341290001Sglebius/**
342181834Sroberto *  Interface defines for specific options.
343290001Sglebius * @{
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'
353290001Sglebius
354290001Sglebius#define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
355181834Sroberto#define VALUE_OPT_DRIFTFILE      'f'
356181834Sroberto#define VALUE_OPT_PANICGATE      'g'
357290001Sglebius#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'
368290001Sglebius
369181834Sroberto#define OPT_VALUE_PRIORITY       (DESC(PRIORITY).optArg.argInt)
370181834Sroberto#define VALUE_OPT_QUIT           'q'
371181834Sroberto#define VALUE_OPT_PROPAGATIONDELAY 'r'
372290001Sglebius#define VALUE_OPT_SAVECONFIGQUIT 0x1001
373181834Sroberto#define VALUE_OPT_STATSDIR       's'
374181834Sroberto#define VALUE_OPT_TRUSTEDKEY     't'
375181834Sroberto#define VALUE_OPT_USER           'u'
376290001Sglebius#define VALUE_OPT_UPDATEINTERVAL 'U'
377290001Sglebius
378290001Sglebius#define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
379290001Sglebius#define VALUE_OPT_VAR            0x1002
380290001Sglebius#define VALUE_OPT_DVAR           0x1003
381290001Sglebius#define VALUE_OPT_WAIT_SYNC      'w'
382290001Sglebius#ifdef HAVE_WORKING_FORK
383290001Sglebius#define OPT_VALUE_WAIT_SYNC      (DESC(WAIT_SYNC).optArg.argInt)
384290001Sglebius#endif /* HAVE_WORKING_FORK */
385181834Sroberto#define VALUE_OPT_SLEW           'x'
386290001Sglebius#define VALUE_OPT_USEPCC         0x1004
387290001Sglebius#define VALUE_OPT_PCCFREQ        0x1005
388290001Sglebius#define VALUE_OPT_MDNS           'm'
389290001Sglebius/** option flag (value) for help-value option */
390181834Sroberto#define VALUE_OPT_HELP          '?'
391290001Sglebius/** option flag (value) for more-help-value option */
392181834Sroberto#define VALUE_OPT_MORE_HELP     '!'
393290001Sglebius/** option flag (value) for version-value option */
394290001Sglebius#define VALUE_OPT_VERSION       0x1006
395181834Sroberto/*
396181834Sroberto *  Interface defines not associated with particular options
397181834Sroberto */
398290001Sglebius#define ERRSKIP_OPTERR  STMTS(ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP)
399290001Sglebius#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)
404290001Sglebius#define USAGE(c)        (*ntpdOptions.pUsageProc)(&ntpdOptions, c)
405181834Sroberto
406290001Sglebius#ifdef  __cplusplus
407290001Sglebiusextern "C" {
408290001Sglebius#endif
409290001Sglebius
410290001Sglebius
411181834Sroberto/* * * * * *
412181834Sroberto *
413181834Sroberto *  Declare the ntpd option descriptor.
414181834Sroberto */
415290001Sglebiusextern tOptions ntpdOptions;
416181834Sroberto
417290001Sglebius#if defined(ENABLE_NLS)
418290001Sglebius# ifndef _
419290001Sglebius#   include <stdio.h>
420290001Sglebius#   ifndef HAVE_GETTEXT
421290001Sglebius      extern char * gettext(char const *);
422290001Sglebius#   else
423290001Sglebius#     include <libintl.h>
424290001Sglebius#   endif
425181834Sroberto
426290001Sglebius# ifndef ATTRIBUTE_FORMAT_ARG
427290001Sglebius#   define ATTRIBUTE_FORMAT_ARG(_a)
428290001Sglebius# endif
429181834Sroberto
430290001Sglebiusstatic inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
431290001Sglebiusstatic inline char* aoGetsText(char const* pz) {
432290001Sglebius    if (pz == NULL) return NULL;
433290001Sglebius    return (char*)gettext(pz);
434290001Sglebius}
435290001Sglebius#   define _(s)  aoGetsText(s)
436290001Sglebius# endif /* _() */
437290001Sglebius
438290001Sglebius# define OPT_NO_XLAT_CFG_NAMES  STMTS(ntpdOptions.fOptSet |= \
439290001Sglebius                                    OPTPROC_NXLAT_OPT_CFG;)
440290001Sglebius# define OPT_NO_XLAT_OPT_NAMES  STMTS(ntpdOptions.fOptSet |= \
441290001Sglebius                                    OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
442290001Sglebius
443290001Sglebius# define OPT_XLAT_CFG_NAMES     STMTS(ntpdOptions.fOptSet &= \
444290001Sglebius                                  ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
445290001Sglebius# define OPT_XLAT_OPT_NAMES     STMTS(ntpdOptions.fOptSet &= \
446290001Sglebius                                  ~OPTPROC_NXLAT_OPT;)
447290001Sglebius
448290001Sglebius#else   /* ENABLE_NLS */
449290001Sglebius# define OPT_NO_XLAT_CFG_NAMES
450290001Sglebius# define OPT_NO_XLAT_OPT_NAMES
451290001Sglebius
452290001Sglebius# define OPT_XLAT_CFG_NAMES
453290001Sglebius# define OPT_XLAT_OPT_NAMES
454290001Sglebius
455290001Sglebius# ifndef _
456290001Sglebius#   define _(_s)  _s
457290001Sglebius# endif
458290001Sglebius#endif  /* ENABLE_NLS */
459290001Sglebius
460181834Sroberto#ifdef  __cplusplus
461181834Sroberto}
462181834Sroberto#endif
463181834Sroberto#endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
464290001Sglebius
465181834Sroberto/* ntpd-opts.h ends here */
466