fixed graphics bug
[swftools.git] / lib / lame / version.c
1 /*
2  *      Version numbering for LAME.
3  *
4  *      Copyright (c) 1999 A.L. Faber
5  *
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.
10  *
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.
15  *
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.
20  */
21
22 /*!
23   \file   version.c
24   \brief  Version numbering for LAME.
25
26   Contains functions which describe the version of LAME.
27
28   \author A.L. Faber
29   \version \$Id: version.c,v 1.1 2002/04/28 17:30:31 kramm Exp $
30   \ingroup libmp3lame
31 */
32
33
34 #include "config_static.h"
35
36
37 #include <stdio.h>
38 #include "version.h"    /* macros of version numbers */
39
40 #ifdef WITH_DMALLOC
41 #include <dmalloc.h>
42 #endif
43
44 //! Stringify \a x.
45 #define STR(x)   #x
46 //! Stringify \a x, perform macro expansion.
47 #define XSTR(x)  STR(x)
48
49 #if defined(MMX_choose_table)
50 # define V1  "MMX "
51 #else
52 # define V1  ""
53 #endif
54
55 #if defined(KLEMM)
56 # define V2  "KLM "
57 #else
58 # define V2  ""
59 #endif
60
61 #if defined(RH)
62 # define V3  "RH "
63 #else
64 # define V3  ""
65 #endif
66
67 //! Compile time features.
68 #define V   V1 V2 V3
69
70 //! Get the LAME version string.
71 /*!
72   \param void
73   \return a pointer to a string which describes the version of LAME.
74 */
75 const char*  get_lame_version ( void )          /* primary to write screen reports */
76 {
77     /* Here we can also add informations about compile time configurations */
78
79 #if   LAME_ALPHA_VERSION > 0
80     static /*@observer@*/ const char *const str =
81         XSTR(LAME_MAJOR_VERSION) "." XSTR(LAME_MINOR_VERSION) " " V
82         "(alpha " XSTR(LAME_ALPHA_VERSION) ", " __DATE__ " " __TIME__ ")";
83 #elif LAME_BETA_VERSION > 0
84     static /*@observer@*/ const char *const str =
85         XSTR(LAME_MAJOR_VERSION) "." XSTR(LAME_MINOR_VERSION) " " V
86         "(beta " XSTR(LAME_BETA_VERSION) ", " __DATE__ ")";
87 #else
88     static /*@observer@*/ const char *const str =
89         XSTR(LAME_MAJOR_VERSION) "." XSTR(LAME_MINOR_VERSION) " " V;
90 #endif
91
92     return str;
93 }
94
95
96 //! Get the short LAME version string.
97 /*!
98   It's mainly for inclusion into the MP3 stream.
99
100   \param void   
101   \return a pointer to the short version of the LAME version string.
102 */
103 const char*  get_lame_short_version ( void )
104 {
105     /* adding date and time to version string makes it harder for output
106        validation */
107
108 #if   LAME_ALPHA_VERSION > 0
109     static /*@observer@*/ const char *const str =
110         XSTR(LAME_MAJOR_VERSION) "." XSTR(LAME_MINOR_VERSION) " (alpha)";
111 #elif LAME_BETA_VERSION > 0
112     static /*@observer@*/ const char *const str =
113         XSTR(LAME_MAJOR_VERSION) "." XSTR(LAME_MINOR_VERSION) " (beta)";
114 #else
115     static /*@observer@*/ const char *const str =
116         XSTR(LAME_MAJOR_VERSION) "." XSTR(LAME_MINOR_VERSION);
117 #endif
118
119     return str;
120 }
121
122 //! Get the _very_ short LAME version string.
123 /*!
124   It's used in the LAME VBR tag only.
125
126   \param void   
127   \return a pointer to the short version of the LAME version string.
128 */
129 const char*  get_lame_very_short_version ( void )
130 {
131     /* adding date and time to version string makes it harder for output
132        validation */
133
134 #if   LAME_ALPHA_VERSION > 0
135     static /*@observer@*/ const char *const str =
136        "LAME" XSTR(LAME_MAJOR_VERSION) "." XSTR(LAME_MINOR_VERSION) "a";
137 #elif LAME_BETA_VERSION > 0
138     static /*@observer@*/ const char *const str =
139        "LAME" XSTR(LAME_MAJOR_VERSION) "." XSTR(LAME_MINOR_VERSION) "b";
140 #else
141     static /*@observer@*/ const char *const str =
142        "LAME" XSTR(LAME_MAJOR_VERSION) "." XSTR(LAME_MINOR_VERSION) " ";
143 #endif
144
145     return str;
146 }
147
148 //! Get the version string for GPSYCHO.
149 /*!
150   \param void
151   \return a pointer to a string which describes the version of GPSYCHO.
152 */
153 const char*  get_psy_version ( void )
154 {
155 #if   PSY_ALPHA_VERSION > 0
156     static /*@observer@*/ const char *const str =
157         XSTR(PSY_MAJOR_VERSION) "." XSTR(PSY_MINOR_VERSION)
158         " (alpha " XSTR(PSY_ALPHA_VERSION) ", " __DATE__ " " __TIME__ ")";
159 #elif PSY_BETA_VERSION > 0
160     static /*@observer@*/ const char *const str =
161         XSTR(PSY_MAJOR_VERSION) "." XSTR(PSY_MINOR_VERSION)
162         " (beta " XSTR(PSY_BETA_VERSION) ", " __DATE__ ")";
163 #else
164     static /*@observer@*/ const char *const str =
165         XSTR(PSY_MAJOR_VERSION) "." XSTR(PSY_MINOR_VERSION);
166 #endif
167
168     return str;
169 }
170
171
172 //! Get the URL for the LAME website.
173 /*!
174   \param void
175   \return a pointer to a string which is a URL for the LAME website.
176 */
177 const char*  get_lame_url ( void )
178 {
179     static /*@observer@*/ const char *const str = LAME_URL;
180
181     return str;
182 }    
183
184
185 //! Get the numerical representation of the version.
186 /*!
187   Writes the numerical representation of the version of LAME and
188   GPSYCHO into lvp.
189
190   \param lvp    
191 */
192 void get_lame_version_numerical ( lame_version_t *const lvp )
193 {
194     static /*@observer@*/ const char *const features = V;
195
196     /* generic version */
197     lvp->major = LAME_MAJOR_VERSION;
198     lvp->minor = LAME_MINOR_VERSION;
199     lvp->alpha = LAME_ALPHA_VERSION;
200     lvp->beta  = LAME_BETA_VERSION;
201
202     /* psy version */
203     lvp->psy_major = PSY_MAJOR_VERSION;
204     lvp->psy_minor = PSY_MINOR_VERSION;
205     lvp->psy_alpha = PSY_ALPHA_VERSION;
206     lvp->psy_beta  = PSY_BETA_VERSION;
207
208     /* compile time features */
209     /*@-mustfree@*/
210     lvp->features = features;
211     /*@=mustfree@*/
212 }
213
214 /* end of version.c */