root/libutil/version.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. get_version
  2. version

   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 
  29 #include "version.h"
  30 
  31 const char *copy = "\
  32 Copyright (c) 2013 Tama Communications Corporation\n\
  33 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
  34 This is free software; you are free to change and redistribute it.\n\
  35 There is NO WARRANTY, to the extent permitted by law.\n\
  36 ";
  37 /**
  38  * get_version: get version string.
  39  */
  40 char *
  41 get_version(void)
  42 {
  43         return VERSION;
  44 }
  45 /**
  46  * version: print version information.
  47  *
  48  *      @param[in]      name
  49  *      @param[in]      verbose
  50  */
  51 void
  52 version(const char *name, const int verbose)
  53 {
  54         if (name == NULL)
  55                 name = progname;
  56         /*
  57          * if the -q option is not specified then always verbose
  58          * according to the GNU coding standard
  59          */
  60         if (qflag)
  61                 fprintf(stdout, "%s\n", VERSION);
  62         else {
  63                 fprintf(stdout, "%s (%s) %s\n", name, PACKAGE_NAME, VERSION);
  64                 fprintf(stdout, "%s", copy);
  65         }
  66         exit(0);
  67 }

/* [previous][next][first][last][top][bottom][index][help] */