xref: /netbsd-src/external/bsd/ntp/dist/util/ntp-keygen-opts.h (revision eabc0478de71e4e011a5b4e0392741e01d491794)
1*eabc0478Schristos /*	$NetBSD: ntp-keygen-opts.h,v 1.15 2024/08/18 20:47:27 christos Exp $	*/
2abb0f93cSkardel 
3abb0f93cSkardel /*
4abb0f93cSkardel  *  EDIT THIS FILE WITH CAUTION  (ntp-keygen-opts.h)
5abb0f93cSkardel  *
6*eabc0478Schristos  *  It has been AutoGen-ed  May 25, 2024 at 12:04:42 AM by AutoGen 5.18.16
7abb0f93cSkardel  *  From the definitions    ntp-keygen-opts.def
8abb0f93cSkardel  *  and the template file   options
9abb0f93cSkardel  *
10*eabc0478Schristos  * Generated from AutoOpts 42:1:17 templates.
11f003fb54Skardel  *
12f003fb54Skardel  *  AutoOpts is a copyrighted work.  This header file is not encumbered
13f003fb54Skardel  *  by AutoOpts licensing, but is provided under the licensing terms chosen
14f003fb54Skardel  *  by the ntp-keygen author or copyright holder.  AutoOpts is
15f003fb54Skardel  *  licensed under the terms of the LGPL.  The redistributable library
16f003fb54Skardel  *  (``libopts'') is licensed under the terms of either the LGPL or, at the
17f003fb54Skardel  *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
18f003fb54Skardel  *  for details.
19abb0f93cSkardel  *
208585484eSchristos  * The ntp-keygen program is copyrighted and licensed
218585484eSchristos  * under the following terms:
22abb0f93cSkardel  *
23*eabc0478Schristos  *  Copyright (C) 1992-2024 The University of Delaware and Network Time Foundation, all rights reserved.
248585484eSchristos  *  This is free software. It is licensed for use, modification and
258585484eSchristos  *  redistribution under the terms of the NTP License, copies of which
268585484eSchristos  *  can be seen at:
278585484eSchristos  *    <http://ntp.org/license>
288585484eSchristos  *    <http://opensource.org/licenses/ntp-license.php>
29f003fb54Skardel  *
308585484eSchristos  *  Permission to use, copy, modify, and distribute this software and its
318585484eSchristos  *  documentation for any purpose with or without fee is hereby granted,
328585484eSchristos  *  provided that the above copyright notice appears in all copies and that
338585484eSchristos  *  both the copyright notice and this permission notice appear in
348585484eSchristos  *  supporting documentation, and that the name The University of Delaware not be used in
358585484eSchristos  *  advertising or publicity pertaining to distribution of the software
367476e6e4Schristos  *  without specific, written prior permission. The University of Delaware and Network Time Foundation makes no
378585484eSchristos  *  representations about the suitability this software for any purpose. It
388585484eSchristos  *  is provided "as is" without express or implied warranty.
39abb0f93cSkardel  */
408585484eSchristos /**
41abb0f93cSkardel  *  This file contains the programmatic interface to the Automated
42abb0f93cSkardel  *  Options generated for the ntp-keygen program.
43abb0f93cSkardel  *  These macros are documented in the AutoGen info file in the
44abb0f93cSkardel  *  "AutoOpts" chapter.  Please refer to that doc for usage help.
45abb0f93cSkardel  */
46abb0f93cSkardel #ifndef AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD
47abb0f93cSkardel #define AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD 1
48abb0f93cSkardel #include "config.h"
49abb0f93cSkardel #include <autoopts/options.h>
50*eabc0478Schristos #include <stdarg.h>
51*eabc0478Schristos #include <stdnoreturn.h>
52abb0f93cSkardel 
538585484eSchristos /**
54abb0f93cSkardel  *  Ensure that the library used for compiling this generated header is at
55abb0f93cSkardel  *  least as new as the version current when the header template was released
56abb0f93cSkardel  *  (not counting patch version increments).  Also ensure that the oldest
57abb0f93cSkardel  *  tolerable version is at least as old as what was current when the header
58abb0f93cSkardel  *  template was released.
59abb0f93cSkardel  */
60*eabc0478Schristos #define AO_TEMPLATE_VERSION 172033
61abb0f93cSkardel #if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \
62abb0f93cSkardel  || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION)
63abb0f93cSkardel # error option template version mismatches autoopts/options.h header
64abb0f93cSkardel   Choke Me.
65abb0f93cSkardel #endif
66abb0f93cSkardel 
67*eabc0478Schristos #if GCC_VERSION > 40400
68*eabc0478Schristos #define NOT_REACHED __builtin_unreachable();
69*eabc0478Schristos #else
70*eabc0478Schristos #define NOT_REACHED
71*eabc0478Schristos #endif
72*eabc0478Schristos 
738585484eSchristos /**
748585484eSchristos  *  Enumeration of each option type for ntp-keygen
75abb0f93cSkardel  */
76abb0f93cSkardel typedef enum {
778585484eSchristos     INDEX_OPT_IMBITS           =  0,
788585484eSchristos     INDEX_OPT_CERTIFICATE      =  1,
798585484eSchristos     INDEX_OPT_CIPHER           =  2,
808585484eSchristos     INDEX_OPT_DEBUG_LEVEL      =  3,
818585484eSchristos     INDEX_OPT_SET_DEBUG_LEVEL  =  4,
828585484eSchristos     INDEX_OPT_ID_KEY           =  5,
838585484eSchristos     INDEX_OPT_GQ_PARAMS        =  6,
848585484eSchristos     INDEX_OPT_HOST_KEY         =  7,
858585484eSchristos     INDEX_OPT_IFFKEY           =  8,
868585484eSchristos     INDEX_OPT_IDENT            =  9,
878585484eSchristos     INDEX_OPT_LIFETIME         = 10,
884eea345dSchristos     INDEX_OPT_MODULUS          = 11,
894eea345dSchristos     INDEX_OPT_MD5KEY           = 12,
908585484eSchristos     INDEX_OPT_PVT_CERT         = 13,
91b8ecfcfeSchristos     INDEX_OPT_PASSWORD         = 14,
92b8ecfcfeSchristos     INDEX_OPT_EXPORT_PASSWD    = 15,
934eea345dSchristos     INDEX_OPT_SUBJECT_NAME     = 16,
944eea345dSchristos     INDEX_OPT_SIGN_KEY         = 17,
958585484eSchristos     INDEX_OPT_TRUSTED_CERT     = 18,
968585484eSchristos     INDEX_OPT_MV_PARAMS        = 19,
978585484eSchristos     INDEX_OPT_MV_KEYS          = 20,
988585484eSchristos     INDEX_OPT_VERSION          = 21,
998585484eSchristos     INDEX_OPT_HELP             = 22,
1008585484eSchristos     INDEX_OPT_MORE_HELP        = 23,
1018585484eSchristos     INDEX_OPT_SAVE_OPTS        = 24,
1028585484eSchristos     INDEX_OPT_LOAD_OPTS        = 25
103abb0f93cSkardel } teOptIndex;
1048585484eSchristos /** count of all options for ntp-keygen */
1058585484eSchristos #define OPTION_CT    26
1068585484eSchristos /** ntp-keygen version */
107*eabc0478Schristos #define NTP_KEYGEN_VERSION       "4.2.8p18"
1088585484eSchristos /** Full ntp-keygen version text */
109*eabc0478Schristos #define NTP_KEYGEN_FULL_VERSION  "ntp-keygen (ntp) 4.2.8p18"
110abb0f93cSkardel 
1118585484eSchristos /**
112abb0f93cSkardel  *  Interface defines for all options.  Replace "n" with the UPPER_CASED
113abb0f93cSkardel  *  option name (as in the teOptIndex enumeration above).
1148585484eSchristos  *  e.g. HAVE_OPT(IMBITS)
115abb0f93cSkardel  */
116abb0f93cSkardel #define         DESC(n) (ntp_keygenOptions.pOptDesc[INDEX_OPT_## n])
1178585484eSchristos /** 'true' if an option has been specified in any way */
118abb0f93cSkardel #define     HAVE_OPT(n) (! UNUSED_OPT(& DESC(n)))
1198585484eSchristos /** The string argument to an option. The argument type must be \"string\". */
120abb0f93cSkardel #define      OPT_ARG(n) (DESC(n).optArg.argString)
1218585484eSchristos /** Mask the option state revealing how an option was specified.
1228585484eSchristos  *  It will be one and only one of \a OPTST_SET, \a OPTST_PRESET,
1238585484eSchristos  * \a OPTST_DEFINED, \a OPTST_RESET or zero.
1248585484eSchristos  */
125abb0f93cSkardel #define    STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK)
1268585484eSchristos /** Count of option's occurrances *on the command line*. */
127abb0f93cSkardel #define    COUNT_OPT(n) (DESC(n).optOccCt)
1288585484eSchristos /** mask of \a OPTST_SET and \a OPTST_DEFINED. */
129abb0f93cSkardel #define    ISSEL_OPT(n) (SELECTED_OPT(&DESC(n)))
1308585484eSchristos /** 'true' if \a HAVE_OPT would yield 'false'. */
131abb0f93cSkardel #define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n)))
1328585484eSchristos /** 'true' if OPTST_DISABLED bit not set. */
133abb0f93cSkardel #define  ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n)))
1348585484eSchristos /** number of stacked option arguments.
1358585484eSchristos  *  Valid only for stacked option arguments. */
136abb0f93cSkardel #define  STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt)
1378585484eSchristos /** stacked argument vector.
1388585484eSchristos  *  Valid only for stacked option arguments. */
139abb0f93cSkardel #define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs)
1408585484eSchristos /** Reset an option. */
141abb0f93cSkardel #define    CLEAR_OPT(n) STMTS( \
142abb0f93cSkardel                 DESC(n).fOptState &= OPTST_PERSISTENT_MASK;   \
143abb0f93cSkardel                 if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \
144abb0f93cSkardel                     DESC(n).fOptState |= OPTST_DISABLED; \
145abb0f93cSkardel                 DESC(n).optCookie = NULL )
1468585484eSchristos /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1478585484eSchristos /**
148f003fb54Skardel  *  Enumeration of ntp-keygen exit codes
149f003fb54Skardel  */
150f003fb54Skardel typedef enum {
151f003fb54Skardel     NTP_KEYGEN_EXIT_SUCCESS         = 0,
1528585484eSchristos     NTP_KEYGEN_EXIT_FAILURE         = 1,
1538585484eSchristos     NTP_KEYGEN_EXIT_USAGE_ERROR     = 64,
1548585484eSchristos     NTP_KEYGEN_EXIT_NO_CONFIG_INPUT = 66,
1558585484eSchristos     NTP_KEYGEN_EXIT_LIBOPTS_FAILURE = 70
156f003fb54Skardel }   ntp_keygen_exit_code_t;
1578585484eSchristos /** @} */
1588585484eSchristos /**
159abb0f93cSkardel  *  Make sure there are no #define name conflicts with the option names
160abb0f93cSkardel  */
161abb0f93cSkardel #ifndef     NO_OPTION_NAME_WARNINGS
1628585484eSchristos # ifdef    IMBITS
1638585484eSchristos #  warning undefining IMBITS due to option name conflict
1648585484eSchristos #  undef   IMBITS
1658585484eSchristos # endif
166abb0f93cSkardel # ifdef    CERTIFICATE
167abb0f93cSkardel #  warning undefining CERTIFICATE due to option name conflict
168abb0f93cSkardel #  undef   CERTIFICATE
169abb0f93cSkardel # endif
1708585484eSchristos # ifdef    CIPHER
1718585484eSchristos #  warning undefining CIPHER due to option name conflict
1728585484eSchristos #  undef   CIPHER
1738585484eSchristos # endif
174abb0f93cSkardel # ifdef    DEBUG_LEVEL
175abb0f93cSkardel #  warning undefining DEBUG_LEVEL due to option name conflict
176abb0f93cSkardel #  undef   DEBUG_LEVEL
177abb0f93cSkardel # endif
178abb0f93cSkardel # ifdef    SET_DEBUG_LEVEL
179abb0f93cSkardel #  warning undefining SET_DEBUG_LEVEL due to option name conflict
180abb0f93cSkardel #  undef   SET_DEBUG_LEVEL
181abb0f93cSkardel # endif
182abb0f93cSkardel # ifdef    ID_KEY
183abb0f93cSkardel #  warning undefining ID_KEY due to option name conflict
184abb0f93cSkardel #  undef   ID_KEY
185abb0f93cSkardel # endif
186abb0f93cSkardel # ifdef    GQ_PARAMS
187abb0f93cSkardel #  warning undefining GQ_PARAMS due to option name conflict
188abb0f93cSkardel #  undef   GQ_PARAMS
189abb0f93cSkardel # endif
190abb0f93cSkardel # ifdef    HOST_KEY
191abb0f93cSkardel #  warning undefining HOST_KEY due to option name conflict
192abb0f93cSkardel #  undef   HOST_KEY
193abb0f93cSkardel # endif
194abb0f93cSkardel # ifdef    IFFKEY
195abb0f93cSkardel #  warning undefining IFFKEY due to option name conflict
196abb0f93cSkardel #  undef   IFFKEY
197abb0f93cSkardel # endif
1988585484eSchristos # ifdef    IDENT
1998585484eSchristos #  warning undefining IDENT due to option name conflict
2008585484eSchristos #  undef   IDENT
2018585484eSchristos # endif
2028585484eSchristos # ifdef    LIFETIME
2038585484eSchristos #  warning undefining LIFETIME due to option name conflict
2048585484eSchristos #  undef   LIFETIME
205abb0f93cSkardel # endif
206abb0f93cSkardel # ifdef    MODULUS
207abb0f93cSkardel #  warning undefining MODULUS due to option name conflict
208abb0f93cSkardel #  undef   MODULUS
209abb0f93cSkardel # endif
2104eea345dSchristos # ifdef    MD5KEY
2114eea345dSchristos #  warning undefining MD5KEY due to option name conflict
2124eea345dSchristos #  undef   MD5KEY
2134eea345dSchristos # endif
214abb0f93cSkardel # ifdef    PVT_CERT
215abb0f93cSkardel #  warning undefining PVT_CERT due to option name conflict
216abb0f93cSkardel #  undef   PVT_CERT
217abb0f93cSkardel # endif
218b8ecfcfeSchristos # ifdef    PASSWORD
219b8ecfcfeSchristos #  warning undefining PASSWORD due to option name conflict
220b8ecfcfeSchristos #  undef   PASSWORD
221abb0f93cSkardel # endif
222b8ecfcfeSchristos # ifdef    EXPORT_PASSWD
223b8ecfcfeSchristos #  warning undefining EXPORT_PASSWD due to option name conflict
224b8ecfcfeSchristos #  undef   EXPORT_PASSWD
225abb0f93cSkardel # endif
226abb0f93cSkardel # ifdef    SUBJECT_NAME
227abb0f93cSkardel #  warning undefining SUBJECT_NAME due to option name conflict
228abb0f93cSkardel #  undef   SUBJECT_NAME
229abb0f93cSkardel # endif
2304eea345dSchristos # ifdef    SIGN_KEY
2314eea345dSchristos #  warning undefining SIGN_KEY due to option name conflict
2324eea345dSchristos #  undef   SIGN_KEY
2334eea345dSchristos # endif
234abb0f93cSkardel # ifdef    TRUSTED_CERT
235abb0f93cSkardel #  warning undefining TRUSTED_CERT due to option name conflict
236abb0f93cSkardel #  undef   TRUSTED_CERT
237abb0f93cSkardel # endif
238abb0f93cSkardel # ifdef    MV_PARAMS
239abb0f93cSkardel #  warning undefining MV_PARAMS due to option name conflict
240abb0f93cSkardel #  undef   MV_PARAMS
241abb0f93cSkardel # endif
242abb0f93cSkardel # ifdef    MV_KEYS
243abb0f93cSkardel #  warning undefining MV_KEYS due to option name conflict
244abb0f93cSkardel #  undef   MV_KEYS
245abb0f93cSkardel # endif
246abb0f93cSkardel #else  /* NO_OPTION_NAME_WARNINGS */
2478585484eSchristos # undef IMBITS
248abb0f93cSkardel # undef CERTIFICATE
2498585484eSchristos # undef CIPHER
250abb0f93cSkardel # undef DEBUG_LEVEL
251abb0f93cSkardel # undef SET_DEBUG_LEVEL
252abb0f93cSkardel # undef ID_KEY
253abb0f93cSkardel # undef GQ_PARAMS
254abb0f93cSkardel # undef HOST_KEY
255abb0f93cSkardel # undef IFFKEY
2568585484eSchristos # undef IDENT
2578585484eSchristos # undef LIFETIME
258abb0f93cSkardel # undef MODULUS
2594eea345dSchristos # undef MD5KEY
260abb0f93cSkardel # undef PVT_CERT
261b8ecfcfeSchristos # undef PASSWORD
262b8ecfcfeSchristos # undef EXPORT_PASSWD
263abb0f93cSkardel # undef SUBJECT_NAME
2644eea345dSchristos # undef SIGN_KEY
265abb0f93cSkardel # undef TRUSTED_CERT
266abb0f93cSkardel # undef MV_PARAMS
267abb0f93cSkardel # undef MV_KEYS
268abb0f93cSkardel #endif  /*  NO_OPTION_NAME_WARNINGS */
269abb0f93cSkardel 
2708585484eSchristos /**
271abb0f93cSkardel  *  Interface defines for specific options.
2728585484eSchristos  * @{
273abb0f93cSkardel  */
2748585484eSchristos #define VALUE_OPT_IMBITS         'b'
2758585484eSchristos #ifdef AUTOKEY
2768585484eSchristos #define OPT_VALUE_IMBITS         (DESC(IMBITS).optArg.argInt)
2778585484eSchristos #endif /* AUTOKEY */
278abb0f93cSkardel #define VALUE_OPT_CERTIFICATE    'c'
2798585484eSchristos #define VALUE_OPT_CIPHER         'C'
280abb0f93cSkardel #define VALUE_OPT_DEBUG_LEVEL    'd'
281abb0f93cSkardel #define VALUE_OPT_SET_DEBUG_LEVEL 'D'
2828585484eSchristos 
2838585484eSchristos #define OPT_VALUE_SET_DEBUG_LEVEL (DESC(SET_DEBUG_LEVEL).optArg.argInt)
284abb0f93cSkardel #define VALUE_OPT_ID_KEY         'e'
285abb0f93cSkardel #define VALUE_OPT_GQ_PARAMS      'G'
286abb0f93cSkardel #define VALUE_OPT_HOST_KEY       'H'
287abb0f93cSkardel #define VALUE_OPT_IFFKEY         'I'
2888585484eSchristos #define VALUE_OPT_IDENT          'i'
2898585484eSchristos #define VALUE_OPT_LIFETIME       'l'
2908585484eSchristos #ifdef AUTOKEY
2918585484eSchristos #define OPT_VALUE_LIFETIME       (DESC(LIFETIME).optArg.argInt)
2928585484eSchristos #endif /* AUTOKEY */
293abb0f93cSkardel #define VALUE_OPT_MODULUS        'm'
2948585484eSchristos #ifdef AUTOKEY
295abb0f93cSkardel #define OPT_VALUE_MODULUS        (DESC(MODULUS).optArg.argInt)
2968585484eSchristos #endif /* AUTOKEY */
2974eea345dSchristos #define VALUE_OPT_MD5KEY         'M'
298abb0f93cSkardel #define VALUE_OPT_PVT_CERT       'P'
299b8ecfcfeSchristos #define VALUE_OPT_PASSWORD       'p'
300b8ecfcfeSchristos #define VALUE_OPT_EXPORT_PASSWD  'q'
301abb0f93cSkardel #define VALUE_OPT_SUBJECT_NAME   's'
3024eea345dSchristos #define VALUE_OPT_SIGN_KEY       'S'
303abb0f93cSkardel #define VALUE_OPT_TRUSTED_CERT   'T'
304abb0f93cSkardel #define VALUE_OPT_MV_PARAMS      'V'
3058585484eSchristos #ifdef AUTOKEY
306abb0f93cSkardel #define OPT_VALUE_MV_PARAMS      (DESC(MV_PARAMS).optArg.argInt)
3078585484eSchristos #endif /* AUTOKEY */
308abb0f93cSkardel #define VALUE_OPT_MV_KEYS        'v'
3098585484eSchristos #ifdef AUTOKEY
310abb0f93cSkardel #define OPT_VALUE_MV_KEYS        (DESC(MV_KEYS).optArg.argInt)
3118585484eSchristos #endif /* AUTOKEY */
312b8ecfcfeSchristos /** option flag (value) for help-value option */
313abb0f93cSkardel #define VALUE_OPT_HELP          '?'
314b8ecfcfeSchristos /** option flag (value) for more-help-value option */
315abb0f93cSkardel #define VALUE_OPT_MORE_HELP     '!'
316b8ecfcfeSchristos /** option flag (value) for version-value option */
3178585484eSchristos #define VALUE_OPT_VERSION       0x1001
318b8ecfcfeSchristos /** option flag (value) for save-opts-value option */
319abb0f93cSkardel #define VALUE_OPT_SAVE_OPTS     '>'
320b8ecfcfeSchristos /** option flag (value) for load-opts-value option */
321abb0f93cSkardel #define VALUE_OPT_LOAD_OPTS     '<'
322abb0f93cSkardel #define SET_OPT_SAVE_OPTS(a)   STMTS( \
323abb0f93cSkardel         DESC(SAVE_OPTS).fOptState &= OPTST_PERSISTENT_MASK; \
324abb0f93cSkardel         DESC(SAVE_OPTS).fOptState |= OPTST_SET; \
325abb0f93cSkardel         DESC(SAVE_OPTS).optArg.argString = (char const*)(a))
326abb0f93cSkardel /*
327abb0f93cSkardel  *  Interface defines not associated with particular options
328abb0f93cSkardel  */
329abb0f93cSkardel #define ERRSKIP_OPTERR  STMTS(ntp_keygenOptions.fOptSet &= ~OPTPROC_ERRSTOP)
330abb0f93cSkardel #define ERRSTOP_OPTERR  STMTS(ntp_keygenOptions.fOptSet |= OPTPROC_ERRSTOP)
331abb0f93cSkardel #define RESTART_OPT(n)  STMTS( \
332abb0f93cSkardel                 ntp_keygenOptions.curOptIdx = (n); \
333abb0f93cSkardel                 ntp_keygenOptions.pzCurOpt  = NULL )
334abb0f93cSkardel #define START_OPT       RESTART_OPT(1)
335abb0f93cSkardel #define USAGE(c)        (*ntp_keygenOptions.pUsageProc)(&ntp_keygenOptions, c)
336f003fb54Skardel 
337f003fb54Skardel #ifdef  __cplusplus
338f003fb54Skardel extern "C" {
339f003fb54Skardel #endif
340abb0f93cSkardel 
3418585484eSchristos 
342abb0f93cSkardel /* * * * * *
343abb0f93cSkardel  *
344abb0f93cSkardel  *  Declare the ntp-keygen option descriptor.
345abb0f93cSkardel  */
346abb0f93cSkardel extern tOptions ntp_keygenOptions;
347abb0f93cSkardel 
348abb0f93cSkardel #if defined(ENABLE_NLS)
349abb0f93cSkardel # ifndef _
350abb0f93cSkardel #   include <stdio.h>
3518585484eSchristos #   ifndef HAVE_GETTEXT
3528585484eSchristos       extern char * gettext(char const *);
3538585484eSchristos #   else
3548585484eSchristos #     include <libintl.h>
3558585484eSchristos #   endif
3568585484eSchristos 
357b8ecfcfeSchristos # ifndef ATTRIBUTE_FORMAT_ARG
358b8ecfcfeSchristos #   define ATTRIBUTE_FORMAT_ARG(_a)
359b8ecfcfeSchristos # endif
360b8ecfcfeSchristos 
361b8ecfcfeSchristos static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1);
362abb0f93cSkardel static inline char* aoGetsText(char const* pz) {
363abb0f93cSkardel     if (pz == NULL) return NULL;
364abb0f93cSkardel     return (char*)gettext(pz);
365abb0f93cSkardel }
366abb0f93cSkardel #   define _(s)  aoGetsText(s)
367abb0f93cSkardel # endif /* _() */
368abb0f93cSkardel 
369abb0f93cSkardel # define OPT_NO_XLAT_CFG_NAMES  STMTS(ntp_keygenOptions.fOptSet |= \
370abb0f93cSkardel                                     OPTPROC_NXLAT_OPT_CFG;)
371abb0f93cSkardel # define OPT_NO_XLAT_OPT_NAMES  STMTS(ntp_keygenOptions.fOptSet |= \
372abb0f93cSkardel                                     OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;)
373abb0f93cSkardel 
374abb0f93cSkardel # define OPT_XLAT_CFG_NAMES     STMTS(ntp_keygenOptions.fOptSet &= \
375abb0f93cSkardel                                   ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);)
376abb0f93cSkardel # define OPT_XLAT_OPT_NAMES     STMTS(ntp_keygenOptions.fOptSet &= \
377abb0f93cSkardel                                   ~OPTPROC_NXLAT_OPT;)
378abb0f93cSkardel 
379abb0f93cSkardel #else   /* ENABLE_NLS */
380abb0f93cSkardel # define OPT_NO_XLAT_CFG_NAMES
381abb0f93cSkardel # define OPT_NO_XLAT_OPT_NAMES
382abb0f93cSkardel 
383abb0f93cSkardel # define OPT_XLAT_CFG_NAMES
384abb0f93cSkardel # define OPT_XLAT_OPT_NAMES
385abb0f93cSkardel 
386abb0f93cSkardel # ifndef _
387abb0f93cSkardel #   define _(_s)  _s
388abb0f93cSkardel # endif
389abb0f93cSkardel #endif  /* ENABLE_NLS */
390abb0f93cSkardel 
391*eabc0478Schristos 
392abb0f93cSkardel #ifdef  __cplusplus
393abb0f93cSkardel }
394abb0f93cSkardel #endif
395abb0f93cSkardel #endif /* AUTOOPTS_NTP_KEYGEN_OPTS_H_GUARD */
3968585484eSchristos 
397abb0f93cSkardel /* ntp-keygen-opts.h ends here */
398