LCOV - code coverage report
Current view: top level - src - mkernel-opt.c (source / functions) Hit Total Coverage
Test: mkernel.info Lines: 33 40 82.5 %
Date: 2024-08-25 14:53:31 Functions: 4 4 100.0 %

          Line data    Source code
       1             : /*   -*- buffer-read-only: t -*- vi: set ro:
       2             :  *
       3             :  *  DO NOT EDIT THIS FILE   (mkernel-opt.c)
       4             :  *
       5             :  *  It has been AutoGen-ed
       6             :  *  From the definitions    mkernel-opt.def
       7             :  *  and the template file   options
       8             :  *
       9             :  * Generated from AutoOpts 42:1:17 templates.
      10             :  *
      11             :  *  AutoOpts is a copyrighted work.  This source file is not encumbered
      12             :  *  by AutoOpts licensing, but is provided under the licensing terms chosen
      13             :  *  by the mkernel author or copyright holder.  AutoOpts is
      14             :  *  licensed under the terms of the LGPL.  The redistributable library
      15             :  *  (``libopts'') is licensed under the terms of either the LGPL or, at the
      16             :  *  users discretion, the BSD license.  See the AutoOpts and/or libopts sources
      17             :  *  for details.
      18             :  *
      19             :  * The mkernel program is copyrighted and licensed
      20             :  * under the following terms:
      21             :  *
      22             :  *  Copyright (C) 2017 Francois Cerbelle, all rights reserved.
      23             :  *  This is free software. It is licensed for use, modification and
      24             :  *  redistribution under the terms of the GNU Lesser General Public License,
      25             :  *  version 3 or later <http://gnu.org/licenses/lgpl.html>
      26             :  *
      27             :  *  mkernel is free software: you can redistribute it and/or modify it
      28             :  *  under the terms of the GNU Lesser General Public License as published
      29             :  *  by the Free Software Foundation, either version 3 of the License, or
      30             :  *  (at your option) any later version.
      31             :  *
      32             :  *  mkernel is distributed in the hope that it will be useful, but
      33             :  *  WITHOUT ANY WARRANTY; without even the implied warranty of
      34             :  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      35             :  *  See the GNU Lesser General Public License for more details.
      36             :  *
      37             :  *  You should have received a copy of the GNU Lesser General Public License
      38             :  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.";
      39             :  */
      40             : 
      41             : #ifndef __doxygen__
      42             : #define OPTION_CODE_COMPILE 1
      43             : #include "mkernel-opt.h"
      44             : #include <sys/types.h>
      45             : #include <sys/stat.h>
      46             : 
      47             : #include <errno.h>
      48             : #include <fcntl.h>
      49             : #include <limits.h>
      50             : #include <stdio.h>
      51             : #include <stdlib.h>
      52             : #include <string.h>
      53             : #include <unistd.h>
      54             : 
      55             : #ifdef  __cplusplus
      56             : extern "C" {
      57             : #endif
      58             : extern FILE * option_usage_fp;
      59             : #define zCopyright      (mkernel_opt_strs+0)
      60             : #define zLicenseDescrip (mkernel_opt_strs+266)
      61             : 
      62             : 
      63             : #ifndef NULL
      64             : #  define NULL 0
      65             : #endif
      66             : 
      67             : /**
      68             :  *  static const strings for mkernel options
      69             :  */
      70             : static char const mkernel_opt_strs[1624] =
      71             : /*     0 */ "mkernel 0.0.2\n"
      72             :             "Copyright (C) 2017 Francois Cerbelle, all rights reserved.\n"
      73             :             "This is free software. It is licensed for use, modification and\n"
      74             :             "redistribution under the terms of the GNU Lesser General Public License,\n"
      75             :             "version 3 or later <http://gnu.org/licenses/lgpl.html>\n\0"
      76             : /*   266 */ "mkernel is free software: you can redistribute it and/or modify it under\n"
      77             :             "the terms of the GNU Lesser General Public License as published by the Free\n"
      78             :             "Software Foundation, either version 3 of the License, or (at your option)\n"
      79             :             "any later version.\n\n"
      80             :             "mkernel is distributed in the hope that it will be useful, but WITHOUT ANY\n"
      81             :             "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n"
      82             :             "FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for\n"
      83             :             "more details.\n\n"
      84             :             "You should have received a copy of the GNU Lesser General Public License\n"
      85             :             "along with this program.  If not, see <http://www.gnu.org/licenses/>.\";\n\0"
      86             : /*   892 */ "path to load modules from\0"
      87             : /*   918 */ "MODULE_PATH\0"
      88             : /*   930 */ "module-path\0"
      89             : /*   942 */ "display extended usage information and exit\0"
      90             : /*   986 */ "help\0"
      91             : /*   991 */ "extended usage information passed thru pager\0"
      92             : /*  1036 */ "more-help\0"
      93             : /*  1046 */ "output version information and exit\0"
      94             : /*  1082 */ "version\0"
      95             : /*  1090 */ "save the option state to a config file\0"
      96             : /*  1129 */ "save-opts\0"
      97             : /*  1139 */ "load options from a config file\0"
      98             : /*  1171 */ "LOAD_OPTS\0"
      99             : /*  1181 */ "no-load-opts\0"
     100             : /*  1194 */ "no\0"
     101             : /*  1197 */ "MKERNEL\0"
     102             : /*  1205 */ "mkernel - Generic micro-kernel application\n"
     103             :             "Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <module>\n\0"
     104             : /*  1315 */ "$HOME\0"
     105             : /*  1321 */ ".mkernelrc\0"
     106             : /*  1332 */ "francois@cerbelle.net\0"
     107             : /*  1354 */ "additional information given whenever the usage routine is invoked.\n\0"
     108             : /*  1423 */ "This string is added to the usage output when the HELP option is selected.\n"
     109             :             "The contents of the file 'mkernel.details' is added to the usage output\n"
     110             :             "when the MORE-HELP option is selected.\n\0"
     111             : /*  1610 */ "mkernel 0.0.2";
     112             : 
     113             : /**
     114             :  *  module-path option description:
     115             :  */
     116             : /** Descriptive text for the module-path option */
     117             : #define MODULE_PATH_DESC      (mkernel_opt_strs+892)
     118             : /** Upper-cased name for the module-path option */
     119             : #define MODULE_PATH_NAME      (mkernel_opt_strs+918)
     120             : /** Name string for the module-path option */
     121             : #define MODULE_PATH_name      (mkernel_opt_strs+930)
     122             : /** Compiled in flag settings for the module-path option */
     123             : #define MODULE_PATH_FLAGS     (OPTST_DISABLED \
     124             :         | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
     125             : 
     126             : /*
     127             :  *  Help/More_Help/Version option descriptions:
     128             :  */
     129             : #define HELP_DESC       (mkernel_opt_strs+942)
     130             : #define HELP_name       (mkernel_opt_strs+986)
     131             : #ifdef HAVE_WORKING_FORK
     132             : #define MORE_HELP_DESC  (mkernel_opt_strs+991)
     133             : #define MORE_HELP_name  (mkernel_opt_strs+1036)
     134             : #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
     135             : #else
     136             : #define MORE_HELP_DESC  HELP_DESC
     137             : #define MORE_HELP_name  HELP_name
     138             : #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
     139             : #endif
     140             : #ifdef NO_OPTIONAL_OPT_ARGS
     141             : #  define VER_FLAGS     (OPTST_IMM | OPTST_NO_INIT)
     142             : #else
     143             : #  define VER_FLAGS     (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \
     144             :                          OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT)
     145             : #endif
     146             : #define VER_DESC        (mkernel_opt_strs+1046)
     147             : #define VER_name        (mkernel_opt_strs+1082)
     148             : #define SAVE_OPTS_DESC  (mkernel_opt_strs+1090)
     149             : #define SAVE_OPTS_name  (mkernel_opt_strs+1129)
     150             : #define LOAD_OPTS_DESC     (mkernel_opt_strs+1139)
     151             : #define LOAD_OPTS_NAME     (mkernel_opt_strs+1171)
     152             : #define NO_LOAD_OPTS_name  (mkernel_opt_strs+1181)
     153             : #define LOAD_OPTS_pfx      (mkernel_opt_strs+1194)
     154             : #define LOAD_OPTS_name     (NO_LOAD_OPTS_name + 3)
     155             : /**
     156             :  *  Declare option callback procedures
     157             :  */
     158             : extern tOptProc
     159             :     optionBooleanVal,   optionNestedVal,    optionNumericVal,
     160             :     optionPagedUsage,   optionPrintVersion, optionResetOpt,
     161             :     optionStackArg,     optionTimeDate,     optionTimeVal,
     162             :     optionUnstackArg,   optionVendorOption;
     163             : static tOptProc
     164             :     doUsageOpt;
     165             : #define VER_PROC        optionPrintVersion
     166             : 
     167             : /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
     168             : /**
     169             :  *  Define the mkernel Option Descriptions.
     170             :  * This is an array of OPTION_CT entries, one for each
     171             :  * option that the mkernel program responds to.
     172             :  */
     173             : static tOptDesc optDesc[OPTION_CT] = {
     174             :   {  /* entry idx, value */ 0, VALUE_OPT_MODULE_PATH,
     175             :      /* equiv idx, value */ 0, VALUE_OPT_MODULE_PATH,
     176             :      /* equivalenced to  */ NO_EQUIVALENT,
     177             :      /* min, max, act ct */ 0, 1, 0,
     178             :      /* opt state flags  */ MODULE_PATH_FLAGS, 0,
     179             :      /* last opt argumnt */ { NULL }, /* --module-path */
     180             :      /* arg list/cookie  */ NULL,
     181             :      /* must/cannot opts */ NULL, NULL,
     182             :      /* option proc      */ NULL,
     183             :      /* desc, NAME, name */ MODULE_PATH_DESC, MODULE_PATH_NAME, MODULE_PATH_name,
     184             :      /* disablement strs */ NULL, NULL },
     185             : 
     186             :   {  /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION,
     187             :      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_VERSION,
     188             :      /* equivalenced to  */ NO_EQUIVALENT,
     189             :      /* min, max, act ct */ 0, 1, 0,
     190             :      /* opt state flags  */ VER_FLAGS, AOUSE_VERSION,
     191             :      /* last opt argumnt */ { NULL },
     192             :      /* arg list/cookie  */ NULL,
     193             :      /* must/cannot opts */ NULL, NULL,
     194             :      /* option proc      */ VER_PROC,
     195             :      /* desc, NAME, name */ VER_DESC, NULL, VER_name,
     196             :      /* disablement strs */ NULL, NULL },
     197             : 
     198             : 
     199             : 
     200             :   {  /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
     201             :      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_HELP,
     202             :      /* equivalenced to  */ NO_EQUIVALENT,
     203             :      /* min, max, act ct */ 0, 1, 0,
     204             :      /* opt state flags  */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
     205             :      /* last opt argumnt */ { NULL },
     206             :      /* arg list/cookie  */ NULL,
     207             :      /* must/cannot opts */ NULL, NULL,
     208             :      /* option proc      */ doUsageOpt,
     209             :      /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
     210             :      /* disablement strs */ NULL, NULL },
     211             : 
     212             :   {  /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
     213             :      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
     214             :      /* equivalenced to  */ NO_EQUIVALENT,
     215             :      /* min, max, act ct */ 0, 1, 0,
     216             :      /* opt state flags  */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
     217             :      /* last opt argumnt */ { NULL },
     218             :      /* arg list/cookie  */ NULL,
     219             :      /* must/cannot opts */ NULL,  NULL,
     220             :      /* option proc      */ optionPagedUsage,
     221             :      /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
     222             :      /* disablement strs */ NULL, NULL },
     223             : 
     224             :   {  /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
     225             :      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
     226             :      /* equivalenced to  */ NO_EQUIVALENT,
     227             :      /* min, max, act ct */ 0, 1, 0,
     228             :      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
     229             :                        | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
     230             :      /* last opt argumnt */ { NULL },
     231             :      /* arg list/cookie  */ NULL,
     232             :      /* must/cannot opts */ NULL,  NULL,
     233             :      /* option proc      */ NULL,
     234             :      /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
     235             :      /* disablement strs */ NULL, NULL },
     236             : 
     237             :   {  /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
     238             :      /* equiv idx value  */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
     239             :      /* equivalenced to  */ NO_EQUIVALENT,
     240             :      /* min, max, act ct */ 0, NOLIMIT, 0,
     241             :      /* opt state flags  */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
     242             :                           | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
     243             :      /* last opt argumnt */ { NULL },
     244             :      /* arg list/cookie  */ NULL,
     245             :      /* must/cannot opts */ NULL, NULL,
     246             :      /* option proc      */ optionLoadOpt,
     247             :      /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
     248             :      /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
     249             : };
     250             : 
     251             : 
     252             : /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
     253             : /** Reference to the upper cased version of mkernel. */
     254             : #define zPROGNAME       (mkernel_opt_strs+1197)
     255             : /** Reference to the title line for mkernel usage. */
     256             : #define zUsageTitle     (mkernel_opt_strs+1205)
     257             : /** mkernel configuration file name. */
     258             : #define zRcName         (mkernel_opt_strs+1321)
     259             : /** Directories to search for mkernel config files. */
     260             : static char const * const apzHomeList[2] = {
     261             :     mkernel_opt_strs+1315,
     262             :     NULL };
     263             : /** The mkernel program bug email address. */
     264             : #define zBugsAddr       (mkernel_opt_strs+1332)
     265             : /** Clarification/explanation of what mkernel does. */
     266             : #define zExplain        (mkernel_opt_strs+1354)
     267             : /** Extra detail explaining what mkernel does. */
     268             : #define zDetail         (mkernel_opt_strs+1423)
     269             : /** The full version string for mkernel. */
     270             : #define zFullVersion    (mkernel_opt_strs+1610)
     271             : /* extracted from optcode.tlib near line 342 */
     272             : 
     273             : #if defined(ENABLE_NLS)
     274             : # define OPTPROC_BASE OPTPROC_TRANSLATE
     275             :   static tOptionXlateProc translate_option_strings;
     276             : #else
     277             : # define OPTPROC_BASE OPTPROC_NONE
     278             : # define translate_option_strings NULL
     279             : #endif /* ENABLE_NLS */
     280             : 
     281             : #define mkernel_full_usage (NULL)
     282             : #define mkernel_short_usage (NULL)
     283             : 
     284             : #endif /* not defined __doxygen__ */
     285             : 
     286             : /*
     287             :  *  Create the static procedure(s) declared above.
     288             :  */
     289             : /**
     290             :  * The callout function that invokes the optionUsage function.
     291             :  *
     292             :  * @param[in] opts the AutoOpts option description structure
     293             :  * @param[in] od   the descriptor for the "help" (usage) option.
     294             :  * @noreturn
     295             :  */
     296             : static void
     297           2 : doUsageOpt(tOptions * opts, tOptDesc * od)
     298             : {
     299             :     int ex_code;
     300           2 :     ex_code = MKERNEL_EXIT_SUCCESS;
     301           2 :     optionUsage(&mkernelOptions, ex_code);
     302             :     /* NOTREACHED */
     303           0 :     exit(MKERNEL_EXIT_FAILURE);
     304             :     (void)opts;
     305             :     (void)od;
     306             : }
     307             : /* extracted from optmain.tlib near line 1250 */
     308             : 
     309             : /**
     310             :  * The directory containing the data associated with mkernel.
     311             :  */
     312             : #ifndef  PKGDATADIR
     313             : # define PKGDATADIR ""
     314             : #endif
     315             : 
     316             : /**
     317             :  * Information about the person or institution that packaged mkernel
     318             :  * for the current distribution.
     319             :  */
     320             : #ifndef  WITH_PACKAGER
     321             : # define mkernel_packager_info NULL
     322             : #else
     323             : /** Packager information for mkernel. */
     324             : static char const mkernel_packager_info[] =
     325             :     "Packaged by " WITH_PACKAGER
     326             : 
     327             : # ifdef WITH_PACKAGER_VERSION
     328             :         " ("WITH_PACKAGER_VERSION")"
     329             : # endif
     330             : 
     331             : # ifdef WITH_PACKAGER_BUG_REPORTS
     332             :     "\nReport mkernel bugs to " WITH_PACKAGER_BUG_REPORTS
     333             : # endif
     334             :     "\n";
     335             : #endif
     336             : #ifndef __doxygen__
     337             : 
     338             : #endif /* __doxygen__ */
     339             : /**
     340             :  * The option definitions for mkernel.  The one structure that
     341             :  * binds them all.
     342             :  */
     343             : tOptions mkernelOptions = {
     344             :     OPTIONS_STRUCT_VERSION,
     345             :     0, NULL,                    /* original argc + argv    */
     346             :     ( OPTPROC_BASE
     347             :     + OPTPROC_ERRSTOP
     348             :     + OPTPROC_SHORTOPT
     349             :     + OPTPROC_LONGOPT
     350             :     + OPTPROC_NO_REQ_OPT
     351             :     + OPTPROC_ENVIRON
     352             :     + OPTPROC_ARGS_REQ
     353             :     + OPTPROC_GNUUSAGE ),
     354             :     0, NULL,                    /* current option index, current option */
     355             :     NULL,         NULL,         zPROGNAME,
     356             :     zRcName,      zCopyright,   zLicenseDescrip,
     357             :     zFullVersion, apzHomeList,  zUsageTitle,
     358             :     zExplain,     zDetail,      optDesc,
     359             :     zBugsAddr,                  /* address to send bugs to */
     360             :     NULL, NULL,                 /* extensions/saved state  */
     361             :     optionUsage, /* usage procedure */
     362             :     translate_option_strings,   /* translation procedure */
     363             :     /*
     364             :      *  Indexes to special options
     365             :      */
     366             :     { INDEX_OPT_MORE_HELP, /* more-help option index */
     367             :       INDEX_OPT_SAVE_OPTS, /* save option index */
     368             :       NO_EQUIVALENT, /* '-#' option index */
     369             :       NO_EQUIVALENT /* index of default opt */
     370             :     },
     371             :     6 /* full option count */, 1 /* user option count */,
     372             :     mkernel_full_usage, mkernel_short_usage,
     373             :     NULL, NULL,
     374             :     PKGDATADIR, mkernel_packager_info
     375             : };
     376             : 
     377             : #if ENABLE_NLS
     378             : /**
     379             :  * This code is designed to translate translatable option text for the
     380             :  * mkernel program.  These translations happen upon entry
     381             :  * to optionProcess().
     382             :  */
     383             : #include <stdio.h>
     384             : #include <stdlib.h>
     385             : #include <string.h>
     386             : #include <unistd.h>
     387             : #ifdef HAVE_DCGETTEXT
     388             : # include <gettext.h>
     389             : #endif
     390             : #include <autoopts/usage-txt.h>
     391             : 
     392             : static char * AO_gettext(char const * pz);
     393             : static void   coerce_it(void ** s);
     394             : 
     395             : /**
     396             :  * AutoGen specific wrapper function for gettext.  It relies on the macro _()
     397             :  * to convert from English to the target language, then strdup-duplicates the
     398             :  * result string.  It tries the "libopts" domain first, then whatever has been
     399             :  * set via the \a textdomain(3) call.
     400             :  *
     401             :  * @param[in] pz the input text used as a lookup key.
     402             :  * @returns the translated text (if there is one),
     403             :  *   or the original text (if not).
     404             :  */
     405             : static char *
     406        2023 : AO_gettext(char const * pz)
     407             : {
     408             :     char * res;
     409        2023 :     if (pz == NULL)
     410           0 :         return NULL;
     411             : #ifdef HAVE_DCGETTEXT
     412             :     /*
     413             :      * While processing the option_xlateable_txt data, try to use the
     414             :      * "libopts" domain.  Once we switch to the option descriptor data,
     415             :      * do *not* use that domain.
     416             :      */
     417        2023 :     if (option_xlateable_txt.field_ct != 0) {
     418        1819 :         res = dgettext("libopts", pz);
     419        1819 :         if (res == pz)
     420        1819 :             res = (char *)VOIDP(_(pz));
     421             :     } else
     422         204 :         res = (char *)VOIDP(_(pz));
     423             : #else
     424             :     res = (char *)VOIDP(_(pz));
     425             : #endif
     426        2023 :     if (res == pz)
     427        2023 :         return res;
     428           0 :     res = strdup(res);
     429           0 :     if (res == NULL) {
     430           0 :         fputs(_("No memory for duping translated strings\n"), stderr);
     431           0 :         exit(MKERNEL_EXIT_FAILURE);
     432             :     }
     433           0 :     return res;
     434             : }
     435             : 
     436             : /**
     437             :  * All the pointers we use are marked "* const", but they are stored in
     438             :  * writable memory.  Coerce the mutability and set the pointer.
     439             :  */
     440         204 : static void coerce_it(void ** s) { *s = AO_gettext(*s);
     441         204 : }
     442             : 
     443             : /**
     444             :  * Translate all the translatable strings in the mkernelOptions
     445             :  * structure defined above.  This is done only once.
     446             :  */
     447             : static void
     448          17 : translate_option_strings(void)
     449             : {
     450          17 :     tOptions * const opts = &mkernelOptions;
     451             : 
     452             :     /*
     453             :      *  Guard against re-translation.  It won't work.  The strings will have
     454             :      *  been changed by the first pass through this code.  One shot only.
     455             :      */
     456          17 :     if (option_xlateable_txt.field_ct != 0) {
     457             :         /*
     458             :          *  Do the translations.  The first pointer follows the field count
     459             :          *  field.  The field count field is the size of a pointer.
     460             :          */
     461          17 :         char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
     462          17 :         int     ix  = option_xlateable_txt.field_ct;
     463             : 
     464             :         do {
     465        1819 :             ppz++; /* skip over field_ct */
     466        1819 :             *ppz = AO_gettext(*ppz);
     467        1819 :         } while (--ix > 0);
     468             :         /* prevent re-translation and disable "libopts" domain lookup */
     469          17 :         option_xlateable_txt.field_ct = 0;
     470             : 
     471          17 :         coerce_it(VOIDP(&(opts->pzCopyright)));
     472          17 :         coerce_it(VOIDP(&(opts->pzCopyNotice)));
     473          17 :         coerce_it(VOIDP(&(opts->pzFullVersion)));
     474          17 :         coerce_it(VOIDP(&(opts->pzUsageTitle)));
     475          17 :         coerce_it(VOIDP(&(opts->pzExplain)));
     476          17 :         coerce_it(VOIDP(&(opts->pzDetail)));
     477             :         {
     478          17 :             tOptDesc * od = opts->pOptDesc;
     479         119 :             for (ix = opts->optCt; ix > 0; ix--, od++)
     480         102 :                 coerce_it(VOIDP(&(od->pzText)));
     481             :         }
     482             :     }
     483          17 : }
     484             : #endif /* ENABLE_NLS */
     485             : 
     486             : #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
     487             : /** I18N function strictly for xgettext.  Do not compile. */
     488             : static void bogus_function(void) {
     489             :   /* TRANSLATORS:
     490             : 
     491             :      The following dummy function was crated solely so that xgettext can
     492             :      extract the correct strings.  These strings are actually referenced
     493             :      by a field name in the mkernelOptions structure noted in the
     494             :      comments below.  The literal text is defined in mkernel_opt_strs.
     495             : 
     496             :      NOTE: the strings below are segmented with respect to the source string
     497             :      mkernel_opt_strs.  The strings above are handed off for translation
     498             :      at run time a paragraph at a time.  Consequently, they are presented here
     499             :      for translation a paragraph at a time.
     500             : 
     501             :      ALSO: often the description for an option will reference another option
     502             :      by name.  These are set off with apostrophe quotes (I hope).  Do not
     503             :      translate option names.
     504             :    */
     505             :   /* referenced via mkernelOptions.pzCopyright */
     506             :   puts(_("mkernel 0.0.2\n\
     507             : Copyright (C) 2017 Francois Cerbelle, all rights reserved.\n\
     508             : This is free software. It is licensed for use, modification and\n\
     509             : redistribution under the terms of the GNU Lesser General Public License,\n\
     510             : version 3 or later <http://gnu.org/licenses/lgpl.html>\n"));
     511             : 
     512             :   /* referenced via mkernelOptions.pzCopyNotice */
     513             :   puts(_("mkernel is free software: you can redistribute it and/or modify it under\n\
     514             : the terms of the GNU Lesser General Public License as published by the Free\n\
     515             : Software Foundation, either version 3 of the License, or (at your option)\n\
     516             : any later version.\n\n"));
     517             :   puts(_("mkernel is distributed in the hope that it will be useful, but WITHOUT ANY\n\
     518             : WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\
     519             : FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for\n\
     520             : more details.\n\n"));
     521             :   puts(_("You should have received a copy of the GNU Lesser General Public License\n\
     522             : along with this program.  If not, see <http://www.gnu.org/licenses/>.\";\n"));
     523             : 
     524             :   /* referenced via mkernelOptions.pOptDesc->pzText */
     525             :   puts(_("path to load modules from"));
     526             : 
     527             :   /* referenced via mkernelOptions.pOptDesc->pzText */
     528             :   puts(_("display extended usage information and exit"));
     529             : 
     530             :   /* referenced via mkernelOptions.pOptDesc->pzText */
     531             :   puts(_("extended usage information passed thru pager"));
     532             : 
     533             :   /* referenced via mkernelOptions.pOptDesc->pzText */
     534             :   puts(_("output version information and exit"));
     535             : 
     536             :   /* referenced via mkernelOptions.pOptDesc->pzText */
     537             :   puts(_("save the option state to a config file"));
     538             : 
     539             :   /* referenced via mkernelOptions.pOptDesc->pzText */
     540             :   puts(_("load options from a config file"));
     541             : 
     542             :   /* referenced via mkernelOptions.pzUsageTitle */
     543             :   puts(_("mkernel - Generic micro-kernel application\n\
     544             : Usage:  %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <module>\n"));
     545             : 
     546             :   /* referenced via mkernelOptions.pzExplain */
     547             :   puts(_("additional information given whenever the usage routine is invoked.\n"));
     548             : 
     549             :   /* referenced via mkernelOptions.pzDetail */
     550             :   puts(_("This string is added to the usage output when the HELP option is selected.\n\
     551             : The contents of the file 'mkernel.details' is added to the usage output\n\
     552             : when the MORE-HELP option is selected.\n"));
     553             : 
     554             :   /* referenced via mkernelOptions.pzFullVersion */
     555             :   puts(_("mkernel 0.0.2"));
     556             : 
     557             :   /* referenced via mkernelOptions.pzFullUsage */
     558             :   puts(_("<<<NOT-FOUND>>>"));
     559             : 
     560             :   /* referenced via mkernelOptions.pzShortUsage */
     561             :   puts(_("<<<NOT-FOUND>>>"));
     562             :   /* LIBOPTS-MESSAGES: */
     563             : #line 67 "../autoopts.c"
     564             :   puts(_("allocation of %d bytes failed\n"));
     565             : #line 89 "../autoopts.c"
     566             :   puts(_("allocation of %d bytes failed\n"));
     567             : #line 48 "../init.c"
     568             :   puts(_("AutoOpts function called without option descriptor\n"));
     569             : #line 81 "../init.c"
     570             :   puts(_("\tThis exceeds the compiled library version:  "));
     571             : #line 79 "../init.c"
     572             :   puts(_("Automated Options Processing Error!\n"
     573             :        "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
     574             : #line 78 "../autoopts.c"
     575             :   puts(_("realloc of %d bytes at 0x%p failed\n"));
     576             : #line 83 "../init.c"
     577             :   puts(_("\tThis is less than the minimum library version:  "));
     578             : #line 121 "../version.c"
     579             :   puts(_("Automated Options version %s\n"
     580             :        "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
     581             : #line 49 "../makeshell.c"
     582             :   puts(_("(AutoOpts bug):  %s.\n"));
     583             : #line 90 "../reset.c"
     584             :   puts(_("optionResetOpt() called, but reset-option not configured"));
     585             : #line 241 "../usage.c"
     586             :   puts(_("could not locate the 'help' option"));
     587             : #line 330 "../autoopts.c"
     588             :   puts(_("optionProcess() was called with invalid data"));
     589             : #line 697 "../usage.c"
     590             :   puts(_("invalid argument type specified"));
     591             : #line 568 "../find.c"
     592             :   puts(_("defaulted to option with optional arg"));
     593             : #line 76 "../alias.c"
     594             :   puts(_("aliasing option is out of range."));
     595             : #line 210 "../enum.c"
     596             :   puts(_("%s error:  the keyword '%s' is ambiguous for %s\n"));
     597             : #line 78 "../find.c"
     598             :   puts(_("  The following options match:\n"));
     599             : #line 263 "../find.c"
     600             :   puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
     601             : #line 161 "../check.c"
     602             :   puts(_("%s: Command line arguments required\n"));
     603             : #line 43 "../alias.c"
     604             :   puts(_("%d %s%s options allowed\n"));
     605             : #line 56 "../makeshell.c"
     606             :   puts(_("%s error %d (%s) calling %s for '%s'\n"));
     607             : #line 268 "../makeshell.c"
     608             :   puts(_("interprocess pipe"));
     609             : #line 171 "../version.c"
     610             :   puts(_("error: version option argument '%c' invalid.  Use:\n"
     611             :        "\t'v' - version only\n"
     612             :        "\t'c' - version and copyright\n"
     613             :        "\t'n' - version and full copyright notice\n"));
     614             : #line 58 "../check.c"
     615             :   puts(_("%s error:  the '%s' and '%s' options conflict\n"));
     616             : #line 187 "../find.c"
     617             :   puts(_("%s: The '%s' option has been disabled."));
     618             : #line 400 "../find.c"
     619             :   puts(_("%s: The '%s' option has been disabled."));
     620             : #line 38 "../alias.c"
     621             :   puts(_("-equivalence"));
     622             : #line 439 "../find.c"
     623             :   puts(_("%s: illegal option -- %c\n"));
     624             : #line 110 "../reset.c"
     625             :   puts(_("%s: illegal option -- %c\n"));
     626             : #line 241 "../find.c"
     627             :   puts(_("%s: illegal option -- %s\n"));
     628             : #line 740 "../find.c"
     629             :   puts(_("%s: illegal option -- %s\n"));
     630             : #line 118 "../reset.c"
     631             :   puts(_("%s: illegal option -- %s\n"));
     632             : #line 305 "../find.c"
     633             :   puts(_("%s: unknown vendor extension option -- %s\n"));
     634             : #line 135 "../enum.c"
     635             :   puts(_("  or an integer from %d through %d\n"));
     636             : #line 145 "../enum.c"
     637             :   puts(_("  or an integer from %d through %d\n"));
     638             : #line 696 "../usage.c"
     639             :   puts(_("%s error:  invalid option descriptor for %s\n"));
     640             : #line 1030 "../usage.c"
     641             :   puts(_("%s error:  invalid option descriptor for %s\n"));
     642             : #line 355 "../find.c"
     643             :   puts(_("%s: invalid option name: %s\n"));
     644             : #line 497 "../find.c"
     645             :   puts(_("%s: The '%s' option requires an argument.\n"));
     646             : #line 150 "../autoopts.c"
     647             :   puts(_("(AutoOpts bug):  Equivalenced option '%s' was equivalenced to both\n"
     648             :        "\t'%s' and '%s'."));
     649             : #line 94 "../check.c"
     650             :   puts(_("%s error:  The %s option is required\n"));
     651             : #line 602 "../find.c"
     652             :   puts(_("%s: The '%s' option cannot have an argument.\n"));
     653             : #line 151 "../check.c"
     654             :   puts(_("%s: Command line arguments are not allowed.\n"));
     655             : #line 568 "../save.c"
     656             :   puts(_("error %d (%s) creating %s\n"));
     657             : #line 210 "../enum.c"
     658             :   puts(_("%s error:  '%s' does not match any %s keywords.\n"));
     659             : #line 93 "../reset.c"
     660             :   puts(_("%s error: The '%s' option requires an argument.\n"));
     661             : #line 122 "../save.c"
     662             :   puts(_("error %d (%s) stat-ing %s\n"));
     663             : #line 175 "../save.c"
     664             :   puts(_("error %d (%s) stat-ing %s\n"));
     665             : #line 143 "../restore.c"
     666             :   puts(_("%s error: no saved option state\n"));
     667             : #line 225 "../autoopts.c"
     668             :   puts(_("'%s' is not a command line option.\n"));
     669             : #line 113 "../time.c"
     670             :   puts(_("%s error:  '%s' is not a recognizable date/time.\n"));
     671             : #line 50 "../time.c"
     672             :   puts(_("%s error:  '%s' is not a recognizable time duration.\n"));
     673             : #line 92 "../check.c"
     674             :   puts(_("%s error:  The %s option must appear %d times.\n"));
     675             : #line 165 "../numeric.c"
     676             :   puts(_("%s error:  '%s' is not a recognizable number.\n"));
     677             : #line 176 "../enum.c"
     678             :   puts(_("%s error:  %s exceeds %s keyword count\n"));
     679             : #line 279 "../usage.c"
     680             :   puts(_("Try '%s %s' for more information.\n"));
     681             : #line 45 "../alias.c"
     682             :   puts(_("one %s%s option allowed\n"));
     683             : #line 170 "../makeshell.c"
     684             :   puts(_("standard output"));
     685             : #line 905 "../makeshell.c"
     686             :   puts(_("standard output"));
     687             : #line 223 "../usage.c"
     688             :   puts(_("standard output"));
     689             : #line 364 "../usage.c"
     690             :   puts(_("standard output"));
     691             : #line 574 "../usage.c"
     692             :   puts(_("standard output"));
     693             : #line 178 "../version.c"
     694             :   puts(_("standard output"));
     695             : #line 223 "../usage.c"
     696             :   puts(_("standard error"));
     697             : #line 364 "../usage.c"
     698             :   puts(_("standard error"));
     699             : #line 574 "../usage.c"
     700             :   puts(_("standard error"));
     701             : #line 178 "../version.c"
     702             :   puts(_("standard error"));
     703             : #line 170 "../makeshell.c"
     704             :   puts(_("write"));
     705             : #line 905 "../makeshell.c"
     706             :   puts(_("write"));
     707             : #line 222 "../usage.c"
     708             :   puts(_("write"));
     709             : #line 363 "../usage.c"
     710             :   puts(_("write"));
     711             : #line 573 "../usage.c"
     712             :   puts(_("write"));
     713             : #line 177 "../version.c"
     714             :   puts(_("write"));
     715             : #line 60 "../numeric.c"
     716             :   puts(_("%s error:  %s option value %ld is out of range.\n"));
     717             : #line 44 "../check.c"
     718             :   puts(_("%s error:  %s option requires the %s option\n"));
     719             : #line 121 "../save.c"
     720             :   puts(_("%s warning:  cannot save options - %s not regular file\n"));
     721             : #line 174 "../save.c"
     722             :   puts(_("%s warning:  cannot save options - %s not regular file\n"));
     723             : #line 193 "../save.c"
     724             :   puts(_("%s warning:  cannot save options - %s not regular file\n"));
     725             : #line 567 "../save.c"
     726             :   puts(_("%s warning:  cannot save options - %s not regular file\n"));
     727             :   /* END-LIBOPTS-MESSAGES */
     728             : 
     729             :   /* USAGE-TEXT: */
     730             : #line 822 "../usage.c"
     731             :   puts(_("\t\t\t\t- an alternate for '%s'\n"));
     732             : #line 1097 "../usage.c"
     733             :   puts(_("Version, usage and configuration options:"));
     734             : #line 873 "../usage.c"
     735             :   puts(_("\t\t\t\t- default option for unnamed options\n"));
     736             : #line 786 "../usage.c"
     737             :   puts(_("\t\t\t\t- disabled as '--%s'\n"));
     738             : #line 1066 "../usage.c"
     739             :   puts(_(" --- %-14s %s\n"));
     740             : #line 1064 "../usage.c"
     741             :   puts(_("This option has been disabled"));
     742             : #line 813 "../usage.c"
     743             :   puts(_("\t\t\t\t- enabled by default\n"));
     744             : #line 40 "../alias.c"
     745             :   puts(_("%s error:  only "));
     746             : #line 1143 "../usage.c"
     747             :   puts(_(" - examining environment variables named %s_*\n"));
     748             : #line 168 "../file.c"
     749             :   puts(_("\t\t\t\t- file must not pre-exist\n"));
     750             : #line 172 "../file.c"
     751             :   puts(_("\t\t\t\t- file must pre-exist\n"));
     752             : #line 329 "../usage.c"
     753             :   puts(_("Options are specified by doubled hyphens and their name or by a single\n"
     754             :        "hyphen and the flag character.\n"));
     755             : #line 882 "../makeshell.c"
     756             :   puts(_("\n"
     757             :        "= = = = = = = =\n\n"
     758             :        "This incarnation of genshell will produce\n"
     759             :        "a shell script to parse the options for %s:\n\n"));
     760             : #line 142 "../enum.c"
     761             :   puts(_("  or an integer mask with any of the lower %d bits set\n"));
     762             : #line 846 "../usage.c"
     763             :   puts(_("\t\t\t\t- is a set membership option\n"));
     764             : #line 867 "../usage.c"
     765             :   puts(_("\t\t\t\t- must appear between %d and %d times\n"));
     766             : #line 331 "../usage.c"
     767             :   puts(_("Options are specified by single or double hyphens and their name.\n"));
     768             : #line 853 "../usage.c"
     769             :   puts(_("\t\t\t\t- may appear multiple times\n"));
     770             : #line 840 "../usage.c"
     771             :   puts(_("\t\t\t\t- may not be preset\n"));
     772             : #line 1258 "../usage.c"
     773             :   puts(_("   Arg Option-Name    Description\n"));
     774             : #line 1194 "../usage.c"
     775             :   puts(_("  Flg Arg Option-Name    Description\n"));
     776             : #line 1252 "../usage.c"
     777             :   puts(_("  Flg Arg Option-Name    Description\n"));
     778             : #line 1253 "../usage.c"
     779             :   puts(_(" %3s %s"));
     780             : #line 1259 "../usage.c"
     781             :   puts(_(" %3s %s"));
     782             : #line 336 "../usage.c"
     783             :   puts(_("The '-#<number>' option may omit the hash char\n"));
     784             : #line 332 "../usage.c"
     785             :   puts(_("All arguments are named options.\n"));
     786             : #line 920 "../usage.c"
     787             :   puts(_(" - reading file %s"));
     788             : #line 358 "../usage.c"
     789             :   puts(_("\n"
     790             :        "Please send bug reports to:  <%s>\n"));
     791             : #line 100 "../version.c"
     792             :   puts(_("\n"
     793             :        "Please send bug reports to:  <%s>\n"));
     794             : #line 129 "../version.c"
     795             :   puts(_("\n"
     796             :        "Please send bug reports to:  <%s>\n"));
     797             : #line 852 "../usage.c"
     798             :   puts(_("\t\t\t\t- may NOT appear - preset only\n"));
     799             : #line 893 "../usage.c"
     800             :   puts(_("\n"
     801             :        "The following option preset mechanisms are supported:\n"));
     802             : #line 1141 "../usage.c"
     803             :   puts(_("\n"
     804             :        "The following option preset mechanisms are supported:\n"));
     805             : #line 631 "../usage.c"
     806             :   puts(_("prohibits these options:\n"));
     807             : #line 626 "../usage.c"
     808             :   puts(_("prohibits the option '%s'\n"));
     809             : #line 81 "../numeric.c"
     810             :   puts(_("%s%ld to %ld"));
     811             : #line 79 "../numeric.c"
     812             :   puts(_("%sgreater than or equal to %ld"));
     813             : #line 75 "../numeric.c"
     814             :   puts(_("%s%ld exactly"));
     815             : #line 68 "../numeric.c"
     816             :   puts(_("%sit must lie in one of the ranges:\n"));
     817             : #line 68 "../numeric.c"
     818             :   puts(_("%sit must be in the range:\n"));
     819             : #line 88 "../numeric.c"
     820             :   puts(_(", or\n"));
     821             : #line 66 "../numeric.c"
     822             :   puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
     823             : #line 77 "../numeric.c"
     824             :   puts(_("%sless than or equal to %ld"));
     825             : #line 339 "../usage.c"
     826             :   puts(_("Operands and options may be intermixed.  They will be reordered.\n"));
     827             : #line 601 "../usage.c"
     828             :   puts(_("requires the option '%s'\n"));
     829             : #line 604 "../usage.c"
     830             :   puts(_("requires these options:\n"));
     831             : #line 1270 "../usage.c"
     832             :   puts(_("   Arg Option-Name   Req?  Description\n"));
     833             : #line 1264 "../usage.c"
     834             :   puts(_("  Flg Arg Option-Name   Req?  Description\n"));
     835             : #line 143 "../enum.c"
     836             :   puts(_("or you may use a numeric representation.  Preceding these with a '!'\n"
     837             :        "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
     838             :        "will set them all.  Multiple entries may be passed as an option\n"
     839             :        "argument list.\n"));
     840             : #line 859 "../usage.c"
     841             :   puts(_("\t\t\t\t- may appear up to %d times\n"));
     842             : #line 52 "../enum.c"
     843             :   puts(_("The valid \"%s\" option keywords are:\n"));
     844             : #line 1101 "../usage.c"
     845             :   puts(_("The next option supports vendor supported extra options:"));
     846             : #line 722 "../usage.c"
     847             :   puts(_("These additional options are:"));
     848             :   /* END-USAGE-TEXT */
     849             : }
     850             : #endif /* uncompilable code */
     851             : #ifdef  __cplusplus
     852             : }
     853             : #endif
     854             : /* mkernel-opt.c ends here */

Generated by: LCOV version 1.16