"Fossies" - the Fresh Open Source Software Archive

Member "leafnode-1.12.0/leafnode-version.c" (28 Dec 2021, 1419 Bytes) of package /linux/misc/leafnode-1.12.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "leafnode-version.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.11.12_vs_1.12.0.

    1 /* (C) 2002 - 2021 by Matthias Andree
    2  *
    3  * This file is under the same license as the rest of leafnode. Please see the
    4  * file "COPYING" that should be in the same directory as this.
    5  */
    6 
    7 #include "leafnode.h"
    8 
    9 #include <stdio.h>
   10 #include <string.h>
   11 
   12 int main(int argc, char **argv) {
   13     static char env_path[] = "PATH=/bin:/usr/bin";
   14     uint8_t pcre2info[64]; /* PCRE 10 requires at least 24 code units */
   15 
   16     /* DO NOT CHANGE THE OUTPUT FORMAT; EXTERNAL TOOLS DEPEND ON IT!
   17      * (namely, leafwa does)
   18      */
   19     fputs("version: leafnode-", stdout);
   20     puts(version);
   21 
   22     /* new in 1.11.7: -v mode to print more information, such as directories */
   23     if (argc > 1 &&
   24         (0 == strcmp(argv[1], "-v")
   25          || 0 == strcmp(argv[1], "--verbose")))
   26     {
   27     fputs("current machine: ", stdout);
   28     fflush(stdout);
   29     putenv(env_path);
   30     if (system("uname -a"))
   31         puts(" (error)");
   32     fputs("sysconfdir: ", stdout);
   33     puts(sysconfdir);
   34     fputs("spooldir: ", stdout);
   35     puts(spooldir);
   36     fputs("lockfile: ", stdout);
   37     puts(lockfile);
   38 #ifdef HAVE_IPV6
   39     puts("IPv6: yes");
   40 #else
   41     puts("IPv6: no");
   42 #endif
   43 #ifdef HAVE_GETIFADDRS
   44     puts("HAVE_GETIFADDRS: yes");
   45 #else
   46     puts("HAVE_GETIFADDRS: no");
   47 #endif
   48     pcre2_config_8(PCRE2_CONFIG_VERSION, pcre2info);
   49     printf("PCRE2 version: %s\n", pcre2info);
   50 
   51     pcre2_config_8(PCRE2_CONFIG_UNICODE_VERSION, pcre2info);
   52     printf("PCRE2 Unicode version: %s\n", pcre2info);
   53     }
   54     return 0;
   55 }