2 * Version numbering for LAME.
4 * Copyright (c) 1999 A.L. Faber
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
24 \brief Version numbering for LAME.
26 Contains functions which describe the version of LAME.
29 \version \$Id: version.c,v 1.32.2.2 2011/11/18 09:18:28 robert Exp $
42 #include "version.h" /* macros of version numbers */
48 /*! Get the LAME version string. */
51 \return a pointer to a string which describes the version of LAME.
54 get_lame_version(void)
55 { /* primary to write screen reports */
56 /* Here we can also add informations about compile time configurations */
58 #if LAME_ALPHA_VERSION
59 static /*@observer@ */ const char *const str =
60 STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " "
61 "(alpha " STR(LAME_PATCH_VERSION) ", " __DATE__ " " __TIME__ ")";
62 #elif LAME_BETA_VERSION
63 static /*@observer@ */ const char *const str =
64 STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " "
65 "(beta " STR(LAME_PATCH_VERSION) ", " __DATE__ ")";
66 #elif LAME_RELEASE_VERSION && (LAME_PATCH_VERSION > 0)
67 static /*@observer@ */ const char *const str =
68 STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) "." STR(LAME_PATCH_VERSION);
70 static /*@observer@ */ const char *const str =
71 STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION);
78 /*! Get the short LAME version string. */
80 It's mainly for inclusion into the MP3 stream.
83 \return a pointer to the short version of the LAME version string.
86 get_lame_short_version(void)
88 /* adding date and time to version string makes it harder for output
91 #if LAME_ALPHA_VERSION
92 static /*@observer@ */ const char *const str =
93 STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " (alpha " STR(LAME_PATCH_VERSION) ")";
94 #elif LAME_BETA_VERSION
95 static /*@observer@ */ const char *const str =
96 STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) " (beta " STR(LAME_PATCH_VERSION) ")";
97 #elif LAME_RELEASE_VERSION && (LAME_PATCH_VERSION > 0)
98 static /*@observer@ */ const char *const str =
99 STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) "." STR(LAME_PATCH_VERSION);
101 static /*@observer@ */ const char *const str =
102 STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION);
108 /*! Get the _very_ short LAME version string. */
110 It's used in the LAME VBR tag only.
113 \return a pointer to the short version of the LAME version string.
116 get_lame_very_short_version(void)
118 /* adding date and time to version string makes it harder for output
120 #if LAME_ALPHA_VERSION
122 #elif LAME_BETA_VERSION
124 #elif LAME_RELEASE_VERSION && (LAME_PATCH_VERSION > 0)
129 static /*@observer@ */ const char *const str =
130 #if (LAME_PATCH_VERSION > 0)
131 "LAME" STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) P STR(LAME_PATCH_VERSION)
133 "LAME" STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) P
139 /*! Get the _very_ short LAME version string. */
141 It's used in the LAME VBR tag only, limited to 9 characters max.
142 Due to some 3rd party HW/SW decoders, it has to start with LAME.
145 \return a pointer to the short version of the LAME version string.
148 get_lame_tag_encoder_short_version(void)
150 static /*@observer@ */ const char *const str =
151 /* FIXME: new scheme / new version counting / drop versioning here ? */
152 "LAME" STR(LAME_MAJOR_VERSION) "." STR(LAME_MINOR_VERSION) P
157 /*! Get the version string for GPSYCHO. */
160 \return a pointer to a string which describes the version of GPSYCHO.
163 get_psy_version(void)
165 #if PSY_ALPHA_VERSION > 0
166 static /*@observer@ */ const char *const str =
167 STR(PSY_MAJOR_VERSION) "." STR(PSY_MINOR_VERSION)
168 " (alpha " STR(PSY_ALPHA_VERSION) ", " __DATE__ " " __TIME__ ")";
169 #elif PSY_BETA_VERSION > 0
170 static /*@observer@ */ const char *const str =
171 STR(PSY_MAJOR_VERSION) "." STR(PSY_MINOR_VERSION)
172 " (beta " STR(PSY_BETA_VERSION) ", " __DATE__ ")";
174 static /*@observer@ */ const char *const str =
175 STR(PSY_MAJOR_VERSION) "." STR(PSY_MINOR_VERSION);
182 /*! Get the URL for the LAME website. */
185 \return a pointer to a string which is a URL for the LAME website.
190 static /*@observer@ */ const char *const str = LAME_URL;
196 /*! Get the numerical representation of the version. */
198 Writes the numerical representation of the version of LAME and
204 get_lame_version_numerical(lame_version_t * lvp)
206 static /*@observer@ */ const char *const features = ""; /* obsolete */
208 /* generic version */
209 lvp->major = LAME_MAJOR_VERSION;
210 lvp->minor = LAME_MINOR_VERSION;
211 #if LAME_ALPHA_VERSION
212 lvp->alpha = LAME_PATCH_VERSION;
214 #elif LAME_BETA_VERSION
216 lvp->beta = LAME_PATCH_VERSION;
223 lvp->psy_major = PSY_MAJOR_VERSION;
224 lvp->psy_minor = PSY_MINOR_VERSION;
225 lvp->psy_alpha = PSY_ALPHA_VERSION;
226 lvp->psy_beta = PSY_BETA_VERSION;
228 /* compile time features */
230 lvp->features = features;
236 get_lame_os_bitness(void)
238 static /*@observer@ */ const char *const strXX = "";
239 static /*@observer@ */ const char *const str32 = "32bits";
240 static /*@observer@ */ const char *const str64 = "64bits";
242 switch (sizeof(void *)) {
254 /* end of version.c */