~ubuntu-branches/ubuntu/gutsy/ntp/gutsy

« back to all changes in this revision

Viewing changes to ntpd/ntpd-opts.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-05-18 22:41:56 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070518224156-563ruqxsxvqvoy8h
Tags: 1:4.2.4p0+dfsg-1ubuntu1
* Merge from Debian unstable.
* Remaining Ubuntu changes:
  - Update version in conflicts/replaces to that which was shipped in edgy,
    which was later than that in Debian (due to the ubuntuX).
  - Change default server to ntp.ubuntu.com.
  - Remove stop links from rc0 and rc6
  - Call dh_installinit with --error-handler
  - Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*   -*- buffer-read-only: t -*- vi: set ro:
 
2
 *  
 
3
 *  DO NOT EDIT THIS FILE   (ntpd-opts.h)
 
4
 *  
 
5
 *  It has been AutoGen-ed  Wednesday March  7, 2007 at 06:37:35 AM EST
 
6
 *  From the definitions    ntpd-opts.def
 
7
 *  and the template file   options
 
8
 *
 
9
 * Generated from AutoOpts 27:5:3 templates.
 
10
 */
 
11
 
 
12
/*
 
13
 *  This file was produced by an AutoOpts template.  AutoOpts is a
 
14
 *  copyrighted work.  This header file is not encumbered by AutoOpts
 
15
 *  licensing, but is provided under the licensing terms chosen by the
 
16
 *  ntpd author or copyright holder.  AutoOpts is licensed under
 
17
 *  the terms of the LGPL.  The redistributable library (``libopts'') is
 
18
 *  licensed under the terms of either the LGPL or, at the users discretion,
 
19
 *  the BSD license.  See the AutoOpts and/or libopts sources for details.
 
20
 *
 
21
 * This source file is copyrighted and licensed under the following terms:
 
22
 *
 
23
 * ntpd copyright 1970-2006 ntp.org - all rights reserved
 
24
 *
 
25
 * see html/copyright.html
 
26
 */
 
27
/*
 
28
 *  This file contains the programmatic interface to the Automated
 
29
 *  Options generated for the ntpd program.
 
30
 *  These macros are documented in the AutoGen info file in the
 
31
 *  "AutoOpts" chapter.  Please refer to that doc for usage help.
 
32
 */
 
33
#ifndef AUTOOPTS_NTPD_OPTS_H_GUARD
 
34
#define AUTOOPTS_NTPD_OPTS_H_GUARD
 
35
#include "config.h"
 
36
#include <autoopts/options.h>
 
37
 
 
38
/*
 
39
 *  Ensure that the library used for compiling this generated header is at
 
40
 *  least as new as the version current when the header template was released
 
41
 *  (not counting patch version increments).  Also ensure that the oldest
 
42
 *  tolerable version is at least as old as what was current when the header
 
43
 *  template was released.
 
44
 */
 
45
#define AO_TEMPLATE_VERSION 110597
 
46
#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
 
47
 || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
 
48
# error option template version mismatches autoopts/options.h header
 
49
  Choke Me.
 
50
#endif
 
51
 
 
52
/*
 
53
 *  Enumeration of each option:
 
54
 */
 
55
typedef enum {
 
56
        INDEX_OPT_IPV4             =  0,
 
57
        INDEX_OPT_IPV6             =  1,
 
58
        INDEX_OPT_AUTHREQ          =  2,
 
59
        INDEX_OPT_AUTHNOREQ        =  3,
 
60
        INDEX_OPT_BCASTSYNC        =  4,
 
61
        INDEX_OPT_CONFIGFILE       =  5,
 
62
        INDEX_OPT_DEBUG_LEVEL      =  6,
 
63
        INDEX_OPT_SET_DEBUG_LEVEL  =  7,
 
64
        INDEX_OPT_DRIFTFILE        =  8,
 
65
        INDEX_OPT_PANICGATE        =  9,
 
66
        INDEX_OPT_JAILDIR          = 10,
 
67
        INDEX_OPT_INTERFACE        = 11,
 
68
        INDEX_OPT_KEYFILE          = 12,
 
69
        INDEX_OPT_LOGFILE          = 13,
 
70
        INDEX_OPT_NOVIRTUALIPS     = 14,
 
71
        INDEX_OPT_MODIFYMMTIMER    = 15,
 
72
        INDEX_OPT_NOFORK           = 16,
 
73
        INDEX_OPT_NICE             = 17,
 
74
        INDEX_OPT_PIDFILE          = 18,
 
75
        INDEX_OPT_PRIORITY         = 19,
 
76
        INDEX_OPT_QUIT             = 20,
 
77
        INDEX_OPT_PROPAGATIONDELAY = 21,
 
78
        INDEX_OPT_UPDATEINTERVAL   = 22,
 
79
        INDEX_OPT_STATSDIR         = 23,
 
80
        INDEX_OPT_TRUSTEDKEY       = 24,
 
81
        INDEX_OPT_USER             = 25,
 
82
        INDEX_OPT_VAR              = 26,
 
83
        INDEX_OPT_DVAR             = 27,
 
84
        INDEX_OPT_SLEW             = 28,
 
85
        INDEX_OPT_VERSION          = 29,
 
86
        INDEX_OPT_HELP             = 30,
 
87
        INDEX_OPT_MORE_HELP        = 31,
 
88
        INDEX_OPT_SAVE_OPTS        = 32,
 
89
        INDEX_OPT_LOAD_OPTS        = 33
 
90
} teOptIndex;
 
91
 
 
92
#define OPTION_CT    34
 
93
#define NTPD_VERSION       "4.2.4p0"
 
94
#define NTPD_FULL_VERSION  "ntpd - NTP daemon program - Ver. 4.2.4p0"
 
95
 
 
96
/*
 
97
 *  Interface defines for all options.  Replace "n" with the UPPER_CASED
 
98
 *  option name (as in the teOptIndex enumeration above).
 
99
 *  e.g. HAVE_OPT( IPV4 )
 
100
 */
 
101
#define         DESC(n) ntpdOptions.pOptDesc[INDEX_OPT_ ## n]
 
102
#define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
 
103
#define      OPT_ARG(n) (DESC(n).optArg.argString)
 
104
#define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
 
105
#define    COUNT_OPT(n) (DESC(n).optOccCt)
 
106
#define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
 
107
#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
 
108
#define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
 
109
#define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
 
110
#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
 
111
#define    CLEAR_OPT(n) STMTS( \
 
112
                DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
 
113
                if ( (DESC(n).fOptState & OPTST_INITENABLED) == 0) \
 
114
                    DESC(n).fOptState |= OPTST_DISABLED; \
 
115
                DESC(n).optCookie = NULL )
 
116
 
 
117
/*
 
118
 *  Make sure there are no #define name conflicts with the option names
 
119
 */
 
120
#ifndef     NO_OPTION_NAME_WARNINGS
 
121
# ifdef    IPV4
 
122
#  warning undefining IPV4 due to option name conflict
 
123
#  undef   IPV4
 
124
# endif
 
125
# ifdef    IPV6
 
126
#  warning undefining IPV6 due to option name conflict
 
127
#  undef   IPV6
 
128
# endif
 
129
# ifdef    AUTHREQ
 
130
#  warning undefining AUTHREQ due to option name conflict
 
131
#  undef   AUTHREQ
 
132
# endif
 
133
# ifdef    AUTHNOREQ
 
134
#  warning undefining AUTHNOREQ due to option name conflict
 
135
#  undef   AUTHNOREQ
 
136
# endif
 
137
# ifdef    BCASTSYNC
 
138
#  warning undefining BCASTSYNC due to option name conflict
 
139
#  undef   BCASTSYNC
 
140
# endif
 
141
# ifdef    CONFIGFILE
 
142
#  warning undefining CONFIGFILE due to option name conflict
 
143
#  undef   CONFIGFILE
 
144
# endif
 
145
# ifdef    DEBUG_LEVEL
 
146
#  warning undefining DEBUG_LEVEL due to option name conflict
 
147
#  undef   DEBUG_LEVEL
 
148
# endif
 
149
# ifdef    SET_DEBUG_LEVEL
 
150
#  warning undefining SET_DEBUG_LEVEL due to option name conflict
 
151
#  undef   SET_DEBUG_LEVEL
 
152
# endif
 
153
# ifdef    DRIFTFILE
 
154
#  warning undefining DRIFTFILE due to option name conflict
 
155
#  undef   DRIFTFILE
 
156
# endif
 
157
# ifdef    PANICGATE
 
158
#  warning undefining PANICGATE due to option name conflict
 
159
#  undef   PANICGATE
 
160
# endif
 
161
# ifdef    JAILDIR
 
162
#  warning undefining JAILDIR due to option name conflict
 
163
#  undef   JAILDIR
 
164
# endif
 
165
# ifdef    INTERFACE
 
166
#  warning undefining INTERFACE due to option name conflict
 
167
#  undef   INTERFACE
 
168
# endif
 
169
# ifdef    KEYFILE
 
170
#  warning undefining KEYFILE due to option name conflict
 
171
#  undef   KEYFILE
 
172
# endif
 
173
# ifdef    LOGFILE
 
174
#  warning undefining LOGFILE due to option name conflict
 
175
#  undef   LOGFILE
 
176
# endif
 
177
# ifdef    NOVIRTUALIPS
 
178
#  warning undefining NOVIRTUALIPS due to option name conflict
 
179
#  undef   NOVIRTUALIPS
 
180
# endif
 
181
# ifdef    MODIFYMMTIMER
 
182
#  warning undefining MODIFYMMTIMER due to option name conflict
 
183
#  undef   MODIFYMMTIMER
 
184
# endif
 
185
# ifdef    NOFORK
 
186
#  warning undefining NOFORK due to option name conflict
 
187
#  undef   NOFORK
 
188
# endif
 
189
# ifdef    NICE
 
190
#  warning undefining NICE due to option name conflict
 
191
#  undef   NICE
 
192
# endif
 
193
# ifdef    PIDFILE
 
194
#  warning undefining PIDFILE due to option name conflict
 
195
#  undef   PIDFILE
 
196
# endif
 
197
# ifdef    PRIORITY
 
198
#  warning undefining PRIORITY due to option name conflict
 
199
#  undef   PRIORITY
 
200
# endif
 
201
# ifdef    QUIT
 
202
#  warning undefining QUIT due to option name conflict
 
203
#  undef   QUIT
 
204
# endif
 
205
# ifdef    PROPAGATIONDELAY
 
206
#  warning undefining PROPAGATIONDELAY due to option name conflict
 
207
#  undef   PROPAGATIONDELAY
 
208
# endif
 
209
# ifdef    UPDATEINTERVAL
 
210
#  warning undefining UPDATEINTERVAL due to option name conflict
 
211
#  undef   UPDATEINTERVAL
 
212
# endif
 
213
# ifdef    STATSDIR
 
214
#  warning undefining STATSDIR due to option name conflict
 
215
#  undef   STATSDIR
 
216
# endif
 
217
# ifdef    TRUSTEDKEY
 
218
#  warning undefining TRUSTEDKEY due to option name conflict
 
219
#  undef   TRUSTEDKEY
 
220
# endif
 
221
# ifdef    USER
 
222
#  warning undefining USER due to option name conflict
 
223
#  undef   USER
 
224
# endif
 
225
# ifdef    VAR
 
226
#  warning undefining VAR due to option name conflict
 
227
#  undef   VAR
 
228
# endif
 
229
# ifdef    DVAR
 
230
#  warning undefining DVAR due to option name conflict
 
231
#  undef   DVAR
 
232
# endif
 
233
# ifdef    SLEW
 
234
#  warning undefining SLEW due to option name conflict
 
235
#  undef   SLEW
 
236
# endif
 
237
#else  /* NO_OPTION_NAME_WARNINGS */
 
238
# undef IPV4
 
239
# undef IPV6
 
240
# undef AUTHREQ
 
241
# undef AUTHNOREQ
 
242
# undef BCASTSYNC
 
243
# undef CONFIGFILE
 
244
# undef DEBUG_LEVEL
 
245
# undef SET_DEBUG_LEVEL
 
246
# undef DRIFTFILE
 
247
# undef PANICGATE
 
248
# undef JAILDIR
 
249
# undef INTERFACE
 
250
# undef KEYFILE
 
251
# undef LOGFILE
 
252
# undef NOVIRTUALIPS
 
253
# undef MODIFYMMTIMER
 
254
# undef NOFORK
 
255
# undef NICE
 
256
# undef PIDFILE
 
257
# undef PRIORITY
 
258
# undef QUIT
 
259
# undef PROPAGATIONDELAY
 
260
# undef UPDATEINTERVAL
 
261
# undef STATSDIR
 
262
# undef TRUSTEDKEY
 
263
# undef USER
 
264
# undef VAR
 
265
# undef DVAR
 
266
# undef SLEW
 
267
#endif  /*  NO_OPTION_NAME_WARNINGS */
 
268
 
 
269
/*
 
270
 *  Interface defines for specific options.
 
271
 */
 
272
#define VALUE_OPT_IPV4           '4'
 
273
#define WHICH_OPT_IPV4           (DESC(IPV4).optActualValue)
 
274
#define WHICH_IDX_IPV4           (DESC(IPV4).optActualIndex)
 
275
#define VALUE_OPT_IPV6           '6'
 
276
#define VALUE_OPT_AUTHREQ        'a'
 
277
#define VALUE_OPT_AUTHNOREQ      'A'
 
278
#define VALUE_OPT_BCASTSYNC      'b'
 
279
#define VALUE_OPT_CONFIGFILE     'c'
 
280
#ifdef DEBUG
 
281
#define VALUE_OPT_DEBUG_LEVEL    'd'
 
282
#endif /* DEBUG */
 
283
#ifdef DEBUG
 
284
#define VALUE_OPT_SET_DEBUG_LEVEL 'D'
 
285
#endif /* DEBUG */
 
286
#define VALUE_OPT_DRIFTFILE      'f'
 
287
#define VALUE_OPT_PANICGATE      'g'
 
288
#define VALUE_OPT_JAILDIR        'i'
 
289
#define VALUE_OPT_INTERFACE      'I'
 
290
#define VALUE_OPT_KEYFILE        'k'
 
291
#define VALUE_OPT_LOGFILE        'l'
 
292
#define VALUE_OPT_NOVIRTUALIPS   'L'
 
293
#ifdef SYS_WINNT
 
294
#define VALUE_OPT_MODIFYMMTIMER  'M'
 
295
#endif /* SYS_WINNT */
 
296
#define VALUE_OPT_NOFORK         'n'
 
297
#define VALUE_OPT_NICE           'N'
 
298
#define VALUE_OPT_PIDFILE        'p'
 
299
#define VALUE_OPT_PRIORITY       'P'
 
300
#define OPT_VALUE_PRIORITY       (DESC(PRIORITY).optArg.argInt)
 
301
#define VALUE_OPT_QUIT           'q'
 
302
#define VALUE_OPT_PROPAGATIONDELAY 'r'
 
303
#define VALUE_OPT_UPDATEINTERVAL 'U'
 
304
#define OPT_VALUE_UPDATEINTERVAL (DESC(UPDATEINTERVAL).optArg.argInt)
 
305
#define VALUE_OPT_STATSDIR       's'
 
306
#define VALUE_OPT_TRUSTEDKEY     't'
 
307
#define VALUE_OPT_USER           'u'
 
308
#define VALUE_OPT_VAR            'v'
 
309
#define VALUE_OPT_DVAR           'V'
 
310
#define VALUE_OPT_SLEW           'x'
 
311
 
 
312
#define VALUE_OPT_VERSION       'v'
 
313
#define VALUE_OPT_SAVE_OPTS     '>'
 
314
#define VALUE_OPT_LOAD_OPTS     '<'
 
315
#define VALUE_OPT_HELP          '?'
 
316
#define VALUE_OPT_MORE_HELP     '!'
 
317
#define SET_OPT_SAVE_OPTS(a)   STMTS( \
 
318
        DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
 
319
        DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
 
320
        DESC(SAVE_OPTS).optArg.argString = (char const*)(a) )
 
321
/*
 
322
 *  Interface defines not associated with particular options
 
323
 */
 
324
#define ERRSKIP_OPTERR  STMTS( ntpdOptions.fOptSet &= ~OPTPROC_ERRSTOP )
 
325
#define ERRSTOP_OPTERR  STMTS( ntpdOptions.fOptSet |= OPTPROC_ERRSTOP )
 
326
#define RESTART_OPT(n)  STMTS( \
 
327
                ntpdOptions.curOptIdx = (n); \
 
328
                ntpdOptions.pzCurOpt  = NULL )
 
329
#define START_OPT       RESTART_OPT(1)
 
330
#define USAGE(c)        (*ntpdOptions.pUsageProc)( &ntpdOptions, c )
 
331
/* extracted from opthead near line 312 */
 
332
 
 
333
/* * * * * *
 
334
 *
 
335
 *  Declare the ntpd option descriptor.
 
336
 */
 
337
#ifdef  __cplusplus
 
338
extern "C" {
 
339
#endif
 
340
 
 
341
extern tOptions   ntpdOptions;
 
342
 
 
343
#ifndef _
 
344
#  if ENABLE_NLS
 
345
#    include <stdio.h>
 
346
     static inline char* aoGetsText( char const* pz ) {
 
347
         if (pz == NULL) return NULL;
 
348
         return (char*)gettext( pz );
 
349
     }
 
350
#    define _(s)  aoGetsText(s)
 
351
#  else  /* ENABLE_NLS */
 
352
#    define _(s)  s
 
353
#  endif /* ENABLE_NLS */
 
354
#endif
 
355
 
 
356
#ifdef  __cplusplus
 
357
}
 
358
#endif
 
359
#endif /* AUTOOPTS_NTPD_OPTS_H_GUARD */
 
360
/*
 
361
 * Local Variables:
 
362
 * Mode: C
 
363
 * c-file-style: "stroustrup"
 
364
 * indent-tabs-mode: nil
 
365
 * End:
 
366
 * options.h ends here */