source: vendor/bash/3.1-p17/version.c@ 3548

Last change on this file since 3548 was 3231, checked in by bird, 18 years ago

eol style.

  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1/* version.c -- distribution and version numbers. */
2
3/* Copyright (C) 1989-2005 Free Software Foundation, Inc.
4
5 This file is part of GNU Bash, the Bourne Again SHell.
6
7 Bash is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License along
18 with Bash; see the file COPYING. If not, write to the Free Software
19 Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
20
21#include <config.h>
22
23#include <stdio.h>
24
25#include "stdc.h"
26
27#include "version.h"
28#include "patchlevel.h"
29#include "conftypes.h"
30
31#include "bashintl.h"
32
33extern char *shell_name;
34
35/* Defines from version.h */
36const char *dist_version = DISTVERSION;
37int patch_level = PATCHLEVEL;
38int build_version = BUILDVERSION;
39#ifdef RELSTATUS
40const char *release_status = RELSTATUS;
41#else
42const char *release_status = (char *)0;
43#endif
44const char *sccs_version = SCCSVERSION;
45
46/* Functions for getting, setting, and displaying the shell version. */
47
48/* Forward declarations so we don't have to include externs.h */
49extern char *shell_version_string __P((void));
50extern void show_shell_version __P((int));
51
52/* Give version information about this shell. */
53char *
54shell_version_string ()
55{
56 static char tt[32] = { '\0' };
57
58 if (tt[0] == '\0')
59 {
60 if (release_status)
61#if defined (HAVE_SNPRINTF)
62 snprintf (tt, sizeof (tt), "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status);
63#else
64 sprintf (tt, "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status);
65#endif
66 else
67#if defined (HAVE_SNPRINTF)
68 snprintf (tt, sizeof (tt), "%s.%d(%d)", dist_version, patch_level, build_version);
69#else
70 sprintf (tt, "%s.%d(%d)", dist_version, patch_level, build_version);
71#endif
72 }
73 return tt;
74}
75
76void
77show_shell_version (extended)
78 int extended;
79{
80 printf ("GNU bash, version %s (%s)\n", shell_version_string (), MACHTYPE);
81 if (extended)
82 printf (_("Copyright (C) 2005 Free Software Foundation, Inc.\n"));
83}
Note: See TracBrowser for help on using the repository browser.