Fix intmap bug for maps with only one element
[bpt/guile.git] / libguile / version.c
CommitLineData
89607fab 1/* Copyright (C) 1995,1996, 1999, 2000, 2001, 2006, 2008, 2010 Free Software Foundation, Inc.
9d7e1edf 2 *
73be1d9e 3 * This library is free software; you can redistribute it and/or
53befeb7
NJ
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.
9d7e1edf 7 *
53befeb7
NJ
8 * This library is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
73be1d9e
MV
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
9d7e1edf 12 *
73be1d9e
MV
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
53befeb7
NJ
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301 USA
73be1d9e 17 */
1bbd0b84 18
1bbd0b84 19
9d7e1edf 20\f
dbb605f5
LC
21#ifdef HAVE_CONFIG_H
22# include <config.h>
23#endif
9d7e1edf 24
3143f109 25#include <stdio.h>
a0599745
MD
26#include "libguile/_scm.h"
27#include "libguile/strings.h"
9d7e1edf 28
a0599745 29#include "libguile/version.h"
9d7e1edf
JB
30\f
31
3143f109
RB
32#define SCM_TMP_MACRO_MKSTR(x) #x
33
9d7e1edf
JB
34/* Return a Scheme string containing Guile's major version number. */
35
3b3b36dd 36SCM_DEFINE (scm_major_version, "major-version", 0, 0, 0,
d727c64b
GB
37 (),
38 "Return a string containing Guile's major version number.\n"
b89d554b 39 "E.g., the 1 in \"1.6.5\".")
1bbd0b84 40#define FUNC_NAME s_scm_major_version
9d7e1edf 41{
e11e83f3
MV
42 return scm_number_to_string (scm_from_int (SCM_MAJOR_VERSION),
43 scm_from_int (10));
9d7e1edf 44}
1bbd0b84 45#undef FUNC_NAME
9d7e1edf
JB
46
47/* Return a Scheme string containing Guile's minor version number. */
48
3b3b36dd 49SCM_DEFINE (scm_minor_version, "minor-version", 0, 0, 0,
d727c64b
GB
50 (),
51 "Return a string containing Guile's minor version number.\n"
b89d554b 52 "E.g., the 6 in \"1.6.5\".")
1bbd0b84 53#define FUNC_NAME s_scm_minor_version
9d7e1edf 54{
e11e83f3
MV
55 return scm_number_to_string (scm_from_int (SCM_MINOR_VERSION),
56 scm_from_int (10));
9d7e1edf 57}
1bbd0b84 58#undef FUNC_NAME
9d7e1edf 59
41bc3f42 60/* Return a Scheme string containing Guile's micro version number. */
b89d554b
RB
61
62SCM_DEFINE (scm_micro_version, "micro-version", 0, 0, 0,
63 (),
64 "Return a string containing Guile's micro version number.\n"
65 "E.g., the 5 in \"1.6.5\".")
41bc3f42 66#define FUNC_NAME s_scm_micro_version
b89d554b 67{
e11e83f3
MV
68 return scm_number_to_string (scm_from_int (SCM_MICRO_VERSION),
69 scm_from_int (10));
b89d554b
RB
70}
71#undef FUNC_NAME
72
9d7e1edf
JB
73/* Return a Scheme string containing Guile's complete version. */
74
3b3b36dd 75SCM_DEFINE (scm_version, "version", 0, 0, 0,
d727c64b 76 (),
8f85c0c6
NJ
77 "@deffnx {Scheme Procedure} major-version\n"
78 "@deffnx {Scheme Procedure} minor-version\n"
79 "@deffnx {Scheme Procedure} micro-version\n"
72dd0a03
NJ
80 "Return a string describing Guile's version number, or its major, minor\n"
81 "or micro version number, respectively.\n\n"
1e6808ea 82 "@lisp\n"
72dd0a03 83 "(version) @result{} \"1.6.0\"\n"
d3818c29 84 "(major-version) @result{} \"1\"\n"
72dd0a03
NJ
85 "(minor-version) @result{} \"6\"\n"
86 "(micro-version) @result{} \"0\"\n"
1e6808ea 87 "@end lisp")
1bbd0b84 88#define FUNC_NAME s_scm_version
9d7e1edf 89{
857a263e 90 return scm_from_locale_string (PACKAGE_VERSION);
9d7e1edf 91}
1bbd0b84 92#undef FUNC_NAME
9d7e1edf 93
ccf01e3e
RB
94/* Return a Scheme string containing Guile's effective version. */
95
96SCM_DEFINE (scm_effective_version, "effective-version", 0, 0, 0,
97 (),
98 "Return a string describing Guile's effective version number.\n"
99 "@lisp\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"
105 "@end lisp")
106#define FUNC_NAME s_scm_effective_version
107{
89607fab 108 return scm_from_locale_string (SCM_EFFECTIVE_VERSION);
ccf01e3e
RB
109}
110#undef FUNC_NAME
111
9d7e1edf
JB
112\f
113
1cc91f1b 114
9d7e1edf
JB
115void
116scm_init_version ()
9d7e1edf 117{
a0599745 118#include "libguile/version.x"
9d7e1edf 119}
89e00824
ML
120
121/*
122 Local Variables:
123 c-file-style: "gnu"
124 End:
125*/