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