src/contrib/ntp/util/ntp-keygen-opts.c
/**
 * AutoGen specific wrapper function for gettext.  It relies on the macro _()
 * to convert from English to the target language, then strdup-duplicates the
 * result string.  It tries the "libopts" domain first, then whatever has been
 * set via the \a textdomain(3) call.
 *
 * @param[in] pz the input text used as a lookup key.
 * @returns the translated text (if there is one),
 *   or the original text (if not).
 */
AutoGen specific wrapper function for gettext.  It relies on the macro _()
to convert from English to the target language, then strdup-duplicates the
result string.  It tries the "libopts" domain first, then whatever has been
set via the \a textdomain(3) call.

@param[in] pz the input text used as a lookup key.
@returns the translated text (if there is one),
or the original text (if not).
AutoGen specific wrapper function for gettext . It relies on the macro _ () to convert from English to the target language then strdup - duplicates the result string . It tries the " libopts " domain first then whatever has been set via the \ a textdomain ( 3 ) call . @param [ in ] pz the input text used as a lookup key . @returns the translated text ( if there is one ) or the original text ( if not ) .
static char *
AO_gettext(char const * pz)
{
    char * res;
    if (pz == NULL)
        return NULL;
#ifdef HAVE_DCGETTEXT
    if (option_xlateable_txt.field_ct != 0) {
        res = dgettext("libopts", pz);
        if (res == pz)
            res = (char *)VOIDP(_(pz));
    } else
        res = (char *)VOIDP(_(pz));
#else
    res = (char *)VOIDP(_(pz));
#endif
    if (res == pz)
        return res;
    res = strdup(res);
    if (res == NULL) {
        fputs(_("No memory for duping translated strings\n"), stderr);
        exit(NTP_KEYGEN_EXIT_FAILURE);
    }
    return res;
}
static char * AO_gettext ( char const * pz ) { char * res ; if ( pz == NULL ) return NULL ; #ifdef HAVE_DCGETTEXT if ( option_xlateable_txt . field_ct != 0 ) { res = dgettext ( " " , pz ) ; if ( res == pz ) res = ( char * ) VOIDP ( _ ( pz ) ) ; } else res = ( char * ) VOIDP ( _ ( pz ) ) ; #else res = ( char * ) VOIDP ( _ ( pz ) ) ; #endif if ( res == pz ) return res ; res = strdup ( res ) ; if ( res == NULL ) { fputs ( _ ( " \n " ) , stderr ) ; exit ( NTP_KEYGEN_EXIT_FAILURE ) ; } return res ; }
AutoGen specific wrapper function for gettext.
AutoGen specific wrapper function for gettext .
/*
     * While processing the option_xlateable_txt data, try to use the
     * "libopts" domain.  Once we switch to the option descriptor data,
     * do *not* use that domain.
     */