"Fossies" - the Fresh Open Source Software Archive

Member "global-6.6.5/libutil/version.c" (3 Sep 2020, 1964 Bytes) of package /linux/misc/global-6.6.5.tar.gz:


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 "version.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 6.6.4_vs_6.6.5.

    1 /*
    2  * Copyright (c) 1999, 2000, 2001, 2007
    3  *  Tama Communications Corporation
    4  *
    5  * This file is part of GNU GLOBAL.
    6  *
    7  * This program is free software: you can redistribute it and/or modify
    8  * it under the terms of the GNU General Public License as published by
    9  * the Free Software Foundation, either version 3 of the License, or
   10  * (at your option) any later version.
   11  * 
   12  * This program is distributed in the hope that it will be useful,
   13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15  * GNU General Public License for more details.
   16  * 
   17  * You should have received a copy of the GNU General Public License
   18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   19  */
   20 
   21 #ifdef HAVE_CONFIG_H
   22 #include <config.h>
   23 #endif
   24 #include <stdio.h>
   25 #ifdef STDC_HEADERS
   26 #include <stdlib.h>
   27 #endif
   28 #ifdef USE_SQLITE3
   29 #include "sqlite3.h"
   30 #endif
   31 #include "version.h"
   32 
   33 static const char *copy = "\
   34 Copyright (c) %s Tama Communications Corporation\n\
   35 License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl.html>\n\
   36 This is free software; you are free to change and redistribute it.\n\
   37 There is NO WARRANTY, to the extent permitted by law.\n\
   38 ";
   39 /**
   40  * get_version: get version string.
   41  */
   42 char *
   43 get_version(void)
   44 {
   45     return VERSION;
   46 }
   47 /**
   48  * version: print version information.
   49  *
   50  *  @param[in]  name
   51  *  @param[in]  verbose
   52  */
   53 void
   54 version(const char *name, const int verbose)
   55 {
   56     if (name == NULL)
   57         name = progname;
   58     /*
   59      * if the -q option is not specified then always verbose
   60      * according to the GNU coding standard
   61      */
   62     if (qflag)
   63         fprintf(stdout, "%s\n", VERSION);
   64     else {
   65         fprintf(stdout, "%s (%s) %s\n", name, PACKAGE_NAME, VERSION);
   66         fprintf(stdout, "Powered by Berkeley DB 1.85");
   67 #ifdef USE_SQLITE3
   68         fprintf(stdout, " and SQLite3 %s", sqlite3_version);
   69 #endif
   70         fprintf(stdout, ".\n");
   71         fprintf(stdout, copy, COPYRIGHT_YEAR);
   72     }
   73     exit(0);
   74 }