1 /* Copyright (C) 1995,1996, 1999, 2000, 2001, 2006, 2008, 2010 Free Software Foundation, Inc.
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public License
5 * as published by the Free Software Foundation; either version 3 of
6 * the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #include "libguile/_scm.h"
27 #include "libguile/strings.h"
29 #include "libguile/version.h"
32 #define SCM_TMP_MACRO_MKSTR(x) #x
34 /* Return a Scheme string containing Guile's major version number. */
36 SCM_DEFINE (scm_major_version
, "major-version", 0, 0, 0,
38 "Return a string containing Guile's major version number.\n"
39 "E.g., the 1 in \"1.6.5\".")
40 #define FUNC_NAME s_scm_major_version
42 return scm_number_to_string (scm_from_int (SCM_MAJOR_VERSION
),
47 /* Return a Scheme string containing Guile's minor version number. */
49 SCM_DEFINE (scm_minor_version
, "minor-version", 0, 0, 0,
51 "Return a string containing Guile's minor version number.\n"
52 "E.g., the 6 in \"1.6.5\".")
53 #define FUNC_NAME s_scm_minor_version
55 return scm_number_to_string (scm_from_int (SCM_MINOR_VERSION
),
60 /* Return a Scheme string containing Guile's micro version number. */
62 SCM_DEFINE (scm_micro_version
, "micro-version", 0, 0, 0,
64 "Return a string containing Guile's micro version number.\n"
65 "E.g., the 5 in \"1.6.5\".")
66 #define FUNC_NAME s_scm_micro_version
68 return scm_number_to_string (scm_from_int (SCM_MICRO_VERSION
),
73 /* Return a Scheme string containing Guile's complete version. */
75 SCM_DEFINE (scm_version
, "version", 0, 0, 0,
77 "@deffnx {Scheme Procedure} major-version\n"
78 "@deffnx {Scheme Procedure} minor-version\n"
79 "@deffnx {Scheme Procedure} micro-version\n"
80 "Return a string describing Guile's version number, or its major, minor\n"
81 "or micro version number, respectively.\n\n"
83 "(version) @result{} \"1.6.0\"\n"
84 "(major-version) @result{} \"1\"\n"
85 "(minor-version) @result{} \"6\"\n"
86 "(micro-version) @result{} \"0\"\n"
88 #define FUNC_NAME s_scm_version
90 return scm_from_locale_string (PACKAGE_VERSION
);
94 /* Return a Scheme string containing Guile's effective version. */
96 SCM_DEFINE (scm_effective_version
, "effective-version", 0, 0, 0,
98 "Return a string describing Guile's effective version number.\n"
100 "(version) @result{} \"1.6.0\"\n"
101 "(effective-version) @result{} \"1.6\"\n"
102 "(major-version) @result{} \"1\"\n"
103 "(minor-version) @result{} \"6\"\n"
104 "(micro-version) @result{} \"0\"\n"
106 #define FUNC_NAME s_scm_effective_version
108 return scm_from_locale_string (SCM_EFFECTIVE_VERSION
);
118 #include "libguile/version.x"