ref: a78f38542dd5f4774ed651eb26218f53001fc6d4
parent: 27a4c0f5bc30ef3a84eef0a312901a153f29348a
author: menno <menno>
date: Mon Jan 21 03:16:23 EST 2002
Added id3v2 library
--- /dev/null
+++ b/common/id3lib/.cvsignore
@@ -1,0 +1,9 @@
+Makefile
+config.cache
+config.h
+config.h.win32
+config.log
+config.status
+id3lib.spec
+stamp-h
+tmp
--- /dev/null
+++ b/common/id3lib/AUTHORS
@@ -1,0 +1,10 @@
+$Id: AUTHORS,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+Authors of id3lib.
+
+Dirk Mahoney originally designed and implemented id3lib.
+Scott Haug (eldamitri@users.sourceforge.net) is the current project maintainer.
+
+Please see the THANKS file for an incomplete list of the many others who have
+contributed patches and fixes.
+
--- /dev/null
+++ b/common/id3lib/COPYING
@@ -1,0 +1,482 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
--- /dev/null
+++ b/common/id3lib/ChangeLog
@@ -1,0 +1,3508 @@
+2000-05-29 Scott Haug <scott@id3.org>
+
+ * NEWS:
+ Further updates for 3.7.9 release (hopefully this is it!)
+
+ * zlib/src/Makefile.am:
+ Updated to compile cleanly on a (Unix-like) system that needs it
+
+ * src/tag_file.cpp:
+ Moved inclusion of "tag.h" to after other includes to compile correctly
+ on Solaris (hack!)
+
+ * src/field_string_unicode.cpp
+ (RenderUnicodeString): Minor updates (needs major updates to compile
+ and work on all platforms!)
+
+ * src/Makefile.am
+ (LDADD): Now conditionally includes distributions zlib if not already
+ in environment
+
+ * include/id3/globals.h:
+ So it will compile on Solaris, changed index_t typedef into #define
+
+ * examples/test_compression.cpp:
+ * examples/test_pic.cpp:
+ * examples/test_unicode.cpp:
+ Removed inclusion of unnecessary header files
+
+ * configure.in:
+ Changed AC_SIZE_T to AC_TYPE_SIZE_T
+
+2000-05-28 Scott Haug <scott@id3.org>
+
+ * examples/get_pic.cpp
+ (main): Removed debugging output, added better regular output
+
+ * src/field.cpp
+ (BinSize): Minor bugfix for rendering non-unicode textstrings
+
+ * examples/test_compression.cpp
+ (main): Removed debugging output
+
+ * examples/230-compressed.tag
+ * examples/230-picture.tag
+ * examples/230-unicode.tag:
+ Removed the experimental flag from the tag headers and the file alter
+ preservation flag from the frame headers
+
+ * examples/Makefile.am
+ (check_PROGRAMS): Added testunicode and testcompression
+
+ * examples/demo_convert.cpp (main):
+ * examples/demo_info.cpp (main):
+ * examples/demo_tag.cpp (main):
+ argc is now unsigned to prevent compiler warning
+
+ * examples/test_compression.cpp:
+ * examples/test_unicode.cpp:
+ Initial revision
+
+ * include/id3/frame.h
+ (class ID3_Frame): Removed _UpdateStringTypes decl
+
+ * src/frame.cpp:
+ Removed _UpdateStringTypes implementation (no longer needed)
+ (Size): Updated to not use _UpdateStringTypes
+ (operator=): Fixed to now extract complete info from copied frame
+
+ * src/field_string_unicode.cpp
+ (RenderUnicodeString): Changed the byte order for rendering the BOM
+ (this is unlikely to be the right solution, though---the unicode
+ support needs to be much better than this!)
+
+ * src/field.cpp
+ (BinSize): Fixed bug that was reporting the wrong binary size for
+ unicode strings
+
+ * include/id3/header_frame.h
+ (class ID3_FrameHeader): Minor code reformatting
+
+ * src/tag_sync.cpp
+ (ID3_ReSync): Fixed a bug in ReSync'ing that caused it to improperly
+ handle the last character
+ (ID3_ShouldUnsync): Fixed a bug with recognizing sync signals
+
+ * src/tag_render.cpp
+ (Render): Now returns 0 with NULL buffer rather than throw,
+
+ * src/tag_parse.cpp
+ (Parse): No longer saves the return value of ParseFrames to prevent
+ compiler warnings
+
+ * src/tag.cpp
+ (ID3_Tag): Reorganized member variable initialization to avoid
+ compiler warnings
+
+ * src/misc_support.cpp
+ (ID3_AddTrack): Changed size_t's to luints to prevent comiler warnings
+ (ID3_AddGenre): Changed size_t's to luints to prevent comiler warnings
+
+ * src/frame.cpp
+ (ID3_Frame): Reorganized member variable initialization to avoid
+ compiler warnings
+
+ * src/field_string_unicode.cpp
+ (ParseUnicodeString): Removed unnecessary cast
+
+ * src/field.cpp
+ (ID3_Field): Reorganized member variable initialization to avoid
+ compiler warnings
+ (operator=): Added default clause to prevent compiler warning
+
+ * include/id3/tag.h:
+ Added GetUnsync()
+
+ * examples/test_pic.cpp
+ (main): Now includes actual picture data, unsyncs tag
+
+ * examples/get_pic.cpp:
+ Initial revision.
+
+ * examples/composer.jpg:
+ Added. Initial revision.
+
+ * examples/Makefile.am
+ (check_PROGRAMS): Added get_pic
+
+ * src/tag_render.cpp
+ (RenderFrames): Added so that frames are rendered in correct order
+ (Render): Doesn't render if there aren't any frames, makes use of new
+ RenderFrames function
+ (Size): Size is 0 if there aren't any frames
+
+ * src/header_tag.cpp
+ (Render): Now always renders the latest version of the spec
+
+ * examples/test_pic.cpp:
+ (main): uncommented the frame additions
+
+2000-05-27 Scott Haug <scott@id3.org>
+
+ * examples/test_pic.cpp:
+ Added.
+
+ * examples/Makefile.am
+ (check_PROGRAMS): Added testpic
+
+ * src/tag_find.cpp
+ (Find): Changed luint to size_t
+
+ * src/tag_file.cpp
+ (Link): If Linking to a tag that's already Linked, simply close the
+ current file and link to the new one
+ (Strip): Only Strips id3v2 if __starting_bytes > 0
+
+ * src/tag.cpp
+ (Clear): No longer removes file name.
+
+ * src/frame_render.cpp
+ (Render): Removed dangling semicolon, fixed call to Render
+
+ * src/frame.cpp
+ (_ClearFields): Clears bitset field rather than deleting it.
+
+ * src/field_string_unicode.cpp (Get):
+ * src/field_string_ascii.cpp (Get):
+ * src/field_binary.cpp (Get):
+ * include/id3/field.h
+ (class ID3_Field): All Get() methods now const
+
+ * src/c_wrapper.cpp
+ * include/id3.h:
+ - ID3Tag_RemoveFrame returns a pointer to the frame removed
+ - ID3Tag_UpdateByTagType's 2nd parameter is no longer const
+ - luint was replaced with size_t, index_t, flags_t, or uint32
+ - The following functions were updated with const parameters:
+ ID3Tag_HasChanged, ID3Tag_AddFrame, ID3Tag_AddFrames,
+ ID3_RemoveFrame, ID3Tag_Parse, ID3Tag_Link, ID3Tag_Strip,
+ ID3Tag_Find*, ID3Tag_GetFrameNum, ID3Frame_GetID, ID3Frame_GetField,
+ ID3Frame_GetCompression, ID3Field_Size, ID3Field_GetNumTextItems,
+ ID3Field_SetINT, ID3Field_*UNICODE, ID3Field_*ASCII, ID3Field_*File
+
+
+ * id3com/ID3Field.h
+ * id3com/ID3Tag.cpp
+ * id3com/id3com.cpp
+ * id3com/id3com.idl:
+ Bugfixes (thanks John Adcock)
+
+2000-05-23 Scott Haug <scott@id3.org>
+
+ * NEWS
+ * THANKS
+ * configure.in
+ * id3lib.spec.in:
+ Updated for 3.7.9 release
+
+ * Makefile.am
+ (docs-release): Adds NEWS(.txt) and ChangeLog(.txt) to the docs release
+
+ * examples/demo_tag.cpp
+ (main): Minor structural changes
+
+ * Makefile.am
+ (release): win build now copies over delphi directory
+
+ * include/id3/frame.h
+ (class ID3_Frame): Render is now const (again). Added comments to
+ SetCompression() and GetCompression() to indicate their limitations.
+ Added protected methods for getting and setting the grouping and
+ encryption id's. __encryption_id and __grouping_id are now just
+ single chars, rather than actual buffers.
+
+ * include/id3/globals.h:
+ Made inclusion of iostream.h dependant on a c++ compiler
+
+ * include/id3/header_frame.h
+ (class ID3_FrameHeader): Removed methods GetExtrasSize(),
+ SetExpandedSize(), GetExpandedSize, SetEncryptionID(),
+ GetEncryptionID(), SetGroupingID, GetGroupingID(), since it was
+ determined that these issues lie outside the domain of the frame header.
+
+ * src/frame.cpp:
+ Updated to reflect changes in __encryption_id and __grouping_id from
+ char buffs to chars.
+
+ * src/frame_parse.cpp
+ (Parse): Added parsing of "extra" information from frame header to here
+ so that the domain of the frame and frame header are more clearly (and
+ cleanly) defined.
+
+ * src/frame_render.cpp
+ (Render): Rewritten to make its operation easier to understand and to
+ make it a const method. Also added extensive comments to explain
+ reason for its somewhat convoluted implementation.
+
+ * src/header_frame.cpp
+ (Parse): Now only responsible for parsing header proper, and not any
+ "extra" info in the data that is a result of the various flags being
+ set (encryiption id, grouping id, and decompressed frame size).
+
+ * src/tag_file.cpp
+ (Update): Added call to CloseFile so that the file isn't left open when
+ Update exits.
+
+ * src/tag_render.cpp
+ (RenderV1ToHandle): Put in a throw when file handle is null.
+ (RenderV2ToHandle): Added a call to reopen new file for writing after
+ writing out v2 under linux so that the file handle isn't null after
+ leaving this function.
+
+2000-05-22 Scott Haug <scott@id3.org>
+
+ * delphi/ID3COM_TLB.dcu
+ * delphi/ID3COM_TLB.pas
+ * delphi/Unit1.dcu
+ * delphi/Unit1.dfm
+ * delphi/Unit1.pas
+ * delphi/id3com.cfg
+ * delphi/id3com.dof
+ * delphi/id3com.dpr
+ * delphi/id3com.res
+ * delphi/readme.txt:
+ Added. Provided by Michael Little <mike at netlinear dot com>.
+
+ * src/frame_parse.cpp
+ (Parse): Fixed bug that wasn't dealing with compressed frames correctly
+
+ * src/header_frame.cpp
+ (SetUnknownFrame): Minor change to return if allocation fails
+
+2000-05-15 Scott Haug <scott@id3.org>
+
+ * src/misc_support.cpp:
+ Replaced all frame->SetID() calls with constructor calls that pass in
+ the appropriate ID.
+
+2000-05-12 Scott Haug <scott@id3.org>
+
+ * include/id3/field.h:
+ - Updated luint parameter, return type with more descriptive type name
+ (either size_t, index_t, or flags_t)
+ - (struct ID3_FrameDef): Removed lPriority and parseHandler fields
+
+ * include/id3/tag.h:
+ - CreateFile now returns an ID3_Err
+ - ID3_IsTagHeader now returns an int32
+
+ * src/field.cpp:
+ - Removed priorities and parse handler func pointers from frame def
+ entries
+ - Updated luint parameter, return type with more descriptive type name
+ (either size_t, index_t, or flags_t)
+
+ * src/frame_render.cpp
+ (Render):
+ - Updated luint parameter, return type with more descriptive type name
+ (either size_t, index_t, or flags_t)
+ - No longer calls UpdateStringTypes, instead iterates through the
+ fields, setting the encoding for each depending on the value of the
+ ENCODING field.
+
+ * src/header_frame.cpp
+ (SetUnknownFrame): parseHandler no longer a member of FrameDef
+ (operator=): parseHandler no longer a member of FrameDef
+
+ * src/header.cpp:
+ * src/header_tag.cpp
+ (SetSpec): Parameter no longer const
+
+ * src/tag.cpp
+ (ID3_IsTagHeader): Return an int32 rather than an lsint
+ (Clear): Now sets the header's spec to the latest version
+
+ * src/tag_file.cpp
+ (exists): Returns 'false' rather than throwing
+ (CreateFile): Returns the error encountered rather than throwing
+ (OpenFileForWriting): Returns the error rather than throwing.
+ (OpenFileForReading): Returns the error rather than throwing.
+ (Link): Return 0 rather than throwing
+ (Update): Creates a file if opening it for writing files, now renders
+ a v2 tag before rendering a v1 tag
+
+ * src/tag_parse.cpp
+ (Parse): removed call to Clear(), since we might want to parse more
+ information into an already-full tag
+ (ParseFromHandle): Return with a 0 rather than throw if there's an
+ error either seeking or reading the file
+
+ * src/tag_parse_v1.cpp
+ (ParseID3v1): Exit from the function, rather than throw, if it isn't
+ possible to seek to 128 bytes from the end of the file (i.e., empty
+ files)
+
+ * src/tag_render.cpp
+ (RenderV1ToHandle): If file size is less than the length of an id3v1
+ tag, don't even bother looking for one, but rather append the tag
+ at the end. This allows writing tags to empty files.
+
+ * include/id3/error.h:
+ * include/id3/frame.h:
+ * include/id3/globals.h:
+ * include/id3/header.h:
+ * include/id3/misc_support.h:
+ * include/id3/utils.h:
+ * src/error.cpp:
+ * src/field_binary.cpp:
+ * src/field_integer.cpp:
+ * src/field_string_ascii.cpp:
+ * src/field_string_unicode.cpp:
+ * src/frame.cpp:
+ * src/frame_parse.cpp:
+ * src/misc_support.cpp:
+ * src/utils.cpp:
+ Updated luint parameter, return type with more descriptive type name
+ (either size_t, index_t, or flags_t)
+
+2000-05-11 Scott Haug <scott@id3.org>
+
+ * include/id3/flags.h
+ (class ID3_Flags): Changed TYPE to flags_t
+
+ * include/id3/globals.h:
+ Added typedefs for index_t (size_t) and flags_t (uint16)
+
+ * include/id3/header_tag.h
+ (class ID3_TagHeader): Added SetExtended(), GetExtended()
+
+ * include/id3/tag.h:
+ - Removed acBinary and bTagOwns fields from ID3_Elem (unused)
+ - Constructor parameter now const
+ - Changed all luint return types, parameters to one of index_t, size_t,
+ or flags_t, where appropriate
+ - RemoveFrame now returns a frame pointer
+ - Render, RenderV1 now const methods
+ - Added HasTagType() method in favor of deprecated HasV2Tag(),
+ HasV1Tag(), and HasLyrics() methods
+ - Removed all *Sync* methods (now standalone funcs declared in utils.h)
+ - Removed all List, Elem helper methods (now standalone)
+ - Updated, reorganized private member variables
+
+ * src/tag.cpp:
+ - Removed all occurrences of __instances (unused)
+ - Made RemoveFromList and ClearList local functions
+ - Removed implementation of SetupTag(), moved most of its functionality
+ to Clear()
+ - Updated constructors to no longer rely on SetupTag
+ - Updated destructor to make better use of Clear()
+ - Updated appropriate methods to increment/decrement __num_frames when
+ necessary
+ - RemoveFrame now returns the pointer to the frame returned (NULL if
+ not removed or not present) and therefore the tag is now released
+ from its responsibility of managing frame's memory
+ - Makes use of new __hdr member variable where appropriate
+ - NumFrames implementation removed (moved to header file)
+
+ * src/tag_file.cpp:
+ - Updated member variables to new names
+ (Link):
+ - Updated luint return type to be size_t
+ - Updated to use new __tags_to_parse member variable
+ (Update): Updated luint parameter, return type to flags_t
+ (Strip): Updated luint parameter, return type to flags_t
+
+ * src/tag_find.cpp:
+ (Find): Updated luint parameter to be uint32
+ (GetFrameNum):
+ - Updated luint parameter to be index_t
+ - Reimplemented so that it returns the NumFrames - index element, since
+ the frames are stored in a stack and would otherwise be traversed in
+ reverse order
+ (operator[]): Updated luint parameter to be index_t
+
+ * src/tag_parse.cpp
+ (ID3_ParseFrames): Now a local function rather than an ID3_Tag member
+ function, accepts an ID3_Tag reference
+ (ParseFromHandle): Updated luint return type to size_t, updated to use
+ new __tags_to_parse member variable
+
+ * src/tag_parse_lyrics3.cpp:
+ * src/tag_parse_v1.cpp:
+ Updated for new member variables
+
+ * src/tag_render.cpp:
+ - Updated member variables to new names
+ (Render):
+ - Updated luint return type to size_t
+ - method now const
+ - No longer sets actual tag to have LATEST spec
+ - Made use of new __hdr member variable
+ (Size):
+ - Updated luint return type to size_t
+ - Made use of new __hdr member variable
+ (RenderV1):
+ - Updated luint return type to size_t
+ - method now const
+ - Made use of new __file_tags member variable
+ (PaddingSize):
+ - Updated luint return type to size_t
+
+ * src/tag_sync.cpp
+ (ID3_ReSync): Updated luint parameter, return type to size_t
+ (ID3_GetUnSyncSize): Updated luint parameter, return type to size_t
+ (ID3_UnSync): Updated luint parameters to size_t
+
+ * include/id3/utils.h:
+ * src/tag_sync.cpp:
+ All syncing functions are now stand-alone, rather than member functions
+ of ID3_Tag
+
+ * NEWS
+ * configure.in
+ * id3lib.spec.in:
+ Updated for 3.7.8 release
+
+ * src/field.cpp (Render):
+ * src/field_string_ascii.cpp (Add, Set):
+ * src/field_string_unicode.cpp (Set):
+ Fixed major bug that caused all string tags to be written out as binary
+ data with wrong encoding.
+
+ * src/tag_file.cpp
+ (OpenFileForWriting): Fixed bug when stripping an id3v2 tag w/no id3v1
+ tag
+
+ * src/tag_render.cpp
+ (RenderV1): Fixed bug with writing too many bytes to the v1 tag
+
+2000-05-10 Scott Haug <scott@id3.org>
+
+ * NEWS
+ * THANKS
+ * configure.in
+ * id3lib.spec.in:
+ Updated for 3.7.7 release
+
+ * Makefile.am:
+ Reordered subdirs to put zlib before src so it will be compiled before
+ id3lib if necessary
+
+ * include/id3/Makefile.am:
+ utils.h re-included as a distributed file
+
+ * zlib/src/Makefile.in:
+ Improved configuration for building zlib
+
+ * include/id3/field.h
+ (class ID3_Field): Minor fix to IsEncodable so as to prevent warnings in
+ windows.
+
+ * src/tag_render.cpp
+ (RenderV1): Minor bug fix
+
+ * src/field_string_ascii.cpp
+ (ParseASCIIString): Minor fix
+
+ * src/frame_parse.cpp
+ (Parse): Fixed a minor bug with initializing fields not in scope
+
+ * examples/demo_info.cpp
+ (PrintInformation): Removed old comment that no longer described the
+ operation of the function accurately.
+
+ * include/id3/misc_support.h:
+ Updated interface to synced lyrics helper funcs to accept refs instead
+ of pointers, where appropriate.
+
+ * src/misc_support.cpp:
+ Minor fixes, interface changes
+
+ * src/tag_parse_lyrics3.cpp
+ (ParseLyrics3): Fixed bug in using new synced lyrics helper func.
+
+2000-05-09 Scott Haug <scott@id3.org>
+
+ * include/id3/field.h
+ (class ID3_Field): Added GetType(), IsEncodable(); uncommented
+ GetEncoding(), SetEncoding(); added __enc member variable
+
+ * include/id3/globals.h
+ (enum ID3_FieldFlags): Renamed for clarity: NULL->CSTR,
+ NULLDIVIDE->LIST, ADJUSTENC->ENCODABLE; removed ADJUSTEDBY; added
+ TEXTLIST
+ (enum ID3_FieldType): Added NONE, TEXTSTRING, and NUMTYPES; removed
+ ASCIISTRING and UNICODESTRING
+
+ * include/id3/tag.h
+ (class ID3_Tag): Removed decls of AddBinary(), ExpandBinaries(), and
+ ProcessBinaries(), since they'reno longer needed
+
+ * src/field.cpp:
+ - Updated for renamed field flags
+ - Changed ID3FTY_ASCIISTRING's to ID3FTY_TEXTSTRING's
+ (ID3_Field): Updated to initialize __enc
+ (Clear): Updated to clear __enc
+ (SetSpec): Removed, no lnger needed
+ (Parse): Updated for use with new text encoding scheme
+ (Render): Updated for use with new text encoding scheme
+ (SetEncoding): Uncommented, updated
+
+ * src/field_string_ascii.cpp
+ Updated for renamed field flags
+ (Set): Changes encoding, rather that type, of field
+ (Add): Changes encoding, rather that type, of field
+
+ * src/field_string_unicode.cpp:
+ Updated for renamed field flags
+ (Set): Changes encoding, rather that type, of field
+
+ * src/frame.cpp:
+ (_UpdateFieldDeps): Removed, never used
+ (_UpdateStringTypes): Reimplemented using new encoding code
+
+ * src/frame_parse.cpp
+ (Parse): Uncommented call to SetEncoding
+
+ * src/tag_parse.cpp:
+ (ID3_GetLastElem): Removed, no longer necessary
+ (AddBinary): Removed, no longer necessary
+ (ExpandBinaries): Removed, no longer necessary
+ (ProcessBinaries): Removed, no longer necessary
+
+ * include/id3/field.h
+ (class ID3_Field): Added (commented out) decl's for SetEncoding() and
+ GetEncoding(); removed __spec member variable
+
+ * include/id3/globals.h
+ (enum ID3_TextEnc): Added NONE and NUMENCODINGS to enumeration.
+
+ * src/frame_parse.cpp
+ (Parse): Added call to SetEncoding (commented out for now)
+
+ * src/field.cpp
+ (SetEncoding): Added implementation (commented out for now)
+
+ * src/header_tag.cpp
+ (Parse): Fixed bug with determining data size.
+
+ * src/tag_parse.cpp
+ (ParseFrames): Fixed bug with setting the frame spec (it wasn't!)
+
+ * include/id3/field.h
+ (class ID3_Field): Added InScope and GetID methods, removed SetSpec
+ method and __spec member variable, updated Parse* methods to only
+ accept two parameters, not three
+
+ * include/id3/frame.h
+ (class ID3_Frame): Changed SetID() and Parse() methods to return a bool
+ to indicate if the frame has changed; added BadParse() and
+ GetDataSize() methods, added __bad_parse member variable
+
+ * include/id3/header_frame.h
+ (class ID3_FrameHeader): Added GetExtrasSize(), SetExpandedSize(),
+ GetExpandedSize(), SetEncryptionID(), GetEncryptionID(),
+ SetGroupingID(), and GetGroupingID() methods, as well as
+ __encryption_id, __grouping_id, and __expanded_size member variables
+
+ * include/id3/header_tag.h
+ (class ID3_TagHeader): Added GetUnsync() method
+
+ * include/id3/tag.h
+ (class ID3_Tag): Added ParseFrames() method, __hdr member variable
+
+ * src/field.cpp
+ (ID3_Field): Removed initialization of __spec
+ (SetSpec): Removed
+ (BinSize): No longer checks spec (relies on calling function)
+ (Parse): Updated for new parameters, no longer checks spec (relies on
+ calling function)
+ (Render): No longer checks spec (relies on calling function)
+ (operator=): No longer copies over spec
+
+ * src/field_binary.cpp
+ (ParseBinary): Updated for new parameters
+
+ * src/field_integer.cpp
+ (ParseInteger): Updated for new parameters
+
+ * src/field_string_ascii.cpp
+ (ParseASCIIString): Updated for new parameters
+
+ * src/field_string_unicode.cpp
+ (ParseUnicodeString): Updated for new parameters
+
+ * src/frame.cpp
+ (_ClearFields): Added implementation
+ (Clear): Updated to use _ClearFields
+ (_SetID): Added implementation
+ (SetID): Now returns bool indicating if the frame changed
+ (Size): Now checks to see if a field is in scope before adding its
+ size
+
+ * src/frame_parse.cpp
+ (Parse): New implementation
+
+ * src/frame_render.cpp
+ (Render): Minor implementation change
+
+ * src/header_frame.cpp
+ (SetFrameID): Minor implementation change
+ (Parse): Now checks for compression, encryption, and grouping
+
+ * src/header_tag.cpp
+ (Parse): Updated to prepare for handling extended headers
+
+ * src/tag_parse.cpp
+ (ParseFrames): Added implementation
+ (Parse): New implementation, using ParseFrames
+
+2000-05-08 Scott Haug <scott@id3.org>
+
+ * include/id3/globals.h:
+ * include/id3/misc_support.h:
+ * src/misc_support.cpp:
+ * src/tag_parse_lyrics3.cpp:
+ Updated with new enums, helper functions for adding synced lyrics
+ (thanks Severino Delaurenti).
+
+ * examples/demo_info.cpp
+ (PrintInformation): Updated for new names of ContentType enums
+
+ * doc/index.html.in:
+ Updated to mention COM as a supported language.
+
+2000-05-07 Scott Haug <scott@id3.org>
+
+ * include/id3/error.h
+ * include/id3/field.h
+ * include/id3/frame.h
+ * include/id3/tag.h
+ * src/field.cpp
+ * src/field_binary.cpp
+ * src/field_string_unicode.cpp
+ * src/frame_parse.cpp
+ * src/tag.cpp
+ * src/tag_find.cpp
+ * src/tag_parse.cpp
+ * src/tag_render.cpp:
+ Updated interface to use const appropriately
+
+ * include/id3/misc_support.h:
+ All Get* functions now take const pointers to tags, Minor cleanup
+
+ * include/id3/tag.h:
+ - All Find methods are now const
+ - __cursor is now mutable so Find methods can be const
+ - Removed decl of protected GetLastElem (not dependant on tag data)
+
+ * src/c_wrapper.cpp
+ (ID3Frame_GetCompression): Now returns false by default (thanks John
+ Adcock)
+
+ * src/misc_support.cpp:
+ Fixed bug in AddGenre (thanks Peter Thorstenson), all Get* functions
+ now take const pointers to tags, no function throws on error.
+
+ * src/tag_find.cpp
+ (Find): All are now const methods
+
+ * src/tag_parse.cpp
+ (ID3_GetLastElem): Renamed from ID3_Tag::GetLastElem (local to file)
+ (AddBinary): Updated to use ID3_GetLastElem
+ (ProcessBinaries): Updated to use ID3_GetLastElem
+
+ * id3com/ID3Frame.cpp:
+ * id3com/ID3Frame.h:
+ * id3com/id3com.idl:
+ Updated for the changes to compression in ID3_Tag and ID3_Frame (thanks
+ John Adcock)
+
+2000-05-06 Scott Haug <scott@id3.org>
+
+ * examples/demo_info.cpp
+ (PrintInformation): Now prints out timestamp format for synced lyrics
+
+ * include/id3/tag.h:
+ * src/tag_parse.cpp:
+ (Parse): Now returns the tag size
+
+ * include/id3/utils.h:
+ Commented out namespace, RenderNumber now returns number of bytes
+ rendered
+
+ * src/field_integer.cpp
+ Replaced '#include "misc_support.h"' with '#include "utils.h"'
+ (RenderInteger): Minor cleanup
+
+ * src/frame_render.cpp:
+ Replaced '#include "misc_support.h"' with '#include "utils.h"'
+ (Render): Minor cleanup
+
+ * src/header_frame.cpp
+ (Parse): Minor cleanup
+ (Render): Minor cleanup
+
+ * src/header_tag.cpp
+ (Render): Minor cleanup
+ (Parse): Minor cleanup
+
+ * include/id3/misc_support.h:
+ * src/misc_support.cpp:
+ Moved utility functions to utils.cpp
+
+ * src/tag.cpp
+ (SetupTag): Minor cleanups
+
+ * src/tag_file.cpp
+ (Link): Minor cleanups
+
+ * src/tag_parse_lyrics3.cpp
+ (ID3_RenderTimeStamp): Added new function
+ (ID3_Lyrics3ToSylt): Cleaned up the function, minor bugfix for newlines
+
+ * src/tag_render.cpp:
+ Minor cleanups
+
+ * src/utils.cpp
+ (ParseNumber): New, easier-to-understand implementation
+ (RenderNumber):
+ - New, easier-to-understand implementation
+ - Now returns number of bytes rendered
+
+ * src/field_string_ascii.cpp:
+ * src/field_string_unicode.cpp:
+ * src/tag_find.cpp:
+ * src/tag_parse.cpp:
+ Replaced '#include "misc_support.h"' with '#include "utils.h"'
+
+ * configure.in:
+ Not having sys/param.h or wchar.h doesn't prevent compilation.
+
+ * examples/demo_info.cpp
+ (PrintUsage): Parameter now const
+ (PrintVersion): Parameter now const
+ (PrintInformation): Parameter now const, now prints out info about
+ synced lyrics
+
+ * include/id3/field.h:
+ Added GetBinary() method
+
+ * include/id3/globals.h:
+ Removed VerCtl enumeration, and added LyricsContent enumeration.
+
+ * include/id3/tag.h
+ * src/tag_file.cpp:
+ The Link() methods' filename parameter is now const.
+
+ * src/tag_parse_lyrics3.cpp:
+ Bugfixes to the synchronized lyrics conversion.
+
+2000-05-04 Scott Haug <scott@id3.org>
+
+ * include/id3/Makefile.am
+ * include/id3/Makefile.in:
+ Designated utils.h and uint28.h as not needing to be installed
+
+ * Makefile.in:
+ * configure:
+ * libtool:
+ * src/Makefile.am:
+ * src/Makefile.in:
+ * zlib/src/Makefile.am:
+ * configure.in:
+ Updated to allow zlib to conditionally compile when it isn't found (not
+ yet working right)
+
+ * include/id3/frame.h
+ * include/id3/tag.h:
+ Made destructor virtual to avoid compilation warnings (thanks Peter
+ Thorstenson)
+
+ * doc/index.html.in:
+ Added ref to new project: Sonize.
+
+ * include/id3/globals.h:
+ Added ID3FN_TIMESTAMPFORMAT and ID3FN_CONTENTTYPE constants for the new
+ synced lyrics support (thanks Severino Delaurenti)
+
+ * include/id3/misc_support.h:
+ Added declaration of ID3_GetLyricist, ID3_AddLyricist, and
+ ID3_RemoveLyricist (thanks Severino Delaurenti)
+
+ * src/field.cpp
+ (ID3FD_LinkedInfo): Removed unnecessary (read: wrong) size field for
+ id3v2.2.x
+ (ID3FD_SyncLyrics): Added (thanks Severino Delaurenti)
+ (ID3_FrameDefs): Updated ID3FID_SYNCEDLYRICS frame def to use
+ ID3FD_SyncLyrics
+
+ * src/misc_support.cpp
+ (ID3_AddTitle): Now checks if memory wasn't allocated (thanks Severino
+ Delaurenti)
+ (ID3_GetLyricist): Added implementation (thanks Severino Delaurenti)
+ (ID3_AddLyricist): Added implementation (thanks Severino Delaurenti)
+ (ID3_RemoveLyricist): Added implementation (thanks Severino Delaurenti)
+
+ * src/tag_parse_lyrics3.cpp
+ (ID3_StripTimeStamps): Fixed logic of bad data (thanks Severino
+ Delaurenti)
+ (ID3_Lyrics3ToSylt): Added implementation (thanks Severino Delaurenti)
+ (ParseLyrics3): Adds description, language, lyricist, and information
+ (thanks Severino Delaurenti)
+
+2000-05-03 Scott Haug <scott@id3.org>
+
+ * NEWS
+ * THANKS
+ * configure.in
+ * id3lib.spec.in:
+ Updated for 3.7.6 release
+
+ * include/id3/frame.h
+ (SetCompression): Added as a replacement for ID3_Tag::GetCompression()
+ (GetCompression): Added
+
+ * include/id3.h
+ * src/c_wrapper.cpp:
+ Added ID3Frame_SetCompression and ID3Frame_GetCompression. Deprecated
+ ID3Tag_SetCompression
+
+ * include/id3/frame.h
+ (Contains): Added comparison to ensure boolean output
+
+ * include/id3/header.h
+ (Clear): Updated to return boolean if the header actually changed
+
+ * include/id3/header_tag.h
+ (class ID3_TagHeader): Replaced definition of ID3_TagHeader with just a
+ declaration (windows didn't like having it defined in the header)
+
+ * include/id3/uint28.h:
+ Replaced #include iostream with #include iostream.h. Removed #include
+ algorithm (not needed)
+
+ * src/header_tag.cpp:
+ Added static definition of ID3_TagHeader::ID
+
+ * src/uint28.cpp
+ (operator=): Returns *this
+ (operator>>): Removed std:: (will put this in later when make the move
+ to STL/STC)
+
+ * prj/id3lib.dsp
+ * libprj/id3lib.dsp
+ * id3com/id3com.dsp:
+ Updated to compile with new changes to the library
+
+ * src/frame.cpp
+ (GetDescription): Now returns NULL rather than "Unknown" for unknown
+ frames.
+
+ * include/id3/field.cpp
+ * include/id3/frame.cpp
+ * src/field.cpp
+ * src/frame.cpp:
+ Replaced ID3_GetFrameDescription() with ID3_Frame::GetDescription() and
+ static ID3_Frame::GetDescription(ID3_FrameID)
+
+ * id3com/ID3Frame.cpp
+ (get_FrameName): Updated for new ID3_Frame::GetDescription.
+
+ * examples/demo_info.cpp
+ (PrintInformation): Updated for new ID3_Frame::GetDescription()
+
+ * include/id3/header_tag.h
+ * include/id3/tag.h
+ * src/header_tag.cpp
+ * src/tag.cpp:
+ Moved ID3_TagHeader::IsHeader() to ID3_Tag::IsV2Tag()
+
+2000-05-02 Scott Haug <scott@id3.org>
+
+ * src/tag_file.cpp
+ (Strip): Fix of a major bug that would delete too much info when
+ stripping a file with an ID3v2 tag present
+
+ * include/id3/error.h
+ * include/id3/field.h
+ * include/id3/frame.h
+ * include/id3/tag.h
+ * src/error.cpp
+ * src/field.cpp
+ * src/field_binary.cpp
+ * src/field_integer.cpp
+ * src/field_string_ascii.cpp
+ * src/field_string_unicode.cpp
+ * src/frame.cpp
+ * src/frame_parse.cpp
+ * src/frame_render.cpp
+ * src/tag.cpp
+ * src/tag_file.cpp
+ * src/tag_find.cpp
+ * src/tag_parse.cpp
+ * src/tag_parse_lyrics3.cpp
+ * src/tag_parse_v1.cpp
+ * src/tag_render.cpp:
+ Renamed member variables to something not so windows-ish (ick!)
+
+ * src/field.cpp:
+ Removed left over comment that wasn't commented
+
+ * src/field.cpp
+ (ID3_FrameDefs): Descriptions for PCNT, POSS, PRIV, and POPM were not
+ matched up with their appropriate frame def (thanks Daryl Pawluk)
+
+ * src/tag.cpp
+ (SetPadding): Fixed minor bug (thanks Sasa �olic)
+
+ * include/id3.h:
+ Minor bugfix for #endif (thanks John Southerland)
+
+ * include/id3/frame.h:
+ SetSpec's parameter is no longer const, now returns bool
+
+ * include/id3/globals.h:
+ Added ID3FID_METACOMPRESSION enum for ID3v2.2.1's compressed-data
+ meta-frame ("CDM")
+
+ * include/id3/header.h:
+ (ID3_HeaderInfo):
+ - Struct now defined within ID3_Header
+ - renamed to Info (ID3_Header::Info)
+ - renamed member variables to something not so windows-ish (ick!)
+ - removed ID3_V2Spec member (redundant)
+ (ID3_Header):
+ - Most members now defined in header
+ - Removed *Flags() methods; replaced with __flags protected data members
+ subclasses should now provide subclasses to access this member
+ - removed ID3_V2Spec member (redundant)
+ - Added Parse() pure virtual method to be implemented by subclasses
+ - renamed member variables to something not so windows-ish (ick!)
+ - SetSpec's parameter is no longer const, now returns bool to indicate
+ if the spec actually changed
+ - Clear() now returns bool to indicate if the tag actually needed
+ clearing
+ - Size() method is now const
+
+ * include/id3/header_frame.h:
+ - ID3FL #define's now public enum's within the class
+ - Added SetCompression(), SetEncryption(), SetGrouping(),
+ GetCompression(), GetEncryption(), GetGrouping(), and GetReadOnly()
+ methods and their definitions
+ - renamed member variables to something not so windows-ish (ick!)
+
+ * include/id3/header_tag.h:
+ - ID3HF #define's now public enum's within the class
+ - Added default constructor, copy constructor, destructor, SetSpec(),
+ Parse(), SetUnsync(), and static IsHeader() methods
+ - Added enumeration of offsets, sizes for header fields
+ - Added static const char* ID variable
+ - Deprecated ID3_IsTagHeader (use ID3_TagHeader::IsHeader() instead)
+
+ * include/id3/spec.h:
+ - SetSpec's, SetVersion's now return bool
+ - SetSpec's parameter is no longer const
+
+ * include/id3/tag.h:
+ SetSpec's parameter is no longer const, now returns bool
+
+ * src/field.cpp
+ (ID3FD_LinkedInfo): Now is valid through ID3v2.2.1
+ (ID3FD_CDM): Added for ID3v2.2.1's compressed data meta-frame
+ (ID3_FrameDefs):
+ - Added def for CDM
+ - If a frame isn't defined for a spec, this is now signified with an
+ empty id string, rather than one filled with spaces
+
+ * src/frame.cpp
+ (SetSpec): Updated for new SetSpec interface, now just calls __FrmHdr's
+ SetSpec
+
+ * src/frame_parse.cpp:
+ Removed #include <iostream.h>
+
+ * src/frame_render.cpp
+ (Render): Now uses FrameHeader's GetCompression(), SetCompression(),
+ SetEncryption(), and SetGrouping() methods.
+
+ * src/header.cpp:
+ Moved most methods to the header file. SetSpec reimplemented to assign
+ __info pointer. ID3_SpecInfo (renamed to _spec_info) is static to
+ the file and no longer has the V2Spec member. It is now accessed
+ directly via subscript in SetSpec.
+
+ * src/header_frame.cpp
+ (ID3_FrameHeader): Moved to header
+ (~ID3_FrameHeader): Moved to header
+ (SetFrameID): Now no-ops when the id is the same as the current
+ (Size): Now returns 0 if __info is NULL
+ (Parse): Updated to use new __flags member variable
+ (Render): New interface; method is now const, no longer throws
+ (Clear): New interface; now returns a boolean to indicate if the header
+ actually changed
+
+ * src/header_tag.cpp
+ (IsHeader): Added implementation; returns 0 if buffer isn't an id3v2
+ tag header, otherwise returns the size of the tag (including the header)
+ (ID3_IsTagHeader): Deprecated; now uses IsHeader
+ (SetSpec): Updated for new interface; now returns a boolean to indicate
+ if the spec actually changed
+ (Size): New interface; method is now const
+ (Render): New interface; method is now const, new implementation
+ (Parse): Added implementation
+ (operator=): Implementation moved to header file
+
+ * src/tag.cpp
+ (SetSpec): Updated for new interface; now returns a boolean to indicate
+ if the spec actually changed
+
+ * src/tag_file.cpp
+ (Strip): Added note to log error
+
+ * src/tag_parse.cpp
+ (ExpandBinaries): Now uses new METACOMPRESSION frame id rather than
+ comparing the text id directly
+ (ProcessBinaries): Updated for new FrameHeader methods:
+ GetCompression(),GetEncryption(), GetCrouping()
+ (Parse): Updated to use new uint28 class; updated to use new TagHeader
+ enum's
+
+ * include/id3/Makefile.am:
+ Removed int28.h, added flags.h, uint28.h, and utils.h
+
+ * src/Makefile.am:
+ Removed int28.cpp, added uit28.cpp and utils.cpp
+
+ * src/tag_render.cpp
+ (Render): Replaced call of SetFlags(ID3HF_UNSYNC) to SetUnsync(true)
+
+ * include/id3/flags.h:
+ Added; basic class for manipulating a flags bitset
+
+ * src/utils.cpp
+ * include/id3/utils.h:
+ Added; moved util functions out of misc_support
+
+ * src/uint28.cpp
+ * include/id3/uint28.h:
+ Added; better implementation of the 28-bit unsigned int class.
+
+2000-05-01 Scott Haug <scott@id3.org>
+
+ * include/id3/frame.h:
+ - No longer includes field.h, added advanced decl of ID3_Field
+ - ID3_Tag is no longer a friend class
+ - HasChanged(), Parse(), Size(), Render(), SetSpec() now public
+ - Added decl for Contains(ID3_FieldID) method
+ - Minor cleanup
+
+ * include/id3/tag.h:
+ No longer includes header_frame.h, deprecated SetCompression
+ (compression should be set on a frame-by-frame basis).
+
+ * src/tag.cpp:
+ Removed all occurrences of SetCompression (deprecated)
+
+ * src/tag_find.cpp
+ (Find): Replaced direct access of field bits with call to Contains
+
+ * src/tag_render.cpp
+ (Render): Removed compression step - this will be handled in the frame
+
+ * Makefile.am
+ * configure.in
+ * src/Makefile.am
+ * src/error.cpp
+ * src/field.cpp
+ * src/field_binary.cpp
+ * src/field_integer.cpp
+ * src/field_string_ascii.cpp
+ * src/field_string_unicode.cpp
+ * src/frame.cpp
+ * src/frame_parse.cpp
+ * src/frame_render.cpp
+ * src/globals.cpp
+ * src/header.cpp
+ * src/header_frame.cpp
+ * src/header_tag.cpp
+ * src/int28.cpp
+ * src/misc_support.cpp
+ * src/tag.cpp
+ * src/tag_file.cpp
+ * src/tag_find.cpp
+ * src/tag_parse.cpp
+ * src/tag_parse_lyrics3.cpp
+ * src/tag_parse_v1.cpp
+ * src/tag_render.cpp
+ * src/tag_sync.cpp:
+ Removed Log comments at the end of all files.
+
+2000-04-28 Scott Haug <scott@id3.org>
+
+ * NEWS
+ * configure.in
+ * id3lib.spec.in:
+ Updated for 3.7.5 release
+
+ * THANKS:
+ Added mention of Severino Delaurenti's contribution, other minor fixes
+
+ * doc/Doxyfile.in:
+ Removed source browser
+
+ * doc/index.html.in:
+ Updated to emphasize tagging for both ID3v1 and ID3v2, now mentions
+ C interface, added link to javpc project, slight rewording in places.
+
+ * examples/demo_info.cpp:
+ Updated to use ID3_GetFrameDescription.
+
+ * id3com/ID3Frame.cpp
+ * id3com/ID3Tag.cpp
+ * id3com/ID3Tag.h
+ * id3com/id3com.idl:
+ More id3com fixes and usage of new frame descriptions (thanks John
+ Adcock)
+
+ * include/id3/field.h
+ (struct ID3_FrameDef): Added sDescription field (thanks John Adcock)
+ (ID3_GetFrameDescription): Added declaration
+
+ * src/field.cpp:
+ Added frame descriptions (thanks John Adcock) and
+ ID3_GetFrameDescription implementation.
+
+ * include/id3/frame.h
+ * src/frame.cpp:
+ InitFields method no longer accepts a parameter.
+
+ * include/id3/tag.h
+ * src/tag.cpp:
+ Updated documentation.
+
+ * src/tag_parse.cpp
+ (ProcessBinaries): Removed parseHandler code (never used, and will
+ likely be replaced).
+
+ * src/tag_parse_lyrics3.cpp
+ (ParseLyrics3): Added code for parsing Lyrics3 v1.00 tags (thanks
+ Severino Delaurenti)
+
+2000-04-27 Scott Haug <scott@id3.org>
+
+ * src/tag_render.cpp
+ (RenderV2ToHandle): Fixes a nasty bug when saving a V2 tag to a file
+ (thanks John Adcock)
+
+ * src/field.cpp:
+ Fixed bugs in creation and assignment (thanks John Adcock)
+
+ * src/field_binary.cpp
+ (Set): Now handles the case when null data is passed in (thanks John
+ Adcock)
+
+ * id3com/ID3Tag.cpp
+ (FindFrame): Updated to use AttachFrame (thanks John Adcock)
+ (FindFrameString): Updated to use AttachFrame (thanks John Adcock)
+
+ * id3com/Sample/frmID3Test.frm:
+ Extended the sample with more utility (thanks John Adcock)
+
+2000-04-26 Scott Haug <scott@id3.org>
+
+ * NEWS
+ * THANKS
+ * configure.in
+ * id3lib.spec.in:
+ Updated for 3.7.4 release
+
+ * Makefile.am:
+ Updated release directive to clean up windows distribution of unneeded
+ files/directories.
+
+ * include/id3.h:
+ Every function declaration was prepended with ID3_C_EXPORT so they will
+ compile correctly under windows.
+
+ * include/id3/globals.h:
+ Fixed ID3_C_EXPORT and ID3_C_VAR defs so windows funcs are exported
+ correctly
+
+ * id3com/id3com.dsp:
+ * libprj/id3lib.dsp:
+ * prj/id3lib.dsp:
+ Fixed to work with most current release
+
+ * Makefile.am:
+ Copy windows projects over manually
+
+ * configure.in:
+ No longer generate Makefiles for windows projects
+
+ * include/id3.h:
+ Removed C++ comments
+
+ * id3com/Sample/ID3Test.vbp
+ * id3com/Sample/ID3Test.vbw
+ * id3com/Sample/KMSSCCPRJ.SCC
+ * id3com/Sample/frmID3Test.frm:
+ Initial release; a simple VB app for testing id3com.dll
+
+ * id3com/EnumFields.cpp
+ * id3com/EnumFields.h
+ * id3com/ID3COM_p.c
+ * id3com/ID3Field.cpp
+ * id3com/ID3Field.h
+ * id3com/ID3Field.rgs
+ * id3com/ID3Frame.cpp
+ * id3com/ID3Frame.h
+ * id3com/ID3Frame.rgs
+ * id3com/ID3Tag.cpp
+ * id3com/ID3Tag.h
+ * id3com/ID3Tag.rgs
+ * id3com/StdAfx.cpp
+ * id3com/StdAfx.h
+ * id3com/id3com.cpp
+ * id3com/id3com.dsp
+ * id3com/id3com.idl:
+ Thanks to John Adcock for this update
+ - Fixes to work bring id3com up to speed with library.
+ - Fixed namespace collision caused by restructuring
+ - Changed the project file a bit so it is safer
+ - Changed license to LGPL to match rest of library
+
+ * include/id3/globals.h:
+ Fixed ID3_C_VAR and ID3_C_EXPORT definitions, thanks to John Adcock
+
+ * include/id3/frame.h:
+ ID3_Frame now inherits from ID3_Speccable, SetSpec's parameter is now
+ const, and declared GetSpec
+
+ * include/id3/header.h:
+ Removed SetSpec's default parameter, made parameter const
+
+ * include/id3/tag.h:
+ SetSpec's parameter now const
+
+ * src/field.cpp
+ Updated lists of supported/unsupported frames (PRIV now supported),
+ thanks to John Adcock
+ (ID3FD_Private): Added definition
+ (ID3_FrameDefs): Updated Private's definition
+
+ * src/frame.cpp:
+ (SetSpec): Parameter now const
+ (GetSpec): Added implementation
+
+ * src/header.cpp
+ (ID3_Header): Made call to SetSpec have explicit parameter
+ (SetSpec): Parameter now const
+
+ * src/tag.cpp
+ (SetSpec): Parameter now const
+
+ * src/tag_render.cpp
+ (PaddingSize): Fix for padding logic, thanks to John Adcock for the
+ patch.
+
+2000-04-25 Scott Haug <scott@id3.org>
+
+ * include/id3/field.h:
+ - ID3_VerCtl enumeration removed in favor of using two ID3_V2Spec
+ enums to denote field scope
+ - Deprecated (private) SetVersion in favor of SetSpec
+ - Replaced version/revision uchar combination with ID3_V2Spec enums
+
+ * include/id3/frame.h:
+ Replaced (protected) SetVersion with SetSpec
+
+ * include/id3/globals.h:
+ - Removed ID3_SpecVersion (not used anyway)
+ - Defined ID3_V1Spec and ID3_V2Spec to enumerate various iterations
+ of each specification
+
+ * include/id3/header.h:
+ - Now inherits from ID3_Speccable
+ - Deprecated SetVersion, added SetSpec and GetSpec
+ - Deprecated ID3_LookupHeaderInfo(uchar, uchar) in favor of
+ ID3_LookupHeaderInfo(ID3_V2Spec)
+ - Removed ID3v2_{VERSION,REVISION}; now use ID3V2_LATEST instead
+ - Replaced version/revision uchar combination with ID3_V2Spec enums
+
+ * include/id3/spec.h:
+ Added; defines ID3_Speccable pure virtual class, which provides
+ {Get,Set}Spec methods and deprecated {Get,Set}Version, GetRevision
+
+ * include/id3/Makefile.am
+ (the_headers): Added spec.h
+
+ * include/id3/tag.h
+ - Removed default params for deprecated Link(char *, bool, bool) since
+ they were causing ambiguity for Link(char *, luint)
+ - Now inherits from ID3_Speccable
+ - Deprecated SetVersion, added SetSpec and GetSpec
+
+ * src/c_wrapper.cpp
+ (ID3Tag_AttachFrame): Added implementation
+
+ * src/spec.cpp:
+ Initial release; implements functions ID3_V2SpecToVer, ID3_V2SpecToRev,
+ and ID3_VerRevToV2Spec declared in spec.h
+
+ * src/field.cpp
+ * src/frame.cpp
+ * src/frame_parse.cpp
+ * src/frame_render.cpp
+ * src/header.cpp
+ * src/header_tag.cpp
+ * src/tag.cpp
+ * src/tag_parse.cpp
+ * src/tag_render.cpp:
+ - Replaced version/revision uchar combination with ID3_V2Spec enums
+ - Deprecated {Get,Set}Version, GetRevision for {Get,Set}Spec
+ - ID3_VerCtl enumeration deprecated in favor of using two ID3_V2Spec
+ enums to denote field scope
+ - Replaced ID3v2_VERSION, ID3v2_REVISION constants with ID3V2_LATEST
+ enum
+ - Use ID3V2_UNKNOWN enum rather than 0 for version, revision
+
+ * doc/index.html.in:
+ - Minor reformatting
+ - Added Zlurp! to list of projects using id3lib
+ - Added "Valid HTML 4.01" image, link to validator
+
+ * src/Makefile.am
+ (the_sources): Added spec.cpp
+
+2000-04-24 Scott Haug <scott@id3.org>
+
+ * NEWS
+ * configure.in:
+ Updated for 3.7.3 release
+
+ * id3lib.spec.in:
+ Added explicit RPM_OPT_FLAGS def based on arch, since -fno-exceptions
+ and -fno-rtti are part of the default flags in rpmrc and we need both
+ exceptions and rtti (exceptions uses rtti)
+
+ * doc/Makefile.am
+ (dox): Added to give more precise control over documentation generation
+ (docs): Requires dox
+
+ * id3com/id3com.dsp:
+ Added c_wrapper.cpp and globals.cpp
+
+ * include/id3.h:
+ - Added decl for ID3Tag_AttachFrame
+ - ID3Tag_{Parse,Update,Strip} now all return ID3_Err's
+ - ID3Tag_UpdateType renamed to ID3Tag_UpdateByTagType, returns ID3_Err
+
+ * include/id3/field.h:
+ FixedLength is now unsigned, since a 0, rather than a -1, can represent
+ a variable-length field
+
+ * include/id3/frame.h:
+ Added decl for copy constructor
+
+ * include/id3/globals.h:
+ Replaced C++ comments with C comments
+
+ * include/id3/tag.h:
+ - Moved doxygen comments to appropriate cpp file
+ - AddNewFrame deprecated for AttachFrame
+ - Link(char *, bool, bool) deprecated for Link(char *, luint)
+ - OpenFileFor{Reading,Writing} now returns an ID3_Err rather than void
+
+ * src/c_wrapper.cpp
+ (ID3Tag_Parse): Now returns an ID3_Err
+ (ID3Tag_Update): Now returns an ID3_Err
+ (ID3Tag_UpdateByTagType): Renamed from UpdateType, now returns an
+ ID3_Err
+ (ID3Tag_Strip): Now returns an ID3_Err
+
+ * src/error.cpp
+ (ID3_ErrorDescs): Added "no error" to list
+
+ * src/field.cpp
+ * src/field_binary.cpp
+ * src/field_integer.cpp
+ * src/field_string_ascii.cpp
+ * src/field_string_unicode.cpp:
+ __lFixedLength changed to __ulFixedLength. A fixed length of 0, rather
+ than -1, represents a variable-length field, since we should never have
+ a fixed field length of 0.
+
+ * src/frame.cpp
+ (ID3_Frame): Added copy constructor implementation
+
+ * src/misc_support.cpp:
+ - Calls to AddNewFrame replaced with calls to AttachFrame
+ - Minor changes to prevent warnings w/gcc
+
+ * src/tag.cpp
+ - Added comments originally in include/id3/tag.h
+ - (operator<<): Made frame parameter constant
+ - (AddFrame):
+ - Made frame parameter constant
+ - Now adds a copy of the frame onto the tag, rather than the frame
+ passed in, thus allowing the tag to be repsonsible for deleting
+ the frame
+ - (AddNewFrame): Deprecated in favor of AttachFrame
+ - (AddFrames): Adds copies of frames
+
+ * src/tag_file.cpp:
+ - Added comments originally in include/id3/tag.h
+ - (OpenFileForWriting): Now returns ID3_Err rather than void
+ - (OpenFileForReading): Now returns ID3_Err rather than void
+ - (Link): Deprecated Link(char *, bool, bool) for Link(char *, luint),
+ which accepts an unsigned int representing the tag types to parse.
+
+ * src/tag_parse.cpp:
+ - Added comments originally in include/id3/tag.h
+ - (ParseFromHandle): Conditionally parses tag types based on
+ __ulTagsToParse, which replaces __bParseLyrics3 and __bParseID3v1
+
+ * src/tag_find.cpp:
+ * src/tag_render.cpp:
+ Added comments originally in include/id3/tag.h
+
+2000-04-23 Scott Haug <scott@id3.org>
+
+ * examples/demo_info.cpp:
+ - Removed dependency on config.h
+
+ * examples/demo_convert.cpp:
+ * examples/demo_tag.cpp:
+ - Removed dependency on config.h
+ - Updated ID3_TagType constants to new names
+
+ * include/id3/error.h:
+ Moved ID3_Err enumeration to globals.h
+
+ * include/id3/field.h:
+ Moved ID3_FieldFlags, ID3_FieldType, ID3_VerCtl enums to globals.h
+
+ * include/id3/globals.h:
+ - Remove ID3_ENUM_TYPE macro, renamed and redefined ID3_ENUM_DECL macro
+ to ID3_ENUM to make it easier to use
+ - Added ID3_MACRO macro
+ - Renamed the ID3_SpecVersion, ID3_TagType enums to follow more
+ consistent naming of all enums
+ - Moved LEN_V1 constants into ID3_V1Lengths enumeration, since array
+ lengths can't be specified with consts in C
+ - Added ID3V1_Tag struct from tag.h
+ - Added ID3_FieldFlags, ID3_FieldType, ID3_VerCtl enums from field.h
+ - Added ID3_Err enum from error.h
+
+ * include/id3/tag.h:
+ - Moved def of ID3_PATH_LENGTH from tag.h, since its def requires a
+ macro defined in config.h, which isn't accessible from the .h files.
+ - Moved LEN_V1 constants (renamed to ID3_V1_LEN constants) to globals.h
+ - Moved ID3V1_Tag struct declaration to globals.h
+ - Moved ID3_TagType enum declaration to globals.h
+ - Updated ID3_TagType constants to new names
+ - __sFileName is no longer a fixed-length char array, but rather a char
+ pointer, since ID3_PATH_LENGTH can't be defined in tag.h
+
+ * src/tag.cpp:
+ - Moved def of ID3_PATH_LENGTH from tag.h, since its def requires a
+ macro defined in config.h, which isn't accessible from the .h files.
+ - __sFileName is now dynamically allocated
+
+ * src/tag_file.cpp:
+ - Updated ID3_TagType constants to new names
+
+ * src/tag_parse_v1.cpp:
+ - Updated ID3_V1_LEN constants to new names
+
+ * src/tag_render.cpp:
+ - Moved def of ID3_PATH_LENGTH from tag.h, since its def requires a
+ macro defined in config.h, which isn't accessible from the .h files.
+ - Updated ID3_V1_LEN constants to new names
+
+
+2000-04-22 Scott Haug <scott@id3.org>
+
+ * include/id3.h:
+ Added declaration from ID3Tag_UpdateType
+
+ * src/c_wrapper.cpp:
+ Added implementations for ID3Tag_UpdateType and
+ ID3Frame_{New,NewID,Delete}.
+
+ * doc/index.html.in:
+ Updated DOCTYPE.
+
+2000-04-21 Scott Haug <scott@id3.org>
+
+ * NEWS
+ * configure.in:
+ Updated for 3.7.2 release
+
+ * config.h.win32.in:
+ Updated to be in line with config.h.in
+
+ * configure.in:
+ Added DOX_DIR_{HTML,LATEX,MAN,RTF} so that doxygen's output directories
+ need only be adjusted in one file
+
+ * Makefile.am
+ (docs): Added for creating documentation from top directory
+ (docs-release): Added for automating creation of documentation
+ deliverables
+ (release): Updated to create documentation release
+
+ * id3lib.spec.in:
+ - More conditional blocks for noarch
+ - More thorough cleaning of files for documentation
+ - Updated html directory
+
+ * doc/Doxyfile.in:
+ - Turned off verbatim headers
+ - Added *.c to example patterns
+ - Generalized output directories
+
+ * doc/Makefile.am
+ (docs):
+ - More thorough building of documentation (pd.gz, pdf, html)
+ - Generalized doxygen's output directories
+ - Cleans up intermediate files
+ (dist-hook): Removed; doxygen-created docs no longer distributed with
+ main tarball release
+
+ * doc/index.html.in:
+ Generalized doxygen's html output directory
+
+ * examples/Makefile.am
+ (EXTRA_DIST): mp3 files are no longer distributed
+
+ * id3lib.spec.in:
+ - Fixed date of changelog entry for 3.7.1-1
+ - Added conditional blocks so docs only get built for noarch target
+
+ * examples/Makefile.am:
+ Updated for new example: id3simple
+
+ * examples/demo_simple.c:
+ Initial release; simple example of how to use the C interface
+
+ * include/id3.h:
+ Fixed parameters for ID3Tag_Strip
+
+ * include/id3/header_tag.h:
+ - Moved ID3_{TAGID,TAGIDSIZE,TAGHEADERSIZE} macros to globals.h
+
+ * include/id3/globals.h:
+ - Updated WIN32 macros for creating dll's
+ - Added ID3_{TAGID,TAGIDSIZE,TAGHEADERSIZE} macros from header.h
+ - Changed all enumerations to use same syntax for C and C++
+
+ * prj/id3lib.mak
+ * prj/id3lib.dsp:
+ - Added globals.cpp
+ - Removed version.cpp, types.h, version.h
+ - Renamed src\dll_wrapper.cpp to src\c_wrapper.cpp
+
+ * libprj/id3lib.dsp:
+ - Added globals.cpp
+ - Removed version.cpp, externals.h, types.h, version.h
+ - Renamed include\id3\dll.h to include\id3.h
+
+ * id3com/id3com.dsp:
+ Removed version.cpp
+
+ * src/dll_wrapper.cpp:
+ Removed; replaced by c_wrapper.cpp
+
+2000-04-20 Scott Haug <scott@id3.org>
+
+ * src/Makefile.am
+ (the_sources): Added c_wrapper.cpp, an implementation of the C
+ interface
+ (EXTRA_DIST): Removed, since dll_wrapper.cpp is no longer distributed
+
+ * src/c_wrapper.cpp:
+ Renamed and updated from dll_wrapper.cpp
+
+ * src/tag_find.cpp:
+ Minor updates
+
+ * doc/Makefile.am
+ (dist-hook): Copies latex code into dist package
+
+ * id3lib.spec.in:
+ Updated to make doc package as lean as possible
+
+2000-04-19 Scott Haug <scott@id3.org>
+
+ * NEWS
+ * configure.in:
+ Updated for 3.7.1 release
+
+ * id3lib.spec.in:
+ Added HISTORY to all %doc's
+
+ * id3com/ID3Field.h:
+ * id3com/ID3Frame.h:
+ Changed #include <id3/dll.h> to #include <id3.h>
+
+ * id3lib.spec.in:
+ - Removed zlib-devel requirement from devel
+ - Added doc package to distribute documentation
+ - Added examples package to distribute binary examples
+ - Moved doc/ and examples/ source files from devel to doc package
+
+ * configure.in:
+ - Added ID3LIB_NAME definition
+ - Prepended '__' onto all macros that will be defined in config.h to
+ alleviate namespace clashes
+
+ * src/tag_render.cpp
+ (RenderV2ToHandle): Now uses ID3_PATH_LENGTH instead of MAXPATHLEN
+
+ * src/globals.cpp:
+ Initial release
+
+ * src/version.cpp:
+ Removed; version constants now defined in globals.cpp
+
+ * src/header.cpp
+ (ID3_LookupHeaderInfo): Minor update
+
+ * src/Makefile.am
+ (the_sources): Added globals.cpp, removed version.cpp
+
+ * include/Makefile.am:
+ Added id3.h to included directories
+
+ * include/id3/tag.h:
+ - Abstracted MAXPATHLEN into ID3_PATH_LENGTH macro for platform
+ differences (inspired by glib.h from http://www.gtk.org)
+ - Removed log comments to reduce file size
+
+ * include/id3/sized_types.h:
+ Made compilable with C (changed comments, etc.).
+
+ * include/id3/misc_support.h:
+ - Moved MASK macros to globals.h
+ - Removed log comments to reduce file size
+
+ * include/id3/globals.h:
+ - Made compilable with C (changed comments, etc.).
+ - Merged in contents of types.h.
+ - Added bool typedef and true/false defines for C compilation.
+ - Added version constants (replacements for functions in version.h)
+ - Added ID3_SpecVersion enum
+ - Added new macros to abstract differences between latforms
+ - Removed log comments to reduce file size
+
+ * include/id3/error.h:
+ * include/id3/field.h:
+ * include/id3/frame.h:
+ * include/id3/header.h:
+ * include/id3/header_frame.h:
+ * include/id3/header_tag.h:
+ * include/id3/int28.h:
+ Minor updates; removed log comments to reduce file size
+
+ * include/id3/externals.h:
+ Removed; nothing in it.
+
+ * include/id3/dll.h:
+ Removed; replaced by include/id3.h
+
+ * include/id3/version.h:
+ Removed; replaced with constants in globals.h
+
+ * include/id3/types.h:
+ Removed; merged in with globals.h.
+
+ * include/id3/Makefile.am
+ (the_headers): Removed dll.h, externals.h, version.h, and types.h.
+
+ * examples/demo_tag.cpp (PrintVersion)
+ * examples/demo_info.cpp (PrintVersion)
+ * examples/demo_convert.cpp (PrintVersion):
+ Replaced call to ID3_FullName with ID3LIB_FULL_NAME constant
+
+ * include/id3.h:
+ Added; replaces include/id3/dll.h
+
+ * doc/Makefile.am
+ (dist-hook): Made copying of the html more selective
+
+ * doc/Doxyfile.in
+ (INPUT): Updated for new src code path.
+ (EXAMPLE_PATH): Updated for new example code path
+
+ * examples/Makefile.am
+ (bin_PROGRAMS): Changed from check_PROGRAMS so that they build w/o
+ make check
+ (EXTRA_DIST): Removed readme.txt
+
+2000-04-18 Scott Haug <scott@id3.org>
+
+ * configure.in
+ (AC_OUTPUT): Added examples/Makefile, removed src/id3/Makefile and
+ src/examples/Makefile
+ (EXTRA_DIST): Added HISTORY and id3lib.spec[.in]
+ (id3lib.spec): Added rule for generating from id3lib.spec.in
+ (release): Now depends on id3lib.spec
+
+ * Makefile.am
+ (SUBDIRS): Added 'examples'
+
+ * id3lib.spec.in:
+ Added
+
+ * id3com/id3com.dsp
+ * libprj/id3lib.dsp
+ * prj/id3lib.dsp
+ * prj/id3lib.mak:
+ Updated for new file paths.
+
+2000-04-17 Scott Thomas Haug <scott@id3.org>
+
+ * configure.in:
+ (AC_OUTPUT): Removed doc's subdirs.
+
+ * doc/Makefile.am:
+ Fixed bug which prevented successful 'make distcheck'
+
+2000-04-16 Scott Thomas Haug <scott@id3.org>
+
+ * TODO
+ * THANKS
+ * NEWS:
+ Updated for release of 3.7.0
+
+ * doc/.cvsignore:
+ Added Doxyfile and index.html.
+
+ * HISTORY:
+ Minor updates.
+
+ * configure.in
+ * AUTHORS:
+ Updated email address
+
+ * doc/Makefile.am
+ (EXTRA_DIST): Added new files.
+ (Doxyfile): Added new rule for generating Doxyfile.
+ (index.html): Added new rule for generating index.html.
+ (docs): Added new rule for generating documentation.
+ (dist-hook): Added hook for creating a distrbution (copies
+ documentation to the distribution directory)
+
+ * doc/id3guide.html:
+ Updated to use id3lib.css.
+
+ * doc/Doxyfile.in
+ * doc/id3lib.css
+ * doc/index.html.in:
+ Added to CVS
+
+ * src/id3/field.cpp
+ * src/id3/field_binary.cpp
+ * src/id3/field_integer.cpp
+ * src/id3/field_string_ascii.cpp
+ * src/id3/tag_file.cpp:
+ Updated parameters of certain methods with const modifier to match
+ declaration.
+
+2000-04-15 Scott Thomas Haug <scott@id3.org>
+
+ * doc/Makefile.am
+ (EXTRA_DIST): Updated to reflect documentation changes
+
+ * src/examples/demo_info.cpp
+ (PrintInformation): Renamed ID3FN_SYMBOL to ID3FN_ID
+
+ * doc/id3v2.3.0.html
+ * doc/id3v2.3.0.txt
+ * doc/index.html
+ * doc/id3lib-manual.php:
+ Added
+
+ * doc/id3guide.html:
+ Updated with version at http://www.id3.org
+
+2000-04-13 Scott Thomas Haug <scott@id3.org>
+
+ * include/id3/globals.h
+ (ID3_FieldID): Renamed ID3FN_SYMBOL to ID3FN_ID
+
+ * src/id3/field.cpp
+ (ID3FD_LinkedInfo): Fixed bug in definition of LinkedInfo array.
+ (ID3FD_Registration): Renamed ID3FN_SYMBOL to ID3FN_ID
+
+2000-04-12 Scott Thomas Haug <scott@id3.org>
+
+ * configure.in
+ (AC_OUTPUT): Add id3com/Makefile and libprj/Makefile
+
+ * Makefile.am
+ (SUBDIRS): Added id3com and libprj
+
+ * id3com/Makefile.am
+ (EXTRA_DIST): Removed files.txt
+
+2000-04-10 Scott Thomas Haug <scott@id3.org>
+
+ * include/id3/error.h
+ * include/id3/field.h
+ * include/id3/frame.h
+ * include/id3/globals.h
+ * include/id3/tag.h
+ * include/id3/version.h:
+ Updated comments for use with doxygen.
+
+ * src/id3/tag_parse.cpp
+ (ProcessBinaries): Removed name of caught error since it isn't used.
+
+ * src/id3/header_frame.cpp
+ (operator=): Fixed bug - now returns *this.
+
+ * prj/id3lib.dsp
+ * irj/id3lib.dsw
+ * zlib/prj/zlib.dsp:
+ Updated to allow for better compilation under windows.
+
+ * include/id3/field.h:
+ * include/id3/frame.h:
+ Updated comments for use with doxygen.
+
+ * include/id3/header.h
+ (class ID3_Header): Removed decl of Copy.
+
+ * include/id3/header_frame.h
+ (class ID3_FrameHeader): Added decl for operator=, removed decl of Copy
+
+ * include/id3/header_tag.h
+ (class ID3_TagHeader): Added decl for operator=.
+
+ * src/id3/header.cpp
+ * src/id3/header_frame.cpp:
+ (Copy): removed.
+ (operator=): Updated implementation so it isn't reliant on Copy.
+
+ * src/id3/header_tag.cpp
+ (operator=): Added implementation.
+
+ * src/id3/misc_support.cpp
+ * src/id3/tag_find.cpp:
+ Added inclusion of string.h
+
+ * src/id3/int28.cpp:
+ * src/id3/tag_parse.cpp
+ (ProcessBinaries): Minor change to prevent warning in windows.
+
+2000-04-09 Scott Thomas Haug <scott@id3.org>
+
+ * include/id3/tag.h:
+ Started updating comments for doxygen.
+
+ * src/id3/tag_parse.cpp:
+ Minor structure change.
+
+ * src/id3/header_frame.cpp
+ (ID3_FrameHeader): Added implementation.
+ (SetUnknownFrame): Added implementation.
+ (SetFrameID): Sanity checking inputs.
+ (Parse): Now checks to make sure frame id isn't bogus. If it is,
+ creates an "unknown" frame.
+ (Render): Fixed bug in short/long id determination logic
+ (GetTextID): Fixed bug in short/long id determination logic
+ (Copy): Handles case when copying a frame that has an "unknown" frame
+ type.
+ (Clear): Now deletes __pFrameDef is it was dynamically created.
+
+ * src/id3/field.cpp:
+ Added implementation for DEFAULT.
+
+ * include/id3/header_frame.h
+ (class ID3_FrameHeader): Added destructor and new method
+ SetUnknownFrame(const char*) for creating a frame with an unknown
+ frame id. Added __bDynFrameDef member, set when __pFrameDef has been
+ dynamically created.
+
+ * include/id3/field.h
+ (struct ID3_FieldDef): Added DEFAULT.
+ (struct ID3_FrameDef): Made text id's fixed length char arrays rather
+ than char ptrs.
+
+ * configure.in:
+ Added check for mkstemp.
+
+ * config.h.win32.in:
+ Updated for HAVE_MKSTEMP, which it doesn't define, but it's at least
+ comprehensive.
+
+ * Makefile.am
+ (config.h.win32): Fixed bug in creating config.h.win32.
+ (release): Added. Creates id3lib-$(VERSION).tar.gz and
+ id3lib-$(VERSION).zip.
+ (snapshot): Added. Created id3lib-$(DATE).tar.gz and
+ id3lib-$(DATE).zip
+
+ * src/id3/tag_render.cpp
+ (RenderV2ToHandle): Changed conditional from '#if defined WIN32' to
+ '#if !defined HAVE_MKSTEMP'.
+
+2000-04-07 Scott Thomas Haug <scott@id3.org>
+
+ * configure.in:
+ Updated to version 3.7.0, per Kamran's (MusicMatch) suggestion. Other
+ minor updates.
+
+ * Makefile.am:
+ Updated for config.h.win32.
+
+ * prj/id3lib.dsp
+ * prj/id3lib.dsw
+ * zlib/prj/zlib.dsp:
+ Updated for Visual C++ 6.0.
+
+ * src/id3/tag_render.cpp:
+ Changed new ANSI-standard C++ include headers to old-style headers.
+ (RenderV2ToHandle): Added conditional code for rendering in windows.
+
+ * src/id3/tag_file.cpp:
+ Changed new ANSI-standard C++ include headers to old-style headers.
+ Fixed minor problems for windows.
+
+ * src/id3/misc_support.cpp:
+ Changed new ANSI-standard C++ include headers to old-style headers.
+ (ID3_GetString): Removed variable name to prevent warning in windows.
+
+ * src/id3/frame.cpp
+ * src/id3/field.cpp:
+ Changed new ANSI-standard C++ include headers to old-style headers.
+ Fixed return bug in operator=.
+
+ * src/id3/dll_wrapper.cpp:
+ Changed new ANSI-standard C++ include headers to old-style headers.
+ Updated ID3_VerInfo to represent major, minor, and patch versions.
+
+ * src/id3/tag_parse_v1.cpp
+ * src/id3/tag_parse_lyrics3.cpp
+ * src/id3/tag_parse.cpp
+ * src/id3/header_tag.cpp
+ * src/id3/header_frame.cpp
+ * src/id3/header.cpp
+ * src/id3/frame_render.cpp
+ * src/id3/field_string_unicode.cpp
+ * src/id3/field_string_ascii.cpp
+ * src/id3/error.cpp
+ * include/id3/tag.h
+ * include/id3/int28.h
+ * include/id3/field.h:
+ Changed new ANSI-standard C++ include headers to old-style headers.
+
+ * include/id3/tag.h (class ID3_Tag):
+ Added HasV1Tag, HasV2Tag, and HasLyrics (thanks John Adcock).
+
+ * include/id3/dll.h:
+ Added extern "C" (thanks John Adcock).
+
+2000-04-06 Scott Thomas Haug <scott@id3.org>
+
+ * configure.in:
+ Changed occurrences of 'micro' to 'patch'.
+
+ * src/id3/version.cpp
+ * include/id3/version.h:
+ Changed the version functions to reflect the name change of release
+ and revision to major and minor.
+
+ * src/id3/tag_parse.cpp (ParseFromHandle)
+ * src/id3/tag_file.cpp (Link)
+ * include/id3/tag.h (class ID3_Tag):
+ Added optional parameters to Link to make parsing of id3v1/lyrics3
+ tags optional.
+
+ * THANKS
+ * README:
+ Updated with current information.
+
+ * Makefile.am:
+ Put in version requirement for automake (1.4).
+
+ * configure.in
+ * src/id3/Makefile.am:
+ Updated versioning macros, ala glib (http://www.gtk.org). Also added a
+ few more tests.
+
+ * HISTORY:
+ Added note to refer to ChangeLog for changes since 3.05a.
+
+ * AUTHORS:
+ Updated to reflect MusicMatch's release of project direction.
+
+2000-04-05 Scott Thomas Haug <scott@id3.org>
+
+ * include/id3/field.h
+ * include/id3/int28.h
+ * include/id3/misc_support.h
+ * include/id3/tag.h
+ * include/id3/types.h
+ * src/id3/dll_wrapper.cpp
+ * src/id3/error.cpp
+ * src/id3/field.cpp
+ * src/id3/field_binary.cpp
+ * src/id3/field_integer.cpp
+ * src/id3/field_string_ascii.cpp
+ * src/id3/field_string_unicode.cpp
+ * src/id3/frame.cpp
+ * src/id3/frame_parse.cpp
+ * src/id3/frame_render.cpp
+ * src/id3/header.cpp
+ * src/id3/header_frame.cpp
+ * src/id3/header_tag.cpp
+ * src/id3/int28.cpp
+ * src/id3/misc_support.cpp
+ * src/id3/tag.cpp
+ * src/id3/tag_file.cpp
+ * src/id3/tag_find.cpp
+ * src/id3/tag_parse.cpp
+ * src/id3/tag_parse_lyrics3.cpp
+ * src/id3/tag_parse_v1.cpp
+ * src/id3/tag_render.cpp
+ * src/id3/tag_sync.cpp
+ * src/id3/version.cpp:
+ Updated initial comment information to reflect license, copyright
+ change.
+
+ * COPYING:
+ Switched to the LGPL.
+
+2000-01-04 Scott Thomas Haug <scott@id3.org>
+
+ * configure.in:
+ Removed AC_C_CONST and AC_C_INLINE checks, since we're using a C++ compiler
+ and these check against the C compiler.
+
+ * src/id3/Makefile.am
+ (the_sources): Moved dll_wrapper.cpp to EXTRA_DIST.
+
+ * include/id3/field.h:
+ * include/id3/int28.h:
+ * include/id3/misc_support.h:
+ * include/id3/tag.h:
+ * include/id3/types.h:
+ * src/id3/dll_wrapper.cpp
+ * src/id3/error.cpp
+ * src/id3/field.cpp
+ * src/id3/field_binary.cpp
+ * src/id3/field_integer.cpp
+ * src/id3/field_string_ascii.cpp
+ * src/id3/field_string_unicode.cpp
+ * src/id3/frame.cpp
+ * src/id3/frame_parse.cpp
+ * src/id3/frame_render.cpp
+ * src/id3/header.cpp
+ * src/id3/header_frame.cpp
+ * src/id3/header_tag.cpp
+ * src/id3/int28.cpp
+ * src/id3/misc_support.cpp
+ * src/id3/tag.cpp
+ * src/id3/tag_file.cpp:
+ * src/id3/tag_find.cpp:
+ * src/id3/tag_parse.cpp:
+ * src/id3/tag_parse_lyrics3.cpp:
+ * src/id3/tag_parse_v1.cpp:
+ * src/id3/tag_render.cpp:
+ * src/id3/tag_sync.cpp:
+ * src/id3/version.cpp:
+ For compilation with gcc 2.95.2 and better compatibility with ANSI/ISO
+ standard C++, updated, rearranged, and removed (where necessary)
+ #include directives.
+
+1999-12-27 Scott Thomas Haug <scott@id3.org>
+
+ * configure.in:
+ * config.win32:
+ Changed release information from 3.6.2 to 3.0.6, to prepare for
+ future MusicMatch release to happen Real Soon Now.
+
+ * include/id3/frame.h
+ (class ID3_Frame): Added declaration for constructor which accepts a
+ frame header to copy. Removed redundant data members that are now
+ encapsulated within new frame header member. Added declaration for
+ new methods InitFields and InitFieldBits.
+
+ * include/id3/header.h
+ (ID3_VERSION, ID3_REVISION): Renamed to ID3v2_*
+ (class ID3_Header): Added declarations for GetVersion, GetRevision,
+ AddFlags, SetFlags, Clear, Copy, and operator= methods. Changed
+ return type for Size and Render from luint to size_t.
+
+ * include/id3/header_frame.h:
+ (ID3_FrameAttr): Removed.
+ (class ID3_FrameHeader): Added declarations for default constructor and
+ Parse, GetFrameID, GetTextID, GetFrameDef, and Clear methods. Changed
+ return type for Size and Render. Replaced __eFrameID data member with
+ __pFrameDef, which encapsulates more information about the frame
+ header.
+
+ * include/id3/header_tag.h
+ (ID3_TAGIDSIZE): Added constant.
+ (class ID3_TagHeader): Minor return type changes for Size and Render.
+
+1999-12-26 Scott Thomas Haug <scott@id3.org>
+
+ * src/id3/frame.cpp
+ (ID3_Frame): Added data member initialization list. Updated to reflect
+ abstraction of field bits initialization. Added new constructor which
+ accepts a frame header to copy into the frame.
+ (InitFieldBits): Added implementation. Abstracted from the constuctor.
+ (Clear): Updated to reflect addition of new header data member.
+ Restructured method so it can be used in more situations.
+ (InitFields): Added implementation. Abstracted from the SetID method.
+ (SetID): Updated to reflect new method abstractions.
+ (GetID, SetVersion, Size): Updated to reflect new frame header data
+ member.
+
+ * src/id3/frame_parse.cpp
+ (Parse): Moved header processing tasks to the header object, now a
+ member of ID3_Frame.
+
+ * src/id3/frame_render.cpp
+ (Render): Moved header processing tasks to the header object, now a
+ member of ID3_Frame. Similar changes made due to removal of redundant
+ information from frame object.
+
+ * src/id3/header.cpp
+ (ID3_Header): Updated for new version constants.
+ (AddFlags): Added implementation. Adds flag(s) to current flags.
+ (RemoveFlags): Added implementation. Removes flag(s) from current
+ flags.
+ (GetVersion): Added implementation. Returns version number of header.
+ (GetRevision): Added implementation. Returns revision of header.
+ (Clear): Added implementation. Clears contents of header.
+ (operator=): Added implementation. Assignment operator.
+ (Copy): Added implementation. Copies content of another header.
+
+ * src/id3/header_frame.cpp
+ (ID3_FrameHeader): Added default constructor.
+ (SetFrameID): Modified to reflect internal representation change. Now
+ searches and stores frame definition associated with the frame id.
+ (GetFrameInfo): Removed.
+ (Parse): Added implementation. Based on former GetFrameInfo.
+ (Render): Modified to reflect internal representation change.
+ (GetTextID): Added implementation. Gets text id associated with frame
+ header.
+ (Copy): Added implementation. Copies another frame header.
+ (GetFrameID): Added implementation. Gets frame id associated with
+ frame header.
+ (GetFrameDef): Added implementation. Gets frame definition associated
+ with frame header.
+ (Clear): Added implementation. Clears contents of frame header.
+
+ * src/id3/header_tag.cpp
+ (Size, Render): Minor return type change.
+ (ID3_IsTagHeader): Updated for new version constants.
+
+ * src/id3/tag.cpp
+ (SetupTag): Updated for new version constants.
+
+ * src/id3/tag_parse.cpp
+ (ExpandBinaries, ProcessBinaries): Moved header processing tasks to
+ the header object, now a member of ID3_Frame.
+
+ * src/id3/tag_render.cpp
+ (Render): Updated for new version constants and inclusion of header in
+ each frame.
+
+ * include/id3/misc_support.h
+ (MASK): Defined macro for masking bits.
+ (): Added declarations for ParseNumber and RenderNumber, for converting
+ between character arrays and unsigned ints.
+
+ * include/id3/int28.h
+ (class int28): Restructured.
+
+ * include/id3/header_frame.h
+ (ID3FL_READONLY): Renamed from ID3FL_SIGNED.
+ (class ID3_FrameHeader): Minor cleanup to interface.
+
+ * include/id3/header.h
+ (class ID3_Header): Minor cleanup to interface.
+
+ * include/id3/frame.h
+ (class ID3_Frame): Added bReadOnly property.
+
+ * include/id3/field.h
+ (class ID3_Field): Cleaned up interface to Parse* methods.
+
+ * src/id3/tag_parse.cpp
+ (ExpandBinaries): Now uses ParseNumber, defined in misc_support.
+ (ProcessBinaries): Now uses ParseNumber, defined in misc_support.
+ (Parse): Now uses ParseNumber, defined in misc_support.
+
+ * src/id3/misc_support.cpp
+ (ParseNumber): Defined. Converts a character buffer up to 4 bytes in
+ size into its equivalent big-endian integer equivalent.
+ (RenderNumber): Defined. Converts an integer into an equivalent
+ big-endian binary character array, up to 4 bytes in length.
+
+ * src/id3/int28.cpp
+ (set): Now uses ParseNumber, defined in misc_support. Restructured
+ code.
+
+ * src/id3/header_frame.cpp
+ (GetFrameInfo): Now uses ParseNumber, defined in misc_support.
+ (Render): Now uses RenderNumber, defined in misc_support.
+
+ * src/id3/header.cpp
+ (GetDataSize): Added implementation.
+ (GetFlags): Added implementation.
+
+ * src/id3/header_tag.cpp
+ * src/id3/frame_render.cpp
+ (Render): Now uses RenderNumber, defined in misc_support.
+
+ * src/id3/field_integer.cpp
+ (ParseInteger): Now uses ParseNumber, defined in misc_support.
+ (RenderInteger): Now uses RenderNumber, defined in misc_support.
+
+ * src/id3/frame_parse.cpp:
+ * src/id3/frame.cpp:
+ * src/id3/field_string_unicode.cpp:
+ * src/id3/field_string_ascii.cpp:
+ * src/id3/field_binary.cpp:
+ Minor reformatting.
+
+1999-12-25 Scott Thomas Haug <scott@id3.org>
+
+ * include/id3/globals.h
+ (ID3_FieldID): Reformatted.
+ (ID3_FrameID): Reformatted. Commented descriptions from www.id3.org.
+ Renamed some frame id's: ID3FID_KEY -> ID3FID_INITIALKEY,
+ ID3FID_BEATSPERMINUTE -> ID3FID_BPM, ID3FID_OWNER -> ID3FID_FILEOWNER.
+ Added new frame id's for remaining frames:
+ ID3FID_AUDIOCRYPTO (AENC/CRA), ID3FID_COMMERCIAL (COMR/),
+ ID3FID_EQUALIZATION (EQUA/EQU), ID3FID_EVENTTIMING (ETCO/ETC),
+ ID3FID_CDID (MCDI/MCI), ID3FID_MPEGLOOKUP (MLLT/MLL),
+ ID3FID_OWNERSHIP (OWNE/), ID3FID_POSITIONSYNC (POSS/),
+ ID3FID_PRIVATE (PRIV/) ID3FID_BUFFERSIZE (RBUF/BUF),
+ ID3FID_VOLUMEADJ (RVAD/RVA), ID3FID_SYNCEDLYRICS (SYLT/SLT),
+ ID3FID_SYNCEDTEMPO (SYTC/STC), ID3FID_METACRYPTO (/CRM).
+
+ * src/id3/field.cpp
+ (): Updated list of implemented and unimplemented frames to include
+ their id3lib frame id, id3v2.2 id, and www.id3.org description.
+ (ID3FD_Unimplemented): Added for unimplemented frames so that their
+ data is preseved when parsing and rendering.
+ (ID3_FrameDefs): Added entries for new frames, using
+ ID3FD_Unimplemented as frame definition. Updated renamed entries.
+
+ * src/examples/demo_info.cpp
+ (GetDescription): Reformatted. Descriptions now match those from
+ www.id3.org. Added descriptions for new frame id's.
+ (PrintInformation): Updated for added frames. Now handles
+ unimplemented frames.
+
+ * src/examples/demo_convert.cpp
+ (PrintUsage): Included new padding option.
+ (main): Added new option for padding the tag.
+
+1999-12-23 Scott Thomas Haug <scott@id3.org>
+
+ * src/id3/field_string_ascii.cpp
+ (RenderASCIIString): Rewrote the function so that it doesn't create
+ temporary dynamic storage, and so that it copies the number of
+ characters, not the number of bytes, in the string.
+
+ * src/examples/demo_tag.cpp:
+ Fixed a bug which prevented comment descriptions from being added.
+
+ * src/examples/demo_convert.cpp:
+ * src/examples/demo_info.cpp:
+ * src/examples/demo_tag.cpp:
+ Added check and include for config.h.
+
+1999-12-17 Scott Thomas Haug <scott@id3.org>
+
+ * [all .cpp and .h files in src/id3 and include/id3]
+ Updated opening comment block.
+
+ * THANKS:
+ Updated with thanks for those of who have submitted recent bugfixes.
+
+ * README:
+ Removed BRIEF HISTORY. Fixed typos in FURTHER READING. Added CONTACT
+ information. Added original contact.txt information.
+
+ * COPYING:
+ Named MusicMatch as project coordinator.
+
+ * AUTHORS:
+ Listed MusicMatch as contact project maintainer.
+ Moved contact.txt info to README.
+
+ * src/id3/tag_sync.cpp
+ (ShouldUnsync): Added for use with GetUnSyncSize and UnSync.
+ (ReSync, GetUnSyncSize, UnSync): Renamed variables. Restructured code.
+
+1999-12-16 Scott Thomas Haug <scott@id3.org>
+
+ * src/id3/tag_parse_v1.cpp:
+ Fixed inclusion config.h (thanks Alexander Voronin).
+
+ * src/id3/tag_parse_lyrics3.cpp
+ (ID3_CRLFtoLF): Fixed memory allocation bug (thanks Alexander Voronin).
+
+1999-12-15 Scott Thomas Haug <scott@id3.org>
+
+ * include/id3/field.h:
+ Reformatted some comments.
+
+ * src/id3/field_string_ascii.cpp
+ (ParseASCIIString): Better comment for assigning bytesUsed.
+
+1999-12-13 Scott Thomas Haug <scott@id3.org>
+
+ * src/id3/tag_parse.cpp:
+ Minor code cleanup.
+
+1999-12-12 Scott Thomas Haug <scott@id3.org>
+
+ * config.win32:
+ Added definition of MAXPATHLEN.
+
+ * configure.in
+ (AC_HAVE_HEADERS): Added check for sys/param.h.
+
+ * src/id3/field.cpp
+ (ID3FD_TermsOfUse): Added for defining USER frame.
+ (ID3FD_LinkedInfo): Added for defining LINK frame.
+ (): Added comments that detail which frames are defined and which
+ aren't.
+ (ID3_FrameDefs): Added definitions for the following new frames:
+ ID3FID_LINKEDINFO, ID3FID_BEATSPERMINUTE, ID3FID_PLAYLISTDELAY,
+ ID3FID_KEY, ID3FID_SONGLEN, ID3FID_ORIGYEAR, ID3FID_OWNER, ID3FID_SIZE,
+ ID3FID_ISRC, and ID3FID_TERMSOFUSE. Also sorted the elements of the
+ FrameDefs array based on the long id field.
+
+ * src/id3/tag_render.cpp
+ (RenderV2ToHandle): Cleaned up creation of temp files. Now ensures
+ temp file will be in same directory as original file, thereby ensuring
+ that the call to rename will not be used across partitions.
+
+ * src/id3/tag_file.cpp
+ (exists): Add const qualifier to parameter.
+ (Link): Change to reflect new __sFileName type.
+
+ * src/id3/tag.cpp
+ (SetupTag, ~ID3_Tag): Slight changes to reflect new __sFileName type.
+
+ * src/id3/misc_support.cpp
+ (ID3_AddComment): Fixed bug that wasn't adding specified comment
+ description to comment.
+
+ * src/id3/field_string_ascii.cpp
+ (Get): Potential memory leaks plugged (thanks MusicMatch).
+ (RenderASCIIString): Bugfix for coversion from unicode to ascii string
+ (thanks MusicMatch). Some code cleanup.
+
+ * src/examples/demo_tag.cpp:
+ Added new option for adding a comment description to a comment.
+
+ * src/examples/demo_convert.cpp
+ (main): Minor code cleanup.
+
+ * include/id3/tag.h
+ (): Include sys/param.h (if available) to define MAXPATHLEN.
+ (class ID3_Tag): Made private methods protected. Changed __sFileName
+ from a char * to a char array of size MAXPATHLEN+1.
+
+ * include/id3/globals.h
+ (ID3_FrameID): Added constants for the following newly supported
+ frames: linked information (LINK), BPM (TBPM), playlist delay (TDLY),
+ initial key (TKEY), song length (TLEN), original year (TORY),
+ file owner (TOWN), file size (TSIZ), International Standard
+ Recording Code (TSRC), and terms of use (USER).
+
+1999-12-08 Scott Thomas Haug <scott@id3.org>
+
+ * include/id3/misc_support.h
+ (ID3_GetString): Added nItems parameter for retrieving a string from a
+ list (for example, the involved people list).
+
+ * include/id3/tag.h
+ (class ID3_Tag): Added copy constructor and operator= method
+ declarations.
+
+ * include/id3/frame.h
+ (class ID3_Frame): Added operator= method declaration.
+
+ * include/id3/field.h
+ (class ID3_Field): Added const to Get method. Added operator= method
+ declaration.
+
+ * src/id3/tag_file.cpp:
+ Minor code cleanup.
+
+ * src/id3/tag.cpp
+ (ID3_Tag): Added copy constructor implementation.
+ (operator=): Added implementation.
+
+ * src/id3/misc_support.cpp
+ (ID3_GetString): Added implementation for new nIndex parameter, which
+ will pull out the nIndex'th string from the field, such as for the
+ involved people list frame.
+ (ID3_GetGenre): Fixed bug that wasn't finding the track num frame
+ rather than the genre frame (thanks Alexander Voronin).
+
+ * src/id3/frame.cpp
+ (operator=): Added implementation.
+
+ * src/id3/field_string_unicode.cpp
+ (Add): Cleaned up and restructured code to make for easier reading.
+ Also fixed a bug in adding strings to an involved people list frame.
+
+ * src/id3/field_string_ascii.cpp
+ (ParseASCIIString): Fixed bug which prevented correct parsing of fields
+ separated with NULL dividers (such as the involved people frame).
+ Slightly restructured the code for better performance.
+
+ * src/id3/field_integer.cpp
+ (Get): Added const qualifier.
+
+ * src/id3/field.cpp
+ (): Better comments of the ID3VC_HIGHER/ID3VC_LOWER section in the
+ field defs.
+ (operator=): Added implementation.
+
+ * src/examples/demo_info.cpp
+ (PrintInformation): Separated out information printing code into this
+ separate function.
+ (main): Added new runtime option -a that will test the ability of
+ id3lib to make copies of tags. Not very useful in general, but nice
+ for testing the new operator= code.
+
+1999-12-05 Scott Thomas Haug <scott@id3.org>
+
+ * src/examples/Makefile.am
+ (check_PROGRAMS): Added id3lib
+ (id3tag_SOURCES): Added
+
+ * src/examples/demo_tag.cpp:
+ Added. Allows for simple tagging of files from the command line.
+
+ * src/id3/tag_render.cpp
+ (RenderV2ToHandle): Use mkstemp instead of tmpfile for creating a
+ temporary file, enabling only a single copy for rendering new id3v2
+ tag. Used an fstream for the temporary file.
+
+1999-12-04 Scott Thomas Haug <scott@id3.org>
+
+ * src/id3/tag_parse_v1.cpp
+ (ParseID3v1): Added STR_V1_COMMENT_DESC as description parameter to
+ call to ID3_AddComment
+
+ * include/id3/misc_support.h:
+ Updated the Add functions so that they accept an option boolean
+ parameter which indicates if the function should replace the current
+ frame, if any. Made any char * parameters const, if appropriate.
+ Added a Remove function for each of the frame types handled in this
+ file. Also generalized AddComment so that it now accepts a Description
+ string, which defaults to "".
+
+ * src/id3/misc_support.cpp
+ (ID3_AddArtist): Added extra boolean parameter (see changes for
+ misc_support.h above) as well as the functionality that implements the
+ feature. If bReplace is true, than the new information replaces the
+ information in the previous Artist frame, if any. If bReplace is
+ false, the information is added only if no previous Artist frame
+ existed.
+ (ID3_AddAlbum): See changes for ID3_AddArtist.
+ (ID3_AddTitle): See changes for ID3_AddArtist.
+ (ID3_AddYear): See changes for ID3_AddArtist.
+ (ID3_AddComment): See changes for ID3_AddArtist. Also generalized
+ implementaiton using the new sDescription parameter.
+ (ID3_AddTrack): See changes for ID3_AddArtist.
+ (ID3_AddGenre): See changes for ID3_AddArtist.
+ (ID3_AddLyrics): See changes for ID3_AddArtist.
+ (ID3_RemoveArtists): Added. Removes any and all frames that are
+ associated with artist information (namely, ID3FID_LEADARTIST,
+ ID3FID_BAND, ID3FID_CONDUCTOR, and ID3FID_COMPOSER) from the tag.
+ (ID3_RemoveAlbums): Added. Removes any and all album name frames
+ (ID3_RemoveTitles): Added. Removes any and all song title frames
+ (ID3_RemoveYears): Added. Removes any and all year frames
+ (ID3_RemoveComments): Added. Removes any and all comment frames that
+ match the sDescription parameter. If sDescription is NULL, all comment
+ frames are removed.
+ (ID3_RemoveTracks): Added. Removes any and all track number frames
+ (ID3_RemoveGenres): Added. Removes any and all content type frames
+ (ID3_RemoveLyrics): Added. Removes any and all unsynced lyrics frames
+
+1999-12-03 Scott Thomas Haug <scott@id3.org>
+
+ * Makefile.am
+ (EXTRA_DIST): Added config.win32.
+
+1999-12-02 Scott Thomas Haug <scott@id3.org>
+
+ * NEWS:
+ Added update for release 3.6.2.
+
+ * configure.in
+ (id3lib_patch): Upped to 2 for new release 3.6.2
+ (AC_OUTPUT): Added Makefiles for prj and zlib and its subdirs
+
+ * Makefile.am
+ (SUBDIRS): Added prj and zlib
+
+ * prj/Makefile.am
+ * zlib/Makefile.am
+ * zlib/include/Makefile.am
+ * zlib/lib/Makefile.am
+ * zlib/prj/Makefile.am
+ * zlib/src/Makefile.am:
+ Added for distribution purposes.
+
+ * zlib/include/deflate.h
+ * zlib/include/infblock.h
+ * zlib/include/infcodes.h
+ * zlib/include/inffast.h
+ * zlib/include/inffixed.h
+ * zlib/include/inftrees.h
+ * zlib/include/infutil.h
+ * zlib/include/trees.h
+ * zlib/include/zconf.h
+ * zlib/include/zlib.h
+ * zlib/include/zutil.h
+ * zlib/prj/zlib.dsp
+ * zlib/prj/zlib.dsw
+ * zlib/prj/zlib.mak
+ * zlib/src/adler32.c
+ * zlib/src/compress.c
+ * zlib/src/crc32.c
+ * zlib/src/deflate.c
+ * zlib/src/gzio.c
+ * zlib/src/infblock.c
+ * zlib/src/infcodes.c
+ * zlib/src/inffast.c
+ * zlib/src/inflate.c
+ * zlib/src/inftrees.c
+ * zlib/src/infutil.c
+ * zlib/src/trees.c
+ * zlib/src/uncompr.c
+ * zlib/src/zutil.c:
+ Added for windows compilation. (thanks elrod)
+
+ * src/id3/dll_wrapper.cpp:
+ Fixed config.h macros. (thanks elrod)
+
+ * prj/id3lib.dsp
+ * prj/id3lib.dsw
+ * prj/id3lib.mak
+ * config.win32:
+ Added to the distribution for windows compilation. (thanks elrod)
+
+ * include/id3/dll.h
+ * include/id3/error.h
+ * include/id3/field.h
+ * include/id3/frame.h
+ * include/id3/globals.h
+ * include/id3/header.h
+ * include/id3/header_frame.h
+ * include/id3/header_tag.h
+ * include/id3/int28.h
+ * include/id3/misc_support.h
+ * include/id3/tag.h
+ * include/id3/types.h:
+ Changed all of the #include <id3/*> to #include "*" to help ensure that
+ the sources are searched for in the right places.
+
+1999-12-01 Scott Thomas Haug <scott@id3.org>
+
+ * configure.in:
+ Changed the release information for 3.6.1.
+
+ * NEWS:
+ Updated for the 3.6.1 release.
+
+ * README:
+ Spelling error corrected.
+
+ * ChangeLog:
+ Coalesced all the ChangeLog's (previously one for each directory) into
+ this toplevel ChangeLog.
+
+ * src/id3/Makefile.am
+ * src/Makefile.am:
+ Removed EXTRA_DIST (no more ChangeLog)
+
+ * src/examples/Makefile.am
+ * doc/Makefile.am
+ (EXTRA_DIST): Removed ChangeLog.
+
+ * src/id3/tag_render.cpp
+ (RenderV1ToHandle): Removed reference to tagV1---not used. Other
+ minor windows-compatibility fixes. (thanks elrod)
+
+ * src/id3/tag_parse_v1.cpp
+ (ParseID3v1): Minor fix for windows compatibility (thanks elrod).
+
+ * src/id3/tag_file.cpp
+ (truncate): Added. Defined only for windows, which doesn't have
+ unistd.h available (thanks elrod).
+
+ * src/id3/misc_support.cpp
+ (ucslen): Now returns 0 if input is NULL (thanks elrod).
+
+ * include/id3/misc_support.h:
+ Minor declaraction problem (thanks elrod).
+
+ * include/id3/Makefile.am
+ * include/Makefile.am
+ (EXTRA_DIST): Removed. No extra files to distribute
+
+ * Makefile.am
+ (SUBDIRS): Added "include".
+
+ * configure.in
+ (AC_OUTPUT): Added include/Makefile and include/id3/Makefile
+
+ * include/id3/Makefile.am:
+ Added.
+
+ * include/Makefile.am:
+ Added.
+
+ * src/id3/Makefile.am
+ (INCLUDES): Now points to new, toplevel include directory.
+ (the_headers, id3includedir, id3include_HEADERS): Removed. Headers are
+ no longer in this directory.
+
+ * src/id3/dll_wrapper.cpp
+ * src/id3/error.cpp
+ * src/id3/field.cpp
+ * src/id3/field_binary.cpp
+ * src/id3/field_integer.cpp
+ * src/id3/field_string_ascii.cpp
+ * src/id3/field_string_unicode.cpp
+ * src/id3/frame.cpp
+ * src/id3/frame_parse.cpp
+ * src/id3/frame_render.cpp
+ * src/id3/header.cpp
+ * src/id3/header_frame.cpp
+ * src/id3/header_tag.cpp
+ * src/id3/int28.cpp
+ * src/id3/misc_support.cpp
+ * src/id3/tag.cpp
+ * src/id3/tag_file.cpp
+ * src/id3/tag_find.cpp
+ * src/id3/tag_parse.cpp
+ * src/id3/tag_parse_lyrics3.cpp
+ * src/id3/tag_parse_v1.cpp
+ * src/id3/tag_render.cpp
+ * src/id3/tag_sync.cpp
+ * src/id3/version.cpp:
+ Changed all of the #include <id3/*> to #include "*" to help ensure that
+ the sources are searched for in the right places (and to make compiling
+ under windows easier).
+
+ * src/examples/Makefile.am
+ (INCLUDES): Updated to point to new toplevel include directory.
+
+1999-11-30 Scott Thomas Haug <scott@id3.org>
+
+ * README:
+ Renamed ID3Lib to id3lib.
+
+ * COPYING:
+ Renamed ID3Lib to id3lib. Fixed spelling of "optimizations".
+
+ * configure.in:
+ Minor modifications. Removed call to SH_SIZE_SPECIFIC_TYPES---these
+ types are now defined in src/id3/sized_types.h. Removed ID3LIB_NAME
+ macro (same as PACKAGE). Removed ID3LIB_RELEASE macro (same as
+ VERSION). Renamed ID3LIB_IDSTRING to ID3LIB_FULLNAME and removed
+ the date part of it.
+
+ * Makefile.am
+ (EXTRA_DIST): Removed ChangeLog, configure, HISTORY, and TODO.
+ These are included in the distribution automatically.
+
+ * configure.in:
+ Generalized versioning mechanism so it only has to be changed in this
+ file to be propagated throughout rest of source code. Used a hack to
+ make libtool version coincide with release versioning. This is
+ expressly warned against in the libtool docs, so it might be changed.
+ However, it also seems to be a common practice amongst other library
+ writers, so I'm torn. Added versioning macro definitions normally
+ found in version.h. Probably not the best place for this...
+
+ * src/id3/version.cpp:
+ Added. Implements version functions declared in version.h.
+
+ * src/id3/sized_types.h:
+ Added. Converted from sh_types.h in toplevel m4 directory. Defines
+ size-specific types based on macros in limits.h. int8, uint8, int16,
+ uint16, int32, uint32.
+
+ * src/id3/version.h:
+ Changed from preprocessor macros to functions. Now changes to top
+ level configure.in with regards to version info will be reflected in
+ these functions without having to change this file.
+
+ * src/id3/types.h
+ * src/id3/misc_support.h:
+ Removed include for wchar.h
+
+ * src/id3/misc_support.cpp:
+ No more SIZE_SPECIFIC_TYPES code. No more code for wchar's. Typedefs
+ in sized_types.h guarantee that unicode_t will be two bytes.
+
+ * src/id3/globals.h:
+ No longer includes config.h. No more SIZE_SPECIFIC_TYPES code. No
+ more code for wchar_t. Added include for sized_types.h.
+
+ * src/id3/Makefile.am
+ (the_headers): Added sized_headers.h
+ (the_sources): Added version.cpp
+ (LTVERSION): Updated to make use of configure.in variables.
+
+ * src/examples/demo_info.cpp
+ * src/examples/demo_convert.cpp:
+ Updated to reflect changes from version macros to version functions.
+
+ * m4/Makefile.am
+ (m4macros): Removed sh_types.m4.
+
+ * m4/sh_types.m4:
+ Removed. Content now in src/id3/sized_types.h (a more appropriate
+ file).
+
+1999-11-29 Scott Thomas Haug <scott@id3.org>
+
+ * configure.in:
+ Added doc/*/Makefile to AC_OUPUT
+
+ * AUTHORS:
+ Included text from contact.txt in original distribution.
+
+ * configure.in:
+ Added many more checks. Restructured into more logical groups.
+
+ * src/id3/Makefile.am:
+ (the_headers): Added globals.h to header file listing.
+
+ * src/id3/misc_support.h:
+ Renamed ID3_ASCIItoUnicode to mbstoucs. Renamed ID3_UnicodeToASCII to
+ ucstombs. Added declarations for ucslen, ucscpy, ucsncpy, ucscmp, and
+ ucsncmp.
+
+ * src/id3/globals.h:
+ Updated documentation to work better with doc++ (probably doesn't work
+ well with kdoc anymore). Added the unicode_t typedef.
+
+ * src/id3/version.h:
+ Updated documentation to work better with doc++ (probably doesn't work
+ well with kdoc anymore). Updated the constants.
+
+ * src/id3/misc_support.cpp:
+ (): Made includsion of wchar.h dependant on SIZE_SPECIFIC_TYPES.
+ Put in compile-time checks to compile differently based on the
+ definition of unicode_t.
+ (mbstoucs): Renamed from ID3_ASCIItoUnicode.
+ (ucstombs): Renamed from ID3_UnicodeToASCII.
+ (ucslen): Added. Returns the length of a unicode character string.
+ (ucscpy): Added. Copies one unicode string to another.
+ (ucsncpy): Added. Copies n chars from one unicode string to another.
+ (ucscmp): Added. Compares two unicode strings.
+ (ucsncmp): Added. Compares the first n chars of two unicode strings.
+
+ * src/id3/tag_find.cpp:
+ (): Updated methods to use unicode_t instead of wchar_t. unicode_t is
+ defined in globals.h. The type unicode_t is more likely to be two
+ bytes on every platform. Updated calls to unicode methods to more
+ general methods defined in misc_support.cpp.
+
+ * src/id3/field_string_unicode.cpp
+ (): Updated methods to use unicode_t instead of wchar_t. unicode_t is
+ defined in globals.h. The type unicode_t is more likely to be two
+ bytes on every platform. Updated calls to unicode methods to more
+ general methods defined in misc_support.cpp.
+ (ParseUnicodeString): Fixed a bug (?) to make unicode parsing work.
+ Not really sure if this is the source of the bug, or if there is a
+ more pervasive misunderstanding of the format of unicode. Need to
+ check on this.
+
+ * src/id3/field_string_ascii.cpp:
+ Updated methods to use unicode_t instead of wchar_t. unicode_t is
+ defined in globals.h. The type unicode_t is more likely to be two
+ bytes on every platform. Updated calls to unicode methods to more
+ general methods defined in misc_support.cpp.
+
+ * src/id3/field.cpp:
+ Updated methods to use unicode_t instead of wchar_t. unicode_t is
+ defined in globals.h. The type unicode_t is more likely to be two
+ bytes on every platform.
+
+ * src/id3/error.h
+ * src/id3/field.h
+ * src/id3/frame.h
+ * src/id3/tag.h:
+ Updated documentation to work better with doc++ (probably doesn't work
+ well with kdoc anymore).
+
+ * src/id3/dll.h
+ * src/id3/dll_wrapper.cpp:
+ Updated unicode function declarations to now pass unicode_t instead of
+ wchar_t. unicode_t now defined in globals.h.
+
+ * doc/Makefile.am:
+ Removed refs to removed files.
+
+ * doc/Makefile.am
+ (SUBDIRS): Added.
+
+ * m4/sh_types.m4:
+ Added. Defines size-specific typedefs based on macro defs in limits.h.
+
+ * m4/lf_cxx_convenience.m4:
+ Added. Pulled out non-portability macros from lf_cxx.m4.
+
+ * m4/lf_cxx.m4: Moved conenience macros to lf_cxx_convenience.m4.
+
+ * m4/Makefile.am
+ * m4/Makefile.in:
+ Added sh_types.m4 and lf_cxx_convenience.m4 to distribution.
+
+1999-11-26 Scott Thomas Haug <scott@id3.org>
+
+ * doc/contact.txt:
+ Removed. Relevant information updated and included in README and
+ AUTHORS.
+
+ * doc/software.txt:
+ Removed. No longer applies to this fork.
+
+ * doc/bugreport.txt
+ * doc/id3v2-3.00.txt
+ * doc/id3guide.html
+ * doc/logo.txt
+ * doc/contact.txt:
+ dos2unix'ified
+
+ * doc/licence.txt:
+ Removed. Replaced with COPYING file in top dir.
+
+ * doc/zlib_readme.txt:
+ Removed. zlib sources no longer included in the distribution.
+
+ * doc/id3libhistory.txt:
+ Removed. Replaced with HISTORY file in top dir.
+
+ * doc/id3lib305.doc:
+ Removed. Replaced with inline documentation found in source,
+ converted into various formats (html, latex, texinfo, man) using
+ doc++ or kdoc.
+
+1999-11-25 Scott Thomas Haug <scott@id3.org>
+
+ * Makefile.am
+ (EXTRA_DIST): Added HISTORY and TODO
+
+ * AUTHORS:
+ Minor clarification.
+
+ * COPYING:
+ Change from the GPL to the original statement about being in the Public
+ Domain.
+
+ * TODO
+ * HISTORY:
+ Initial revision.
+
+ * NEWS:
+ Actually added some news.
+
+ * README:
+ Filled the README with semi-useful information.
+
+ * THANKS:
+ Transcribed the Thanks section from Dirk's original documentation.
+
+ * src/id3/version.h:
+ Added doc++/kdoc/javadoc-like documentation. Replaced #define's with
+ const's.
+
+ * src/id3/types.h:
+ Removed typedefs, which are now included in the globas.h file.
+
+ * src/id3/tag.h
+ (): Added doc++/kdoc/javadoc-like documentation, mostly transcribed
+ from Dirk's ID3Lib Documentation MSWord doc.
+ (ID3_TagTypes): Added. The different types of tags that can be parsed
+ and/or rendered by id3lib.
+ (class ID3_Tag): Changed the interface to AddFrame slightly. Now there
+ is two AddTag-like methods: AddTag and AddNewTag. The former merely
+ attaches the frame to the tag without taking repsonsibility for
+ deallocating the frame when the tag goes out of scope or is deleted.
+ The latter does take this responsibility. Granted, there could be a
+ better interface for this, but it works for now... Update and Strip
+ now return flags which indicate what tags were actually updated or
+ stripped. Removed OpenLinkedFile method; replaced with
+ OpenFileForReading, OpenFileForWriting, and CreateFile.
+
+ * src/id3/frame.h:
+ Added doc++/kdoc/javadoc-like documentation, mostly transcribed
+ from Dirk's ID3Lib Documentation MSWord doc.
+
+ * src/id3/field.h
+ (): Added doc++/kdoc/javadoc-like documentation, mostly transcribed
+ from Dirk's ID3Lib Documentation MSWord doc.
+ (ID3_FieldFlags ): Created enumeration to replace generic constants.
+ (ID3_FieldID): Removed. Replaced in globals.h.
+ (ID3_FrameID): Removed. Replaced in globals.h.
+ (class ID3_Field): Made the constructor private.
+
+ * src/id3/error.h
+ (): Added doc++/kdoc/javadoc-like documentation.
+ (ID3_Err): Added error types SmallBuffer and ReadOnly.
+
+ * src/id3/misc_support.cpp:
+ Replaced every call to AddFrame with AddNewFrame.
+
+ * src/id3/tag_render.cpp
+ (Render): Replaced manual array initialization with call to memset.
+ (GenerateTempName): Removed method. No longer used.
+ (RenderV1): New method. Renders an id3v1 tag to an array.
+ (RenderV1ToHandle): Moved work of writing tag to array to RenderV1.
+ (RenderV2ToHandle): Rather than generating a temporary file name with
+ mktemp (or similar) and opening that file name to a temporary file,
+ we now use tmpfile to create a temporary file directly. Unfortunately,
+ this means we can't just rename the tempfile to the original file
+ when all the copying is done, so we have to perform a second copy from
+ the temp file back to the original. This makes the code less efficient
+ but more portable, as we rely on tmpfile for knowing where to create
+ the temporary file. To improve, we'll need to figure out a portable
+ mechanism for creating temporary files (i.e., resolve the differences
+ between /tmp/ and C:\temp\).
+
+ * src/id3/tag_parse.cpp
+ (ProcessBinaries): Minor code reorg.
+
+ * src/id3/tag_file.cpp
+ (OpenLinkedFile): Removed method. Replaced with CreateFile,
+ OpenFileForReading, and OpenFileForWriting.
+ (CreateFile): New method. Creates a new file with file name sFileName.
+ Throws if unable to.
+ (OpenFileForWriting): New method. Opens a file with write permissions.
+ Throws if unable to.
+ (OpenFileForReading): New method. Opens a file with read permissions.
+ Throws if unable to.
+ (CloseFile): New method. Closes a file. Returns true if successful,
+ false otherwise.
+ (Link): Now dynamically allocate sFileName. Make use of new method
+ OpenFileForReading rather than OpenLinkedFile. Closes the file
+ when done.
+ (Update): Now returns a flag indicating which tags were actually
+ written. Calls OpenFileForWriting to open the file appropriately.
+ Closes the file when done.
+ (Strip): Now returns a flag indicating which tags were actually
+ written. Now strips a file "in place," by copying the non-stripped
+ information to the beginning of the file and using ftruncate to chop
+ off the rest. Prevents having to create a temporary file. Calls
+ OpenFileForWriting to open the file appropriately. Closes the file
+ when done.
+
+ * src/id3/tag.cpp
+ (SetupTag): Initialized sFileName to NULL rather than the empty string
+ to indicate no filename is present.
+ (ID3_Tag): Deleted sFileName if allocated. Added call to CloseFile.
+ (AddFrame): Modified to reflect change in interface. AddFrame now adds
+ a frame without taking responsibility for deallocating the memory when
+ the tag goes out of scope.
+ (AddNewFrame): New method. AddNewFrame adds a frame and takes
+ responsibility for deallocating the frame when the tag goes out of
+ scope.
+
+ * src/id3/error.cpp
+ (ID3_ErrorDescs): Added descriptions for new error types.
+ (ID3_Error): Minor bugfix in string copying.
+
+ * src/id3/dll.h:
+ Removed many of the enums and typedefs to globals.h to reduce
+ redundancy.
+
+ * src/id3/globals.h:
+ Added. Includes constants, typedefs, and enums common to several
+ files that were redundantly copying them.
+
+ * src/examples/Makefile.am:
+ Removed demo_strip from the make rules.
+
+ * src/examples/demo_strip.cpp:
+ Removed. Functionality now in demo_convert.cpp with the -s flag.
+
+ * src/examples/demo_convert.cpp
+ (PrintUsage): Added for printing usage information.
+ (PrintVersion): Added for printing version information.
+ (DisplayTags): Added for printing out the contents of a tag flag.
+ (main): Modified to make use of command-line options via option.h.
+ Can now choose which type of tag to convert to, can convert multiple
+ tags at once. Can print out usage and version info. Added stripping
+ capabilities with the -s flag.
+
+ * doc/id3libhistory.txt:
+ Rerformatted to fit within 80 characters.
+
+1999-11-19 Scott Thomas Haug <scott@id3.org>
+
+ * src/id3/tag_render.cpp
+ (RenderV1ToHandle): Added. Adds or overwrites an id3v1 tag to a file
+ handle. Needs testing.
+ (RenderV2ToHandle): Renamed from RenderToHandle.
+
+ * src/id3/tag_parse_v1.cpp
+ (ID3_RemoveTrailingSpaces): Minor code cleanup.
+ (ParseID3v1): Massive recoding of method to make use of new functions
+ defined in misc_support. Simplifies flow of method.
+
+ * src/id3/tag_find.cpp
+ (Find): Add const qualifier.
+
+ * src/id3/tag_file.cpp
+ (Update): Changed parameter to be a flag which indicates which type of
+ tag to update, either V1_TAG, V2_TAG, or BOTH_TAGS. Updated method to
+ act appropriately based on the parameter passed in.
+ (Strip): Changed parameter to be a flag which indicates which type of
+ tag to update, either V1_TAG, V2_TAG, or BOTH_TAGS. Updated method to
+ act appropriately based on the parameter passed in.
+
+ * src/id3/tag.h:
+ Added new constants: STR_V1_COMMENT_DESC (to be added to the
+ description of comments converted from id3v1 tags); V1_TAG,
+ V2_TAG, and BOTH_TAGS (used for methods Strip and Update to
+ determine which tag to act on); and LEN_V1, LEN_V1_ID,
+ LEN_V1_TITLE, LEN_V1_ARTIST, LEN_V1_ALBUM, LEN_V1_YEAR,
+ LEN_V1_COMMENT, LEN_V1_GENRE (the lengths of the id3v1 tag and its
+ fields). Generalized ID3V1_Tag struct using newly defined
+ constants. Added 1 to each char array size for null terminator.
+ Added const qualifier to appropriate methods and parameters.
+ Added declaration of RenderV1ToHandle method. Renamed
+ "RenderToHandle" to "RenderV2ToHandle".
+
+ * src/id3/misc_support.h:
+ Added the function declarations for ID3_GetString, ID3_GetArtist,
+ ID3_GetAlbum, ID3_GetTitle, ID3_GetYear, ID3_AddYear,
+ ID3_GetComment, ID3_AddComment, ID3_GetTrack, ID3_GetTrackNum,
+ ID3_AddTrack, ID3_GetGenre, ID3_GetGenreNum, and ID3_GetLyrics.
+
+ * src/id3/misc_support.cpp
+ (ID3_ASCIItoUnicode): Updated interface to make parameters const.
+ Replaced content of the code with call to mbstowcs, a function defined
+ in wchar.h for converting from a regular string to a wchar string. The
+ original code might be reinstated if another type is used to store
+ unicode characters.
+ (ID3_UnicodeToASCII): Updated interface to make parameters const.
+ Replaced content of the code with call to wcstombs, a function defined
+ in wchar.h for converting from a wchar string to a regular string. The
+ original code might be reinstated if another type is used to store
+ unicode characters.
+ (ID3_GetString): Added. Returns a dynamically-allocated copy of the
+ string contained in the frame/field parameters.
+ (ID3_GetArtist): Added. Returns the artist as a string. Will return
+ the LEADARTIST, the BAND, the CONDUCTOR, or the COMPOSER, whichever is
+ found first in that order.
+ (ID3_GetAlbum): Added. Returns the album as a string.
+ (ID3_GetTitle): Added. Returns the song title as a string.
+ (ID3_GetYear): Added. Returns the year as a string.
+ (ID3_AddYear): Added. Adds the year as a string to the frame.
+ (ID3_GetComment): Added. Returns the first comment found as a string.
+ (ID3_AddComment): Added. Adds the comment as a string with the
+ description stored in STR_V1_COMMENT_DESC, currently "ID3v1_Comment".
+ Won't add if a tag with that or no description already exists.
+ (ID3_GetTrack): Added. Returns the track number as a string.
+ (ID3_GetTrackNum): Added. Returns the track number as an unsigned
+ integer.
+ (ID3_AddTrack): Added. Adds the track number and track total as a
+ string in the form "N/T", where N is the track number and T is the
+ total. If no total is indicated, then only the track number is added.
+ (ID3_GetGenre): Added. Returns the genre as a string.
+ (ID3_GetGenreNum): Added. Returns the genre as a number.
+ (ID3_AddGenre): Added. Adds the genre number as a string in the form
+ "(G)", where G is the genre number.
+ (ID3_GetLyrics): Added. Gets the unsynced lyrics as a string.
+
+ * src/id3/field_string_unicode.cpp
+ (operator=): Updated interface to make parameters const.
+ (Set): Updated interface to make parameters const. Bug fix for fixed
+ length strings. Minor variable renaming.
+ (Add): Updated interface to make parameters const.
+ (Get): Updated interface to make parameters const. Fixed bug which
+ would add a null character to the string regardless of the length of
+ string requested. Now only adds a null when the actual length of the
+ string is less than the maxium number of characters requested.
+
+ * src/id3/field_string_ascii.cpp
+ (operator=): Updated interface to make parameters const.
+ (Set): Updated interface to make parameters const. Bug fix for fixed
+ length strings.
+ (Get): Removed check for nonempty strings so empty strings would be
+ set correctly. Minor code cleanup.
+ (Add): Updated interface to make parameters const. Made variable name
+ more descriptive.
+
+ * src/id3/field_integer.cpp
+ (ParseInteger): Updated interface to make parameters const.
+
+ * src/id3/field_binary.cpp
+ (Set): Updated interface to make parameters const.
+ (FromFile): Updated interface to make parameters const.
+ (ToFile): Updated interface to make parameters const.
+ (ParseBinary): Updated interface to make parameters const.
+
+ * src/id3/field.h
+ (class ID3_Field): Updated method interfaces to make appropriate
+ parameters const.
+
+ * src/id3/field.cpp
+ (BinSize): Added check for an ascii string when called by Size, since
+ we store every string internally as unicode.
+ (Parse): Updated interface to make parameters const.
+ (ID3_FindFrameDef): Updated interface to make parameter const.
+ (ID3_FindFrameID): Updated interface to make parameter const.
+
+ * src/id3/dll_wrapper.cpp
+ (ID3Tag_Strip): Updated for interface change to
+ Tag::Strip. Now accepts tag flags rather than a v1 boolean.
+
+ * src/examples/Makefile.am:
+ Added compilation options for demo_strip.cpp
+
+ * src/examples/demo_info.cpp:
+ Added runtime options for version and help. Minor code cleanup.
+
+ * src/examples/demo_strip.cpp: Initial revision.
+
+1999-11-16 Scott Thomas Haug <scott@id3.org>
+
+ * src/id3/tag_parse.cpp
+ (ProcessBinaries): Added try/catch block to catch any exceptions so
+ that the parser can carry on parsing the rest of the frames if any
+ particular frame is poorly encoded. Need to add some sort of
+ mechanism to determine how many frames exist, how many have been
+ parsed correctly and how many have been parsed incorrectly.
+
+ * src/id3/field_string_unicode.cpp
+ (ParseUnicodeString): Put in sanity check for indices so that
+ memcpy doesn't go out of bounds. Made unicode code more specific
+ to the type of data storing unicode characters. This fix doesn't
+ work if the type is different than two bytes in size. Need to fix
+ so that the type is guaranteed to be two bytes.
+ (RenderUnicodeString): Made unicode code more specific to the type
+ of data storing unicode characters.
+
+ * src/id3/field_string_ascii.cpp
+ (ParseASCIIString): Added sanity check for indices so we don't
+ call memcpy with out-of-bounds indices.
+
+ * src/id3/field.cpp
+ (Render): Minor reformatting.
+
+ * src/id3/error.h
+ (ID3_Err): Added new ID3_Err: ID3E_BadData.
+
+ * src/id3/error.cpp
+ (ID3_ErrorDescs): Added text entry for ID3E_BadData.
+
+1999-11-15 Scott Thomas Haug <scott@id3.org>
+
+ * configure.in
+ * configure:
+ Changed the distribution version to 3.0.6pre1.
+
+ * Makefile.am
+ * Makefile.in:
+ Added EXTRA_DIST and moved EXTRA_SUBDIRS to SUBDIRS.
+
+ * src/Makefile.am
+ (EXTRA_DIST): Added ChangeLog.
+ (SUBDIRS): Added examples.
+
+ * src/id3/Makefile.am:
+ Upped the version info to 3.0.6.
+
+ * src/id3/tag_render.cpp:
+ Added include for config.h. Minor code cleanup. Removed
+ assignments from if checks; first makes assignment, then checks
+ for appropriate value. Made private member variable names more
+ descriptive. Now uses mktemp rather than mkstemp in
+ GenerateTempName so that a file descriptor isn't created along
+ with the temporary name.
+
+ * src/id3/tag_find.cpp:
+ Added include for config.h. Removed assignments from if checks;
+ first makes assignment, then checks for appropriate value. Made
+ private member variable names more descriptive. Major code
+ cleanup: use of for loops instead of while's to ease code
+ readability, more compact looping structures to reduce possibility
+ in coding or human parsing errors,
+
+ * src/id3/tag_file.cpp:
+ Added include for config.h. Minor code cleanup. Removed
+ assignments from if checks; first makes assignment, then checks
+ for appropriate value. Made private member variable names more
+ descriptive. OpenLinkedFile now checks to see if the file is
+ writable or not, and still opens the file, even if it can't be
+ written to. This needs to be more robust (i.e., we shouldn't be
+ creating temp files if the file isn't writable). Made use of
+ bFileWrtiable variable, which was introduced.
+
+ * src/id3/tag.h:
+ Made variable names more descriptive. Added const qualifier to
+ appropriate methods.
+
+ * src/id3/int28.cpp:
+ Added include for config.h. Changed some ints to luints to avoid
+ compiler warnings.
+
+ * src/id3/header.h
+ * src/id3/header_frame.h:
+ Made variable names more descriptive.
+
+ * src/id3/header.cpp:
+ Added include for config.h. Minor code cleanup. Made private
+ member variable names more descriptive. Fixed bug I introduced in
+ logic of checking version/revision numbers in
+ ID3_LookupHeaderInfo, and cleaned up the code in the process.
+
+ * src/id3/frame.h:
+ Made ID3_Tag a friend of ID3_Frame to allow access to the private
+ members in ID3_Frame. Made variable names more descriptive.
+ Added const qualifier to appropriate methods.
+
+ * src/id3/field_binary.cpp
+ * src/id3/field_integer.cpp
+ * src/id3/field_string_ascii.cpp
+ * src/id3/field_string_unicode.cpp
+ * src/id3/frame.cpp
+ * src/id3/frame_render.cpp
+ * src/id3/header_frame.cpp
+ * src/id3/misc_support.cpp
+ * src/id3/tag.cpp, tag_parse.cpp
+ * src/id3/tag_parse_lyrics3.cpp
+ * src/id3/tag_parse_v1.cpp
+ * src/id3/tag_sync.cpp:
+ Added include for config.h. Minor code cleanup. Removed
+ assignments from if checks; first makes assignment, then checks
+ for appropriate value. Made private member variable names more
+ descriptive.
+
+ * src/id3/field.h:
+ Made ID3_Frame and ID3_Tag friends of the ID3_Field class to allow
+ access to the private members in ID3_Field. Made ID3FF field
+ flags const luints, rather than #define's. Made member variable
+ names of classes and structs more descriptive.
+
+ * src/id3/field.cpp:
+ Added include for config.h. Replaced LU_NULL with ID3FF_NONE for
+ more consistency in flag naming. Blocked out the ID3FD_Volume
+ array definition since it is currently unused. Reformatted
+ ID3_FrameDefs for easier reading (although most lines are more
+ than 80 chars long now). Made private member variable names more
+ descriptive. Fixed bug in SetVersion (was checking "rev != rev").
+ Adjusted logic somewhat in BinSize to ease code reading. Fixed
+ bug in BinSize that was causing incorrect parsing of correct
+ frames, such as COMM (previously assumed a wchar_t is 2 bytes,
+ which might not be true on some platforms).
+
+ * src/id3/error.h:
+ Made constructor public. Added new interface to error reporting
+ to allow for more descriptive error messages (this should still be
+ worked on). Made private member variable names more descriptive.
+ Added const qualifier to appropriate methods.
+
+ * src/id3/error.cpp:
+ Added include for config.h. Added new interface to error
+ reporting to allow for more descriptive error messages (this
+ should still be worked on). Made private member variable names
+ more descriptive.
+
+ * src/id3/dll_wrapper.cpp
+ * src/id3/frame_parse.cpp
+ * src/id3/header_tag.cpp:
+ Added include for config.h. Made variable names more descriptive.
+
+ * src/id3/Makefile.am
+ * src/id3/Makefile.in:
+ Updated versioning info and CXXFLAGS
+
+ * src/examples/Makefile.am:
+ Added macros to allow for compiling test programs id3convert and
+ id3info.
+
+ * src/examples/demo_convert.cpp:
+ More descriptive error message.
+
+ * src/examples/demo_main.cpp:
+ Reformatted, dos2unix, cleaned up code, etc.
+
+ * doc/Makefile.am
+ (EXTRA_DIST): Added doc files that are to be distributed.
+
+ * m4/Makefile.am:
+ Adjusted so that the macros aren't installed.
+
+
+1999-11-04 Scott Thomas Haug <scott@id3.org>
+ * src/id3/dll.h:
+ * src/id3/error.h:
+ * src/id3/externals.h:
+ * src/id3/field.h:
+ * src/id3/field_binary.cpp:
+ * src/id3/field_integer.cpp:
+ * src/id3/field_string_ascii.cpp:
+ * src/id3/field_string_unicode.cpp:
+ * src/id3/frame.cpp:
+ * src/id3/frame.h:
+ * src/id3/frame_parse.cpp:
+ * src/id3/frame_render.cpp:
+ * src/id3/header.cpp:
+ * src/id3/header.h:
+ * src/id3/header_frame.cpp:
+ * src/id3/header_frame.h:
+ * src/id3/header_tag.cpp:
+ * src/id3/header_tag.h:
+ * src/id3/int28.cpp:
+ * src/id3/int28.h:
+ * src/id3/misc_support.cpp:
+ * src/id3/misc_support.h:
+ * src/id3/tag.cpp:
+ * src/id3/tag.h:
+ * src/id3/tag_file.cpp:
+ * src/id3/tag_find.cpp:
+ * src/id3/tag_parse.cpp:
+ * src/id3/tag_parse_lyrics3.cpp:
+ * src/id3/tag_parse_v1.cpp:
+ * src/id3/tag_render.cpp:
+ * src/id3/tag_sync.cpp:
+ * src/id3/types.h:
+ * src/id3/version.cpp:
+ * src/id3/version.h:
+ Added cvs Id and Log tags to beginning and end of file, respectively.
+ Code clean up. No semantic changes.
+
+ * src/examples/demo_convert.cpp:
+ Removed deprecated call to SetVersion (now a private method)
+
+ * configure.in
+ Removed reference to zlib
+
+1999-11-02 Scott Thomas Haug <scott@id3.org>
+ * src/id3/dll.h:
+ * src/id3/error.h:
+ * src/id3/externals.h:
+ * src/id3/field.h:
+ * src/id3/field_binary.cpp:
+ * src/id3/field_integer.cpp:
+ * src/id3/field_string_ascii.cpp:
+ * src/id3/field_string_unicode.cpp:
+ * src/id3/frame.cpp:
+ * src/id3/frame.h:
+ * src/id3/frame_parse.cpp:
+ * src/id3/frame_render.cpp:
+ * src/id3/header.cpp:
+ * src/id3/header.h:
+ * src/id3/header_frame.cpp:
+ * src/id3/header_frame.h:
+ * src/id3/header_tag.cpp:
+ * src/id3/header_tag.h:
+ * src/id3/int28.cpp:
+ * src/id3/int28.h:
+ * src/id3/misc_support.cpp:
+ * src/id3/misc_support.h:
+ * src/id3/tag.cpp:
+ * src/id3/tag.h:
+ * src/id3/tag_file.cpp:
+ * src/id3/tag_find.cpp:
+ * src/id3/tag_parse.cpp:
+ * src/id3/tag_parse_lyrics3.cpp:
+ * src/id3/tag_parse_v1.cpp:
+ * src/id3/tag_render.cpp:
+ * src/id3/tag_sync.cpp:
+ * src/id3/types.h:
+ * src/id3/version.cpp:
+ * src/id3/version.h:
+ Formatting changes (tab to spaces, excess space removal, etc.)
+
+1999-11-01 Scott Thomas Haug <scott@id3.org>
+ * src/id3/dll.h:
+ * src/id3/dll_wrapper.cpp:
+ * src/id3/error.cpp:
+ * src/id3/error.h:
+ * src/id3/externals.h:
+ * src/id3/field.cpp:
+ * src/id3/field.h:
+ * src/id3/frame.h:
+ * src/id3/header.h:
+ * src/id3/header_frame.h:
+ * src/id3/header_tag.h:
+ * src/id3/int28.h:
+ * src/id3/misc_support.h:
+ * src/id3/tag.h:
+ * src/id3/types.h:
+ * src/id3/version.h:
+ * src/id3/field_binary.cpp:
+ Cleaned up the code somwhat. Made some of the files more readable
+ in 80 character displays. Switched tabs to spaces. Changed
+ #include to point to right directory for the id3 .h files. Changed
+ call to tmpnam to mkstemp in tag_render.cpp. Renamed by removing
+ "id3_" suffix and moved to src/id3
+
+ * src/examples/demo_convert.cpp:
+ Cleaned up code (tabs, whitespace, etc)
+
+ * src/examples/demo_convert.cpp:
+ * src/examples/demo_info.cpp:
+ * src/examples/demo_main.cpp:
+ * src/examples/readme.txt:
+ Moved from orig/sources/examples to src/examples
+
+ * src/id3/Makefile.am:
+ Removed zlib files -- unnecessary for linx
+
+ * doc/idguide.html:
+ * doc/bugreport.txt:
+ * doc/id3v2-3.00.txt:
+ * doc/id3v2.gif:
+ * doc/id3v2.ico:
+ * doc/id3v2.png:
+ * doc/logo.txt:
+ * doc/software.txt:
+ Moved from orig/documentation to doc
+
+ * configure.in
+ Now makes Makefiles in src/zlib and src/examples
+
+ * AUTHORS:
+ * COPYING:
+ * ChangeLog:
+ * INSTALL:
+ * Makefile.am:
+ * NEWS:
+ * README:
+ * THANKS:
+ * configure.in:
+ * doc/Makefile.am:
+ * m4/Makefile.am:
+ * m4/lf_bash.m4:
+ * m4/lf_cc.m4:
+ * m4/lf_cxx.m4:
+ * m4/lf_fortran.m4:
+ * m4/lf_host_type.m4:
+ * m4/lf_list.m4:
+ * m4/lf_local.m4:
+ * m4/lf_nm.m4:
+ * m4/lf_texidoc.m4:
+ * m4/lf_txtc.m4:
+ * m4/lf_warnings.m4:
+ * m4/lf_x11.m4:
+ * orig/dll/id3lib.dll:
+ * orig/dll/id3lib.exp:
+ * orig/dll/id3lib.h:
+ * orig/dll/id3lib.lib:
+ * orig/dll/readme.txt:
+ * src/Makefile.am:
+ * src/examples/Makefile.am:
+ * src/id3/Makefile.am:
+ Initial revision
--- /dev/null
+++ b/common/id3lib/HISTORY
@@ -1,0 +1,315 @@
+$Id: HISTORY,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+ID3Lib History
+
+The following is a history of id3lib up to version 3.05a. Please see the
+NEWS file for changes since then.
+
+23 Nov 1998 3.05a - Released 3.05a in which the only change was the
+ inclusion of a C header file for using the DLL
+ (how forgetful I am!).
+
+22 Nov 1998 3.05 - Released 3.05 and the DLL.
+
+ 8 Nov 1998 3.05 - Finished the first revision of the DLL. Interesting
+ stuff. Contains both C++ class and C functions (the
+ C++ classes that are exported to the DLL are Tag,
+ Frame, Field and Error).
+ - Took out the SetVersion function from the ID3_Tag
+ class. This is because I no longer wish ID3Lib to be
+ able to create the old ID3v2-2.0 tags. ID3Lib will
+ always create the latest version tags it is capable
+ of creating.
+
+ 1 Nov 1998 3.05 - Removed the encryption and grouping stuff. I have a
+ lot to do before I finish that section and I might
+ end up implementing it differently, so I thought it
+ best to remove it before people started using it
+ (no-one should since it wasn't fully functional
+ anyway).
+
+13 Oct 1998 3.05 - Work has begun on the Windows DLL.
+
+ 9 Oct 1998 3.04 - Added the text list handling functions from 2.16, but
+ they are slightly different under 3.xx.
+ - Also added a Size() function for fields which
+ applications can use to allocate buffers and so on.
+ - Work has progressed on the encryption and grouping
+ side of things, but nothing usable by an application
+ just yet.
+
+ 5 Oct 1998 3.04 - Changed the ID3_AddHandler() function to include a
+ parameter which specifies the factor by which the
+ size of the frame may increase as a result of
+ encryption or encoding. This is used for buffer and
+ size estimates.
+
+ 3 Oct 1998 3.03a - Fixed a small Unicode BOM bug.
+
+ 2 Oct 1998 3.03 - Added very minimal and not-totally-functional support
+ for the automatic handling of encryption and
+ grouping.
+ - Added a function to ID3_Tag which makes attaching
+ arrays of ID3_Frame objects easy.
+
+ 1 Oct 1998 3.03 - Yesterday, ID3v2-3.0 became an informal standard.
+ Due to this, ID3Lib now does not create ID3v2-3.0
+ tags with the EXPERIMENTAL bit set.
+
+30 Sep 1998 3.02 - Expanded the error handling class to include
+ functions which return the ID3Lib source file and
+ line number of the exception. This is useful for
+ debugging and generating bug reports (hint, hint).
+
+28 Sep 1998 3.02 - Added the grouping registration and encryption
+ registration frames. Also added support for parsing
+ and rendering frames with the grouping and encryption
+ symbols, although currently this data is ignored. I
+ plan to implement call backs to handle the encryption
+ and decryption of data. Also, there is currently no
+ checking at render-time that all frames which have
+ these symbols also have a corresponding rego frame.
+
+26 Sep 1998 3.02 - Changed the 'tag changed' stuff so that calls to
+ ID3_Tag::SetVersion(), ID3_Tag::SetCompression() etc
+ now constitute a change in the tag. This is because
+ of the relaxed restrictions on the calls to these
+ functions before rendering/updating. - Fixed a bug
+ in the ID3_Tag::Link() command.
+
+25 Sep 1998 3.01 - Added the ID3_Tag::RemoveFrame() function.
+ - Added the ID3_Tag::SetExtendedHeader() function, even
+ though this setting is currently ignored.
+ - Added luint return type to the Field::Get() functions
+ for ASCII and Unicode strings. These functions now
+ return how many characters (not bytes necessarily) of
+ the supplied buffer were used, not including the
+ NULL-termination.
+ - Added the 'unique file identifier' frame which I
+ omitted from 3.00 but was present in 2.xx.
+ - Added code that allows ID3Lib and applications to
+ track whether a tag has been altered since the last
+ parse or render.
+ - Slightly altered the padding strategy when a tag
+ shrinks in size.
+ - No more requirements on when ID3_Tag::SetVersion()
+ etc must be called, except that they should be called
+ prior to an update or render if you plan to use
+ different settings than the defaults.
+
+21 Sep 1998 3.00 - Released 3.00
+
+15 Sep 1998 3.00 - Added support for parsing and converting ID3v1/1.1
+ and Lyrics3 v2.0 tags and CDM frames from 2.01
+ experimental tags. Also parses Unicode now.
+
+ 9 Sep 1998 3.00 - Work almost done on 3.00. A little bit to fix up in
+ the parsing department (doesn't parse Unicode yet, or
+ CDMs from the old 2.01 draft). Then just add
+ validity checking and support for most of the frames.
+
+ 2 Sep 1998 2.16 - Small Unicode string parsing bug fixed.
+
+25 Aug 1998 2.15 - Small bug fixes in the tag parsing routines.
+ - Completely removed support for creating extended
+ headers, and ID3Lib will now ignore tags which have
+ the EXTENDEDHEADER bit set (as under 2.00, this bit
+ isn't defined).
+
+24 Aug 1998 2.14 - Small bug fixes in the example file 'convert.cpp'.
+ - ID3Lib now sets the EXPERIMENTAL bit in the tag
+ header.
+
+13 Aug 1998 2.13 - As of 2.13, ID3Lib now comes in two flavours. The
+ first is the normal distribution as we have come to
+ know and love. The second is a machine-specific
+ archive which contains the static link libraries.
+ Currently, you can get Win32 link libraries.
+
+12 Aug 1998 2.12 - As of 2.12, the ID3Lib distribution will contain
+ precompiled static libraries for Visual C++ and
+ eventually for Linux i386. The MSVC static libs are
+ be compiled for the multi-threaded run-time library
+ and there will be one for debugging and one normal
+ one for release-quality applications.
+
+ - Fixed a small exclusion in the 'id3_support.h' file.
+ It now contains a #include for the 'wchar.h' header
+ file. The absence of this line resulted in some
+ applications producing compilation errors if they
+ didn't already include it or 'stdio.h'.
+
+11 Aug 1998 2.12 - I created a small problem in 2.11 where the name of
+ the URL field in the 'ID3FID_WWWUSER' frame ('WXX')
+ was changed from ID3FN_URL to ID3FN_TEXT. This has
+ been fixed (is back to ID3FN_URL).
+ - When reading a binary tag, previous versions of
+ ID3Lib ignored the fact that some of the frames in
+ the tag may have been compressed, so when writing the
+ tag back out, those old frames were written without
+ compression. This is fixed so that all old frames
+ are written back out as they were read in, unless of
+ course you explicitly change the compression status
+ before rendering the new tag.
+ - Added the ID3C_SetSongSize and ID3C_GetSongSize
+ commands to the ID3_Tag class. These allow you to
+ tell ID3Lib how big (in bytes) the song file is to
+ which you intend attaching the tag. ID3Lib can then
+ work out how much padding the tag requires to
+ correctly make the entire resulting file fill an even
+ multiple of 2Kb.
+ - If the tag we are manipulating was read in as a
+ binary tag before we started playing with it, then
+ ID3Lib will record the size of tag before we started
+ fooling around with it. This way, the padding system
+ can pad the new tag out to the old size if the new
+ tag will still fit inside the old one. This makes
+ file manipulation much easier when writing tags to
+ existing song files. If it won't fit, then the new
+ tag will receive padding as per the 2K cluster
+ method. All this talk of padding only applies if the
+ tag's padding property is set to ID3PD_AUTOMATIC,
+ which it is by default.
+
+10 Aug 1998 2.11 - Replaced ID3C_SetID and GetID with proper field
+ names, and the same with ID3C_SetComp and GetComp.
+ This requires a change in source code for the
+ application. Without quotes, do a search and
+ replace...
+
+ "ID3C_SetID," replace with "ID3C_Set, ID3FN_ID,"
+ "ID3C_GetID," replace with "ID3C_Get, ID3FN_ID,"
+ "ID3C_SetComp," replace with "ID3C_Set, ID3FN_COMPRESSED,"
+ "ID3C_GetComp," replace with "ID3C_Get, ID3FN_COMPRESSED,"
+
+ - Thanks to a suggestion by Ilana Rudnik, I added a
+ generic frame type called 'ID3FID_UNSUPPORTED' which
+ is only to be used by applications as a
+ 'place-holder' in lists and arrays while waiting for
+ ID3Lib to support all the frames.
+
+ 6 Aug 1998 2.11 - Created the ID3C_Locate and ID3C_GetNumFrames
+ commands.
+ - Made the documentation an HTML file instead of boring
+ text.
+
+ 5 Aug 1998 2.11 - Thanks to Eng-Keong Lee, I have located and fixed a
+ bug which most-of-the-time caused a crash when
+ performing an ID3C_SetID on a frame for the first
+ time.
+
+ 3 Aug 1998 2.10 - Fixed a few things to make ID3Lib compile completely
+ cleanly under Linux - thanks to Carlos Puchol for
+ finding the remaining hassles.
+ - Added two commands to adjust the unsync facility -
+ ID3C_SetUnsync and ID3C_GetUnsync. The default is
+ ID3SY_AUTOMATIC.
+ - Add support for the 2.01 extended tag header. By
+ default, ID3Lib will NOT write an extended header to
+ tags it creates. This can be adjusted by the
+ ID3C_SetExtHeader command.
+ - Changed the directory structure so that the required
+ zlib source is now in the same directory as the
+ ID3Lib source.
+
+ 2 Aug 1998 2.10 - Fixed a small memory leak which occurred when
+ clearing a tag of frames which were read in from an
+ external binary tag.
+ - Added a 'bugreport.txt' file to the documentation to
+ improve effectiveness of bug reporting.
+
+ 1 Aug 1998 2.10 - Adding support for tag padding. This results in two
+ new commands which operate on ID3_Tag objects:
+ ID3C_SetPadding and ID3C_GetPadding.
+
+ 1 Aug 1998 2.09 - Fixed some bugs in the ID3C_ToFile and ID3C_FromFile
+ commands.
+ - Fixed a bug which prevented empty strings which were
+ supposed to be NULL-terminated from doing so.
+
+31 Jul 1998 2.09 - Changed the functionality of the error handling
+ mechanism. The function interface to the error
+ handler has changed - see the example source file
+ 'main.cpp' for details.
+ - Improved frame verification somewhat.
+
+28 July 1998 2.08 - Added ID3C_ToFile command to binary fields.
+ - Changed the format of the ID3C_Size command when
+ applied to frames. There is now a required second
+ parameter which specifies which field you require the
+ size of. If you request ID3FN_ALL, you will get the
+ size of the frame itself.
+ - The above change for ID3C_Size now also applies to
+ the ID3C_Clear command (again, only when applied to
+ frames).
+ - Enhanced the ID3C_Find command so as to allow
+ searches based on the ID3FN_LANGUAGE field and the
+ ID3FN_DESCRIPTION field.
+
+27 July 1998 2.07 - Fixed a bug which had the WXX and TXX frames
+ including a language field which they shouldn't.
+ - Fixed a bug in the string's ID3C_Get command which
+ wrongly interpreted the presence of a '/' symbol in
+ the string as meaning that the string was a textlist.
+
+21 July 1998 2.06 - Added support for frame compression via zlib. This
+ means that all frames have an extra attribute which
+ specifies whether the frame should be compressed.
+ - Changed some typedefs and macro names so as not to
+ clash with some of Windows' pre-defined
+ datatypes/names. Thanks to Chuck Zenkus for finding
+ this.
+
+14 July 1998 2.05 - Finished up Unicode support. All internal string
+ handling is done with Unicode strings. Strings are
+ converted as needed during rendering of the tag.
+
+ 6 July 1998 2.05 - BINARY fields now support an 'ID3C_FromFile' command
+ which fills the field with data from the specified
+ file. The file is read and the contents placed in
+ the field immediately on the field encountering this
+ command.
+
+ 2 July 1998 2.04 - Improved support for frame validation.
+ - Repaired a cool bug in the error handling which
+ prevented an application from finding further
+ information about the error. This fix resulted in a
+ new format for the application error handler
+ function.
+
+ 2.03 - Added support for the ID3C_Add, ID3C_Remove,
+ ID3C_GetElement, ID3C_GetNumElements commands in the
+ STRING field type. This allows easy use of the text
+ lists as used in the 'TP1' frame.
+
+ - Improved error handling once more.
+ - Added support for the ID3C_Increment command in the
+ INT field type.
+ - Added support for the CNT, POP, GEO, TCO, TCR and UFI
+ frames.
+ - Added preliminary validation checking for frames to
+ ensure they meet the ID3v2 standard requirements.
+ Not fully implemented.
+
+ 2.02 - Adjusted the '::Do()' function slightly - you can now
+ chain commands together. The last parameter to this
+ call must now always be 'ID3C_DONE'.
+
+ 1 July 1998 2.01 - Added the 'ID3_IsTagHeader()' function and an
+ appropriately adjusted ID3C_Parse command.
+
+30 June 1998 2.00 - First preliminary release of ID3Lib v2.00. Supports
+ lots of frames (even PIC). Lots of work still
+ needed.
+
+25 June 1998 2.00 - Abandoned the v1.xx framework in favour of a more
+ versatile and expandable one. This required a major
+ re-write of most of the internals of the library as
+ well as changes to any applications using the
+ previous framework. The new framework is part of all
+ ID3Libs which are 2.xx.
+
+23 June 1998 1.01 - Released v1.01 which added support for four new
+ frames. TXX, WXX, COM, ULT
+
+21 June 1998 1.00 - Initial Release (v1.0)
--- /dev/null
+++ b/common/id3lib/INSTALL
@@ -1,0 +1,179 @@
+Basic Installation
+==================
+
+ For more information specific to this package, please read the README
+file. This source code distribution is autoconfiguring and you should be
+able to compile it and install it without manual interventions such as
+editing Makefiles, configuration files, and so on. These are generic
+instructions for people who are not familiar with installing autoconfiguring
+software.
+
+The simplest way to compile this package is to enter the source code
+main directory and do the following:
+
+ 1. Configure the source code by typing:
+ % sh ./configure
+
+ If you're planning to install the package into your home directory
+ or to a location other than `/usr/local' then add the flag
+ `--prefix=PATH' to `configure'. For example, if your home directory
+ is `/home/luser' you can configure the package to install itself there
+ by invoking:
+ % sh ./configure --prefix=/home/luser
+
+ While running, `configure' prints some messages telling which
+ features is it checking for.
+
+ 2. Compile the package by typing:
+ % make
+ Running `make' takes a while. If this is a very large package, now
+ is the time to go make some coffee.
+
+ 3. Some packages are bundled with self-tests for source-code
+ verification. If this package includes such tests, you can
+ optionally run them after compilation by typing
+ % make check
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation. Type `make uninstall' to undo the installation.
+ During installation, the following files go to the following directories:
+ Executables -> /prefix/bin
+ Libraries -> /prefix/lib
+ Public header files -> /prefix/include
+ Man pages -> /prefix/man/man?
+ Info files -> /prefix/info
+ where `prefix' is either `/usr/local' or the PATH that you specified
+ in the `--prefix' flag.
+
+ If any of these directories do not presently exist, they will be
+ created on demand.
+
+ If you are installing in your home directory make sure that
+ `/home/luser/bin' is in your path. If you're using the bash shell
+ add this line at the end of your .cshrc file:
+ PATH="/home/luser/bin:${PATH}"
+ export PATH
+ If you are using csh or tcsh, then use this line instead:
+ setenv PATH /home/luser/bin:${PATH}
+ By prepending your home directory to the rest of the PATH you can
+ override systemwide installed software with your own custom installation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'.
+
+Compiler configuration
+======================
+
+ The `configure' shell script is responsible for choosing and configuring
+the compiler(s).
+
+The following options allow you to specify whether you
+want to enable or disable various debugging mechanisms:
+
+`--with-warnings'
+ Make the compilers very picky about warnings. Try this whenever you
+ write new code since it may catch a few bugs. This is not active by
+ default because all too often warnings can be too picky and scare
+ the end-user.
+
+`--disable-assert'
+ Compile without using assertions. This results in faster code,
+ but should not be used during developerment, or to run `make check'
+ which depends on assertions. It should only be used for production
+ runs on code that you believe is bug free.
+
+All programs are compiled with optimization level 2 by default (-O2).
+Occasionally that confuses the debugger when code is inlined. To disable
+optimization and enable debugging, set the shell environment variables
+CFLAGS, CXXFLAGS, FFLAGS to `-g'. On the bash shell, you can do this
+like this:
+ $ export CFLAGS="-g"
+ $ export CXXFLAGS="-g"
+ $ export FFLAGS="-g"
+On the tcsh shell, use the `setenv' command instead:
+ % setenv CFLAGS "-g"
+ ...etc...
+For other shell, please consult your shell's documentation.
+
+Similarly, you can increase the optimization level by assigning these
+variables to "-g -O3".
+
+The following options allow you to reconsider the `configure' shell script's
+choice of Fortran compilers.
+
+`--with-f2c'
+ Compile the Fortran code by translating it to C, even if a native
+ Fortran compiler is available. A copy of the f2c translator should be
+ bundled in the distribution. It will be compiled and then used to
+ compile your Fortran code.
+`--with-g77'
+ Compile the Fortran code with g77 even if a proprietary Fortran
+ compiler is available
+`--with-f77=F77'
+ Compile the Fortran code with the specified Fortran compiler.
+
+Depending on what languages the package uses, some of these options may
+or may not be available. To see what is available, type:
+ % sh ./configure --help
+
+About the configure script
+==========================
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+Advanced installation options.
+==============================
+
+ The `configure' script also understands the following more advanced
+options, to handle situations for which `--prefix' alone is not sufficient.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
--- /dev/null
+++ b/common/id3lib/Makefile.am
@@ -1,0 +1,75 @@
+# $Id: Makefile.am,v 1.1 2002/01/21 08:16:20 menno Exp $
+#
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# require automake 1.4
+AUTOMAKE_OPTIONS = 1.4
+
+EXTRA_DIST = \
+ HISTORY \
+ config.h.win32 \
+ config.h.win32.in \
+ id3lib.spec \
+ id3lib.spec.in \
+ reconf
+SUBDIRS = . m4 zlib doc include src examples
+
+INCLUDES = @ID3LIB_DEBUG_FLAGS@
+
+config.h.win32: $(top_builddir)/config.status $(top_srcdir)/config.h.win32.in
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+id3lib.spec: $(top_builddir)/config.status $(top_srcdir)/id3lib.spec.in
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+docsdistdir = $(PACKAGE)-doc-$(VERSION)
+
+.PHONY: release snapshot docs-release docs
+
+docs:
+ -cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
+
+docs-release: docs
+ -mv doc/$(docsdistdir).* .
+ -cd examples && $(MAKE) $(AM_MAKEFLAGS) clean
+ -mkdir $(docsdistdir)
+ -cp -R examples $(docsdistdir)
+ -cp doc/*.* $(docsdistdir)
+ -cp -R doc/@DOX_DIR_HTML@ $(docsdistdir)
+ -cp NEWS $(docsdistdir)/NEWS.txt
+ -cp ChangeLog $(docsdistdir)/ChangeLog.txt
+ -find $(docsdistdir) -name "Makefile*" -exec rm -f {} \;
+ -find $(docsdistdir) -name "*.mp3" -exec rm -f {} \;
+ GZIP=$(GZIP_ENV) $(TAR) zcf $(docsdistdir).tar.gz $(docsdistdir)
+ -rm -rf $(docsdistdir)
+
+release: config.h.win32 id3lib.spec
+ -rm -rf .deps */.deps $(distdir).zip
+ $(MAKE) $(AM_MAKEFLAGS) distcheck
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ -cp -R id3com/ prj/ libprj/ delphi/ $(distdir)
+ -find $(distdir) -name "*~" -exec rm {} \;
+ -find $(distdir) -type d -name CVS -exec rm -r {} \;
+ -find $(distdir) -name .cvsignore -exec rm {} \;
+ cd $(distdir) && cp config.h.win32 config.h
+ cd $(distdir) && zip -r ../$(distdir).zip *
+ cd $(distdir) && ./configure && $(MAKE) $(AM_MAKEFLAGS) docs-release
+ mv $(distdir)/$(docsdistdir).* .
+ -rm -rf $(distdir)
+
+snapshot: config.h.win32
+ ss_distdir=$(PACKAGE)-`date +"%Y%m%d"`; \
+ $(MAKE) $(AM_MAKEFLAGS) distdir distdir=$$ss_distdir; \
+ chmod -R a+r $$ss_distdir; \
+ GZIP=$(GZIP_ENV) $(TAR) chozf $${ss_distdir}.tar.gz $$ss_distdir; \
+ cd $$ss_distdir && cp config.h.win32 config.h && cd ..; \
+ cd $$ss_distdir && zip -r ../$${ss_distdir}.zip * && cd ..; \
+ rm -rf $$ss_distdir
--- /dev/null
+++ b/common/id3lib/Makefile.in
@@ -1,0 +1,455 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# $Id: Makefile.in,v 1.1 2002/01/21 08:16:20 menno Exp $
+#
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# require automake 1.4
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+AUTOMAKE_OPTIONS = 1.4
+
+EXTRA_DIST = HISTORY config.h.win32 config.h.win32.in id3lib.spec id3lib.spec.in reconf
+
+SUBDIRS = . m4 zlib doc include src examples
+
+INCLUDES = @ID3LIB_DEBUG_FLAGS@
+
+docsdistdir = $(PACKAGE)-doc-$(VERSION)
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
+Makefile.am Makefile.in NEWS THANKS TODO acconfig.h aclocal.m4 \
+config.guess config.h.in config.sub configure configure.in install-sh \
+ltconfig ltmain.sh missing mkinstalldirs
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+ @if test ! -f $@; then \
+ rm -f stamp-h; \
+ $(MAKE) stamp-h; \
+ else :; fi
+stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
+ cd $(top_builddir) \
+ && CONFIG_FILES= CONFIG_HEADERS=config.h \
+ $(SHELL) ./config.status
+ @echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
+ else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
+ cd $(top_srcdir) && $(AUTOHEADER)
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+ -rm -f config.h
+
+maintainer-clean-hdr:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+all-recursive-am: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am:
+uninstall: uninstall-recursive
+all-am: Makefile config.h
+all-redirect: all-recursive-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-recursive
+ -rm -f config.status
+
+maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+config.h.win32: $(top_builddir)/config.status $(top_srcdir)/config.h.win32.in
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+id3lib.spec: $(top_builddir)/config.status $(top_srcdir)/id3lib.spec.in
+ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+.PHONY: release snapshot docs-release docs
+
+docs:
+ -cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
+
+docs-release: docs
+ -mv doc/$(docsdistdir).* .
+ -cd examples && $(MAKE) $(AM_MAKEFLAGS) clean
+ -mkdir $(docsdistdir)
+ -cp -R examples $(docsdistdir)
+ -cp doc/*.* $(docsdistdir)
+ -cp -R doc/@DOX_DIR_HTML@ $(docsdistdir)
+ -cp NEWS $(docsdistdir)/NEWS.txt
+ -cp ChangeLog $(docsdistdir)/ChangeLog.txt
+ -find $(docsdistdir) -name "Makefile*" -exec rm -f {} \;
+ -find $(docsdistdir) -name "*.mp3" -exec rm -f {} \;
+ GZIP=$(GZIP_ENV) $(TAR) zcf $(docsdistdir).tar.gz $(docsdistdir)
+ -rm -rf $(docsdistdir)
+
+release: config.h.win32 id3lib.spec
+ -rm -rf .deps */.deps $(distdir).zip
+ $(MAKE) $(AM_MAKEFLAGS) distcheck
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ -cp -R id3com/ prj/ libprj/ delphi/ $(distdir)
+ -find $(distdir) -name "*~" -exec rm {} \;
+ -find $(distdir) -type d -name CVS -exec rm -r {} \;
+ -find $(distdir) -name .cvsignore -exec rm {} \;
+ cd $(distdir) && cp config.h.win32 config.h
+ cd $(distdir) && zip -r ../$(distdir).zip *
+ cd $(distdir) && ./configure && $(MAKE) $(AM_MAKEFLAGS) docs-release
+ mv $(distdir)/$(docsdistdir).* .
+ -rm -rf $(distdir)
+
+snapshot: config.h.win32
+ ss_distdir=$(PACKAGE)-`date +"%Y%m%d"`; \
+ $(MAKE) $(AM_MAKEFLAGS) distdir distdir=$$ss_distdir; \
+ chmod -R a+r $$ss_distdir; \
+ GZIP=$(GZIP_ENV) $(TAR) chozf $${ss_distdir}.tar.gz $$ss_distdir; \
+ cd $$ss_distdir && cp config.h.win32 config.h && cd ..; \
+ cd $$ss_distdir && zip -r ../$${ss_distdir}.zip * && cd ..; \
+ rm -rf $$ss_distdir
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/NEWS
@@ -1,0 +1,231 @@
+$Id: NEWS,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+2000-05-28 Version 3.7.9
+
+* Added new test programs in examples/ for creating example tag files
+* Further improvements to compile on (Unix) systems that don't have zlib
+* Fixed a bug when parsing compressed frames (thanks to Christian Becker for
+ the bug report and example file)
+* Fixed several bugs when writing to files (thanks to Lothar Egger and Peter
+ Thorstenson for the bug reports)
+* New delphi example code for use with id3com (thanks Michael Little)
+* Bugfixes for id3com (thanks John Adcock)
+* Changed behavior of Link() and Clear() in ID3_Tag: Clear() doesn't remove
+ file reference, and Link'ing to an already-linked tag just changes the file
+ reference
+* Cleaned up the class interfaces to use size_t, flags_t, and index_t rather
+ than luint, so as to be more descriptive
+* ID3_Tag::RemoveFrame() now returns the pointer to the frame removed (NULL if
+ not present), thus releasing the tag from its repsonsibility of managing that
+ frame's memory
+* Cleaned up C interface so that appropriate function parameters are const
+* Cleaned up implementation of ID3_Tag::Clear() to fix inconsistencies
+* Deprecated ID3_Tag's HasV2Tag(), HasV1Tag(), and HasLyrics() methods in
+ favor of ID3_Tag::HasTagType() method
+* All Render() methods now const
+* Added GetUnsync() method to ID3_Tag
+* Cleaned up internal class definitions (thereby destroying binary
+ compatibility)
+* ID3v2 tag now won't render (and its reported size is 0) if there aren't any
+ frames (per the spec)
+* Fixed a bug when copying frames that prevented rendering compressed frames in
+ certain situations
+* Fixed a bug with resyncing that caused it to improperly handle the last byte
+* Fixed a bug with recognizing certain sync signals
+* Lots of other minor changes
+
+2000-05-11 Version 3.7.8
+
+* Major bug fix that caused all string frames to be written out as unicode, yet
+ with the wrong encoding information given
+* Bug fix for stripping id3v2 tags that wouldn't remove enough data
+* Bug fix for writing id3v1 tags that might add extraneous data to the tag
+
+2000-05-10 Version 3.7.7
+
+* As part of the major rewrite of underlying codebase started with previous
+ release, this release features near-complete reimplementation of most of the
+ ID3v2 parsing code - smaller, faster, and better organized
+* Much imporved Lyrics3 v2 tag support, along with much improved synchronized
+ lyrics (SYLT) support (thanks Severino Delaurenti)
+* Updated id3com to reflect changes to compression strategy introduced in last
+ release (thanks John Adcock)
+* Cleaned up the parameters to several functions/methods with regards to
+ constness
+* Several new methods to several classes
+* A variety of bugfixes
+
+2000-05-03 Version 3.7.6
+
+* Beginning of major rewrite of underlying codebase to improve efficiency,
+ expandability; the interface will need minor updates through this endeavor
+ (sorry!)
+* Major bugfix in ID3_Tag::Strip which was deleting too much info from a file
+ in certain circumstances
+* Add descriptions to frames; can access either through a ID3_Frame method for
+ a frame object, or via the static method on the class (w/ ID3_FrameID param)
+ (thanks John Adcock for descriptions, Daryl Pawluk for spotting misorder)
+* Frame compression is determined frame by frame, so deprecated
+ ID3_Tag::SetCompression() for ID3_Frame::SetCompression().
+ ID3_Tag::SetCompression() is now a no-op (updated C interface accordingly)
+* New method ID3_Frame::Contains(ID3_FieldID) for determining if a frame
+ contains a particular field
+* New static method ID3_Tag::IsV2Tag() deprecates ID3_IsTagHeader()
+* Other minor bugfixes
+
+2000-04-28 Version 3.7.5
+
+* Fixed nasty bug with rewriting tags to windows files (thanks John Adcock)
+* More fixes, improvements to id3com files (thanks John Adcock)
+* Added parsing of Lyrics3 v1.00 tags (thanks Severino Delaurenti)
+* Updated documentation, but still in flux
+* Other minor bugfixes
+
+2000-04-26 Version 3.7.4
+
+* Fixed windows project files so that they all work correctly with new release
+ (thanks John Adcock, Robert Moon, and Lothar Egger)
+* Added a simple VB app to test id3lib using id3com.dll (thanks John Adcock)
+* Added better implementation of PRIV (Private) frame (thanks John Adcock)
+* Fixed padding logic (thanks John Adcock)
+* New "Spec Versioning" system under the hood produces minor interface change
+ - Defined new enum: ID3_V2Spec (ID3V2_2_0, ID3V2_2_1, ID3V2_3_0, etc.)
+ - {Get,Set}Spec now used in favor of deprected {Get,Set}Version, GetRevision
+ - Field definitions updated accordingly; now smaller and more exact
+
+2000-04-24 Version 3.7.3
+
+* C/C++ interface changes:
+ - Moved V1_LEN* constants into an enumeration so that they can be used as
+ array size initializers in C. Renamed the constants for consistency
+ (LEN_V1 -> ID3_V1_LEN, LEN_V1_TITLE -> ID3_V1_LEN_TITLE, etc.)
+ - Renamed ID3_TagType's enums to be more consistent with rest of library's
+ enums (V1_TAG -> ID3TT_ID3V1, V2_TAG -> ID3TT_ID3V2, etc.)
+ - ID3_Err enumeration now defines ID3E_NoError
+* C++ interface changes:
+ - ID3_Frame now has a copy constructor
+ - ID3_Tag::AddNewFrame deprecated for AttachFrame (no other difference in
+ behavior)
+ - ID3_Tag::Link(char *, bool, bool) deprecated for
+ ID3_Tag::Link(char *, luint). Now accepts ID3_TagTypes to determine which
+ tags to parse. i.e, mytag.Link("myfile.mp3", ID3TT_ID3V2 | ID3TT_LYRICS);
+ - ID3_Tag::operator<<, ID3_Tag::AddFrame: relevant parameters now const
+* C interface changes:
+ - ID3Tag_Parse, ID3Tag_Update, ID3Tag_Strip now return an ID3_Err
+ - Added functions ID3Tag_UpdateByTagType, ID3Frame_New, ID3Frame_NewID,
+ ID3Frame_Delete
+* Implementation changes:
+ - AddFrame, AddFrames now add copies of the frames passed in.
+ - AttachFrame adds the actual frame passed to it.
+ - The tag takes responsibility for managing its frames' memory in all cases.
+* Miscellaneous changes:
+ - Moved most enum and struct declarations to include/id3/globals.h so they
+ are accessible to C interface
+ - id3com.dsp file is 'fixed', but the project still doesn't compile w/o
+ errors
+ - Most doxygen comments moved from tag.h to respective files
+ - Fixed a bug in id3lib.spec which caused rpm binaries to be compiled without
+ exception handling
+ - examples, include/id3/* header files no longer include config.h
+ - Other minor bugfixes
+
+2000-04-21 Version 3.7.2
+
+* Implementation of C interface for all platforms (in src/c_wrapper.cpp, which
+ replaces dll_wrapper.cpp)
+* Added examples/demo_simple.c which demonstrates basic use of C interface
+* Auto-generated documentation no longer shipped with main tarball distribution
+* mp3 example files no longer included (still available via CVS)
+* Updated Windows project files so that they'll (hopefully) compile cleanly
+ again
+
+2000-04-19 Version 3.7.1
+
+* Interface changed: functions in version.{h,cpp} replaced with constants
+ defined in globals.h
+* Added a spec file for creating rpm's
+* C interface now defined in include/id3.h, replaces include/src/dll.h;
+* Lots of file movement. src/id3/* to src/; src/examples to examples;
+* Examples now compiled as installable binaries, rather than 'checks'
+* Removed unnecessary files: externals.h, types.h, version.{h,cpp}, dll.h
+
+2000-04-15 Version 3.7.0
+
+* New project management: MusicMatch handed reigns over to Scott Haug
+* New project licensing: LGPL (http://www.gnu.org/copyleft/lesser.html)
+* New versioning: 3.7.x is unstable series leading up to 3.8.x stable
+* Many bug fixes
+* Better windows compatibility, with new windows project files
+* Improved documentation, using the Doxygen documentation system
+ (http://www.stack.nl/~dimitri/doxygen/)
+* Extended API, improved implementation
+* More supported frames
+* Now parses and rerenders unrecognized frame types
+* Better version handling in configuration files, similar to the glib library
+ (http://www.gtk.org)
+
+1999-12-02 Version 3.6.2
+
+* Improved portability: another minor portability fixes, along with the
+ inclusion of zlib sources and project files for windows compilation.
+
+1999-12-01 Version 3.6.1
+
+* Code movement: moved the header files from src/id3 to include/id3 to allow
+ for easier windows compilation.
+* Improved portability: made changes in several files to improve compilation
+ on windows. (thanks to elrod for the fixes)
+* Random cleanup: some spelling errors fixed, some minor file administration,
+ etc.
+
+1999-11-30 Version 3.6.0
+
+* Code overhaul: more descriptive variable naming, streamlined implementation
+ logic, cleaner interface specification, generalization of magic numbers and
+ strings.
+* Better documentation: transcribed the the "Documentation for ID3Lib 3.05"
+ document (written by Dirk Mahoney, 22 Nov 1998) into the actual source, using
+ javadoc-like tags so as to create documentation with the application doc++.
+ Using this program (and ones like it) allows for creating the documentation
+ in many different formats, including html, texinfo, man, latex, and the like.
+* Added functionality: Added additional functions for simplified access to
+ common tags, such as artist, title, and album.
+* More robust error checking: Improved upon the exception handling already in
+ place to better handle error conditions, such as invalid tags, unrecognized
+ frames, and the like. Work is still needed to ensure the library can handle
+ error situations gracefully.
+* Improved portability: restructured the code into a GNU-like directory.
+ hierarchy. By making use of the GNU tools automake and autoconf, a wide
+ variety of platforms can be easily supported. This allows for a standard
+ "./configure; make; make install" installation process, as well as an
+ equally trivial method for uninstallation: "make uninstall". Likewise,
+ "make check" builds the example applications (see below).
+* Enhanced examples: the src/examples/ subdirectory has both new and improved
+ examples demonstrating how to make use of id3lib. The original "id3convert"
+ example now can convert both ways between id3v1 and id3v2 tags, as well as
+ strip both types of tags off of files via command-line switches.
+ Additionally, an "id3info" app has been added for displaying id3v1/v2 tag
+ information about a file.
+* Bug fixing: Fixes, fixes, and more fixes. A continual process.
+* The zlib library files were removed from the project. The need for zlib
+ was instead made a requirement through the configuration process via autoconf
+ and automake.
+* All of the id3lib library files were renamed by removing the "id3_" prefix.
+ Instead, the library files were placed in an id3 subdirectory in the src
+ directory. Likewise, when the library is installed on a system, an "id3"
+ subdirectory is created in the indicated include directory, and the header
+ files are placed there. Pragmatically, this means that code that makes use
+ of id3lib needs to "#include <id3/tag.h>" rather than "#include <id3_tag.h>".
+ This was done to create more structure and to avoid clutter in the include
+ directory.
+* The versioning strategy has been updated to be more in line with the
+ "libtool" way. However, in order to be more compatible with how versions
+ progressed previously, I've taken the approach that many other libraries have
+ taken: I've "massaged" the version:revision:age numbers so that the resulting
+ compiled library shows up as id3lib.so.3.6.0 (or whatever the current release
+ is). This is /strongly/ advised against in the libtool documentation, so I'm
+ considering going to a more "traditional" libtool versioning approach (see
+ the libtool info page for more information).
+
+There is yet much to do! Please see the TODO file for known bugs and lacking
+features...
\ No newline at end of file
--- /dev/null
+++ b/common/id3lib/README
@@ -1,0 +1,98 @@
+General Information
+===================
+
+id3lib is a software library for manipulating ID3v1/v1.1 and ID3v2 tags.
+id3lib 3.0.x conforms to all ID3v2 standards up to and including the ID3v2.3.0
+informal standard.
+
+The id3lib project makes use of the resources available through
+SourceForge.net. Using SourceForge, the id3lib project is able to provide
+several tools for developers, including a project homepage, a mailing list, a
+patch manager, bug tracking, and cvs access, among other things.
+
+The id3lib project page, which includes links to all of the above, is:
+ http://sourceforge.net/project/?group_id=979
+
+The official id3lib homepage is:
+ http://id3lib.sourceforge.net
+
+The id3lib developers' mailing list's address is:
+ id3lib-devel@lists.sourceforge.net
+
+You can subscribe, unsubscribe, and view mailing list archives at:
+ http://lists.sourceforge.net/mailman/listinfo/id3lib-devel
+
+Information about ID3v2 and related standards can be found at:
+ http://www.id3.org
+
+Installation
+============
+
+See the file 'INSTALL'
+
+Requirements
+============
+
+In order to successfully compile and use id3lib, the following programs and
+libraries are needed:
+
+Compiling:
+----------
+g++ 2.8/egcs 1.0.3 (or compatible)
+GNU make
+autoconf 2.13
+automake 1.4
+zlib
+doxygen (optional, for creating documentation)
+
+Using:
+----------
+zlib
+
+How to report bugs
+==================
+
+To report a bug, submit it to the bug tracker, linked to from the id3lib
+project page, or send mail to the id3lib-devel mailing list.
+
+If you send it to the mailing list, please include the following:
+
+* The version of id3lib
+
+* Information about your system. For instance:
+
+ - What operating system and version
+ - For Linux, what version of the C library
+
+ And anything else you think is relevant.
+
+* How to reproduce the bug.
+
+ Please include either a short test program that exhibits the
+ behavior or an example tag that isn't correctly parsed/rendered by
+ the library. As a last resort, you can also provide a pointer to
+ a larger piece of software or tagged file that can be downloaded.
+
+* If the bug was a crash, the exact text that was printed out
+ when the crash occured.
+
+* Further information such as stack traces may be useful, but
+ is not necessary.
+
+Patches
+=======
+
+Patches can be submitted to the patch manager at the id3lib project page, as
+mentioned above. Please follow the instructions there. So as not to annoy
+uniterested parties with large email messages, it is preferable that you not
+send such patches to the mailing list.
+
+For Further Reading
+===================
+
+id3lib is free software. Please see the COPYING file for details.
+For documentation, please see the files in the doc subdirectory.
+See the HISTORY file for information about development up to version 3.05a.
+See the NEWS file for information about development since 3.05a.
+See the ChangeLog file for an account of changes made to files in the library.
+See the AUTHORS and THANKS files to see who has contributed to id3lib.
--- /dev/null
+++ b/common/id3lib/THANKS
@@ -1,0 +1,97 @@
+$Id: THANKS,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+id3lib THANKS file
+
+See the AUTHORS file for a list of past and current project maintainers.
+
+Since version 3.05a, several individuals have helped further the development of
+id3lib. They are listed below, in no particular order. Please inform the
+current project maintainer if anyone has been missed.
+
+* Kamran (kamran@musicmatch.com) fixed several bugs in MusicMatch's internal
+ version of ID3Lib which were merged into the current public version of
+ id3lib.
+* Alexander Voronin (av@oskarsb.ru) has submitted several patches to fix a
+ variety of bugs.
+* John Adcock (johnadcock@hotmail.com) provided the COM wrapper and lib
+ projects for id3lib, the VB test app for id3com.dll, as well as several
+ bugfixes and improvements.
+* Myers W. Carpenter (myers@fil.org) has submitted a patch for improving the
+ interface and functionality of the library.
+* Justin Rogers (justin@mlstoday.com) has provided much valuable conversation
+ as to the design and implementation of id3lib.
+* Mark B. Elrod (elrod@liquidmetal.com) has provided several patches for better
+ win32 functionality.
+* Scott Moser (smoser@brickies.net) provided the php translation of the
+ original ID3Lib manual
+* Robert Moon (rob@emusic.com) provided tremendous help getting the C interface
+ up to speed, as well as providing bugfixes for the Windows projects.
+* Lothar Egger (lothar.egger@chello.at) also assisted in fixing the Windows
+ projects, as well as providing assistance for testing the dlls under Windows
+* Severino Delaurenti (id3lib@castlems.com) added functionality for parsing
+ Lyrics3 v1.0 and v2.0 tags, as well as improving synchronized lyric frame
+ (SYLT) dramatically.
+* Michael Little (mike@netlinear.com) provided the delphi code for use with
+ id3com.
+* The following individuals have assisted by providing bug reports and (often)
+ suggestions for fixes:
+ - Daryl Pawluk (dpawluk@home.com)
+ - John Southerland (jbsouthe@home.com)
+ - Sasa �olic (sasad@moderngroove.com)
+ - Peter Thorstenson (swede@openlink.com.br)
+ - Christian Becker (chris@craze.de)
+ - (nuisance@cmu.edu)
+
+Dirk Mahoney included the following at the end of his documentation on ID3Lib
+3.05a. It is included in verbatim here.
+
+ Special Thanks and Credits
+
+ I would like to extend my many thanks to the people who have contributed to
+ the ID3Lib project. The show of support has been tremendous. I consider
+ ID3Lib to be a very 'international' product, as contributions have come from
+ almost literally every corner of the globe. If I have missed you, please
+ forgive my lapse of memory.
+
+ * Jean-loup Gailly and Mark Adler - for their great zlib compression library
+ and for making it free.
+ * Tord Jansson - for much help with teaching me how to make and use DLLs.
+ * Slava Karpenko for creating the MacOS static link libraries for the PowerPC
+ and CodeWarrior.
+ * Bob Kohn - for his advice, input, and generally creating the ID3Lib license
+ agreement.
+ * Eng-Keong Lee - for finding a few bugs and for extensively testing ID3Lib
+ 2.xx.
+ * James Lin - for his 'ID3v2 Programming Guidelines', and many helpful
+ suggestions
+ * Michael Mutschler - for prompting me to write the Unicode support and for
+ his input on the ID3Lib calling convention.
+ * Martin Nilsson - for ID3v2, his support of the ID3Lib web page, for many,
+ many suggestions, debates, pointers, URLs, documents, and brightly coloured
+ fish.
+ * Chris Nunn - for the 3D animated ID3v2 logos which appear in the ID3Lib web
+ page and in the distribution.
+ * Lachlan Pitts - for general implementation ideas and his brief but helpful
+ work on the up-coming genre tree.
+ * Jukka Poikolainen - for prompting to implement error handling via the C++
+ exception handling mechanism instead of the old 2.xx-style of using an
+ error handling function.
+ * Carson Puchol - for his help with some minor Linux compilation hassles.
+ * Andreas Sigfridsson - for his initial code for the unsync/resync support
+ and for his very valuable input in long brainstorming sessions.
+ * Michael Robertson - for helping support ID3Lib by posting announcements on
+ MP3.com.
+ * Ilana Rudnik - for bug finding and suggestions.
+ * Chuck Zenkus - for his support of ID3v2 and ID3Lib by providing us with a
+ mirror in the United States and for his bug finding and suggestions.
+ * And last but by no means least, all the others who support ID3Lib by
+ subscribing to the mailing list and to the contributors to the discussions
+ and debates in the ID3v2 discussion group.
+
+ Without the help of all these people, ID3Lib would not be as good as it is,
+ and I dare say might not even exist if they all weren't around to provide
+ motivation to continue to write the thing!
+
+ - Dirk Mahoney
+ 22 November 1998
+ Brisbane, Australia
--- /dev/null
+++ b/common/id3lib/TODO
@@ -1,0 +1,42 @@
+$Id: TODO,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+id3lib still requires the following work:
+
+* testing testing testing
+* The interface for file access is muddled. It has been separated out from the
+ next unstable release (3.9.x), but perhaps it can be cleaned up for 3.7.x
+* id3lib needs a C interface. Badly.
+* Some of the limitations present in 3.05a have been fixed, but many still
+ exist. See below for the original list and what has been updated.
+
+Version 3.05a of ID3Lib has some known limitations...
+
+* Firstly, contrary to good programming ideas and contrary to the 'ID3v2
+ Programming Guidelines', ID3Lib will explode in a ball of brilliant blue
+ flame if asked to parse an invalid ID3v2 tag. This will change.
+ + Update for 3.7.0: this has been improved, but still requires more testing.
+
+* Incorrect handling of unknown frames. This means that when ID3Lib encounters
+ an unknown frame, it is currently ignored. It is neither re-written to the
+ tag when re-rendered nor are the file or tag alter frame flags observed.
+ + 3.7.0 adds nominal support for all remaining known frames (as defined in
+ the spec for id3v2.2.0 and id3v2.3.0 at www.id3.org). Unknown frames are
+ now parsed and re-rendered, but the file and tag alter frame flags are not
+ yet observed
+
+* No support for the read-only frame flag. It is currently ignored---such
+ frames can be altered at will.
+
+* No support as yet for the verification of frames before rendering.
+
+* Does not yet render 3.0 extended headers. Although the functionality for
+ selecting this is present, the setting is ignored for now.
+
+* Does not yet parse 3.0 extended headers. They are quite adequately ignored
+ and the rest of the tag is parsed correctly.
+
+* ID3Lib currently has no direct support for things like the language and
+ currency fields. It is up to the application to generate the data for these
+ fields manually. Soon, ID3Lib will have these things assigned to IDs so that
+ the applications programmer will not have to remember the ISO tables for the
+ actual strings.
\ No newline at end of file
--- /dev/null
+++ b/common/id3lib/acconfig
@@ -1,0 +1,204 @@
+#! /usr/bin/perl
+$VERSION="0.10";
+$PREFIX="/usr/local";
+# -* perl *-
+# Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a configuration
+# script generated by Autoconf, you may include it under the same
+# distribution terms that you use for the rest of that program.
+
+
+# =======================
+# == Usage information ==
+# =======================
+
+sub usage
+{
+ print <<"EOF";
+Usage:
+% acconfig
+
+Options:
+ --help Print this message
+ --version Show version information
+
+Purpose:
+This utility parses aclocal.m4 and creates an appropriate acconfig.h.
+In your m4 files put the following lines:
+ dnl ACCONFIG [BOTTOM | TOP | TEMPLATE]
+ dnl .....
+ dnl END ACCONFIG
+Everything that appears in ... will be included in acconfig.h
+The parameter [bottom|top|template] determines where in acconfig.h
+the enclosed text is meant to appear.
+EOF
+ exit(0);
+}
+
+sub version
+{
+ print <<"EOF";
+acconfig $VERSION - Automatic generator for acconfig.h
+Copyright (C) 1998 Eleftherios Gkioulekas <lf\@amath.washington.edu>
+This is free software, and you are welcome to redistribute it and modify
+it under certain conditions. There is ABSOLUTELY NO WARRANTY for this
+software. For details refer to version 2 of the GNU General Public License.
+EOF
+ exit(0);
+}
+
+sub invalid
+{
+ print "Invalid usage. For help:\n";
+ print "% acconfig --help\n";
+ exit(1);
+}
+
+sub throw_error
+{
+ local($errormsg) = @_;
+ print "line $line: $errormsg \n";
+ exit(1);
+}
+
+# ==================
+# == The main fun ==
+# ==================
+
+# No more than one argument
+do invalid() if ($#ARGV > 0);
+
+# If there is one argument then check for --version or --help
+if ($#ARGV == 0)
+{
+ do version() if ($ARGV[0] eq "--version");
+ do usage() if ($ARGV[0] eq "--help");
+ # else, invalid usage
+ do invalid();
+}
+
+# Load the aclocal.m4 file in memory
+open(FILE,"aclocal.m4") || die "Can't open aclocal.m4: $!";
+@aclocal_content = <FILE>;
+close(FILE);
+
+# Load the configure.in file in memory
+open(FILE,"configure.in") || die "Can't open configure.in: $!";
+@configure_in_content = <FILE>;
+@aclocal_content = (@aclocal_content, @configure_in_content);
+close(FILE);
+
+# Strip the carriage returns for each line
+chop(@aclocal_content);
+
+# Initialize contents of acconfig.h
+$bottom_content = "";
+$top_content = "";
+$template_content = "";
+
+# Initialize the state of the parser
+# 0 if outside @acconfig
+# 1 if inside and it is bottom
+# 2 if inside and it is top
+# 3 if inside and it is template
+$inside_acconfig = 0;
+
+# Now loop over the contents of aclocal.m4 and do it
+$line = 0;
+foreach (@aclocal_content)
+{
+ #
+ # Do these things if we are in state 0
+ #
+ if ($inside_acconfig == 0)
+ {
+ # Detect whether the current line is a directive to switch state
+ if (/^dnl ACCONFIG BOTTOM/) { $inside_acconfig = 1; }
+ elsif (/^dnl ACCONFIG TOP/) { $inside_acconfig = 2; }
+ elsif (/^dnl ACCONFIG TEMPLATE/) { $inside_acconfig = 3; }
+
+ # Catch a couple of possible errors
+ elsif (/^dnl ACCONFIG/) { throw_error("invalid ACCONFIG directive."); }
+ elsif (/^dnl END/) { throw_error("unmatched END directive."); }
+ }
+ #
+ # Do these things if we are in state 1, 2 or 3
+ #
+ elsif ($inside_acconfig == 1 ||
+ $inside_acconfig == 2 ||
+ $inside_acconfig == 3)
+ {
+ # Detect whether we go back to state 0
+ if (/^dnl END ACCONFIG/) { $inside_acconfig = 0; }
+ # If this is an ordinary dnl line then add it to bottom_content
+ elsif (/^dnl/)
+ {
+ # Get rid of the dnl prefix
+ s/^dnl //g;
+
+ # Add the line to the appropriate content variable
+ if ($inside_acconfig == 1)
+ { $bottom_content = $bottom_content . $_ . "\n"; }
+ if ($inside_acconfig == 2)
+ { $top_content = $top_content . $_ . "\n"; }
+ if ($inside_acconfig == 3)
+ { $template_content = $template_content . $_ . "\n"; }
+ }
+ # If this is something else, then that's an error!
+ else { throw_error("non-dnl line while inside ACCONFIG."); }
+ }
+ else
+ { throw_error("INTERNAL ERROR: invalid value for inside_acconfig."); }
+
+ # Increase the line number by one
+ $line = $line + 1;
+}
+
+# Now generate acconfig.h
+open(OUT,">acconfig.h");
+print OUT <<"END";
+/*
+** This file has been automatically generated by 'acconfig' from aclocal.m4
+** Copyright (C) 1988 Eleftherios Gkioulekas <lf\@amath.washington.edu>
+**
+** This file is free software; as a special exception the author gives
+** unlimited permission to copy and/or distribute it, with or without
+** modifications, as long as this notice is preserved.
+**
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+/* This is the top section */
+$top_content
+\@TOP\@
+/* This is the template section */
+
+/* These are standard for all packages using Automake */
+#undef PACKAGE
+#undef VERSION
+
+/* And now the rest of the boys */
+$template_content
+\@BOTTOM\@
+/* This is the bottom section */
+$bottom_content
+END
+close(OUT);
--- /dev/null
+++ b/common/id3lib/acconfig.h
@@ -1,0 +1,74 @@
+/*
+** This file has been automatically generated by 'acconfig' from aclocal.m4
+** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+**
+** This file is free software; as a special exception the author gives
+** unlimited permission to copy and/or distribute it, with or without
+** modifications, as long as this notice is preserved.
+**
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+/* This is the top section */
+
+@TOP@
+/* This is the template section */
+
+/* These are standard for all packages using Automake */
+#undef PACKAGE
+#undef VERSION
+
+/* And now the rest of the boys */
+#undef CXX_HAS_BUGGY_FOR_LOOPS
+#undef CXX_HAS_NO_BOOL
+
+/* config.h defines these preprocesser symbols to be used by id3lib for
+ * determining internal versioning information. The intent is that these
+ * macros will be made available in the library via constants, functions,
+ * or static methods.
+ */
+#undef __ID3LIB_NAME
+#undef __ID3LIB_DATE
+#undef __ID3LIB_VERSION
+#undef __ID3LIB_FULLNAME
+#undef __ID3LIB_MAJOR_VERSION
+#undef __ID3LIB_MINOR_VERSION
+#undef __ID3LIB_PATCH_VERSION
+#undef __ID3LIB_INTERFACE_AGE
+#undef __ID3LIB_BINARY_AGE
+#undef __ID3_COMPILED_WITH_DEBUGGING
+/* */
+
+@BOTTOM@
+/* This is the bottom section */
+
+// This file defines portability work-arounds for various proprietory
+// C++ compilers
+
+// Workaround for compilers with buggy for-loop scoping
+// That's quite a few compilers actually including recent versions of
+// Dec Alpha cxx, HP-UX CC and SGI CC.
+// The trivial "if" statement provides the correct scoping to the
+// for loop
+
+#ifdef CXX_HAS_BUGGY_FOR_LOOPS
+#undef for
+#define for if(1) for
+#endif
+
+//
+// If the C++ compiler we use doesn't have bool, then
+// the following is a near-perfect work-around.
+// You must make sure your code does not depend on "int" and "bool"
+// being two different types, in overloading for instance.
+//
+
+#ifdef CXX_HAS_NO_BOOL
+#define bool int
+#define true 1
+#define false 0
+#endif
+
+
--- /dev/null
+++ b/common/id3lib/aclocal.m4
@@ -1,0 +1,816 @@
+dnl aclocal.m4 generated automatically by aclocal 1.4
+
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+# Do all the work for Automake. This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 1
+
+dnl Usage:
+dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+
+AC_DEFUN(AM_INIT_AUTOMAKE,
+[AC_REQUIRE([AC_PROG_INSTALL])
+PACKAGE=[$1]
+AC_SUBST(PACKAGE)
+VERSION=[$2]
+AC_SUBST(VERSION)
+dnl test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+ifelse([$3],,
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
+dnl FIXME This is truly gross.
+missing_dir=`cd $ac_aux_dir && pwd`
+AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
+AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
+AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
+AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
+AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
+AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+AC_DEFUN(AM_SANITY_CHECK,
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "[$]*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "[$]*" != "X $srcdir/configure conftestfile" \
+ && test "[$]*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "[$]2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+rm -f conftest*
+AC_MSG_RESULT(yes)])
+
+dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
+dnl The program must properly implement --version.
+AC_DEFUN(AM_MISSING_PROG,
+[AC_MSG_CHECKING(for working $2)
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if ($2 --version) < /dev/null > /dev/null 2>&1; then
+ $1=$2
+ AC_MSG_RESULT(found)
+else
+ $1="$3/missing $2"
+ AC_MSG_RESULT(missing)
+fi
+AC_SUBST($1)])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+AC_DEFUN(AM_CONFIG_HEADER,
+[AC_PREREQ([2.12])
+AC_CONFIG_HEADER([$1])
+dnl When config.status generates a header, we must update the stamp-h file.
+dnl This file resides in the same directory as the config header
+dnl that is generated. We must strip everything past the first ":",
+dnl and everything past the last "/".
+AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
+ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
+<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
+<<am_indx=1
+for am_file in <<$1>>; do
+ case " <<$>>CONFIG_HEADERS " in
+ *" <<$>>am_file "*<<)>>
+ echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
+ ;;
+ esac
+ am_indx=`expr "<<$>>am_indx" + 1`
+done<<>>dnl>>)
+changequote([,]))])
+
+
+# serial 40 AC_PROG_LIBTOOL
+AC_DEFUN(AC_PROG_LIBTOOL,
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+
+# Save cache, so that ltconfig can load it
+AC_CACHE_SAVE
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+
+# Reload cache, that may have been modified by ltconfig
+AC_CACHE_LOAD
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+AC_DEFUN(AC_LIBTOOL_SETUP,
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_RANLIB])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+dnl
+
+# Check for any special flags to pass to ltconfig.
+#
+# the following will cause an existing older ltconfig to fail, so
+# we ignore this at the expense of the cache file... Checking this
+# will just take longer ... bummer!
+#libtool_flags="--cache-file=$cache_file"
+#
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
+[libtool_flags="$libtool_flags --enable-dlopen"])
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+[libtool_flags="$libtool_flags --enable-win32-dll"])
+AC_ARG_ENABLE(libtool-lock,
+ [ --disable-libtool-lock avoid locking (might break parallel builds)])
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw*)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+])
+esac
+])
+
+# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+
+# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AC_ENABLE_SHARED, [dnl
+define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)])
+
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AC_ENABLE_STATIC, [dnl
+define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+])
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)])
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
+define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+])
+
+# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)])
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AC_PROG_LD,
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+changequote(,)dnl
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+changequote([,])dnl
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(ac_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_SUBST(LD)
+AC_PROG_LD_GNU
+])
+
+AC_DEFUN(AC_PROG_LD_GNU,
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi])
+])
+
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AC_PROG_NM,
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(ac_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ ac_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ break
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ break
+ else
+ ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+fi])
+NM="$ac_cv_path_NM"
+AC_MSG_RESULT([$NM])
+AC_SUBST(NM)
+])
+
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN(AC_CHECK_LIBM,
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case "$host" in
+*-*-beos* | *-*-cygwin*)
+ # These system don't have libm
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, main, LIBM="-lm")
+ ;;
+esac
+])
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library, adds --enable-ltdl-convenience to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ case "$enable_ltdl_convenience" in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+ INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library, and adds --enable-ltdl-install to
+# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
+# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
+# to be `${top_builddir}/libltdl'. Make sure you start DIR with
+# '${top_builddir}/' (note the single quotes!) if your package is not
+# flat, and, if you're not using automake, define top_builddir as
+# appropriate in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, main,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ else
+ enable_ltdl_install=yes
+ fi
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+ INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ INCLTDL=
+ fi
+])
+
+dnl old names
+AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
+AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
+AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
+AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
+AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
+
+dnl This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])dnl
+
+# Add --enable-maintainer-mode option to configure.
+# From Jim Meyering
+
+# serial 1
+
+AC_DEFUN(AM_MAINTAINER_MODE,
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT($USE_MAINTAINER_MODE)
+ AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+# Define a conditional.
+
+AC_DEFUN(AM_CONDITIONAL,
+[AC_SUBST($1_TRUE)
+AC_SUBST($1_FALSE)
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi])
+
+dnl Autoconf support for C++
+dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+# -----------------------------------------------------------------
+# This macro should be called to configure your C++ compiler.
+# When called, the macro does the following things:
+# 1. It finds an appropriate C++ compiler
+# If you passed the flag --with-cxx=foo, then it uses that
+# particular compiler
+# 2. Checks whether the compiler accepts the -g
+# ------------------------------------------------------------------
+
+AC_DEFUN(LF_CONFIGURE_CXX,[
+ AC_PROG_CXX
+ AC_PROG_CXXCPP
+ LF_CXX_PORTABILITY
+])
+
+# -----------------------------------------------------------------------
+# This macro tests the C++ compiler for various portability problem.
+# 1. Defines CXX_HAS_NO_BOOL if the compiler does not support the bool
+# data type
+# 2. Defines CXX_HAS_BUGGY_FOR_LOOPS if the compiler has buggy
+# scoping for the for-loop
+# Seperately we provide some config.h.bot code to be added to acconfig.h
+# that implements work-arounds for these problems.
+# -----------------------------------------------------------------------
+
+dnl ACCONFIG TEMPLATE
+dnl #undef CXX_HAS_BUGGY_FOR_LOOPS
+dnl #undef CXX_HAS_NO_BOOL
+dnl END ACCONFIG
+
+AC_DEFUN(LF_CXX_PORTABILITY,[
+
+ AC_PROVIDE([$0])
+
+ dnl
+ dnl Check for common C++ portability problems
+ dnl
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ dnl Check whether we have bool
+ AC_MSG_CHECKING(whether C++ has bool)
+ AC_TRY_RUN([main() { bool b1=true; bool b2=false; }],
+ [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no)
+ AC_DEFINE(CXX_HAS_NO_BOOL) ],
+ [ AC_MSG_WARN(Don't cross-compile)]
+ )
+
+ dnl Test whether C++ has buggy for-loops
+ AC_MSG_CHECKING(whether C++ has correct scoping in for-loops)
+ AC_TRY_COMPILE([#include <iostream.h>], [
+ for (int i=0;i<10;i++) { }
+ for (int i=0;i<10;i++) { }
+], [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no)
+ AC_DEFINE(CXX_HAS_BUGGY_FOR_LOOPS) ])
+
+ dnl Done with the portability checks
+ AC_LANG_RESTORE
+])
+
+dnl ACCONFIG BOTTOM
+dnl
+dnl // This file defines portability work-arounds for various proprietory
+dnl // C++ compilers
+dnl
+dnl // Workaround for compilers with buggy for-loop scoping
+dnl // That's quite a few compilers actually including recent versions of
+dnl // Dec Alpha cxx, HP-UX CC and SGI CC.
+dnl // The trivial "if" statement provides the correct scoping to the
+dnl // for loop
+dnl
+dnl #ifdef CXX_HAS_BUGGY_FOR_LOOPS
+dnl #undef for
+dnl #define for if(1) for
+dnl #endif
+dnl
+dnl //
+dnl // If the C++ compiler we use doesn't have bool, then
+dnl // the following is a near-perfect work-around.
+dnl // You must make sure your code does not depend on "int" and "bool"
+dnl // being two different types, in overloading for instance.
+dnl //
+dnl
+dnl #ifdef CXX_HAS_NO_BOOL
+dnl #define bool int
+dnl #define true 1
+dnl #define false 0
+dnl #endif
+dnl
+dnl END ACCONFIG
+
+
+dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+# --------------------------------------------------------------------------
+# Check whether the C++ compiler accepts a certain flag
+# If it does it adds the flag to CXXFLAGS
+# If it does not then it returns an error to lf_ok
+# Usage:
+# LF_CHECK_CXX_FLAG(-flag1 -flag2 -flag3 ...)
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_CHECK_CXX_FLAG,[
+ echo 'void f(){}' > conftest.cc
+ for i in $1
+ do
+ AC_MSG_CHECKING([whether $CXX accepts $i])
+ if test -z "`${CXX} $i -c conftest.cc 2>&1`"
+ then
+ CXXFLAGS="${CXXFLAGS} $i"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+ rm -f conftest.cc conftest.o
+])
+
+# --------------------------------------------------------------------------
+# Check whether the C compiler accepts a certain flag
+# If it does it adds the flag to CFLAGS
+# If it does not then it returns an error to lf_ok
+# Usage:
+# LF_CHECK_CC_FLAG(-flag1 -flag2 -flag3 ...)
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_CHECK_CC_FLAG,[
+ echo 'void f(){}' > conftest.c
+ for i in $1
+ do
+ AC_MSG_CHECKING([whether $CC accepts $i])
+ if test -z "`${CC} $i -c conftest.c 2>&1`"
+ then
+ CFLAGS="${CFLAGS} $i"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+ rm -f conftest.c conftest.o
+])
+
+# --------------------------------------------------------------------------
+# Check whether the Fortran compiler accepts a certain flag
+# If it does it adds the flag to FFLAGS
+# If it does not then it returns an error to lf_ok
+# Usage:
+# LF_CHECK_F77_FLAG(-flag1 -flag2 -flag3 ...)
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_CHECK_F77_FLAG,[
+ cat << EOF > conftest.f
+c....:++++++++++++++++++++++++
+ PROGRAM MAIN
+ PRINT*,'Hello World!'
+ END
+EOF
+ for i in $1
+ do
+ AC_MSG_CHECKING([whether $F77 accepts $i])
+ if test -z "`${F77} $i -c conftest.f 2>&1`"
+ then
+ FFLAGS="${FFLAGS} $i"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+ rm -f conftest.f conftest.o
+])
+
+# ----------------------------------------------------------------------
+# Provide the configure script with an --with-warnings option that
+# turns on warnings. Call this command AFTER you have configured ALL your
+# compilers.
+# ----------------------------------------------------------------------
+
+AC_DEFUN(LF_SET_WARNINGS,[
+ dnl Check for --with-warnings
+ AC_MSG_CHECKING([whether user wants warnings])
+ AC_ARG_WITH(warnings,
+ [ --with-warnings Turn on warnings],
+ [ lf_warnings=yes ], [ lf_warnings=no ])
+ AC_MSG_RESULT($lf_warnings)
+
+ dnl Warnings for the two main compilers
+ cc_warning_flags="-Wall"
+ cxx_warning_flags="-Wall -Woverloaded-virtual -Wtemplate-debugging"
+ if test $lf_warnings = yes
+ then
+ if test -n "${CC}"
+ then
+ LF_CHECK_CC_FLAG($cc_warning_flags)
+ fi
+ if test -n "${CXX}"
+ then
+ LF_CHECK_CXX_FLAG($cxx_warning_flags)
+ fi
+ fi
+])
+
--- /dev/null
+++ b/common/id3lib/config.guess
@@ -1,0 +1,997 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner@cygnus.com>.
+# The master version of this file is at the FSF in /home/gd/gnu/lib.
+# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit system type (host/target name).
+#
+# Only a few systems have been added to this list; please add others
+# (but try to keep the structure clean).
+#
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 8/24/94.)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ cat <<EOF >$dummy.s
+ .globl main
+ .ent main
+main:
+ .frame \$30,0,\$26,0
+ .prologue 0
+ .long 0x47e03d80 # implver $0
+ lda \$2,259
+ .long 0x47e20c21 # amask $2,$1
+ srl \$1,8,\$2
+ sll \$2,2,\$2
+ sll \$0,3,\$0
+ addl \$1,\$0,\$0
+ addl \$2,\$0,\$0
+ ret \$31,(\$26),1
+ .end main
+EOF
+ ${CC-cc} $dummy.s -o $dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./$dummy
+ case "$?" in
+ 7)
+ UNAME_MACHINE="alpha"
+ ;;
+ 15)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 14)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 10)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 16)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ esac
+ fi
+ rm -f $dummy.s $dummy
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-cbm-sysv4
+ exit 0;;
+ amiga:NetBSD:*:*)
+ echo m68k-cbm-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ arc64:OpenBSD:*:*)
+ echo mips64el-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hkmips:OpenBSD:*:*)
+ echo mips-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mips-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ arm32:NetBSD:*:*)
+ echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ SR2?01:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:NetBSD:*:*)
+ echo m68k-atari-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3*:NetBSD:*:*)
+ echo m68k-sun-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3*:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:NetBSD:*:*)
+ echo m68k-apple-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:NetBSD:*:*)
+ echo powerpc-apple-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ ${CC-cc} $dummy.c -o $dummy \
+ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+ -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i?86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ ${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:4)
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=4.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[34678]??:HP-UX:*:*)
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/6?? | 9000/7?? | 9000/80[024] | 9000/8?[136790] | 9000/892 )
+ sed 's/^ //' << EOF >$dummy.c
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (${CC-cc} $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+ rm -f $dummy.c $dummy
+ esac
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ ${CC-cc} $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ *9??*:MPE*:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ *9??*:MPE*:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i?86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*X-MP:*:*:*)
+ echo xmp-cray-unicos
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE}
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE}
+ exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo t3e-cray-unicosmk${UNAME_RELEASE}
+ exit 0 ;;
+ CRAY-2:*:*:*)
+ echo cray2-cray-unicos
+ exit 0 ;;
+ F300:UNIX_System_V:*:*)
+ FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ F301:UNIX_System_V:*:*)
+ echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+ exit 0 ;;
+ hp3[0-9][05]:NetBSD:*:*)
+ echo m68k-hp-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*)
+ if test -x /usr/bin/objformat; then
+ if test "elf" = "`/usr/bin/objformat`"; then
+ echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
+ exit 0
+ fi
+ fi
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+ *:NetBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ *:Linux:*:*)
+# # uname on the ARM produces all sorts of strangeness, and we need to
+# # filter it out.
+# case "$UNAME_MACHINE" in
+# armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
+# arm* | sa110*) UNAME_MACHINE="arm" ;;
+# esac
+
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us.
+ ld_help_string=`ld --help 2>&1`
+ ld_supported_emulations=`echo $ld_help_string \
+ | sed -ne '/supported emulations:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported emulations: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_emulations" in
+ i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
+ i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
+ sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ elf32arm) echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 ;;
+ elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
+ esac
+
+ if test "${UNAME_MACHINE}" = "alpha" ; then
+ sed 's/^ //' <<EOF >$dummy.s
+ .globl main
+ .ent main
+ main:
+ .frame \$30,0,\$26,0
+ .prologue 0
+ .long 0x47e03d80 # implver $0
+ lda \$2,259
+ .long 0x47e20c21 # amask $2,$1
+ srl \$1,8,\$2
+ sll \$2,2,\$2
+ sll \$0,3,\$0
+ addl \$1,\$0,\$0
+ addl \$2,\$0,\$0
+ ret \$31,(\$26),1
+ .end main
+EOF
+ LIBC=""
+ ${CC-cc} $dummy.s -o $dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./$dummy
+ case "$?" in
+ 7)
+ UNAME_MACHINE="alpha"
+ ;;
+ 15)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 14)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 10)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 16)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ esac
+
+ objdump --private-headers $dummy | \
+ grep ld.so.1 > /dev/null
+ if test "$?" = 0 ; then
+ LIBC="libc1"
+ fi
+ fi
+ rm -f $dummy.s $dummy
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
+ elif test "${UNAME_MACHINE}" = "mips" ; then
+ cat >$dummy.c <<EOF
+#ifdef __cplusplus
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+#ifdef __MIPSEB__
+ printf ("%s-unknown-linux-gnu\n", argv[1]);
+#endif
+#ifdef __MIPSEL__
+ printf ("%sel-unknown-linux-gnu\n", argv[1]);
+#endif
+ return 0;
+}
+EOF
+ ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ else
+ # Either a pre-BFD a.out linker (linux-gnuoldld)
+ # or one that does not give us useful --help.
+ # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
+ # If ld does not provide *any* "supported emulations:"
+ # that means it is gnuoldld.
+ echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
+ test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+
+ case "${UNAME_MACHINE}" in
+ i?86)
+ VENDOR=pc;
+ ;;
+ *)
+ VENDOR=unknown;
+ ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ cat >$dummy.c <<EOF
+#include <features.h>
+#ifdef __cplusplus
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+#ifdef __ELF__
+# ifdef __GLIBC__
+# if __GLIBC__ >= 2
+ printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+# else
+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+# endif
+# else
+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+# endif
+#else
+ printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+#endif
+ return 0;
+}
+EOF
+ ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ fi ;;
+# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
+# are messed up and put the nodename in both sysname and nodename.
+ i?86:DYNIX/ptx:4*:*)
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i?86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ i?86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ i?86:UnixWare:*:*)
+ if /bin/uname -X 2>/dev/null >/dev/null ; then
+ (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ fi
+ echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
+ exit 0 ;;
+ pc:*:*:*)
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:*:6*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+ printf ("vax-dec-bsd\n"); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+#echo '(Unable to guess system type)' 1>&2
+
+exit 1
--- /dev/null
+++ b/common/id3lib/config.h.in
@@ -1,0 +1,113 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+/*
+** This file has been automatically generated by 'acconfig' from aclocal.m4
+** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+**
+** This file is free software; as a special exception the author gives
+** unlimited permission to copy and/or distribute it, with or without
+** modifications, as long as this notice is preserved.
+**
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+/* This is the top section */
+
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* And now the rest of the boys */
+#undef CXX_HAS_BUGGY_FOR_LOOPS
+#undef CXX_HAS_NO_BOOL
+
+/* config.h defines these preprocesser symbols to be used by id3lib for
+ * determining internal versioning information. The intent is that these
+ * macros will be made available in the library via constants, functions,
+ * or static methods.
+ */
+#undef __ID3LIB_NAME
+#undef __ID3LIB_DATE
+#undef __ID3LIB_VERSION
+#undef __ID3LIB_FULLNAME
+#undef __ID3LIB_MAJOR_VERSION
+#undef __ID3LIB_MINOR_VERSION
+#undef __ID3LIB_PATCH_VERSION
+#undef __ID3LIB_INTERFACE_AGE
+#undef __ID3LIB_BINARY_AGE
+#undef __ID3_COMPILED_WITH_DEBUGGING
+/* */
+
+/* Define if you have the mkstemp function. */
+#undef HAVE_MKSTEMP
+
+/* Define if you have the truncate function. */
+#undef HAVE_TRUNCATE
+
+/* Define if you have the <ctype.h> header file. */
+#undef HAVE_CTYPE_H
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <wchar.h> header file. */
+#undef HAVE_WCHAR_H
+
+/* Define if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
+
+/* Define if you have the z library (-lz). */
+#undef HAVE_LIBZ
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
+/* This is the bottom section */
+
+// This file defines portability work-arounds for various proprietory
+// C++ compilers
+
+// Workaround for compilers with buggy for-loop scoping
+// That's quite a few compilers actually including recent versions of
+// Dec Alpha cxx, HP-UX CC and SGI CC.
+// The trivial "if" statement provides the correct scoping to the
+// for loop
+
+#ifdef CXX_HAS_BUGGY_FOR_LOOPS
+#undef for
+#define for if(1) for
+#endif
+
+//
+// If the C++ compiler we use doesn't have bool, then
+// the following is a near-perfect work-around.
+// You must make sure your code does not depend on "int" and "bool"
+// being two different types, in overloading for instance.
+//
+
+#ifdef CXX_HAS_NO_BOOL
+#define bool int
+#define true 1
+#define false 0
+#endif
+
+
--- /dev/null
+++ b/common/id3lib/config.h.win32.in
@@ -1,0 +1,115 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+/*
+** This file has been automatically generated by 'acconfig' from aclocal.m4
+** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+**
+** This file is free software; as a special exception the author gives
+** unlimited permission to copy and/or distribute it, with or without
+** modifications, as long as this notice is preserved.
+**
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+/* This is the top section */
+
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* And now the rest of the boys */
+/* #undef CXX_HAS_BUGGY_FOR_LOOPS */
+/* #undef CXX_HAS_NO_BOOL */
+
+/* config.h defines these preprocesser symbols to be used by id3lib for
+ * determining internal versioning information. The intent is that these
+ * macros will be made available in the library via constants, functions,
+ * or static methods.
+ */
+#define __ID3LIB_NAME "@ID3LIB_NAME@"
+#define __ID3LIB_DATE "@ID3LIB_DATE@"
+#define __ID3LIB_VERSION "@ID3LIB_VERSION@"
+#define __ID3LIB_FULLNAME "@ID3LIB_FULLNAME@"
+#define __ID3LIB_MAJOR_VERSION @ID3LIB_MAJOR_VERSION@
+#define __ID3LIB_MINOR_VERSION @ID3LIB_MINOR_VERSION@
+#define __ID3LIB_PATCH_VERSION @ID3LIB_PATCH_VERSION@
+#define __ID3LIB_INTERFACE_AGE @ID3LIB_INTERFACE_AGE@
+#define __ID3LIB_BINARY_AGE @ID3LIB_BINARY_AGE@
+/* #undef ID3_COMPILED_WITH_DEBUGGING */
+
+/* Define if you have the mkstemp function. */
+/* #undef HAVE_MKSTEMP */
+
+/* Define if you have the ftruncate function. */
+/* #undef HAVE_TRUNCATE */
+
+/* Define if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define if you have the <iostream.h> header file. */
+#define HAVE_IOSTREAM_H 1
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define if you have the <sys/param.h> header file. */
+/* #undef HAVE_SYS_PARAM_H */
+
+/* Define if you have the <unistd.h> header file. */
+/* #undef HAVE_UNISTD_H */
+
+/* Define if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define if you have the <zlib.h> header file. */
+#define HAVE_ZLIB_H 1
+
+/* Define if you have the z library (-lz). */
+/* #undef HAVE_LIBZ */
+
+/* Name of package */
+#define PACKAGE "@PACKAGE@"
+
+/* Version number of package */
+#define VERSION "@VERSION@"
+
+/* This is the bottom section */
+
+// This file defines portability work-arounds for various proprietory
+// C++ compilers
+
+// Workaround for compilers with buggy for-loop scoping
+// That's quite a few compilers actually including recent versions of
+// Dec Alpha cxx, HP-UX CC and SGI CC.
+// The trivial "if" statement provides the correct scoping to the
+// for loop
+
+#ifdef CXX_HAS_BUGGY_FOR_LOOPS
+/* #undef for */
+#define for if(1) for
+#endif
+
+//
+// If the C++ compiler we use doesn't have bool, then
+// the following is a near-perfect work-around.
+// You must make sure your code does not depend on "int" and "bool"
+// being two different types, in overloading for instance.
+//
+
+#ifdef CXX_HAS_NO_BOOL
+#define bool int
+#define true 1
+#define false 0
+#endif
+
+
--- /dev/null
+++ b/common/id3lib/config.sub
@@ -1,0 +1,979 @@
+#! /bin/sh
+# Configuration validation subroutine script, version 1.1.
+# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+if [ x$1 = x ]
+then
+ echo Configuration name missing. 1>&2
+ echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+ echo "or $0 ALIAS" 1>&2
+ echo where ALIAS is a recognized configuration type. 1>&2
+ exit 1
+fi
+
+# First pass through any local machine types.
+case $1 in
+ *local*)
+ echo $1
+ exit 0
+ ;;
+ *)
+ ;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ linux-gnu*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple)
+ os=
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+ | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
+ | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
+ | hppa2.0w \
+ | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
+ | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
+ | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
+ | mipstx39 | mipstx39el | armv[34][lb] \
+ | sparc | sparclet | sparclite | sparc64 | v850)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i[34567]86)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
+ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
+ | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+ | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
+ | hppa2.0w-* \
+ | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
+ | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
+ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+ | sparc64-* | mips64-* | mipsel-* | armv[34][lb]-*\
+ | mips64el-* | mips64orion-* | mips64orionel-* \
+ | mipstx39-* | mipstx39el-* \
+ | f301-* | armv*-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-cbm
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-cbm
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-cbm
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ cray2)
+ basic_machine=cray2-cray
+ os=-unicos
+ ;;
+ [ctj]90-cray)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ os=-mpeix
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ os=-mpeix
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i[34567]86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i[34567]86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i[34567]86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i[34567]86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ mipsel*-linux*)
+ basic_machine=mipsel-unknown
+ os=-linux-gnu
+ ;;
+ mips*-linux*)
+ basic_machine=mips-unknown
+ os=-linux-gnu
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netwinder)
+ basic_machine=armv4l-corel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | nexen)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | k6 | 6x86)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | nexen-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | k6-* | 6x86-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=rs6000-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ xmp)
+ basic_machine=xmp-cray
+ os=-unicos
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ mips)
+ if [ x$os = x-linux-gnu ]; then
+ basic_machine=mips-unknown
+ else
+ basic_machine=mips-mips
+ fi
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sparc)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \
+ | -openstep* | -mpeix* | -oskit*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-corel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f301-fujitsu)
+ os=-uxpv
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxsim* | -vxworks*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
--- /dev/null
+++ b/common/id3lib/config.win32
@@ -1,0 +1,116 @@
+/* config.h. Generated automatically by configure. */
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+/*
+** This file has been automatically generated by 'acconfig' from aclocal.m4
+** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+**
+** This file is free software; as a special exception the author gives
+** unlimited permission to copy and/or distribute it, with or without
+** modifications, as long as this notice is preserved.
+**
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+/* This is the top section */
+
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define as __inline if that's what the C compiler calls it. */
+/* #undef inline */
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* And now the rest of the boys */
+/* #undef CXX_HAS_BUGGY_FOR_LOOPS */
+/* #undef CXX_HAS_NO_BOOL */
+
+/* config.h defines these preprocesser symbols to be used by id3lib for
+ * determining internal versioning information. The intent is that these
+ * macros will be made available int the library via functions or static
+ * methods.
+ */
+/* Defines which version of id3lib is being used (int) */
+#define ID3LIB_VERSION (3)
+/* Defines which revision of id3lib is being used (int) */
+#define ID3LIB_REVISION (0)
+/* Defines which patch of id3lib is being used (int) */
+#define ID3LIB_PATCH (6)
+/* The date of this id3lib release */
+#define ID3LIB_DATE ": 1999/12/03 00:47:51 "
+/* The identifying string of this id3lib */
+#define ID3LIB_FULLNAME "id3lib-3.0.6"
+
+/* Define if you have the ftruncate function. */
+/* #define HAVE_FTRUNCATE 1 */
+
+/* Define if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define if you have the <iostream.h> header file. */
+#define HAVE_IOSTREAM_H 1
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define if you have the <unistd.h> header file. */
+/*#define HAVE_UNISTD_H 1 */
+
+/* Define if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define if you have the <zlib.h> header file. */
+#define HAVE_ZLIB_H 1
+
+/* Define if you have the z library (-lz). */
+/* #define HAVE_LIBZ 1 */
+
+/* Name of package */
+#define PACKAGE "id3lib"
+
+/* Version number of package */
+#define VERSION "3.6.0"
+
+/* This is the bottom section */
+
+// This file defines portability work-arounds for various proprietory
+// C++ compilers
+
+// Workaround for compilers with buggy for-loop scoping
+// That's quite a few compilers actually including recent versions of
+// Dec Alpha cxx, HP-UX CC and SGI CC.
+// The trivial "if" statement provides the correct scoping to the
+// for loop
+
+#ifdef CXX_HAS_BUGGY_FOR_LOOPS
+/* #undef for */
+#define for if(1) for
+#endif
+
+//
+// If the C++ compiler we use doesn't have bool, then
+// the following is a near-perfect work-around.
+// You must make sure your code does not depend on "int" and "bool"
+// being two different types, in overloading for instance.
+//
+
+#ifdef CXX_HAS_NO_BOOL
+#define bool int
+#define true 1
+#define false 0
+#endif
+
+#define MAXPATHLEN 1024
\ No newline at end of file
--- /dev/null
+++ b/common/id3lib/configure
@@ -1,0 +1,3146 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.14.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+# Making releases:
+# ID3LIB_PATCH_VERSION += 1;
+# ID3LIB_INTERFACE_AGE += 1;
+# ID3LIB_BINARY_AGE += 1;
+# if any functions have been added, set ID3LIB_INTERFACE_AGE to 0.
+# if backwards compatibility has been broken,
+# set ID3LIB_BINARY_AGE _and_ ID3LIB_INTERFACE_AGE to 0.
+#
+ID3LIB_MAJOR_VERSION=3
+ID3LIB_MINOR_VERSION=7
+ID3LIB_PATCH_VERSION=9
+ID3LIB_INTERFACE_AGE=2
+ID3LIB_BINARY_AGE=3
+ID3LIB_VERSION=$ID3LIB_MAJOR_VERSION.$ID3LIB_MINOR_VERSION.$ID3LIB_PATCH_VERSION
+ac_help="$ac_help
+ --enable-shared[=PKGS] build shared libraries [default=yes]"
+ac_help="$ac_help
+ --enable-static[=PKGS] build static libraries [default=yes]"
+ac_help="$ac_help
+ --enable-fast-install[=PKGS] optimize for fast installation [default=yes]"
+ac_help="$ac_help
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
+ac_help="$ac_help
+ --disable-libtool-lock avoid locking (might break parallel builds)"
+ac_help="$ac_help
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer"
+if test `expr $ID3LIB_MINOR_VERSION \% 2` = 1 ; then
+ debug_default=yes
+else
+ debug_default=minimum
+fi
+ac_help="$ac_help
+ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]"
+ac_help="$ac_help
+ --enable-ansi turn on strict ansi [default=no]"
+ac_help="$ac_help
+ --with-warnings Turn on warnings"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.14.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=reconf
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ test -f "$cache_file" && . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+ID3LIB_NAME=id3lib
+
+
+
+
+
+
+
+
+
+
+# for documentation purposes
+DOX_DIR_HTML=api
+DOX_DIR_LATEX=latex
+DOX_DIR_MAN=man
+DOX_DIR_RTF=rtf
+
+
+
+
+
+
+# libtool versioning
+LT_RELEASE=$ID3LIB_MAJOR_VERSION.$ID3LIB_MINOR_VERSION
+LT_CURRENT=`expr $ID3LIB_PATCH_VERSION - $ID3LIB_INTERFACE_AGE`
+LT_REVISION=$ID3LIB_INTERFACE_AGE
+LT_AGE=`expr $ID3LIB_BINARY_AGE - $ID3LIB_INTERFACE_AGE`
+
+
+
+
+
+VERSION=$ID3LIB_VERSION
+PACKAGE=$ID3LIB_NAME
+
+ID3LIB_DATE="$Date: 2002/01/21 08:16:20 $ID3LIB_UNDEFINED"
+ID3LIB_FULLNAME=$ID3LIB_NAME-$ID3LIB_VERSION
+
+
+
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:636: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"\${ac_cv_path_install+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:693: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:750: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=$PACKAGE
+
+VERSION=$VERSION
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:796: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
+else
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:809: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:822: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:835: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
+else
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:848: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
+
+
+
+
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=yes
+fi
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi
+
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:936: checking host system type" >&5
+if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
+
+# Make sure we can run config.sub.
+ if $ac_config_sub sun4 >/dev/null 2>&1; then :
+ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+ fi
+
+ ac_cv_host_alias=$host
+ case "$ac_cv_host_alias" in
+ NONE)
+ case $nonopt in
+ NONE)
+ if ac_cv_host_alias=`$ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) ac_cv_host_alias=$nonopt ;;
+ esac ;;
+ esac
+
+ ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
+ ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+ ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+ ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+ echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+echo "$ac_t""$ac_cv_host" 1>&6
+
+host=$ac_cv_host
+host_alias=$ac_cv_host_alias
+host_cpu=$ac_cv_host_cpu
+host_vendor=$ac_cv_host_vendor
+host_os=$ac_cv_host_os
+
+
+
+
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:977: checking build system type" >&5
+if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
+
+# Make sure we can run config.sub.
+ if $ac_config_sub sun4 >/dev/null 2>&1; then :
+ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+ fi
+
+ ac_cv_build_alias=$build
+ case "$ac_cv_build_alias" in
+ NONE)
+ case $nonopt in
+ NONE)
+ ac_cv_build_alias=$host_alias ;;
+
+ *) ac_cv_build_alias=$nonopt ;;
+ esac ;;
+ esac
+
+ ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
+ ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+ ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+ ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+ echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+echo "$ac_t""$ac_cv_build" 1>&6
+
+build=$ac_cv_build
+build_alias=$ac_cv_build_alias
+build_cpu=$ac_cv_build_cpu
+build_vendor=$ac_cv_build_vendor
+build_os=$ac_cv_build_os
+
+
+
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1018: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1048: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1078: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32* | *CYGWIN*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1129: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1161: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 1172 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:1177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1203: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1208: checking whether we are using GNU C" >&5
+if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1236: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:1279: checking for ld used by GCC" >&5
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:1303: checking for GNU ld" >&5
+else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:1306: checking for non-GNU ld" >&5
+fi
+if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ echo "$ac_t""$LD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:1342: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
+
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:1358: checking for BSD-compatible nm" >&5
+if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ ac_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ break
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ break
+ else
+ ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+fi
+fi
+
+NM="$ac_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1395: checking whether ln -s works" >&5
+if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+# Check for any special flags to pass to ltconfig.
+#
+# the following will cause an existing older ltconfig to fail, so
+# we ignore this at the expense of the cache file... Checking this
+# will just take longer ... bummer!
+#libtool_flags="--cache-file=$cache_file"
+#
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+ :
+fi
+
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 1444 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:1466: checking whether the C compiler needs -belf" >&5
+if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1471 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+
+esac
+
+
+# Save cache, so that ltconfig can load it
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ test -f "$cache_file" && . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
+echo "configure:1581: checking whether to enable maintainer-specific portions of Makefiles" >&5
+ # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval="$enable_maintainer_mode"
+ USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
+
+
+if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:1606: checking host system type" >&5
+if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
+
+# Make sure we can run config.sub.
+ if $ac_config_sub sun4 >/dev/null 2>&1; then :
+ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+ fi
+
+ ac_cv_host_alias=$host
+ case "$ac_cv_host_alias" in
+ NONE)
+ case $nonopt in
+ NONE)
+ if ac_cv_host_alias=`$ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) ac_cv_host_alias=$nonopt ;;
+ esac ;;
+ esac
+
+ ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
+ ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+ ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+ ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+ echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+echo "$ac_t""$ac_cv_host" 1>&6
+
+host=$ac_cv_host
+host_alias=$ac_cv_host_alias
+host_cpu=$ac_cv_host_cpu
+host_vendor=$ac_cv_host_vendor
+host_os=$ac_cv_host_os
+
+
+
+
+
+
+# Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+ enableval="$enable_debug"
+ :
+else
+ enable_debug=$debug_default
+fi
+
+# Check whether --enable-ansi or --disable-ansi was given.
+if test "${enable_ansi+set}" = set; then
+ enableval="$enable_ansi"
+ :
+else
+ enable_ansi=no
+fi
+
+
+if test "x$enable_debug" = "xyes"; then
+ test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
+ ID3LIB_DEBUG_FLAGS="-DID3_ENABLE_DEBUG"
+else
+ if test "x$enable_debug" = "xno"; then
+ ID3LIB_DEBUG_FLAGS="-DID3_DISABLE_ASSERT -DID3_DISABLE_CHECKS"
+ fi
+fi
+
+
+
+for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1680: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_CXX+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CXX="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+ echo "$ac_t""$CXX" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CXX" && break
+done
+test -n "$CXX" || CXX="gcc"
+
+
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1712: checking whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) works" >&5
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 1723 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cxx_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cxx_cross=no
+ else
+ ac_cv_prog_cxx_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cxx_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
+if test $ac_cv_prog_cxx_works = no; then
+ { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1754: checking whether the C++ compiler ($CXX $CXXFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
+cross_compiling=$ac_cv_prog_cxx_cross
+
+echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
+echo "configure:1759: checking whether we are using GNU C++" >&5
+if eval "test \"\${ac_cv_prog_gxx+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.C <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1768: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gxx=yes
+else
+ ac_cv_prog_gxx=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+
+if test $ac_cv_prog_gxx = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+
+ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ac_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS=
+echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+echo "configure:1787: checking whether ${CXX-g++} accepts -g" >&5
+if eval "test \"\${ac_cv_prog_cxx_g+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.cc
+if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+ ac_cv_prog_cxx_g=yes
+else
+ ac_cv_prog_cxx_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS="$ac_save_CXXFLAGS"
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+
+echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
+echo "configure:1819: checking how to run the C++ preprocessor" >&5
+if test -z "$CXXCPP"; then
+if eval "test \"\${ac_cv_prog_CXXCPP+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+ CXXCPP="${CXX-g++} -E"
+ cat > conftest.$ac_ext <<EOF
+#line 1832 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CXXCPP=/lib/cpp
+fi
+rm -f conftest*
+ ac_cv_prog_CXXCPP="$CXXCPP"
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+fi
+CXXCPP="$ac_cv_prog_CXXCPP"
+fi
+echo "$ac_t""$CXXCPP" 1>&6
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1865: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:1904: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"\${ac_cv_path_install+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+echo $ac_n "checking for uncompress in -lz""... $ac_c" 1>&6
+echo "configure:1962: checking for uncompress in -lz" >&5
+ac_lib_var=`echo z'_'uncompress | sed 'y%./+-%__p_%'`
+if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lz $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1970 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char uncompress();
+
+int main() {
+uncompress()
+; return 0; }
+EOF
+if { (eval echo configure:1981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lz $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+#,,
+# AC_MSG_ERROR([id3lib requires zlib to process compressed frames]))
+
+
+
+if test x$ac_cv_lib_z_uncompress = xno; then
+ ID3_NEEDZLIB_TRUE=
+ ID3_NEEDZLIB_FALSE='#'
+else
+ ID3_NEEDZLIB_TRUE='#'
+ ID3_NEEDZLIB_FALSE=
+fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:2021: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 2036 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 2053 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 2070 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:2101: checking for ANSI C header files" >&5
+if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2106 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2114: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 2131 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 2149 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2170 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:2181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+for ac_hdr in zlib.h wchar.h sys/param.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2208: checking for $ac_hdr" >&5
+if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2213 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2218: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in \
+ ctype.h \
+ limits.h \
+ memory.h \
+ stdio.h \
+ unistd.h \
+
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2254: checking for $ac_hdr" >&5
+if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2259 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+{ echo "configure: error: Missing a vital header file for id3lib" 1>&2; exit 1; }
+
+fi
+done
+
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ac_safe=`echo "iostream.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for iostream.h""... $ac_c" 1>&6
+echo "configure:2302: checking for iostream.h" >&5
+if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2307 "configure"
+#include "confdefs.h"
+#include <iostream.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
+echo "configure:2335: checking for 8-bit clean memcmp" >&5
+if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_clean=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2343 "configure"
+#include "confdefs.h"
+#ifdef __cplusplus
+extern "C" void exit(int);
+#endif
+
+main()
+{
+ char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+ exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
+}
+
+EOF
+if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_memcmp_clean=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_memcmp_clean=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
+
+for ac_func in mkstemp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2376: checking for $ac_func" >&5
+if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2381 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+char (*f)();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in truncate \
+
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2436: checking for $ac_func" >&5
+if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2441 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+char (*f)();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+{ echo "configure: error: Missing a vital function for id3lib" 1>&2; exit 1; }
+
+fi
+done
+
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:2496: checking for size_t" >&5
+if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2501 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ eval "ac_cv_type_size_t=yes"
+else
+ rm -rf conftest*
+ eval "ac_cv_type_size_t=no"
+fi
+rm -f conftest*
+
+fi
+if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+ cat >> confdefs.h <<EOF
+#define size_t unsigned
+EOF
+
+fi
+
+
+
+
+
+
+
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+
+ echo $ac_n "checking whether C++ has bool""... $ac_c" 1>&6
+echo "configure:2547: checking whether C++ has bool" >&5
+ if test "$cross_compiling" = yes; then
+ echo "configure: warning: Don't cross-compile" 1>&2
+
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2553 "configure"
+#include "confdefs.h"
+#ifdef __cplusplus
+extern "C" void exit(int);
+#endif
+main() { bool b1=true; bool b2=false; }
+EOF
+if { (eval echo configure:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ echo "$ac_t""no" 1>&6
+ cat >> confdefs.h <<\EOF
+#define CXX_HAS_NO_BOOL 1
+EOF
+
+fi
+rm -fr conftest*
+fi
+
+
+ echo $ac_n "checking whether C++ has correct scoping in for-loops""... $ac_c" 1>&6
+echo "configure:2578: checking whether C++ has correct scoping in for-loops" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 2580 "configure"
+#include "confdefs.h"
+#include <iostream.h>
+int main() {
+
+ for (int i=0;i<10;i++) { }
+ for (int i=0;i<10;i++) { }
+
+; return 0; }
+EOF
+if { (eval echo configure:2590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+ cat >> confdefs.h <<\EOF
+#define CXX_HAS_BUGGY_FOR_LOOPS 1
+EOF
+
+fi
+rm -f conftest*
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+
+
+
+ echo $ac_n "checking whether user wants warnings""... $ac_c" 1>&6
+echo "configure:2616: checking whether user wants warnings" >&5
+ # Check whether --with-warnings or --without-warnings was given.
+if test "${with_warnings+set}" = set; then
+ withval="$with_warnings"
+ lf_warnings=yes
+else
+ lf_warnings=no
+fi
+
+ echo "$ac_t""$lf_warnings" 1>&6
+
+ cc_warning_flags="-Wall"
+ cxx_warning_flags="-Wall -Woverloaded-virtual -Wtemplate-debugging"
+ if test $lf_warnings = yes
+ then
+ if test -n "${CC}"
+ then
+
+ echo 'void f(){}' > conftest.c
+ for i in $cc_warning_flags
+ do
+ echo $ac_n "checking whether $CC accepts $i""... $ac_c" 1>&6
+echo "configure:2638: checking whether $CC accepts $i" >&5
+ if test -z "`${CC} $i -c conftest.c 2>&1`"
+ then
+ CFLAGS="${CFLAGS} $i"
+ echo "$ac_t""yes" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+ done
+ rm -f conftest.c conftest.o
+
+ fi
+ if test -n "${CXX}"
+ then
+
+ echo 'void f(){}' > conftest.cc
+ for i in $cxx_warning_flags
+ do
+ echo $ac_n "checking whether $CXX accepts $i""... $ac_c" 1>&6
+echo "configure:2657: checking whether $CXX accepts $i" >&5
+ if test -z "`${CXX} $i -c conftest.cc 2>&1`"
+ then
+ CXXFLAGS="${CXXFLAGS} $i"
+ echo "$ac_t""yes" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ fi
+ done
+ rm -f conftest.cc conftest.o
+
+ fi
+ fi
+
+
+
+cat >> confdefs.h <<EOF
+#define __ID3LIB_NAME "$ID3LIB_NAME"
+EOF
+
+cat >> confdefs.h <<EOF
+#define __ID3LIB_DATE "$ID3LIB_DATE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define __ID3LIB_VERSION "$ID3LIB_VERSION"
+EOF
+
+cat >> confdefs.h <<EOF
+#define __ID3LIB_FULLNAME "$ID3LIB_FULLNAME"
+EOF
+
+cat >> confdefs.h <<EOF
+#define __ID3LIB_MAJOR_VERSION $ID3LIB_MAJOR_VERSION
+EOF
+
+cat >> confdefs.h <<EOF
+#define __ID3LIB_MINOR_VERSION $ID3LIB_MINOR_VERSION
+EOF
+
+cat >> confdefs.h <<EOF
+#define __ID3LIB_PATCH_VERSION $ID3LIB_PATCH_VERSION
+EOF
+
+cat >> confdefs.h <<EOF
+#define __ID3LIB_INTERFACE_AGE $ID3LIB_INTERFACE_AGE
+EOF
+
+cat >> confdefs.h <<EOF
+#define __ID3LIB_BINARY_AGE $ID3LIB_BINARY_AGE
+EOF
+
+cat >> confdefs.h <<EOF
+#define __ID3_COMPILED_WITH_DEBUGGING "${enable_debug}"
+EOF
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.14.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "\
+ Makefile \
+ doc/Makefile \
+ m4/Makefile \
+ zlib/Makefile \
+ zlib/include/Makefile \
+ zlib/lib/Makefile \
+ zlib/prj/Makefile \
+ zlib/src/Makefile \
+ include/Makefile \
+ include/id3/Makefile \
+ src/Makefile \
+ examples/Makefile \
+ config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@ID3LIB_NAME@%$ID3LIB_NAME%g
+s%@ID3LIB_MAJOR_VERSION@%$ID3LIB_MAJOR_VERSION%g
+s%@ID3LIB_MINOR_VERSION@%$ID3LIB_MINOR_VERSION%g
+s%@ID3LIB_PATCH_VERSION@%$ID3LIB_PATCH_VERSION%g
+s%@ID3LIB_VERSION@%$ID3LIB_VERSION%g
+s%@ID3LIB_INTERFACE_AGE@%$ID3LIB_INTERFACE_AGE%g
+s%@ID3LIB_BINARY_AGE@%$ID3LIB_BINARY_AGE%g
+s%@DOX_DIR_HTML@%$DOX_DIR_HTML%g
+s%@DOX_DIR_LATEX@%$DOX_DIR_LATEX%g
+s%@DOX_DIR_MAN@%$DOX_DIR_MAN%g
+s%@DOX_DIR_RTF@%$DOX_DIR_RTF%g
+s%@LT_RELEASE@%$LT_RELEASE%g
+s%@LT_CURRENT@%$LT_CURRENT%g
+s%@LT_REVISION@%$LT_REVISION%g
+s%@LT_AGE@%$LT_AGE%g
+s%@ID3LIB_DATE@%$ID3LIB_DATE%g
+s%@ID3LIB_FULLNAME@%$ID3LIB_FULLNAME%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@RANLIB@%$RANLIB%g
+s%@CC@%$CC%g
+s%@LD@%$LD%g
+s%@NM@%$NM%g
+s%@LN_S@%$LN_S%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
+s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
+s%@MAINT@%$MAINT%g
+s%@ID3LIB_DEBUG_FLAGS@%$ID3LIB_DEBUG_FLAGS%g
+s%@CXX@%$CXX%g
+s%@CXXCPP@%$CXXCPP%g
+s%@ID3_NEEDZLIB_TRUE@%$ID3_NEEDZLIB_TRUE%g
+s%@ID3_NEEDZLIB_FALSE@%$ID3_NEEDZLIB_FALSE%g
+s%@CPP@%$CPP%g
+s%@LIBOBJS@%$LIBOBJS%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"\
+ Makefile \
+ doc/Makefile \
+ m4/Makefile \
+ zlib/Makefile \
+ zlib/include/Makefile \
+ zlib/lib/Makefile \
+ zlib/prj/Makefile \
+ zlib/src/Makefile \
+ include/Makefile \
+ include/id3/Makefile \
+ src/Makefile \
+ examples/Makefile \
+"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
+
--- /dev/null
+++ b/common/id3lib/configure.in
@@ -1,0 +1,213 @@
+# $Id: configure.in,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+# Copyright 1999, 2000 Scott Thomas Haug <eldamitri@users.sourceforge.net>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# require autoconf 2.13
+AC_PREREQ(2.13)
+
+# init autoconf (and check for presence fo reconf)
+AC_INIT(reconf)
+
+ID3LIB_NAME=id3lib
+
+dnl The following has been adapted from glib (http://www.gtk.org)
+dnl
+dnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
+dnl are available for $ac_help expansion (don't we all *love* autoconf?)
+AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+# Making releases:
+# ID3LIB_PATCH_VERSION += 1;
+# ID3LIB_INTERFACE_AGE += 1;
+# ID3LIB_BINARY_AGE += 1;
+# if any functions have been added, set ID3LIB_INTERFACE_AGE to 0.
+# if backwards compatibility has been broken,
+# set ID3LIB_BINARY_AGE _and_ ID3LIB_INTERFACE_AGE to 0.
+#
+ID3LIB_MAJOR_VERSION=3
+ID3LIB_MINOR_VERSION=7
+ID3LIB_PATCH_VERSION=9
+ID3LIB_INTERFACE_AGE=2
+ID3LIB_BINARY_AGE=3
+ID3LIB_VERSION=$ID3LIB_MAJOR_VERSION.$ID3LIB_MINOR_VERSION.$ID3LIB_PATCH_VERSION
+AC_DIVERT_POP()dnl
+
+AC_SUBST(ID3LIB_NAME)
+AC_SUBST(ID3LIB_MAJOR_VERSION)
+AC_SUBST(ID3LIB_MINOR_VERSION)
+AC_SUBST(ID3LIB_PATCH_VERSION)
+AC_SUBST(ID3LIB_VERSION)
+AC_SUBST(ID3LIB_INTERFACE_AGE)
+AC_SUBST(ID3LIB_BINARY_AGE)
+
+# for documentation purposes
+DOX_DIR_HTML=api
+DOX_DIR_LATEX=latex
+DOX_DIR_MAN=man
+DOX_DIR_RTF=rtf
+
+AC_SUBST(DOX_DIR_HTML)
+AC_SUBST(DOX_DIR_LATEX)
+AC_SUBST(DOX_DIR_MAN)
+AC_SUBST(DOX_DIR_RTF)
+
+# libtool versioning
+LT_RELEASE=$ID3LIB_MAJOR_VERSION.$ID3LIB_MINOR_VERSION
+LT_CURRENT=`expr $ID3LIB_PATCH_VERSION - $ID3LIB_INTERFACE_AGE`
+LT_REVISION=$ID3LIB_INTERFACE_AGE
+LT_AGE=`expr $ID3LIB_BINARY_AGE - $ID3LIB_INTERFACE_AGE`
+AC_SUBST(LT_RELEASE)
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION)
+AC_SUBST(LT_AGE)
+
+VERSION=$ID3LIB_VERSION
+PACKAGE=$ID3LIB_NAME
+
+dnl This is a hack to get the release date using cvs checkin macros
+ID3LIB_DATE="$Date: 2002/01/21 08:16:20 $ID3LIB_UNDEFINED"
+ID3LIB_FULLNAME=$ID3LIB_NAME-$ID3LIB_VERSION
+
+AC_SUBST(ID3LIB_DATE)
+AC_SUBST(ID3LIB_FULLNAME)
+
+AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
+AM_CONFIG_HEADER(config.h)
+
+dnl Initialize libtool
+AM_PROG_LIBTOOL
+
+dnl Initialize maintainer mode
+AM_MAINTAINER_MODE
+
+AC_CANONICAL_HOST
+
+dnl figure debugging default, prior to $ac_help setup
+dnl
+AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+if test `expr $ID3LIB_MINOR_VERSION \% 2` = 1 ; then
+ debug_default=yes
+else
+ debug_default=minimum
+fi
+AC_DIVERT_POP()dnl
+
+dnl declare --enable-* args and collect ac_help strings
+AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
+AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],
+ , enable_ansi=no)
+
+if test "x$enable_debug" = "xyes"; then
+ test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
+ ID3LIB_DEBUG_FLAGS="-DID3_ENABLE_DEBUG"
+else
+ if test "x$enable_debug" = "xno"; then
+ ID3LIB_DEBUG_FLAGS="-DID3_DISABLE_ASSERT -DID3_DISABLE_CHECKS"
+ fi
+fi
+
+dnl
+AC_SUBST(ID3LIB_DEBUG_FLAGS)
+
+dnl Checks for programs
+AC_PROG_CXX
+AC_PROG_CXXCPP
+AC_PROG_RANLIB
+AC_PROG_INSTALL
+
+dnl Checks for libraries.
+AC_CHECK_LIB(z,uncompress)#,,
+# AC_MSG_ERROR([id3lib requires zlib to process compressed frames]))
+
+AM_CONDITIONAL(ID3_NEEDZLIB, test x$ac_cv_lib_z_uncompress = xno)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_HAVE_HEADERS(zlib.h wchar.h sys/param.h)
+AC_HAVE_HEADERS( \
+ ctype.h \
+ limits.h \
+ memory.h \
+ stdio.h \
+ unistd.h \
+ ,,AC_MSG_ERROR([Missing a vital header file for id3lib])
+)
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_CHECK_HEADER(iostream.h)
+
+dnl Check for functions.
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS(mkstemp)
+AC_CHECK_FUNCS(
+ truncate \
+ ,,AC_MSG_ERROR([Missing a vital function for id3lib])
+)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_SIZE_T
+
+dnl
+dnl Checks with local macros
+dnl
+
+dnl Checks for the portability of certain c++ features: the bool type and
+dnl for-loop scoping
+LF_CXX_PORTABILITY
+
+dnl Provides a --with-warnings option to the configure script that turns on
+dnl compiler warnings. Must be used AFTER configuring ALL compilers.
+LF_SET_WARNINGS
+
+dnl ACCONFIG TEMPLATE
+dnl
+dnl /* config.h defines these preprocesser symbols to be used by id3lib for
+dnl * determining internal versioning information. The intent is that these
+dnl * macros will be made available in the library via constants, functions,
+dnl * or static methods.
+dnl */
+dnl #undef __ID3LIB_NAME
+dnl #undef __ID3LIB_DATE
+dnl #undef __ID3LIB_VERSION
+dnl #undef __ID3LIB_FULLNAME
+dnl #undef __ID3LIB_MAJOR_VERSION
+dnl #undef __ID3LIB_MINOR_VERSION
+dnl #undef __ID3LIB_PATCH_VERSION
+dnl #undef __ID3LIB_INTERFACE_AGE
+dnl #undef __ID3LIB_BINARY_AGE
+dnl #undef __ID3_COMPILED_WITH_DEBUGGING
+dnl /* */
+dnl END ACCONFIG
+
+AC_DEFINE_UNQUOTED(__ID3LIB_NAME, "$ID3LIB_NAME")
+AC_DEFINE_UNQUOTED(__ID3LIB_DATE, "$ID3LIB_DATE")
+AC_DEFINE_UNQUOTED(__ID3LIB_VERSION, "$ID3LIB_VERSION")
+AC_DEFINE_UNQUOTED(__ID3LIB_FULLNAME, "$ID3LIB_FULLNAME")
+AC_DEFINE_UNQUOTED(__ID3LIB_MAJOR_VERSION, $ID3LIB_MAJOR_VERSION)
+AC_DEFINE_UNQUOTED(__ID3LIB_MINOR_VERSION, $ID3LIB_MINOR_VERSION)
+AC_DEFINE_UNQUOTED(__ID3LIB_PATCH_VERSION, $ID3LIB_PATCH_VERSION)
+AC_DEFINE_UNQUOTED(__ID3LIB_INTERFACE_AGE, $ID3LIB_INTERFACE_AGE)
+AC_DEFINE_UNQUOTED(__ID3LIB_BINARY_AGE, $ID3LIB_BINARY_AGE)
+AC_DEFINE_UNQUOTED(__ID3_COMPILED_WITH_DEBUGGING, "${enable_debug}")
+
+AC_OUTPUT( \
+ Makefile \
+ doc/Makefile \
+ m4/Makefile \
+ zlib/Makefile \
+ zlib/include/Makefile \
+ zlib/lib/Makefile \
+ zlib/prj/Makefile \
+ zlib/src/Makefile \
+ include/Makefile \
+ include/id3/Makefile \
+ src/Makefile \
+ examples/Makefile \
+)
--- /dev/null
+++ b/common/id3lib/id3lib.spec.in
@@ -1,0 +1,201 @@
+# $Id: id3lib.spec.in,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+%define name @PACKAGE@
+%define version @VERSION@
+%define release 1
+%define prefix /usr
+
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Summary: A software library for manipulating ID3v1 and ID3v2 tags.
+Source: http://download.sourceforge.net/id3lib/%{name}-%{version}.tar.gz
+URL: http://id3lib.sourceforge.net
+Group: System Environment/Libraries
+BuildRoot: %{_tmppath}/%{name}-buildroot
+Copyright: LGPL
+Prefix: %{_prefix}
+Docdir: %{prefix}/doc
+Requires: zlib
+
+%description
+This package provides a software library for manipulating ID3v1 and ID3v2 tags.
+It provides a convenient interface for software developers to include
+standards-compliant ID3v1/2 tagging capabilities in their applications.
+Features include identification of valid tags, automatic size conversions,
+(re)synchronisation of tag frames, seamless tag (de)compression, and optional
+padding facilities.
+
+%package devel
+Summary: Headers for developing programs that will use id3lib
+Group: Development/Libraries
+Requires: %{name}
+
+%description devel
+This package contains the headers that programmers will need to develop
+applications which will use id3lib, the software library for ID3v1 and ID3v2
+tag manipulation.
+
+%package doc
+Summary: Documentation for developing programs that will use id3lib
+Group: Documentation
+
+%description doc
+This package contains the documentation of the id3lib API that programmers will
+need to develop applications which will use id3lib, the software library for ID3v1
+and ID3v2 tag manipulation.
+
+%package examples
+Summary: Example applications that make use of the id3lib library
+Group: Applications/File
+Requires: %{name}
+
+%description examples
+This package contains simple example applications that make use of id3lib, a
+software library for ID3v1 and ID3v2 tag maniuplation.
+
+%prep
+%setup -q
+
+%build
+%ifarch i386 i486
+
+ID3_ARCH=i486
+
+%endif
+
+%ifarch i586
+
+ID3_ARCH=pentium
+
+%endif
+
+%ifarch i686
+
+ID3_ARCH=pentiumpro
+
+%endif
+
+%ifarch k6
+
+ID3_ARCH=k6
+
+%endif
+
+%ifarch i386 i486 i586 i686 k6
+
+RPM_OPT_FLAGS="-O3 -fomit-frame-pointer -pipe -s -mcpu=$ID3_ARCH -march=$ID3_ARCH -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -mpreferred-stack-boundary=2"
+
+%endif
+
+CXXFLAGS="$RPM_OPT_FLAGS -fexceptions" ./configure --prefix=%prefix
+
+%ifnarch noarch
+
+uname -a|grep SMP && make -j 2 || make
+
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%ifnarch noarch
+
+make prefix=$RPM_BUILD_ROOT%{prefix} install
+
+%else
+
+make docs
+
+# strip down the doc and examples directories so we can copy w/impunity
+for i in doc/ examples/; do \
+ find $i \
+ \( -name 'Makefile*' -or \
+ -name '*.ps.gz' -or \
+ -name '*.pdf' \
+ \) -exec rm {} \; ; done
+
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%ifnarch noarch
+
+%files
+%defattr(-, root, root)
+%doc AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO
+%{prefix}/lib/*.so.*
+
+%files devel
+%defattr(-, root, root)
+%doc AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO
+%{prefix}/include/id3*.h
+%{prefix}/include/id3
+%{prefix}/lib/*.la
+%{prefix}/lib/*.a
+%{prefix}/lib/*.so
+
+%files examples
+%defattr(-, root, root)
+%doc AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO
+%{prefix}/bin/id3*
+
+%else
+
+%files doc
+%defattr(-, root, root)
+%doc AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO
+%doc doc/*.* doc/@DOX_DIR_HTML@ examples
+
+%endif
+
+%changelog
+* Wed 24 May 2000 Scott Haug <scott@id3.org> 3.7.9-1
+- Version 3.7.9
+- Modified the date format in the changelog
+
+* Wed 10 May 2000 Scott Haug <scott@id3.org> 3.7.8-1
+- Version 3.7.8
+
+* Wed 10 May 2000 Scott Haug <scott@id3.org> 3.7.7-1
+- Version 3.7.7
+
+* Wed 03 May 2000 Scott Haug <scott@id3.org> 3.7.6-1
+- Version 3.7.6
+
+* Fri 28 Apr 2000 Scott Haug <scott@id3.org> 3.7.5-1
+- Version 3.7.5
+
+* Wed 26 Apr 2000 Scott Haug <scott@id3.org> 3.7.4-1
+- Version 3.7.4
+
+* Mon 24 Apr 2000 Scott Haug <scott@id3.org> 3.7.3-1
+- Version 3.7.3
+- Added explicit RPM_OPT_FLAGS def based on arch, since -fno-exceptions and
+ -fno-rtti are part of the default flags in rpmrc and we need both exceptions
+ and rtti (exceptions uses rtti)
+
+* Fri 21 Apr 2000 Scott Haug <scott@id3.org> 3.7.2-1
+- Version 3.7.2
+- More conditional blocks for noarch
+- More thorough cleaning of files for documentation
+- Updated html directory
+
+* Thu 20 Apr 2000 Scott Haug <scott@id3.org> 3.7.1-2
+- Fixed date of changelog entry for 3.7.1-1
+- Added conditional blocks so docs only get built for noarch target
+
+* Wed 19 Apr 2000 Scott Haug <scott@id3.org> 3.7.1-1
+- Version 3.7.1
+- Removed zlib-devel requirement from devel
+- Added doc package to distribute documentation
+- Added examples package to distribute binary examples (id3tag, id3info, ...)
+- Moved doc/ and examples/ source files from devel to doc package
+
+* Mon 17 Apr 2000 Scott Haug <scott@id3.org> 3.7.0-1
+- First (s)rpm build
--- /dev/null
+++ b/common/id3lib/include/.cvsignore
@@ -1,0 +1,1 @@
+Makefile
--- /dev/null
+++ b/common/id3lib/include/Makefile.am
@@ -1,0 +1,15 @@
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+SUBDIRS = id3
+
+id3includedir = $(includedir)
+id3include_HEADERS = id3.h
+
--- /dev/null
+++ b/common/id3lib/include/Makefile.in
@@ -1,0 +1,339 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+SUBDIRS = id3
+
+id3includedir = $(includedir)
+id3include_HEADERS = id3.h
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+HEADERS = $(id3include_HEADERS)
+
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+install-id3includeHEADERS: $(id3include_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(id3includedir)
+ @list='$(id3include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(id3includedir)/$$p"; \
+ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(id3includedir)/$$p; \
+ done
+
+uninstall-id3includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ list='$(id3include_HEADERS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(id3includedir)/$$p; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = include
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu include/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am: install-id3includeHEADERS
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am: uninstall-id3includeHEADERS
+uninstall: uninstall-recursive
+all-am: Makefile $(HEADERS)
+all-redirect: all-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(id3includedir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-tags distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-recursive
+
+maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
+ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+
+.PHONY: uninstall-id3includeHEADERS install-id3includeHEADERS \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/include/id3.h
@@ -1,0 +1,101 @@
+/* $Id: id3.h,v 1.1 2002/01/21 08:16:20 menno Exp $
+ *
+ * id3lib: a software library for creating and manipulating id3v1/v2 tags
+ * Copyright 1999, 2000 Scott Thomas Haug
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+ * License for more details.
+
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ * The id3lib authors encourage improvements and optimisations to be sent to
+ * the id3lib coordinator. Please see the README file for details on where to
+ * send such submissions. See the AUTHORS file for a list of people who have
+ * contributed to id3lib. See the ChangeLog file for a list of changes to
+ * id3lib. These files are distributed with id3lib at
+ * http://download.sourceforge.net/id3lib/
+ */
+
+#ifndef __ID3LIB_ID3_H__
+#define __ID3LIB_ID3_H__
+
+#include "id3/globals.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+ typedef struct { char __dummy; } ID3Tag;
+ typedef struct { char __dummy; } ID3Frame;
+ typedef struct { char __dummy; } ID3Field;
+
+ /* tag wrappers */
+ ID3_C_EXPORT ID3Tag *ID3Tag_New (void);
+ ID3_C_EXPORT void ID3Tag_Delete (ID3Tag *tag);
+ ID3_C_EXPORT void ID3Tag_Clear (ID3Tag *tag);
+ ID3_C_EXPORT bool ID3Tag_HasChanged (const ID3Tag *tag);
+ ID3_C_EXPORT void ID3Tag_SetUnsync (ID3Tag *tag, bool unsync);
+ ID3_C_EXPORT void ID3Tag_SetExtendedHeader (ID3Tag *tag, bool ext);
+ ID3_C_EXPORT void ID3Tag_SetPadding (ID3Tag *tag, bool pad);
+ ID3_C_EXPORT void ID3Tag_AddFrame (ID3Tag *tag, const ID3Frame *frame);
+ ID3_C_EXPORT void ID3Tag_AttachFrame (ID3Tag *tag, ID3Frame *frame);
+ ID3_C_EXPORT void ID3Tag_AddFrames (ID3Tag *tag, const ID3Frame *frames, size_t num);
+ ID3_C_EXPORT ID3Frame *ID3Tag_RemoveFrame (ID3Tag *tag, const ID3Frame *frame);
+ ID3_C_EXPORT ID3_Err ID3Tag_Parse (ID3Tag *tag, const uchar header[ID3_TAGHEADERSIZE], const uchar *buffer);
+ ID3_C_EXPORT size_t ID3Tag_Link (ID3Tag *tag, const char *fileName);
+ ID3_C_EXPORT ID3_Err ID3Tag_Update (ID3Tag *tag);
+ ID3_C_EXPORT ID3_Err ID3Tag_UpdateByTagType (ID3Tag *tag, flags_t type);
+ ID3_C_EXPORT ID3_Err ID3Tag_Strip (ID3Tag *tag, flags_t ulTagFlags);
+ ID3_C_EXPORT ID3Frame *ID3Tag_FindFrameWithID (const ID3Tag *tag, ID3_FrameID id);
+ ID3_C_EXPORT ID3Frame *ID3Tag_FindFrameWithINT (const ID3Tag *tag, ID3_FrameID id, ID3_FieldID fld, uint32 data);
+ ID3_C_EXPORT ID3Frame *ID3Tag_FindFrameWithASCII (const ID3Tag *tag, ID3_FrameID id, ID3_FieldID fld, const char *data);
+ ID3_C_EXPORT ID3Frame *ID3Tag_FindFrameWithUNICODE (const ID3Tag *tag, ID3_FrameID id, ID3_FieldID fld, const unicode_t *data);
+ ID3_C_EXPORT ID3Frame *ID3Tag_GetFrameNum (const ID3Tag *tag, index_t num);
+ ID3_C_EXPORT size_t ID3Tag_NumFrames (const ID3Tag *tag);
+
+ /* frame wrappers */
+ ID3_C_EXPORT ID3Frame *ID3Frame_New (void);
+ ID3_C_EXPORT ID3Frame *ID3Frame_NewID (ID3_FrameID id);
+ ID3_C_EXPORT void ID3Frame_Delete (ID3Frame *frame);
+ ID3_C_EXPORT void ID3Frame_Clear (ID3Frame *frame);
+ ID3_C_EXPORT void ID3Frame_SetID (ID3Frame *frame, ID3_FrameID id);
+ ID3_C_EXPORT ID3_FrameID ID3Frame_GetID (const ID3Frame *frame);
+ ID3_C_EXPORT ID3Field *ID3Frame_GetField (const ID3Frame *frame, ID3_FieldID name);
+ ID3_C_EXPORT void ID3Frame_SetCompression (ID3Frame *frame, bool comp);
+ ID3_C_EXPORT bool ID3Frame_GetCompression (const ID3Frame *frame);
+
+ /* field wrappers */
+ ID3_C_EXPORT void ID3Field_Clear (ID3Field *field);
+ ID3_C_EXPORT size_t ID3Field_Size (const ID3Field *field);
+ ID3_C_EXPORT size_t ID3Field_GetNumTextItems (const ID3Field *field);
+ ID3_C_EXPORT void ID3Field_SetINT (ID3Field *field, uint32 data);
+ ID3_C_EXPORT uint32 ID3Field_GetINT (const ID3Field *field);
+ ID3_C_EXPORT void ID3Field_SetUNICODE (ID3Field *field, const unicode_t *string);
+ ID3_C_EXPORT size_t ID3Field_GetUNICODE (const ID3Field *field, unicode_t *buffer, size_t maxChars, index_t itemNum);
+ ID3_C_EXPORT void ID3Field_AddUNICODE (ID3Field *field, const unicode_t *string);
+ ID3_C_EXPORT void ID3Field_SetASCII (ID3Field *field, const char *string);
+ ID3_C_EXPORT size_t ID3Field_GetASCII (const ID3Field *field, char *buffer, size_t maxChars, index_t itemNum);
+ ID3_C_EXPORT void ID3Field_AddASCII (ID3Field *field, const char *string);
+ ID3_C_EXPORT void ID3Field_SetBINARY (ID3Field *field, const uchar *data, size_t size);
+ ID3_C_EXPORT void ID3Field_GetBINARY (const ID3Field *field, uchar *buffer, size_t buffLength);
+ ID3_C_EXPORT void ID3Field_FromFile (ID3Field *field, const char *fileName);
+ ID3_C_EXPORT void ID3Field_ToFile (const ID3Field *field, const char *fileName);
+
+ /* Deprecated */
+ ID3_C_EXPORT void ID3Tag_SetCompression (ID3Tag *tag, bool comp);
+
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+#endif /* __ID3LIB_ID3H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/.cvsignore
@@ -1,0 +1,2 @@
+Makefile
+old
--- /dev/null
+++ b/common/id3lib/include/id3/Makefile.am
@@ -1,0 +1,32 @@
+# $Id: Makefile.am,v 1.1 2002/01/21 08:16:20 menno Exp $
+#
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+the_headers = \
+ error.h \
+ field.h \
+ flags.h \
+ frame.h \
+ globals.h \
+ header.h \
+ header_frame.h \
+ header_tag.h \
+ misc_support.h \
+ sized_types.h \
+ spec.h \
+ tag.h \
+ utils.h
+
+id3includedir = $(includedir)/id3
+id3include_HEADERS = $(the_headers)
+
+noinst_HEADERS = \
+ uint28.h
--- /dev/null
+++ b/common/id3lib/include/id3/Makefile.in
@@ -1,0 +1,269 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# $Id: Makefile.in,v 1.1 2002/01/21 08:16:20 menno Exp $
+#
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ../..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+the_headers = error.h field.h flags.h frame.h globals.h header.h header_frame.h header_tag.h misc_support.h sized_types.h spec.h tag.h utils.h
+
+
+id3includedir = $(includedir)/id3
+id3include_HEADERS = $(the_headers)
+
+noinst_HEADERS = uint28.h
+
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../../config.h
+CONFIG_CLEAN_FILES =
+HEADERS = $(id3include_HEADERS) $(noinst_HEADERS)
+
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu include/id3/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+install-id3includeHEADERS: $(id3include_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(id3includedir)
+ @list='$(id3include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(id3includedir)/$$p"; \
+ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(id3includedir)/$$p; \
+ done
+
+uninstall-id3includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ list='$(id3include_HEADERS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(id3includedir)/$$p; \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = include/id3
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu include/id3/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am: install-id3includeHEADERS
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-id3includeHEADERS
+uninstall: uninstall-am
+all-am: Makefile $(HEADERS)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(id3includedir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-tags clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-tags distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
+ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: uninstall-id3includeHEADERS install-id3includeHEADERS tags \
+mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
+distdir info-am info dvi-am dvi check check-am installcheck-am \
+installcheck install-exec-am install-exec install-data-am install-data \
+install-am install uninstall-am uninstall all-redirect all-am all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/include/id3/error.h
@@ -1,0 +1,112 @@
+// $Id: error.h,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_ERROR_H__
+#define __ID3LIB_ERROR_H__
+
+#include "globals.h"
+
+/** When id3lib encounters a nasty error, it thros an exception of type
+ ** ID3_Error. A function that calls an id3lib routine can place the call in a
+ ** try block and provide an appropriate catch block.
+ **
+ ** <pre>
+ ** try
+ ** {
+ ** // call some id3lib routine
+ ** ID3_Tag myTag("mySong.mp3");
+ ** ID3_Frame *myFrame = NULL;
+ **
+ ** // this will generate an exception
+ ** myTag << myFrame;
+ ** }
+ ** catch (ID3_Error err)
+ ** {
+ ** // handle the error
+ ** ...
+ ** }</pre>
+ **/
+class ID3_Error
+{
+public:
+ /** Returns the ID3_Err value, which represents the ID of the error
+ ** that caused the exception.
+ **/
+ ID3_Err GetErrorID() const;
+ /** Returns the English string that defines the error type.
+ **
+ ** Each error ID has a set string error type.
+ **/
+ char *GetErrorType() const;
+ /** Returns a string that gives more explanation as to what caused the
+ ** exception, if enabled by the code that caused the exception.
+ **/
+ char *GetErrorDesc() const;
+ /** Returns a pointer to a string of characters that is the name
+ ** of the id3lib source file that generated the exception.
+ **
+ ** When submitting bug reports, it is useful to include the following.
+ **
+ ** <pre>
+ ** cout << "Exception in file '" << err.GetErrorFile() << "'" << endl;</pre>
+ **/
+ char *GetErrorFile() const;
+ /** Returns the line number in the id3lib source file that threw the
+ ** exception.
+ **
+ ** <pre>cout << "Line #" << err.GetErrorLine() << endl;</pre>
+ **/
+ size_t GetErrorLine() const;
+
+ /** Constructor
+ **
+ ** @param eID Erroy id
+ ** @param sFileName Filename where error occurred
+ ** @param nLineNum Linenumber where error occurred
+ ** @param sDescription Description of error
+ **/
+ ID3_Error(ID3_Err eID, const char *sFileName, size_t nLineNum,
+ const char *sDescription);
+private:
+ ID3_Err __error;
+ size_t __line_num;
+ char *__file_name;
+ char *__description;
+};
+
+/** Shortcut macro for throwing an error without a description
+ **
+ ** @param x The error id
+ **/
+#define ID3_THROW(x) throw ID3_Error(x, __FILE__, __LINE__, "")
+/** Shortcut macro for throwing an error with a description
+ **
+ ** @param x The error id
+ ** @param y The error description
+ **/
+#define ID3_THROW_DESC(x, y) throw ID3_Error(x, __FILE__, __LINE__, y)
+
+#endif /* __ID3LIB_ERROR_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/field.h
@@ -1,0 +1,398 @@
+// $Id: field.h,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_FIELD_H__
+#define __ID3LIB_FIELD_H__
+
+#include <stdlib.h>
+#include "error.h"
+
+struct ID3_FieldDef
+{
+ ID3_FieldID eID;
+ ID3_FieldType eType;
+ size_t ulFixedLength;
+ ID3_V2Spec eSpecBegin;
+ ID3_V2Spec eSpecEnd;
+ flags_t ulFlags;
+ ID3_FieldID eLinkedField;
+ static const ID3_FieldDef* DEFAULT;
+};
+
+class ID3_Frame;
+class ID3_Tag;
+
+// Structure used for defining how frames are defined internally.
+struct ID3_FrameDef
+{
+ ID3_FrameID eID;
+ char sShortTextID[3 + 1];
+ char sLongTextID[4 + 1];
+ bool bTagDiscard;
+ bool bFileDiscard;
+ ID3_FieldDef *aeFieldDefs;
+ const char * sDescription;
+};
+
+/** The representative class of an id3v2 field.
+ **
+ ** As a general rule, you need never create an object of this type. id3lib
+ ** uses them internally as part of the id3_frame class. You must know how to
+ ** interact with these objects, though, and that's what this section is about.
+ **
+ ** The ID3_Field contains many overloaded methods to provide these facilities
+ ** for four different data types: integers, ASCII strings, Unicode strings,
+ ** and binary data.
+ **
+ ** An integer field supports the Get(), Set(uint32), and operator=(uint32)
+ ** methods.
+ **
+ ** Both types of strings support the GetNumTextItems() method.
+ **
+ ** An ASCII string field supports the Get(char*, size_t, index_t)),
+ ** Set(const char*), Add(const char*), and operator=(const char*) methods.
+ **
+ ** A Unicode field also supports Get(unicode_t*, size_t, index_t),
+ ** Set(const unicode_t*), Add(const unicode_t*), and
+ ** operator=(const unicode_t*). Without elaborating, the Unicode
+ ** methods behave exactly the same as their ASCII counterparts, taking
+ ** \c unicode_t pointers in place of \c char pointers.
+ **
+ ** All strings in id3lib are handled internally as Unicode. This means that
+ ** when you set a field with an ASCII source type, it will be converted and
+ ** stored internally as a Unicode string. id3lib will handle all necessary
+ ** conversions when parsing, rendering, and retrieving. If you set a field as
+ ** an ASCII string, then try to read the string into a \c unicode_t buffer,
+ ** id3lib will automatically convert the string into Unicode so this will
+ ** function as expected. The same holds true in reverse. Of course, when
+ ** converting from Unicode to ASCII, you will experience problems when the
+ ** Unicode string contains characters that don't map to ISO-8859-1.
+ **
+ ** A binary field supports the Get(uchar *, size_t), Set(const uchar*, size_t),
+ ** FromFile(const char*), and ToFile(const char*) methods. The binary field
+ ** holds miscellaneous data that can't easily be described any other way, such
+ ** as a JPEG image.
+ **
+ ** As a general implementation note, you should be prepared to support all
+ ** fields in an id3lib frame, even if all fields in the id3lib version of the
+ ** frame aren't present in the id3v2 version. This is because of frames like
+ ** the picture frame, which changed slightly from one version of the id3v2
+ ** standard to the next (the IMAGEFORMAT format in 2.0 changed to a MIMETYPE
+ ** in 3.0). If you support all id3lib fields in a given frame, id3lib can
+ ** generate the correct id3v2 frame for the id3v2 version you wish to support.
+ ** Alternatively, just support the fields you know will be used in, say, 3.0
+ ** if you only plan to generate 3.0 tags.
+ **
+ ** @author Dirk Mahoney
+ ** @version $Id: field.h,v 1.1 2002/01/21 08:16:20 menno Exp $
+ ** \sa ID3_Tag
+ ** \sa ID3_Frame
+ ** \sa ID3_Err
+ **/
+class ID3_Field
+{
+ friend ID3_Frame;
+ friend ID3_Tag;
+public:
+ ~ID3_Field();
+
+ /** Clears any data and frees any memory associated with the field
+ **
+ ** \sa ID3_Tag::Clear()
+ ** \sa ID3_Frame::Clear()
+ **/
+ void Clear();
+
+ /** Returns the size of a field.
+ **
+ ** The value returned is dependent on the type of the field. For ASCII
+ ** strings, this returns the number of characters in the field, no including
+ ** any NULL-terminator. The same holds true for Unicode---it returns the
+ ** number of characters in the field, not bytes, and this does not include
+ ** the Unicode BOM, which isn't put in a Unicode string obtained by the
+ ** Get(unicode_t*, size_t, index_t) method anyway. For binary and
+ ** integer fields, this returns the number of bytes in the field.
+ **
+ ** \code
+ ** size_t howBig = myFrame.Field(ID3FN_DATA).Size();
+ ** \endcode
+ **
+ ** \return The size of the field, either in bytes (for binary or integer
+ ** fields) or characters (for strings).
+ **/
+ size_t Size() const;
+
+ /** Returns the number of items in a text list.
+ **
+ ** \code
+ ** size_t numItems = myFrame.Field(ID3FN_TEXT).GetNumItems();
+ ** \endcode
+ **
+ ** \return The number of items in a text list.
+ **/
+ size_t GetNumTextItems() const;
+
+ // integer field functions
+ /** A shortcut for the Set method.
+ **
+ ** \code
+ ** myFrame.Field(ID3FN_PICTURETYPE) = 0x0B;
+ ** \endcode
+ **
+ ** \param data The data to assign to this field
+ ** \sa Set
+ **/
+ ID3_Field& operator= (uint32);
+
+ /** Sets the value of the field to the specified integer.
+ **
+ ** \param data The data to assign to this field
+ **/
+ void Set(uint32);
+
+ /** Returns the value of the integer field.
+ **
+ ** \code
+ ** uint32 picType = myFrame.Field(ID3FN_PICTURETYPE).Get();
+ ** \endcode
+ **
+ ** \return The value of the integer field
+ **/
+ uint32 Get() const;
+
+ // ASCII string field functions
+ /** Shortcut for the Set operator.
+ **
+ ** \param data The string to assign to this field
+ ** \sa Set(uint32)
+ **/
+ ID3_Field& operator= (const char*);
+
+ /** Copies the supplied string to the field.
+ **
+ ** You may dispose of the source string after a call to this method.
+ **
+ ** \code
+ ** myFrame.Field(ID3FN_TEXT).Set("ID3Lib is very cool!");
+ ** \endcode
+ **/
+ void Set(const char*);
+
+ /** Copies the contents of the field into the supplied buffer, up to the
+ ** number of characters specified; for fields with multiple entries, the
+ ** optional third parameter indicates which of the fields to retrieve.
+ **
+ ** The third parameter is useful when using text lists (see ID3_Field::Add
+ ** for more details). The default value for this third parameter is 1,
+ ** which returns the entire string if the field contains only one item.
+ **
+ ** It returns the number of characters (not bytes necessarily, and not
+ ** including any NULL terminator) of the supplied buffer that are now used.
+ **
+ ** \code
+ ** char myBuffer[1024];
+ ** size_t charsUsed = myFrame.Field(ID3FN_TEXT).Get(buffer, 1024);
+ ** \endcode
+ **
+ ** It fills the buffer with as much data from the field as is present in the
+ ** field, or as large as the buffer, whichever is smaller.
+ **
+ ** \code
+ ** char myBuffer[1024];
+ ** size_t charsUsed = myFrame.Field(ID3FN_TEXT).Get(buffer, 1024, 3);
+ ** \endcode
+ **
+ ** This fills the buffer with up to the first 1024 characters from the third
+ ** element of the text list.
+ **
+ ** \sa ID3_Field::Add
+ **/
+ size_t Get(char *buffer, ///< Where to copy the data
+ size_t, ///< Maximum number of characters to copy
+ index_t = 1 ///< The item number to retrieve
+ ) const;
+
+ /** For fields which support this feature, adds a string to the list of
+ ** strings currently in the field.
+ **
+ ** This is useful for using id3v2 frames such as the involved people list,
+ ** composer, and part of set. You can use the GetNumItems() method to find
+ ** out how many such items are in a list.
+ **
+ ** \code
+ ** myFrame.Field(ID3FN_TEXT).Add("this is a test");
+ ** \endcode
+ **
+ ** \param string The string to add to the field
+ **/
+ void Add(const char*);
+
+ // Unicode string field functions
+ /** Shortcut for the Set operator.
+ **
+ ** Peforms similarly as the ASCII assignment operator, taking a unicode_t
+ ** string as a parameter rather than an ascii string.
+ **
+ ** \sa Add(const char*)
+ ** \param string The string to assign to the field
+ **/
+ ID3_Field &operator= (const unicode_t*);
+
+ /** Copies the supplied unicode string to the field.
+ **
+ ** Peforms similarly as the ASCII <a href="#Set">Set</a> method, taking a
+ ** unicode_t string as a parameter rather than an ascii string.
+ **
+ ** \param string The unicode string to set this field to.
+ ** \sa #Add
+ **/
+ void Set(const unicode_t *);
+
+ /** Copies the contents of the field into the supplied buffer, up to the
+ ** number of characters specified; for fields with multiple entries, the
+ ** optional third parameter indicates which of the fields to retrieve.
+ **
+ ** Peforms similarly as the ASCII <a href="#Get">Get</a> method, taking a
+ ** unicode_t string as a parameter rather than an ascii string. The
+ ** maxChars parameter still represents the maximum number of characters, not
+ ** bytes.
+ **
+ ** \code
+ ** unicode_t myBuffer[1024];
+ ** size_t charsUsed = myFrame.Field(ID3FN_TEXT).Get(buffer, 1024);
+ ** \endcode
+ **
+ ** \param buffer Where the field's data is copied to
+ ** \param maxChars The maximum number of characters to copy to the buffer.
+ ** \param itemNum For fields with multiple items (such as the involved
+ ** people frame, the item number to retrieve.
+ ** \sa #Get
+ **/
+ size_t Get(unicode_t *buffer, size_t, index_t = 1) const;
+ /** For fields which support this feature, adds a string to the list of
+ ** strings currently in the field.
+ **
+ ** Peforms similarly as the ASCII <a href="#Add">Add</a> method, taking a
+ ** unicode_t string as a parameter rather than an ascii string.
+ **/
+ void Add(const unicode_t *string);
+ // binary field functions
+ /** Copies the supplied unicode string to the field.
+ **
+ ** Again, like the string types, the binary <a href="#Set">Set</a> function
+ ** copies the data so you may dispose of the source data after a call to
+ ** this method.
+ **
+ ** \param newData The data to assign to this field.
+ ** \param newSize The number of bytes to be copied from the data array.
+ **/
+ void Set(const uchar *newData, size_t newSize);
+ /** Copies the field's internal string to the buffer.
+ **
+ ** It copies the data in the field into the buffer, for as many bytes as the
+ ** field contains, or the size of buffer, whichever is smaller.
+ **
+ ** \code
+ ** uchar buffer[1024];
+ ** myFrame.Field(ID3FN_DATA).Get(buffer, sizeof(buffer));
+ ** \endcode
+ **
+ ** \param buffer Where to copy the contents of the field.
+ ** \param length The number of bytes in the buffer
+ **/
+ void Get(uchar *buffer, size_t length) const;
+ /** Copies binary data from the file specified to the field.
+ **
+ ** \code
+ ** myFrame.Field(ID3FN_DATA).FromFile("mypic.jpg");
+ ** \endcode
+ **
+ ** \param info The name of the file to read the data from.
+ **/
+ void FromFile(const char *info);
+ /** Copies binary data from the field to the specified file.
+ **
+ ** \code
+ ** myFrame.Field(ID3FN_DATA).ToFile("output.bin");
+ ** \endcode
+ **
+ ** \param info The name of the file to write the data to.
+ **/
+ void ToFile(const char *sInfo) const;
+
+ ID3_Field& operator=( const ID3_Field & );
+
+ const uchar* GetBinary() const { return __data; }
+
+ bool InScope(ID3_V2Spec spec) const
+ { return __spec_begin <= spec && spec <= __spec_end; }
+
+ ID3_FieldID GetID() const { return __id; }
+ ID3_FieldType GetType() const { return __type; }
+ bool SetEncoding(ID3_TextEnc enc);
+ ID3_TextEnc GetEncoding() const { return __enc; }
+ bool IsEncodable() const { return (__flags & ID3FF_ENCODABLE) > 0; }
+
+
+private:
+ size_t BinSize(bool withExtras = true) const;
+ bool HasChanged();
+ //void SetSpec(ID3_V2Spec);
+ size_t Render(uchar *buffer) const;
+ size_t Parse(const uchar *buffer, size_t buffSize);
+
+private:
+ // To prevent public instantiation, the constructor is made private
+ ID3_Field();
+
+ ID3_FieldID __id; // the ID of this field
+ ID3_FieldType __type; // what type is this field or should be
+ size_t __length; // length of field (fixed if positive)
+ ID3_V2Spec __spec_begin; // spec end
+ ID3_V2Spec __spec_end; // spec begin
+ flags_t __flags; // special field flags
+ mutable bool __changed; // field changed since last parse/render?
+ uchar *__data;
+ size_t __size;
+ ID3_TextEnc __enc; // encoding
+protected:
+ size_t RenderInteger(uchar *buffer) const;
+ size_t RenderASCIIString(uchar *buffer) const;
+ size_t RenderUnicodeString(uchar *buffer) const;
+ size_t RenderBinary(uchar *buffer) const;
+
+ size_t ParseInteger(const uchar *buffer, size_t);
+ size_t ParseASCIIString(const uchar *buffer, size_t);
+ size_t ParseUnicodeString(const uchar *buffer, size_t);
+ size_t ParseBinary(const uchar *buffer, size_t);
+
+};
+
+// Ack! Not for public use
+ID3_FrameDef *ID3_FindFrameDef(const ID3_FrameID id);
+ID3_FrameID ID3_FindFrameID(const char *id);
+
+#endif /* __ID3LIB_FIELD_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/flags.h
@@ -1,0 +1,55 @@
+// $Id: flags.h,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_FLAGS_H__
+#define __ID3LIB_FLAGS_H__
+
+#include "flags.h"
+
+class ID3_Flags
+{
+public:
+ typedef flags_t TYPE;
+
+ ID3_Flags() : __f(0) { ; }
+ virtual ~ID3_Flags() { ; }
+
+ TYPE get() const { return __f; }
+ bool test(TYPE f) const { return (this->get() & f) == f; }
+ bool set(TYPE f) { bool r = (__f != f); __f = f; return r; }
+ bool add(TYPE f) { return this->set(this->get() | f); }
+ bool remove(TYPE f) { return this->set(this->get() & ~f); }
+ bool clear() { return this->set(0); }
+ bool set(TYPE f, bool b){ if (b) return this->add(f); return this->remove(f); }
+
+ ID3_Flags& operator=(const ID3_Flags& f)
+ { if (this != &f) { this->set(f.get()); } return *this; }
+
+private:
+ TYPE __f;
+};
+
+#endif /* __ID3LIB_FLAGS_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/frame.h
@@ -1,0 +1,192 @@
+// $Id: frame.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_FRAME_H__
+#define __ID3LIB_FRAME_H__
+
+#include "spec.h"
+#include "header_frame.h"
+
+class ID3_Field;
+class ID3_Tag;
+
+/** The representative class of an id3v2 frame.
+ **
+ ** id3lib defines frames in a funny way. Using some nice c++ conventions,
+ ** ID3_Frame class objects appear to be quite polymorphic; that is, they can
+ ** take on many forms. The same ID3_Frame class provides the facilities for
+ ** the implementation of a complex APIC frame and for a simple text frame.
+ **
+ ** @author Dirk Mahoney
+ ** @version $Id: frame.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+ ** @see ID3_Tag
+ ** @see ID3_Field
+ ** @see ID3_Err
+ **/
+class ID3_Frame : public ID3_Speccable
+{
+public:
+ /** Default constructor; accepts as a default parameter the type of frame
+ ** to create.
+ **
+ ** The parameter which will internally set the frame's structure. See
+ ** <a href="#SetID">SetID</a> for more details.
+ **
+ ** @param id The type of frame to create
+ ** @see ID3_FrameID
+ ** @see SetID
+ **/
+ ID3_Frame(ID3_FrameID id = ID3FID_NOFRAME);
+ ID3_Frame(const ID3_FrameHeader&);
+ ID3_Frame(const ID3_Frame&);
+
+ /// Destructor.
+ virtual ~ID3_Frame();
+
+ /** Clears the frame of all data and resets the frame such that it can take
+ ** on the form of any id3v2 frame that id3lib supports.
+ **
+ ** @see ID3_Tag::Clear
+ **/
+ void Clear();
+
+ /** Establishes the internal structure of an ID3_Frame object so
+ ** that it represents the id3v2 frame indicated by the parameter
+ **
+ ** Given an ID3_FrameID (a list of which is found in <id3/field.h>),
+ ** <a href="#SetID">SetID</a> will structure the object according to the
+ ** frame you wish to implement.
+ **
+ ** Either using this call or via the constructor, this must be the first
+ ** command performed on an ID3_Frame object.
+ **
+ ** \code
+ ** myFrame.SetID(ID3FID_TITLE);
+ ** \endcode
+ **
+ ** @param id The type of frame this frame should be set to
+ ** @see ID3_FrameID
+ **/
+ bool SetID(ID3_FrameID id);
+
+ /** Returns the type of frame that the object represents.
+ **
+ ** Useful in conjunction with ID3_Tag's Find method
+ **
+ ** @returns The type, or id, of the frame
+ ** @see ID3_Tag::Find
+ **/
+ ID3_FrameID GetID() const;
+
+ /** Returns a reference to the frame's internal field indicated by the
+ ** parameter.
+ **
+ ** A list of fields that are in given frames appears in
+ ** <id3/field.cpp>. This method returns a reference to the field in
+ ** question so that the result can be used as though it were a field
+ ** itself.
+ **
+ ** \code
+ ** ID3_TextEnc enc;
+ ** enc = (ID3_TextEnc) myFrame.Field(ID3FN_TEXTENC).Get();
+ ** \endcode
+ **
+ ** @param name The name of the field to be retrieved
+ ** @returns A reference to the desired field
+ **/
+ ID3_Field &Field(ID3_FieldID name) const;
+
+ const char* GetDescription() const;
+ static const char* GetDescription(ID3_FrameID);
+
+ ID3_Frame &operator=(const ID3_Frame &);
+ bool HasChanged() const;
+ size_t Parse(const uchar *buffer, size_t size);
+ size_t Size();
+ size_t Render(uchar *buffer) const;
+ bool Contains(ID3_FieldID fld) const
+ { return BS_ISSET(__field_bitset, fld) > 0; }
+ bool SetSpec(ID3_V2Spec);
+ ID3_V2Spec GetSpec() const;
+
+ /** Sets the compression flag within the frame. When the compression flag is
+ ** is set, compression will be attempted. However, the frame might not
+ ** actually be compressed after it is rendered if the "compressed" data is no
+ ** smaller than the "uncompressed" data.
+ **/
+ bool SetCompression(bool b) { return __hdr.SetCompression(b); }
+ /** Returns whether or not the compression flag is set. After parsing a tag,
+ ** this will indicate whether or not the frame was compressed. After
+ ** rendering a tag, however, it does not actually indicate if the frame is
+ ** compressed rendering. It only indicates whether or not compression was
+ ** attempted. A frame will not be compressed, even whent the compression
+ ** flag is set, if the "compressed" data is no smaller than the
+ ** "uncompressed" data.
+ **/
+ bool GetCompression() const { return __hdr.GetCompression(); }
+ bool BadParse() const { return __bad_parse; }
+ size_t GetDataSize() const { return __hdr.GetDataSize(); }
+
+protected:
+ bool _SetID(ID3_FrameID);
+ bool _ClearFields();
+ void _InitFields();
+ void _InitFieldBits();
+ void _UpdateFieldDeps();
+ lsint _FindField(ID3_FieldID name) const;
+
+ bool _SetEncryptionID(uchar id)
+ {
+ bool changed = id != __encryption_id;
+ __encryption_id = id;
+ __changed = __changed || changed;
+ __hdr.SetEncryption(true);
+ return changed;
+ }
+ uchar _GetEncryptionID() const { return __encryption_id; }
+ bool _SetGroupingID(uchar id)
+ {
+ bool changed = id != __grouping_id;
+ __grouping_id = id;
+ __changed = __changed || changed;
+ __hdr.SetGrouping(true);
+ return changed;
+ }
+ uchar _GetGroupingID() const { return __grouping_id; }
+
+private:
+ mutable bool __changed; // frame changed since last parse/render?
+ bitset __field_bitset; // which fields are present?
+ size_t __num_fields; // how many fields are in this frame?
+ ID3_Field **__fields; // an array of field object pointers
+ ID3_FrameHeader __hdr; //
+ uchar __encryption_id; // encryption id
+ uchar __grouping_id; // grouping id
+ bool __bad_parse; //
+}
+;
+
+#endif /* __ID3LIB_FRAME_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/globals.h
@@ -1,0 +1,427 @@
+/* $Id: globals.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+ * id3lib: a C++ library for creating and manipulating id3v1/v2 tags Copyright
+ * 1999, 2000 Scott Thomas Haug
+
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ * The id3lib authors encourage improvements and optimisations to be sent to
+ * the id3lib coordinator. Please see the README file for details on where to
+ * send such submissions. See the AUTHORS file for a list of people who have
+ * contributed to id3lib. See the ChangeLog file for a list of changes to
+ * id3lib. These files are distributed with id3lib at
+ * http://download.sourceforge.net/id3lib/
+ */
+
+/** This file defines common macros, types, constants, and enums used
+ ** throughout id3lib.
+ **/
+
+#ifndef __ID3LIB_GLOBALS_H__
+#define __ID3LIB_GLOBALS_H__
+
+#if defined __cplusplus
+#include <iostream.h>
+#endif
+#include <stdlib.h>
+#include "sized_types.h"
+
+/* id3lib version.
+ * we prefix variable declarations so they can
+ * properly get exported in windows dlls.
+ * (borrowed from glib.h http://www.gtk.org)
+ */
+#ifdef WIN32
+# ifdef ID3LIB_COMPILATION
+# define ID3_C_EXPORT extern __declspec(dllexport)
+# else /* !ID3LIB_COMPILATION */
+# define ID3_C_EXPORT extern __declspec(dllimport)
+# endif /* !ID3LIB_COMPILATION */
+#else /* !WIN32 */
+# define ID3_C_EXPORT
+#endif /* !WIN32 */
+#define ID3_C_VAR extern
+
+#ifndef __cplusplus
+
+typedef int bool;
+#define false (0)
+#define true (!false)
+
+#endif /* __cplusplus */
+
+ID3_C_VAR const char * const ID3LIB_NAME;
+ID3_C_VAR const char * const ID3LIB_RELEASE;
+ID3_C_VAR const char * const ID3LIB_FULL_NAME;
+ID3_C_VAR const int ID3LIB_MAJOR_VERSION;
+ID3_C_VAR const int ID3LIB_MINOR_VERSION;
+ID3_C_VAR const int ID3LIB_PATCH_VERSION;
+ID3_C_VAR const int ID3LIB_INTERFACE_AGE;
+ID3_C_VAR const int ID3LIB_BINARY_AGE;
+
+#define ID3_TAGID "ID3"
+#define ID3_TAGIDSIZE (3)
+#define ID3_TAGHEADERSIZE (10)
+
+typedef unsigned char uchar;
+typedef short signed int ssint;
+typedef short unsigned int suint;
+typedef long signed int lsint;
+typedef long unsigned int luint;
+typedef long double ldoub;
+
+typedef uint32* bitset;
+typedef uint16 unicode_t;
+typedef uint16 flags_t;
+/* this needs to be done for compatibility with Sun Solaris */
+#if !defined index_t
+#define index_t size_t
+#endif
+const unicode_t NULL_UNICODE = (unicode_t) '\0';
+
+/* These macros are used to make the C and C++ declarations for enums and
+ * structs have the same syntax. Basically, it allows C users to refer to an
+ * enum or a struct without prepending enum/struct.
+ */
+#ifdef __cplusplus
+# define ID3_ENUM(E) enum E
+# define ID3_STRUCT(S) struct S
+#else
+# define ID3_ENUM(E) typedef enum __ ## E E; enum __ ## E
+# define ID3_STRUCT(S) typedef struct __ ## S S; struct __ ## S
+#endif
+
+/**
+ ** Enumeration of the types of text encodings: ascii or unicode
+ **/
+ID3_ENUM(ID3_TextEnc)
+{
+ ID3TE_NONE = -1,
+ ID3TE_ASCII = 0,
+ ID3TE_UNICODE,
+ ID3TE_NUMENCODINGS
+};
+
+/** Enumeration of the various id3 specifications
+ **/
+ID3_ENUM(ID3_V1Spec)
+{
+ ID3V1_0 = 0,
+ ID3V1_1,
+ ID3V1_NUMSPECS
+};
+
+ID3_ENUM(ID3_V2Spec)
+{
+ ID3V2_UNKNOWN = -1,
+ ID3V2_2_0 = 0,
+ ID3V2_2_1,
+ ID3V2_3_0,
+ ID3V2_EARLIEST = ID3V2_2_0,
+ ID3V2_LATEST = ID3V2_3_0
+};
+
+/** The various types of tags that id3lib can handle
+ **/
+ID3_ENUM(ID3_TagType)
+{
+ ID3TT_NONE = 0, /**< Represents an empty or non-existant tag */
+ ID3TT_ID3V1 = 1 << 0, /**< Represents an id3v1 or id3v1.1 tag */
+ ID3TT_ID3V2 = 1 << 1, /**< Represents an id3v2 tag */
+ ID3TT_LYRICS = 1 << 2, /**< Represents a Lyrics tag */
+ /** Represents both id3 tags: id3v1 and id3v2 */
+ ID3TT_ID3 = ID3TT_ID3V1 | ID3TT_ID3V2,
+ /** Represents all possible types of tags */
+ ID3TT_ALL = ID3TT_LYRICS | ID3TT_ID3
+};
+
+/**
+ ** Enumeration of the different types of fields in a frame.
+ **/
+ID3_ENUM(ID3_FieldID)
+{
+ ID3FN_NOFIELD = 0, /**< No field */
+ ID3FN_TEXTENC, /**< Text encoding (unicode or ASCII) */
+ ID3FN_TEXT, /**< Text field */
+ ID3FN_URL, /**< A URL */
+ ID3FN_DATA, /**< Data field */
+ ID3FN_DESCRIPTION, /**< Description field */
+ ID3FN_OWNER, /**< Owner field */
+ ID3FN_EMAIL, /**< Email field */
+ ID3FN_RATING, /**< Rating field */
+ ID3FN_FILENAME, /**< Filename field */
+ ID3FN_LANGUAGE, /**< Language field */
+ ID3FN_PICTURETYPE, /**< Picture type field */
+ ID3FN_IMAGEFORMAT, /**< Image format field */
+ ID3FN_MIMETYPE, /**< Mimetype field */
+ ID3FN_COUNTER, /**< Counter field */
+ ID3FN_ID, /**< Identifier/Symbol field */
+ ID3FN_VOLUMEADJ, /**< Volume adjustment field */
+ ID3FN_NUMBITS, /**< Number of bits field */
+ ID3FN_VOLCHGRIGHT, /**< Volume chage on the right channel */
+ ID3FN_VOLCHGLEFT, /**< Volume chage on the left channel */
+ ID3FN_PEAKVOLRIGHT, /**< Peak volume on the right channel */
+ ID3FN_PEAKVOLLEFT, /**< Peak volume on the left channel */
+ ID3FN_TIMESTAMPFORMAT,/**< SYLT Timestamp Format */
+ ID3FN_CONTENTTYPE, /**< SYLT content type */
+ ID3FN_LASTFIELDID /**< Last field placeholder */
+};
+
+/**
+ ** Enumeration of the different types of frames recognized by id3lib
+ **/
+ID3_ENUM(ID3_FrameID)
+{
+ /* ???? */ ID3FID_NOFRAME = 0, /**< No known frame */
+ /* AENC */ ID3FID_AUDIOCRYPTO, /**< Audio encryption */
+ /* APIC */ ID3FID_PICTURE, /**< Attached picture */
+ /* COMM */ ID3FID_COMMENT, /**< Comments */
+ /* COMR */ ID3FID_COMMERCIAL, /**< Commercial frame */
+ /* ENCR */ ID3FID_CRYPTOREG, /**< Encryption method registration */
+ /* EQUA */ ID3FID_EQUALIZATION, /**< Equalization */
+ /* ETCO */ ID3FID_EVENTTIMING, /**< Event timing codes */
+ /* GEOB */ ID3FID_GENERALOBJECT, /**< General encapsulated object */
+ /* GRID */ ID3FID_GROUPINGREG, /**< Group identification registration */
+ /* IPLS */ ID3FID_INVOLVEDPEOPLE, /**< Involved people list */
+ /* LINK */ ID3FID_LINKEDINFO, /**< Linked information */
+ /* MCDI */ ID3FID_CDID, /**< Music CD identifier */
+ /* MLLT */ ID3FID_MPEGLOOKUP, /**< MPEG location lookup table */
+ /* OWNE */ ID3FID_OWNERSHIP, /**< Ownership frame */
+ /* PRIV */ ID3FID_PRIVATE, /**< Private frame */
+ /* PCNT */ ID3FID_PLAYCOUNTER, /**< Play counter */
+ /* POPM */ ID3FID_POPULARIMETER, /**< Popularimeter */
+ /* POSS */ ID3FID_POSITIONSYNC, /**< Position synchronisation frame */
+ /* RBUF */ ID3FID_BUFFERSIZE, /**< Recommended buffer size */
+ /* RVAD */ ID3FID_VOLUMEADJ, /**< Relative volume adjustment */
+ /* RVRB */ ID3FID_REVERB, /**< Reverb */
+ /* SYLT */ ID3FID_SYNCEDLYRICS, /**< Synchronized lyric/text */
+ /* SYTC */ ID3FID_SYNCEDTEMPO, /**< Synchronized tempo codes */
+ /* TALB */ ID3FID_ALBUM, /**< Album/Movie/Show title */
+ /* TBPM */ ID3FID_BPM, /**< BPM (beats per minute) */
+ /* TCOM */ ID3FID_COMPOSER, /**< Composer */
+ /* TCON */ ID3FID_CONTENTTYPE, /**< Content type */
+ /* TCOP */ ID3FID_COPYRIGHT, /**< Copyright message */
+ /* TDAT */ ID3FID_DATE, /**< Date */
+ /* TDLY */ ID3FID_PLAYLISTDELAY, /**< Playlist delay */
+ /* TENC */ ID3FID_ENCODEDBY, /**< Encoded by */
+ /* TEXT */ ID3FID_LYRICIST, /**< Lyricist/Text writer */
+ /* TFLT */ ID3FID_FILETYPE, /**< File type */
+ /* TIME */ ID3FID_TIME, /**< Time */
+ /* TIT1 */ ID3FID_CONTENTGROUP, /**< Content group description */
+ /* TIT2 */ ID3FID_TITLE, /**< Title/songname/content description */
+ /* TIT3 */ ID3FID_SUBTITLE, /**< Subtitle/Description refinement */
+ /* TKEY */ ID3FID_INITIALKEY, /**< Initial key */
+ /* TLAN */ ID3FID_LANGUAGE, /**< Language(s) */
+ /* TLEN */ ID3FID_SONGLEN, /**< Length */
+ /* TMED */ ID3FID_MEDIATYPE, /**< Media type */
+ /* TOAL */ ID3FID_ORIGALBUM, /**< Original album/movie/show title */
+ /* TOFN */ ID3FID_ORIGFILENAME, /**< Original filename */
+ /* TOLY */ ID3FID_ORIGLYRICIST, /**< Original lyricist(s)/text writer(s) */
+ /* TOPE */ ID3FID_ORIGARTIST, /**< Original artist(s)/performer(s) */
+ /* TORY */ ID3FID_ORIGYEAR, /**< Original release year */
+ /* TOWN */ ID3FID_FILEOWNER, /**< File owner/licensee */
+ /* TPE1 */ ID3FID_LEADARTIST, /**< Lead performer(s)/Soloist(s) */
+ /* TPE2 */ ID3FID_BAND, /**< Band/orchestra/accompaniment */
+ /* TPE3 */ ID3FID_CONDUCTOR, /**< Conductor/performer refinement */
+ /* TPE4 */ ID3FID_MIXARTIST, /**< Interpreted, remixed, or otherwise modified by */
+ /* TPOS */ ID3FID_PARTINSET, /**< Part of a set */
+ /* TPUB */ ID3FID_PUBLISHER, /**< Publisher */
+ /* TRCK */ ID3FID_TRACKNUM, /**< Track number/Position in set */
+ /* TRDA */ ID3FID_RECORDINGDATES, /**< Recording dates */
+ /* TRSN */ ID3FID_NETRADIOSTATION, /**< Internet radio station name */
+ /* TRSO */ ID3FID_NETRADIOOWNER, /**< Internet radio station owner */
+ /* TSIZ */ ID3FID_SIZE, /**< Size */
+ /* TSRC */ ID3FID_ISRC, /**< ISRC (international standard recording code) */
+ /* TSSE */ ID3FID_ENCODERSETTINGS, /**< Software/Hardware and settings used for encoding */
+ /* TXXX */ ID3FID_USERTEXT, /**< User defined text information */
+ /* TYER */ ID3FID_YEAR, /**< Year */
+ /* UFID */ ID3FID_UNIQUEFILEID, /**< Unique file identifier */
+ /* USER */ ID3FID_TERMSOFUSE, /**< Terms of use */
+ /* USLT */ ID3FID_UNSYNCEDLYRICS, /**< Unsynchronized lyric/text transcription */
+ /* WCOM */ ID3FID_WWWCOMMERCIALINFO, /**< Commercial information */
+ /* WCOP */ ID3FID_WWWCOPYRIGHT, /**< Copyright/Legal infromation */
+ /* WOAF */ ID3FID_WWWAUDIOFILE, /**< Official audio file webpage */
+ /* WOAR */ ID3FID_WWWARTIST, /**< Official artist/performer webpage */
+ /* WOAS */ ID3FID_WWWAUDIOSOURCE, /**< Official audio source webpage */
+ /* WORS */ ID3FID_WWWRADIOPAGE, /**< Official internet radio station homepage */
+ /* WPAY */ ID3FID_WWWPAYMENT, /**< Payment */
+ /* WPUB */ ID3FID_WWWPUBLISHER, /**< Official publisher webpage */
+ /* WXXX */ ID3FID_WWWUSER, /**< User defined URL link */
+ /* */ ID3FID_METACRYPTO, /**< Encrypted meta frame (id3v2.2.x) */
+ /* */ ID3FID_METACOMPRESSION /**< Compressed meta frame (id3v2.2.1) */
+};
+
+ID3_ENUM(ID3_V1Lengths)
+{
+ ID3_V1_LEN = 128,
+ ID3_V1_LEN_ID = 3,
+ ID3_V1_LEN_TITLE = 30,
+ ID3_V1_LEN_ARTIST = 30,
+ ID3_V1_LEN_ALBUM = 30,
+ ID3_V1_LEN_YEAR = 4,
+ ID3_V1_LEN_COMMENT = 30,
+ ID3_V1_LEN_GENRE = 1
+};
+
+/** A structure for storing the contents of an id3v1 tag.
+ **
+ ** @author Dirk Mahoney (dirk@id3.org)
+ ** @author Scott Thomas Haug (sth2@cs.wustl.edu)
+ ** @version $Id: globals.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+ ** @see ID3_Tag
+ **/
+ID3_STRUCT(ID3V1_Tag)
+{
+ /** String for storing the "TAG" identifier. */
+ char sID [1 + ID3_V1_LEN_ID];
+ /** String for storing the title */
+ char sTitle [1 + ID3_V1_LEN_TITLE];
+ /** String for storing the artist */
+ char sArtist [1 + ID3_V1_LEN_ARTIST];
+ /** String for storing the album */
+ char sAlbum [1 + ID3_V1_LEN_ALBUM];
+ /** String for storing the year */
+ char sYear [1 + ID3_V1_LEN_YEAR];
+ /** String for storing the comment */
+ char sComment[1 + ID3_V1_LEN_COMMENT];
+ /** Byte for storing the genre */
+ uchar ucGenre;
+};
+
+ID3_ENUM(ID3_FieldFlags)
+{
+ ID3FF_NONE = 0,
+ ID3FF_CSTR = 1 << 0,
+ ID3FF_LIST = 1 << 1,
+ ID3FF_ENCODABLE = 1 << 2,
+ ID3FF_TEXTLIST = ID3FF_CSTR | ID3FF_LIST | ID3FF_ENCODABLE
+};
+
+/** Enumeration of the types of field types */
+ID3_ENUM(ID3_FieldType)
+{
+ ID3FTY_NONE = -1,
+ ID3FTY_INTEGER = 0,
+ ID3FTY_BINARY,
+ ID3FTY_TEXTSTRING,
+ ID3FTY_NUMTYPES
+};
+
+/**
+ ** Predefined id3lib error types.
+ **/
+ID3_ENUM(ID3_Err)
+{
+ ID3E_NoError = 0, /**< No error reported */
+ ID3E_NoMemory, /**< No available memory */
+ ID3E_NoData, /**< No data to parse */
+ ID3E_BadData, /**< Improperly formatted data */
+ ID3E_NoBuffer, /**< No buffer to write to */
+ ID3E_SmallBuffer, /**< Buffer is too small */
+ ID3E_InvalidFrameID, /**< Invalid frame id */
+ ID3E_FieldNotFound, /**< Requested field not found */
+ ID3E_UnknownFieldType, /**< Unknown field type */
+ ID3E_TagAlreadyAttached, /**< Tag is already attached to a file */
+ ID3E_InvalidTagVersion, /**< Invalid tag version */
+ ID3E_NoFile, /**< No file to parse */
+ ID3E_ReadOnly, /**< Attempting to write to a read-only file */
+ ID3E_zlibError /**< Error in compression/uncompression */
+
+};
+
+ID3_ENUM(ID3_ContentType)
+{
+ ID3CT_OTHER = 0,
+ ID3CT_LYRICS,
+ ID3CT_TEXTTRANSCRIPTION,
+ ID3CT_MOVEMENT,
+ ID3CT_EVENTS,
+ ID3CT_CHORD,
+ ID3CT_TRIVIA
+};
+
+ID3_ENUM(ID3_TimeStampFormat)
+{
+ ID3TSF_FRAME = 1,
+ ID3TSF_MS
+};
+
+#define BS_SIZE (sizeof(uint32)*8)
+#define BS_SET(v,x) ((v)[(x) / BS_SIZE] |= (1 << ((x) % BS_SIZE)))
+#define BS_CLEAR(v,x) ((v)[(x) / BS_SIZE] &= ~(1 << ((x) % BS_SIZE)))
+#define BS_ISSET(v,x) ((v)[(x) / BS_SIZE] & (1 << ((x) % BS_SIZE)))
+
+#define MASK(bits) ((1 << (bits)) - 1)
+#define MASK1 MASK(1)
+#define MASK2 MASK(2)
+#define MASK3 MASK(3)
+#define MASK4 MASK(4)
+#define MASK5 MASK(5)
+#define MASK6 MASK(6)
+#define MASK7 MASK(7)
+#define MASK8 MASK(8)
+
+/*
+ * The following is borrowed from glib.h (http://www.gtk.org)
+ */
+#ifdef WIN32
+
+/* On native Win32, directory separator is the backslash, and search path
+ * separator is the semicolon.
+ */
+# define ID3_DIR_SEPARATOR '\\'
+# define ID3_DIR_SEPARATOR_S "\\"
+# define ID3_SEARCHPATH_SEPARATOR ';'
+# define ID3_SEARCHPATH_SEPARATOR_S ";"
+
+#else /* !WIN32 */
+
+# ifndef __EMX__
+/* Unix */
+
+# define ID3_DIR_SEPARATOR '/'
+# define ID3_DIR_SEPARATOR_S "/"
+# define ID3_SEARCHPATH_SEPARATOR ':'
+# define ID3_SEARCHPATH_SEPARATOR_S ":"
+
+# else
+/* EMX/OS2 */
+
+# define ID3_DIR_SEPARATOR '/'
+# define ID3_DIR_SEPARATOR_S "/"
+# define ID3_SEARCHPATH_SEPARATOR ';'
+# define ID3_SEARCHPATH_SEPARATOR_S ";"
+
+# endif
+
+#endif /* !WIN32 */
+
+#ifndef NULL
+#define NULL ((void*) 0)
+#endif
+
+#undef MAX
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+#undef MIN
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+
+#undef ABS
+#define ABS(a) (((a) < 0) ? -(a) : (a))
+
+#undef CLAMP
+#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
+
+#endif /* __ID3LIB_GLOBALS_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/header.h
@@ -1,0 +1,102 @@
+// $Id: header.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_HEADER_H__
+#define __ID3LIB_HEADER_H__
+
+#include "spec.h"
+#include "flags.h"
+
+class ID3_Header : public ID3_Speccable
+{
+public:
+ struct Info
+ {
+ uchar frame_bytes_id;
+ uchar frame_bytes_size;
+ uchar frame_bytes_flags;
+ bool is_extended;
+ size_t extended_bytes;
+ bool is_experimental;
+ };
+
+ ID3_Header()
+ {
+ this->Clear();
+ __changed = false;
+ }
+ virtual ~ID3_Header() { ; }
+
+ virtual bool SetSpec(ID3_V2Spec);
+ /* */ ID3_V2Spec GetSpec() const { return __spec; }
+
+ /* */ bool SetDataSize(size_t size)
+ {
+ bool changed = size != __data_size;
+ __changed = __changed || changed;
+ __data_size = size;
+ return changed;
+ }
+ /* */ size_t GetDataSize() const { return __data_size; }
+
+ virtual bool Clear()
+ {
+ bool changed = this->SetDataSize(0);
+ if (this->GetSpec() == ID3V2_UNKNOWN)
+ {
+ this->SetSpec(ID3V2_LATEST);
+ changed = true;
+ }
+ changed = __flags.clear() || changed;
+ __changed = changed || __changed;
+ return changed;
+ }
+ virtual size_t Size() const = 0;
+
+ virtual size_t Render(uchar* buffer) const = 0;
+ virtual size_t Parse(const uchar*, size_t) = 0;
+
+ ID3_Header &operator=( const ID3_Header &rhs)
+ {
+ if (this != &rhs)
+ {
+ this->SetSpec(rhs.GetSpec());
+ this->SetDataSize(rhs.GetSpec());
+ this->__flags = rhs.__flags;
+ }
+ return *this;
+ }
+
+protected:
+ ID3_V2Spec __spec; // which version of the spec
+ size_t __data_size; // how big is the data?
+ ID3_Flags __flags; // header flags
+ const Info* __info; // header info w.r.t. id3v2 spec
+ bool __changed; // has the header changed since parsing
+}
+;
+
+#endif /* __ID3LIB_HEADER_H */
--- /dev/null
+++ b/common/id3lib/include/id3/header_frame.h
@@ -1,0 +1,84 @@
+// $Id: header_frame.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_HEADER_FRAME_H__
+#define __ID3LIB_HEADER_FRAME_H__
+
+#include "header.h"
+#include "field.h"
+
+class ID3_FrameHeader : public ID3_Header
+{
+public:
+
+ enum
+ {
+ TAGALTER = 1 << 15,
+ FILEALTER = 1 << 14,
+ READONLY = 1 << 13,
+ COMPRESSION = 1 << 7,
+ ENCRYPTION = 1 << 6,
+ GROUPING = 1 << 5
+ };
+
+ ID3_FrameHeader() : __frame_def(NULL), __dyn_frame_def(false) { ; }
+ virtual ~ID3_FrameHeader() { this->Clear(); }
+
+ /* */ size_t Size() const;
+ /* */ size_t Parse(const uchar*, size_t);
+ /* */ size_t Render(uchar*) const;
+ /* */ bool SetFrameID(ID3_FrameID id);
+ /* */ ID3_FrameID GetFrameID() const;
+ const char* GetTextID() const;
+ const ID3_FrameDef* GetFrameDef() const;
+ /* */ bool Clear();
+ ID3_FrameHeader& operator=(const ID3_FrameHeader&);
+
+ bool SetCompression(bool b) { return this->SetFlags(COMPRESSION, b); }
+ bool SetEncryption(bool b) { return this->SetFlags(ENCRYPTION, b); }
+ bool SetGrouping(bool b) { return this->SetFlags(GROUPING, b); }
+
+ bool GetCompression() const { return __flags.test(COMPRESSION); }
+ bool GetEncryption() const { return __flags.test(ENCRYPTION); }
+ bool GetGrouping() const { return __flags.test(GROUPING); }
+ bool GetReadOnly() const { return __flags.test(READONLY); }
+
+protected:
+ bool SetFlags(uint16 f, bool b)
+ {
+ bool changed = __flags.set(f, b);
+ __changed = __changed || changed;
+ return changed;
+ }
+ void SetUnknownFrame(const char*);
+
+private:
+ ID3_FrameDef* __frame_def;
+ bool __dyn_frame_def;
+}
+;
+
+#endif /* __ID3LIB_HEADER_FRAME__ */
--- /dev/null
+++ b/common/id3lib/include/id3/header_tag.h
@@ -1,0 +1,87 @@
+// $Id: header_tag.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_HEADER_TAG_H__
+#define __ID3LIB_HEADER_TAG_H__
+
+#include "header.h"
+
+class ID3_TagHeader : public ID3_Header
+{
+public:
+
+ enum
+ {
+ UNSYNC = 1 << 7,
+ EXTENDED = 1 << 6,
+ EXPERIMENTAL = 1 << 5
+ };
+
+ ID3_TagHeader() : ID3_Header() { ; }
+ virtual ~ID3_TagHeader() { ; }
+ ID3_TagHeader(const ID3_TagHeader& rhs) : ID3_Header() { *this = rhs; }
+
+ bool SetSpec(ID3_V2Spec);
+ size_t Size() const;
+ size_t Render(uchar *buffer) const;
+ size_t Parse(const uchar*, size_t);
+ ID3_TagHeader& operator=(const ID3_TagHeader&hdr)
+ { this->ID3_Header::operator=(hdr); return *this; }
+
+ bool SetUnsync(bool b)
+ {
+ bool changed = __flags.set(UNSYNC, b);
+ __changed = __changed || changed;
+ return changed;
+ }
+ bool GetUnsync() const { return __flags.test(UNSYNC); }
+ bool SetExtended(bool b)
+ {
+ bool changed = __flags.set(EXTENDED, b);
+ __changed = __changed || changed;
+ return changed;
+ }
+ bool GetExtended() const { return __flags.test(EXTENDED); }
+
+ // id3v2 tag header signature: $49 44 33 MM mm GG ss ss ss ss
+ // MM = major version (will never be 0xFF)
+ // mm = minor version (will never be 0xFF)
+ // ff = flags byte
+ // ss = size bytes (less than $80)
+ static const char* const ID;
+ enum
+ {
+ ID_SIZE = 3,
+ MAJOR_OFFSET = 3,
+ MINOR_OFFSET = 4,
+ FLAGS_OFFSET = 5,
+ SIZE_OFFSET = 6,
+ SIZE = 10
+ };
+
+};
+
+#endif /* __ID3LIB_HEADER_TAG_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/int28.h
@@ -1,0 +1,54 @@
+// $Id: int28.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_INT28_H__
+#define __ID3LIB_INT28_H__
+
+#include <iostream.h>
+#include "globals.h"
+
+class int28
+{
+ friend ostream &operator<<(ostream& out, int28& val);
+ friend istream &operator>>(istream& in, int28& val);
+public:
+ int28(uint32 val = 0);
+ int28(uchar val[sizeof(uint32)]);
+
+ uchar operator[](size_t posn);
+ uint32 get(void);
+
+protected:
+ void set(uint32 val);
+ void set(uchar val[sizeof(uint32)]);
+
+private:
+ uchar __acValue[sizeof(uint32)]; // the integer stored as a uchar array
+ uint32 __nValue;
+}
+;
+
+#endif /* __ID3LIB_INT28_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/misc_support.h
@@ -1,0 +1,87 @@
+// $Id: misc_support.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_MISC_SUPPORT_H__
+#define __ID3LIB_MISC_SUPPORT_H__
+
+#include "tag.h"
+
+char* ID3_GetString(const ID3_Frame *, ID3_FieldID, size_t nItems = 1);
+
+// defined in 'id3_misc_support.cpp'
+// these are 'convenience functions,' to make using the library easier for the
+// most common of operations
+char* ID3_GetArtist(const ID3_Tag*);
+ID3_Frame* ID3_AddArtist(ID3_Tag*, const char*, bool replace = false);
+size_t ID3_RemoveArtists(ID3_Tag*);
+
+char* ID3_GetAlbum(const ID3_Tag*);
+ID3_Frame* ID3_AddAlbum(ID3_Tag*, const char*, bool replace = false);
+size_t ID3_RemoveAlbums(ID3_Tag*);
+
+char* ID3_GetTitle(const ID3_Tag*);
+ID3_Frame* ID3_AddTitle(ID3_Tag*, const char*, bool replace = false);
+size_t ID3_RemoveTitles(ID3_Tag*);
+
+char* ID3_GetYear(const ID3_Tag*);
+ID3_Frame* ID3_AddYear(ID3_Tag*, const char*, bool replace = false);
+size_t ID3_RemoveYears(ID3_Tag*);
+
+char* ID3_GetComment(const ID3_Tag*);
+ID3_Frame* ID3_AddComment(ID3_Tag *, const char*,
+ const char* desc = "", bool replace = false);
+size_t ID3_RemoveComments(ID3_Tag*, const char * = NULL);
+
+char* ID3_GetTrack(const ID3_Tag*);
+size_t ID3_GetTrackNum(const ID3_Tag*);
+ID3_Frame* ID3_AddTrack(ID3_Tag*, uchar ucTrack, uchar ucTotal = 0,
+ bool replace = false);
+ID3_Frame* ID3_AddTrack(ID3_Tag*, uchar ucTrack, bool replace);
+size_t ID3_RemoveTracks(ID3_Tag*);
+
+char* ID3_GetGenre(const ID3_Tag*);
+size_t ID3_GetGenreNum(const ID3_Tag*);
+ID3_Frame* ID3_AddGenre(ID3_Tag*, size_t ucGenre, bool replace = false);
+size_t ID3_RemoveGenres(ID3_Tag*);
+
+char* ID3_GetLyrics(const ID3_Tag*);
+ID3_Frame* ID3_AddLyrics(ID3_Tag*, const char *, bool replace = false);
+size_t ID3_RemoveLyrics(ID3_Tag*);
+
+char* ID3_GetLyricist(const ID3_Tag*);
+ID3_Frame* ID3_AddLyricist(ID3_Tag *, const char *, bool replace = false);
+size_t ID3_RemoveLyricist(ID3_Tag*);
+
+ID3_Frame* ID3_AddSyncLyrics(ID3_Tag *tag, const char *lang, const char *desc,
+ const uchar *text, size_t textsize,
+ bool bReplace = false);
+ID3_Frame* ID3_GetSyncLyricsInfo(const ID3_Tag *tag, const char *lang,
+ const char *desc, char &stampformat,
+ char &type, size_t &size);
+ID3_Frame* ID3_GetSyncLyrics(const ID3_Tag *tag, const char *lang,
+ const char *desc, char *pData, size_t &size);
+
+#endif /* __ID3LIB_MISC_SUPPORT_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/sized_types.h
@@ -1,0 +1,86 @@
+/* $Id: sized_types.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+ * id3lib: a C++ library for creating and manipulating id3v1/v2 tags Copyright
+ * 1999, 2000 Scott Thomas Haug
+
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ * The id3lib authors encourage improvements and optimisations to be sent to
+ * the id3lib coordinator. Please see the README file for details on where to
+ * send such submissions. See the AUTHORS file for a list of people who have
+ * contributed to id3lib. See the ChangeLog file for a list of changes to
+ * id3lib. These files are distributed with id3lib at
+ * http://download.sourceforge.net/id3lib/
+ */
+
+/**
+ ** This file defines size-specific typedefs based on the macros defined in
+ ** limits.h
+ **/
+
+#ifndef __SIZED_TYPES_H__
+#define __SIZED_TYPES_H__
+
+#include <limits.h>
+
+/* define our datatypes */
+
+/* Define 8-bit types */
+#if UCHAR_MAX == 0xff
+
+typedef unsigned char uint8;
+typedef signed char int8;
+
+#else
+#error This machine has no 8-bit type
+#endif /* UCHAR_MAX == 0xff */
+
+/* Define 16-bit types */
+#if UINT_MAX == 0xffff
+
+typedef unsigned int uint16;
+typedef int int16;
+
+#elif USHRT_MAX == 0xffff
+
+typedef unsigned short uint16;
+typedef short int16;
+
+#else
+#error This machine has no 16-bit type
+#endif /* UINT_MAX == 0xffff */
+
+/* Define 32-bit types */
+#if UINT_MAX == 0xfffffffful
+
+typedef unsigned int uint32;
+typedef int int32;
+
+#elif ULONG_MAX == 0xfffffffful
+
+typedef unsigned long uint32;
+typedef long int32;
+
+#elif USHRT_MAX == 0xfffffffful
+
+typedef unsigned short uint32;
+typedef short int32;
+
+#else
+#error This machine has no 32-bit type
+#endif /* UINT_MAX == 0xfffffffful */
+
+#endif /* __SIZED_TYPES_H__ */
+
--- /dev/null
+++ b/common/id3lib/include/id3/spec.h
@@ -1,0 +1,57 @@
+// $Id: spec.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a software library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_SPEC_H__
+#define __ID3LIB_SPEC_H__
+
+#include "globals.h"
+
+ID3_V2Spec ID3_VerRevToV2Spec(uchar ver, uchar rev);
+uchar ID3_V2SpecToVer(ID3_V2Spec spec);
+uchar ID3_V2SpecToRev(ID3_V2Spec spec);
+
+class ID3_Speccable
+{
+public:
+ virtual bool SetSpec(ID3_V2Spec) = 0;
+ virtual ID3_V2Spec GetSpec() const = 0;
+
+ /* The following methods are deprecated */
+ virtual bool SetVersion(uchar ver, uchar rev)
+ {
+ return this->SetSpec(ID3_VerRevToV2Spec(ver, rev));
+ }
+ virtual uchar GetVersion() const
+ {
+ return ID3_V2SpecToVer(this->GetSpec());
+ }
+ virtual uchar GetRevision() const
+ {
+ return ID3_V2SpecToRev(this->GetSpec());
+ }
+};
+
+#endif /* __ID3LIB_SPEC_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/tag.h
@@ -1,0 +1,169 @@
+// $Id: tag.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a software library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_TAG_H__
+#define __ID3LIB_TAG_H__
+
+#include <stdio.h>
+#include "header_tag.h"
+#include "frame.h"
+#include "spec.h"
+
+struct ID3_Elem
+{
+ virtual ~ID3_Elem() { if (pFrame) { delete pFrame; } }
+ ID3_Elem *pNext;
+ ID3_Frame *pFrame;
+};
+
+/** String used for the description field of a comment tag converted from an
+ ** id3v1 tag to an id3v2 tag
+ **
+ ** \sa #ID3V1_Tag
+ **/
+//const char STR_V1_COMMENT_DESC[] = "ID3v1_Comment";
+const char STR_V1_COMMENT_DESC[] = "";
+
+class ID3_Tag : public ID3_Speccable
+{
+public:
+ ID3_Tag(const char *name = NULL);
+ ID3_Tag(const ID3_Tag &tag);
+ virtual ~ID3_Tag();
+
+ void Clear();
+ bool HasChanged() const;
+ size_t Size() const;
+
+ bool SetUnsync(bool bSync);
+ bool SetExtendedHeader(bool bExt);
+ bool SetPadding(bool bPad);
+
+ void AddFrame(const ID3_Frame&);
+ void AddFrame(const ID3_Frame*);
+ void AttachFrame(ID3_Frame*);
+ ID3_Frame* RemoveFrame(const ID3_Frame *);
+
+ size_t Parse(const uchar*, size_t);
+ size_t Parse(const uchar header[ID3_TAGHEADERSIZE], const uchar *buffer);
+ size_t Render(uchar*) const;
+ size_t Render(uchar*, ID3_TagType) const;
+ size_t RenderV1(uchar*) const;
+
+ size_t Link(const char *fileInfo, flags_t = (flags_t) ID3TT_ALL);
+ flags_t Update(flags_t = (flags_t) ID3TT_ID3V2);
+ flags_t Strip(flags_t = (flags_t) ID3TT_ALL);
+
+ /// Finds frame with given frame id
+ ID3_Frame* Find(ID3_FrameID id) const;
+
+ /// Finds frame with given frame id, fld id, and integer data
+ ID3_Frame* Find(ID3_FrameID id, ID3_FieldID fld, uint32 data) const;
+
+ /// Finds frame with given frame id, fld id, and ascii data
+ ID3_Frame* Find(ID3_FrameID id, ID3_FieldID fld, const char *) const;
+
+ /// Finds frame with given frame id, fld id, and unicode data
+ ID3_Frame* Find(ID3_FrameID id, ID3_FieldID fld, const unicode_t *) const;
+
+ /** Returns the number of frames present in the tag object.
+ **
+ ** This includes only those frames that id3lib recognises. This is used as
+ ** the upper bound on calls to the GetFrame() and operator[]() methods.
+ **
+ ** \return The number of frames present in the tag object.
+ **/
+ size_t NumFrames() const { return __num_frames; }
+ ID3_Frame* GetFrameNum(index_t) const;
+ ID3_Frame* operator[](index_t) const;
+ ID3_Tag& operator=( const ID3_Tag & );
+
+ bool GetUnsync() const { return __hdr.GetUnsync(); }
+
+ bool HasTagType(uint16 tt) const { return __file_tags.test(tt); }
+ ID3_V2Spec GetSpec() const;
+
+ static size_t IsV2Tag(const uchar*);
+
+ /* Deprecated! */
+ void AddNewFrame(ID3_Frame* f) { this->AttachFrame(f); }
+ size_t Link(const char *fileInfo, bool parseID3v1, bool parseLyrics3);
+ void SetCompression(bool) { ; }
+ void AddFrames(const ID3_Frame *, size_t);
+ bool HasLyrics() const { return this->HasTagType(ID3TT_LYRICS); }
+ bool HasV2Tag() const { return this->HasTagType(ID3TT_ID3V2); }
+ bool HasV1Tag() const { return this->HasTagType(ID3TT_ID3V1); }
+
+protected:
+ bool SetSpec(ID3_V2Spec);
+
+ ID3_Elem* Find(const ID3_Frame *) const;
+ size_t PaddingSize(size_t) const;
+
+ void RenderExtHeader(uchar *);
+ ID3_Err OpenFileForWriting();
+ ID3_Err OpenFileForReading();
+ ID3_Err CreateFile();
+ bool CloseFile();
+
+ void RenderV1ToHandle();
+ void RenderV2ToHandle();
+ size_t ParseFromHandle();
+ void ParseID3v1();
+ void ParseLyrics3();
+
+private:
+ ID3_TagHeader __hdr; // information relevant to the tag header
+ bool __is_padded; // add padding to tags?
+
+ ID3_Elem* __frames; // frames attached to the tag
+ size_t __num_frames; // the current number of frames
+
+ mutable ID3_Elem* __cursor; // which frame in list are we at
+ mutable bool __changed; // has tag changed since last parse or render?
+
+ // file-related member variables
+ char* __file_name; // name of the file we are linked to
+ FILE* __file_handle; // a handle to the file we are linked to
+ size_t __file_size; // the size of the file (without any tag(s))
+ size_t __starting_bytes; // number of tag bytes at start of file
+ size_t __ending_bytes; // number of tag bytes at end of file
+ bool __is_file_writable;// is the associated file (via Link) writable?
+ ID3_Flags __tags_to_parse; // which tag types should attempt to be parsed
+ ID3_Flags __file_tags; // which tag types does the file contain
+};
+
+//@{
+/// Copies
+ID3_Tag& operator<<(ID3_Tag&, const ID3_Frame &);
+/// Attaches a pointer to a frame
+ID3_Tag& operator<<(ID3_Tag&, const ID3_Frame *);
+//@}
+
+// deprecated!
+int32 ID3_IsTagHeader(const uchar header[ID3_TAGHEADERSIZE]);
+
+#endif /* __ID3LIB_TAG_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/uint28.h
@@ -1,0 +1,74 @@
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// $Id: uint28.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_UINT28_H__
+#define __ID3LIB_UINT28_H__
+
+#include "globals.h"
+#include <iostream.h>
+
+class uint28
+{
+ uint32 __value;
+public:
+ uint28(uint32 val = 0) : __value(val) { ; }
+ uint28(const uchar* const data) { *this = data; }
+ uint28(const uint28& rhs) : __value(rhs.to_uint32()) { ; }
+ ~uint28() { ; }
+
+ uint28& operator=(const uchar* const);
+
+ uint28& operator=(uint32 val)
+ {
+ __value = val & MASK(28);
+ return *this;
+ }
+
+ uint28& operator=(const uint28& rhs)
+ {
+ if (this != &rhs)
+ {
+ __value = rhs.to_uint32();
+ }
+ return *this;
+ }
+
+ uint32 to_uint32() const
+ {
+ return __value;
+ }
+
+ size_t Parse(const uchar* const data)
+ {
+ *this = data;
+ return sizeof(uint32);
+ }
+
+ void Render(uchar*) const;
+};
+
+ostream& operator<<(ostream&, const uint28&);
+istream& operator>>(istream&, uint28&);
+
+#endif /* __ID3LIB_UINT28_H__ */
--- /dev/null
+++ b/common/id3lib/include/id3/utils.h
@@ -1,0 +1,57 @@
+// $Id: utils.h,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#ifndef __ID3LIB_UTILS_H__
+#define __ID3LIB_UTILS_H__
+
+#include "globals.h"
+
+#if defined ID3_UNDEFINED
+namespace id3
+{
+#endif /* ID3_UNDEFINED */
+ uint32 ParseNumber(const uchar *buffer, size_t size = sizeof(uint32));
+ size_t RenderNumber(uchar *buffer, uint32 val, size_t size = sizeof(uint32));
+
+ void mbstoucs(unicode_t *unicode, const char *ascii, const size_t len);
+ void ucstombs(char *ascii, const unicode_t *unicode, const size_t len);
+ size_t ucslen(const unicode_t *unicode);
+ void ucscpy(unicode_t *dest, const unicode_t *src);
+ void ucsncpy(unicode_t *dest, const unicode_t *src, size_t len);
+ int ucscmp(const unicode_t *s1, const unicode_t *s2);
+ int ucsncmp(const unicode_t *s1, const unicode_t *s2, size_t len);
+
+ // these can be utility functions
+ size_t ID3_GetUnSyncSize(uchar *, size_t);
+ void ID3_UnSync(uchar *, size_t, const uchar *, size_t);
+ size_t ID3_ReSync(uchar *, size_t);
+
+#if defined ID3_UNDEFINED
+}
+#endif /* ID3_UNDEFINED */
+
+
+#endif /* __ID3LIB_UTILS_H__ */
--- /dev/null
+++ b/common/id3lib/install-sh
@@ -1,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
--- /dev/null
+++ b/common/id3lib/libprj/.cvsignore
@@ -1,0 +1,1 @@
+Makefile
--- /dev/null
+++ b/common/id3lib/libprj/Makefile.am
@@ -1,0 +1,13 @@
+# Copyright 2000 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+EXTRA_DIST = id3lib.dsp id3lib.dsw
+
+
--- /dev/null
+++ b/common/id3lib/libprj/id3lib.dsp
@@ -1,0 +1,276 @@
+# Microsoft Developer Studio Project File - Name="id3lib" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=id3lib - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "id3lib.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "id3lib.mak" CFG="id3lib - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "id3lib - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "id3lib - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath "Desktop"
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "id3lib - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I ".\\" /I "..\\" /I "..\include" /I "..\include\id3" /I "..\zlib\include" /I "..\win32" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_WINDOWS" /D "HAVE_CONFIG_H" /D "ID3LIB_COMPILATION" /YX /FD /c
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\id3lib.lib"
+
+!ELSEIF "$(CFG)" == "id3lib - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".\\" /I "..\\" /I "..\include" /I "..\include\id3" /I "..\zlib\include" /I "..\win32" /D "_DEBUG" /D "ID3LIB_COMPILATION" /D "WIN32" /D "_MBCS" /D "_LIB" /D "_WINDOWS" /D "HAVE_CONFIG_H" /FR /YX /FD /GZ /c
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo /out:"..\id3lib.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "id3lib - Win32 Release"
+# Name "id3lib - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\src\c_wrapper.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\error.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\field.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\field_binary.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\field_integer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\field_string_ascii.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\field_string_unicode.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\frame.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\frame_parse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\frame_render.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\globals.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\header.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\header_frame.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\header_tag.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\misc_support.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\spec.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\tag.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\tag_file.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\tag_find.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\tag_parse.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\tag_parse_lyrics3.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\tag_parse_v1.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\tag_render.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\tag_sync.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\uint28.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\utils.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE="E:\Program Files\Microsoft Visual Studio\VC98\Include\BASETSD.H"
+# End Source File
+# Begin Source File
+
+SOURCE=..\config.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\config.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\error.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\field.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\flags.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\frame.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\globals.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\header.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\header_frame.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\header_tag.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\misc_support.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\sized_types.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\spec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\tag.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\uint28.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\id3\utils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\zlib\include\zconf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\zlib\include\zlib.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null
+++ b/common/id3lib/libprj/id3lib.dsw
@@ -1,0 +1,44 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "id3lib"=".\id3lib.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name zlib
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "zlib"="..\zlib\prj\zlib.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null
+++ b/common/id3lib/libtool
@@ -1,0 +1,4235 @@
+#! /bin/sh
+
+# libtool - Provide generalized library-building support services.
+# Generated automatically by ltconfig (GNU libtool 1.3.3 (1.385.2.181 1999/07/02 15:49:11))
+# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
+#
+# Copyright (C) 1996-1999 Free Software Foundation, Inc.
+# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="sed -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
+
+### BEGIN LIBTOOL CONFIG
+# Libtool was configured as follows, on host adsl-208-190-213-110.dsl.stlsmo.swbell.net:
+#
+# CC="gcc" CFLAGS="-g -O2" CPPFLAGS="" \
+# LD="/usr/bin/ld" LDFLAGS="" LIBS="" \
+# NM="/usr/bin/nm -B" RANLIB="ranlib" LN_S="ln -s" \
+# DLLTOOL="" OBJDUMP="" AS="" \
+# ./ltconfig --with-gcc --with-gnu-ld --no-verify ./ltmain.sh i686-pc-linux-gnu
+#
+# Compiler and other test output produced by ltconfig, useful for
+# debugging ltconfig, is in ./config.log if it exists.
+
+# The version of ltconfig that generated this script.
+LTCONFIG_VERSION="1.3.3"
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/sh"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=yes
+
+# Whether or not to build static libraries.
+build_old_libs=yes
+
+# Whether or not to optimize for fast installation.
+fast_install=yes
+
+# The host system.
+host_alias=i686-pc-linux-gnu
+host=i686-pc-linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+
+# The default C compiler.
+CC="gcc"
+
+# The linker used to build libraries.
+LD="/usr/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC"
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Can we write directly to a .lo ?
+compiler_o_lo="yes"
+
+# Must we lock files when doing compilation ?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen=unknown
+
+# Whether dlopen of programs is supported.
+dlopen_self=unknown
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=unknown
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}.so\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR cru \$oldlib\$oldobjs~\$RANLIB \$oldlib"
+old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="/usr/bin/file"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW]\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=unsupported
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+### END LIBTOOL CONFIG
+
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun ltconfig.
+#
+# Copyright (C) 1996-1999 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The name of this program.
+progname=`$echo "$0" | sed 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.3.3
+TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+SP2NL='tr \040 \012'
+NL2SP='tr \015\012 \040\040'
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+ save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+ save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+if test "$LTCONFIG_VERSION" != "$VERSION"; then
+ echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+fi
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ echo "$modename: not configured to build any kind of library" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+# Parse our command line options once, thoroughly.
+while test $# -gt 0
+do
+ arg="$1"
+ shift
+
+ case "$arg" in
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case "$prev" in
+ execute_dlfiles)
+ eval "$prev=\"\$$prev \$arg\""
+ ;;
+ *)
+ eval "$prev=\$arg"
+ ;;
+ esac
+
+ prev=
+ prevopt=
+ continue
+ fi
+
+ # Have we seen a non-optional argument yet?
+ case "$arg" in
+ --help)
+ show_help=yes
+ ;;
+
+ --version)
+ echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+ exit 0
+ ;;
+
+ --config)
+ sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
+ exit 0
+ ;;
+
+ --debug)
+ echo "$progname: enabling shell trace mode"
+ set -x
+ ;;
+
+ --dry-run | -n)
+ run=:
+ ;;
+
+ --features)
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+ exit 0
+ ;;
+
+ --finish) mode="finish" ;;
+
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
+ --quiet | --silent)
+ show=:
+ ;;
+
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
+
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
+
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+fi
+
+if test -z "$show_help"; then
+
+ # Infer the operation mode.
+ if test -z "$mode"; then
+ case "$nonopt" in
+ *cc | *++ | gcc* | *-gcc*)
+ mode=link
+ for arg
+ do
+ case "$arg" in
+ -c)
+ mode=compile
+ break
+ ;;
+ esac
+ done
+ ;;
+ *db | *dbx | *strace | *truss)
+ mode=execute
+ ;;
+ *install*|cp|mv)
+ mode=install
+ ;;
+ *rm)
+ mode=uninstall
+ ;;
+ *)
+ # If we have no mode, but dlfiles were specified, then do execute mode.
+ test -n "$execute_dlfiles" && mode=execute
+
+ # Just use the default operation mode.
+ if test -z "$mode"; then
+ if test -n "$nonopt"; then
+ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+ else
+ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+ fi
+ fi
+ ;;
+ esac
+ fi
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$modename --help --mode=$mode' for more information."
+
+ # These modes are in order of execution frequency so that they run quickly.
+ case "$mode" in
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+ lastarg=
+ srcfile="$nonopt"
+ suppress_output=
+
+ user_target=no
+ for arg
+ do
+ # Accept any command-line options.
+ case "$arg" in
+ -o)
+ if test "$user_target" != "no"; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit 1
+ fi
+ user_target=next
+ ;;
+
+ -static)
+ build_old_libs=yes
+ continue
+ ;;
+ esac
+
+ case "$user_target" in
+ next)
+ # The next one is the -o target name
+ user_target=yes
+ continue
+ ;;
+ yes)
+ # We got the output file
+ user_target=set
+ libobj="$arg"
+ continue
+ ;;
+ esac
+
+ # Accept the current argument as the source file.
+ lastarg="$srcfile"
+ srcfile="$arg"
+
+ # Aesthetically quote the previous argument.
+
+ # Backslashify any backslashes, double quotes, and dollar signs.
+ # These are the only characters that are still specially
+ # interpreted inside of double-quoted scrings.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly in scan
+ # sets, so we specify it separately.
+ case "$lastarg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ # Add the previous argument to base_compile.
+ if test -z "$base_compile"; then
+ base_compile="$lastarg"
+ else
+ base_compile="$base_compile $lastarg"
+ fi
+ done
+
+ case "$user_target" in
+ set)
+ ;;
+ no)
+ # Get the name of the library object.
+ libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
+ *)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSfmso]'
+ case "$libobj" in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform=for ;;
+ esac
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+ case "$libobj" in
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+ *)
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $libobj"
+ else
+ removelist="$libobj"
+ fi
+
+ $run $rm $removelist
+ trap "$run $rm $removelist; exit 1" 1 2 15
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit 1" 1 2 15
+ else
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until ln "$0" "$lockfile" 2>/dev/null; do
+ $show "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+ echo $srcfile > "$lockfile"
+ fi
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ # All platforms use -DPIC, to notify preprocessed assembler code.
+ command="$base_compile $pic_flag -DPIC $srcfile"
+ if test "$build_old_libs" = yes; then
+ lo_libobj="$libobj"
+ dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$libobj"; then
+ dir="$objdir"
+ else
+ dir="$dir/$objdir"
+ fi
+ libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+
+ if test -d "$dir"; then
+ $show "$rm $libobj"
+ $run $rm $libobj
+ else
+ $show "$mkdir $dir"
+ $run $mkdir $dir
+ status=$?
+ if test $status -ne 0 && test ! -d $dir; then
+ exit $status
+ fi
+ fi
+ fi
+ if test "$compiler_o_lo" = yes; then
+ output_obj="$libobj"
+ command="$command -o $output_obj"
+ elif test "$compiler_c_o" = yes; then
+ output_obj="$obj"
+ command="$command -o $output_obj"
+ fi
+
+ $run $rm "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ test -n "$output_obj" && $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+ echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test x"$output_obj" != x"$libobj"; then
+ $show "$mv $output_obj $libobj"
+ if $run $mv $output_obj $libobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # If we have no pic_flag, then copy the object into place and finish.
+ if test -z "$pic_flag" && test "$build_old_libs" = yes; then
+ # Rename the .lo from within objdir to obj
+ if test -f $obj; then
+ $show $rm $obj
+ $run $rm $obj
+ fi
+
+ $show "$mv $libobj $obj"
+ if $run $mv $libobj $obj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+
+ # Now arrange that obj and lo_libobj become the same file
+ $show "$LN_S $obj $lo_libobj"
+ if $run $LN_S $obj $lo_libobj; then
+ exit 0
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Allow error messages only from the first compilation.
+ suppress_output=' >/dev/null 2>&1'
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ command="$base_compile $srcfile"
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ output_obj="$obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ $run $rm "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+ echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed
+ if test x"$output_obj" != x"$obj"; then
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we do not
+ # accidentally link it into a program.
+ if test "$build_libtool_libs" != yes; then
+ $show "echo timestamp > $libobj"
+ $run eval "echo timestamp > \$libobj" || exit $?
+ else
+ # Move the .lo from within objdir
+ $show "$mv $libobj $lo_libobj"
+ if $run $mv $libobj $lo_libobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+ fi
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $rm "$lockfile"
+ fi
+
+ exit 0
+ ;;
+
+ # libtool link mode
+ link)
+ modename="$modename: link"
+ C_compiler="$CC" # save it, to compile generated C sources
+ CC="$nonopt"
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invokation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+
+ # This is a source program that is used to create dlls on Windows
+ # Don't remove nor modify the starting and closing comments
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+ # This is a source program that is used to create import libraries
+ # on Windows for dlls which lack them. Don't remove nor modify the
+ # starting and closing comments
+# /* impgen.c starts here */
+# /* Copyright (C) 1999 Free Software Foundation, Inc.
+#
+# This file is part of GNU libtool.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# */
+#
+# #include <stdio.h> /* for printf() */
+# #include <unistd.h> /* for open(), lseek(), read() */
+# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
+# #include <string.h> /* for strdup() */
+#
+# static unsigned int
+# pe_get16 (fd, offset)
+# int fd;
+# int offset;
+# {
+# unsigned char b[2];
+# lseek (fd, offset, SEEK_SET);
+# read (fd, b, 2);
+# return b[0] + (b[1]<<8);
+# }
+#
+# static unsigned int
+# pe_get32 (fd, offset)
+# int fd;
+# int offset;
+# {
+# unsigned char b[4];
+# lseek (fd, offset, SEEK_SET);
+# read (fd, b, 4);
+# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# static unsigned int
+# pe_as32 (ptr)
+# void *ptr;
+# {
+# unsigned char *b = ptr;
+# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# int
+# main (argc, argv)
+# int argc;
+# char *argv[];
+# {
+# int dll;
+# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
+# unsigned long export_rva, export_size, nsections, secptr, expptr;
+# unsigned long name_rvas, nexp;
+# unsigned char *expdata, *erva;
+# char *filename, *dll_name;
+#
+# filename = argv[1];
+#
+# dll = open(filename, O_RDONLY|O_BINARY);
+# if (!dll)
+# return 1;
+#
+# dll_name = filename;
+#
+# for (i=0; filename[i]; i++)
+# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
+# dll_name = filename + i +1;
+#
+# pe_header_offset = pe_get32 (dll, 0x3c);
+# opthdr_ofs = pe_header_offset + 4 + 20;
+# num_entries = pe_get32 (dll, opthdr_ofs + 92);
+#
+# if (num_entries < 1) /* no exports */
+# return 1;
+#
+# export_rva = pe_get32 (dll, opthdr_ofs + 96);
+# export_size = pe_get32 (dll, opthdr_ofs + 100);
+# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
+# secptr = (pe_header_offset + 4 + 20 +
+# pe_get16 (dll, pe_header_offset + 4 + 16));
+#
+# expptr = 0;
+# for (i = 0; i < nsections; i++)
+# {
+# char sname[8];
+# unsigned long secptr1 = secptr + 40 * i;
+# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
+# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
+# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
+# lseek(dll, secptr1, SEEK_SET);
+# read(dll, sname, 8);
+# if (vaddr <= export_rva && vaddr+vsize > export_rva)
+# {
+# expptr = fptr + (export_rva - vaddr);
+# if (export_rva + export_size > vaddr + vsize)
+# export_size = vsize - (export_rva - vaddr);
+# break;
+# }
+# }
+#
+# expdata = (unsigned char*)malloc(export_size);
+# lseek (dll, expptr, SEEK_SET);
+# read (dll, expdata, export_size);
+# erva = expdata - export_rva;
+#
+# nexp = pe_as32 (expdata+24);
+# name_rvas = pe_as32 (expdata+32);
+#
+# printf ("EXPORTS\n");
+# for (i = 0; i<nexp; i++)
+# {
+# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
+# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
+# }
+#
+# return 0;
+# }
+# /* impgen.c ends here */
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ compile_command="$CC"
+ finalize_command="$CC"
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ linkopts=
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ lib_search_path=
+ fi
+ # now prepend the system-specific ones
+ eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ link_against_libtool_libs=
+ ltlibs=
+ module=no
+ objs=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case "$arg" in
+ -all-static | -static)
+ if test "X$arg" = "X-all-static"; then
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ else
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ fi
+ build_libtool_libs=no
+ build_old_libs=yes
+ prefer_static_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test $# -gt 0; do
+ arg="$1"
+ shift
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case "$prev" in
+ output)
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
+ ;;
+ esac
+
+ case "$prev" in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
+ preload=yes
+ fi
+ case "$arg" in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ if test ! -f "$arg"; then
+ $echo "$modename: symbol file \`$arg' does not exist"
+ exit 1
+ fi
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case "$arg" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi
+
+ prevarg="$arg"
+
+ case "$arg" in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+ continue
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: not more than one -exported-symbols argument allowed"
+ exit 1
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -L*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+ # We need an absolute path.
+ case "$dir" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ absdir="$dir"
+ fi
+ dir="$absdir"
+ ;;
+ esac
+ case " $deplibs " in
+ *" $arg "*) ;;
+ *) deplibs="$deplibs $arg";;
+ esac
+ case " $lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir";;
+ esac
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2*)
+ dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
+ case ":$dllsearchpath:" in
+ ::) dllsearchpath="$dllsearchdir";;
+ *":$dllsearchdir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
+ esac
+ ;;
+ esac
+ ;;
+
+ -l*)
+ if test "$arg" = "-lc"; then
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+ # These systems don't actually have c library (as such)
+ continue
+ ;;
+ esac
+ elif test "$arg" = "-lm"; then
+ case "$host" in
+ *-*-cygwin* | *-*-beos*)
+ # These systems don't actually have math library (as such)
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+ case "$dir" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -static)
+ # If we have no pic_flag, then this is the same as -all-static.
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+
+ *.o | *.obj | *.a | *.lib)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A library object.
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
+ prev=
+ fi
+ libobjs="$libobjs $arg"
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ dlname=
+ libdir=
+ library_names=
+ old_library=
+
+ # Check to see that this really is a libtool archive.
+ if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variable installed.
+ installed=yes
+
+ # Read the .la file
+ # If there is no directory component, then add one.
+ case "$arg" in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+
+ if test -z "$linklib"; then
+ $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Find the relevant object directory and library name.
+ name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
+
+ if test "X$installed" = Xyes; then
+ dir="$libdir"
+ else
+ dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$arg"; then
+ dir="$objdir"
+ else
+ dir="$dir/$objdir"
+ fi
+ fi
+
+ if test -n "$dependency_libs"; then
+ # Extract -R and -L from dependency_libs
+ temp_deplibs=
+ for deplib in $dependency_libs; do
+ case "$deplib" in
+ -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ case " $rpath $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ -L*) case "$compile_command $temp_deplibs " in
+ *" $deplib "*) ;;
+ *) temp_deplibs="$temp_deplibs $deplib";;
+ esac
+ temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ case " $lib_search_path " in
+ *" $temp_dir "*) ;;
+ *) lib_search_path="$lib_search_path $temp_dir";;
+ esac
+ ;;
+ *) temp_deplibs="$temp_deplibs $deplib";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ if test -z "$libdir"; then
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $dir/$old_library"
+ old_convenience="$old_convenience $dir/$old_library"
+ deplibs="$deplibs$dependency_libs"
+ compile_command="$compile_command $dir/$old_library$dependency_libs"
+ finalize_command="$finalize_command $dir/$old_library$dependency_libs"
+ continue
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking statically,
+ # we need to preload.
+ prev=dlprefiles
+ else
+ # We should not create a dependency on this library, but we
+ # may need any libraries it requires.
+ compile_command="$compile_command$dependency_libs"
+ finalize_command="$finalize_command$dependency_libs"
+ prev=
+ continue
+ fi
+ fi
+
+ # The library was specified with -dlpreopen.
+ if test "$prev" = dlprefiles; then
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ dlprefiles="$dlprefiles $dir/$old_library"
+ else
+ dlprefiles="$dlprefiles $dir/$linklib"
+ fi
+ prev=
+ fi
+
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ link_against_libtool_libs="$link_against_libtool_libs $arg"
+ if test -n "$shlibpath_var"; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *) temp_rpath="$temp_rpath $dir" ;;
+ esac
+ fi
+
+ # We need an absolute path.
+ case "$dir" in
+ [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ absdir="$dir"
+ fi
+ ;;
+ esac
+
+ # This is the magic to use -rpath.
+ # Skip directories that are in the system default run-time
+ # search path, unless they have been requested with -R.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+
+ lib_linked=yes
+ case "$hardcode_action" in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ compile_command="$compile_command $dir/$linklib"
+ deplibs="$deplibs $dir/$linklib"
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2*)
+ dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
+ if test -n "$dllsearchpath"; then
+ dllsearchpath="$dllsearchpath:$dllsearchdir"
+ else
+ dllsearchpath="$dllsearchdir"
+ fi
+ ;;
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case "$host" in
+ *-*-sunos*)
+ compile_shlibpath="$compile_shlibpath$dir:"
+ ;;
+ esac
+ case "$compile_command " in
+ *" -L$dir "*) ;;
+ *) compile_command="$compile_command -L$dir";;
+ esac
+ compile_command="$compile_command -l$name"
+ deplibs="$deplibs -L$dir -l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ case ":$compile_shlibpath:" in
+ *":$dir:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$dir:";;
+ esac
+ compile_command="$compile_command -l$name"
+ deplibs="$deplibs -l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+
+ relink)
+ if test "$hardcode_direct" = yes; then
+ compile_command="$compile_command $absdir/$linklib"
+ deplibs="$deplibs $absdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ case "$compile_command " in
+ *" -L$absdir "*) ;;
+ *) compile_command="$compile_command -L$absdir";;
+ esac
+ compile_command="$compile_command -l$name"
+ deplibs="$deplibs -L$absdir -l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case ":$compile_shlibpath:" in
+ *":$absdir:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$absdir:";;
+ esac
+ compile_command="$compile_command -l$name"
+ deplibs="$deplibs -l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+
+ *)
+ lib_linked=no
+ ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ $echo "$modename: configuration error: unsupported hardcode properties"
+ exit 1
+ fi
+
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes; then
+ finalize_command="$finalize_command $libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ case "$finalize_command " in
+ *" -L$libdir "*) ;;
+ *) finalize_command="$finalize_command -L$libdir";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case ":$finalize_shlibpath:" in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ case "$finalize_command " in
+ *" -L$dir "*) ;;
+ *) finalize_command="$finalize_command -L$libdir";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ fi
+ else
+ # Transform directly to old archives if we don't build new libraries.
+ if test -n "$pic_flag" && test -z "$old_library"; then
+ $echo "$modename: cannot find static library for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_command="$compile_command $dir/$linklib"
+ finalize_command="$finalize_command $dir/$linklib"
+ else
+ case "$compile_command " in
+ *" -L$dir "*) ;;
+ *) compile_command="$compile_command -L$dir";;
+ esac
+ compile_command="$compile_command -l$name"
+ case "$finalize_command " in
+ *" -L$dir "*) ;;
+ *) finalize_command="$finalize_command -L$dir";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ fi
+ fi
+
+ # Add in any libraries that this one depends upon.
+ compile_command="$compile_command$dependency_libs"
+ finalize_command="$finalize_command$dependency_libs"
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+ esac
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+ done
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+ libobjs_save="$libobjs"
+
+ case "$output" in
+ "")
+ $echo "$modename: you must specify an output file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *.a | *.lib)
+ if test -n "$link_against_libtool_libs"; then
+ $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
+ exit 1
+ fi
+
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+ fi
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ ;;
+
+ *.la)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case "$outputname" in
+ lib*)
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ if test "$module" = no; then
+ $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval libname=\"$libname_spec\"
+ else
+ libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ fi
+ ;;
+ esac
+
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
+
+ if test -n "$objs"; then
+ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
+ exit 1
+ fi
+
+ # How the heck are we supposed to write a wrapper for a shared library?
+ if test -n "$link_against_libtool_libs"; then
+ $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
+ exit 1
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
+ fi
+
+ set dummy $rpath
+ if test $# -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ libext=al
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+ dependency_libs="$deplibs"
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+ fi
+ else
+
+ # Parse the version information argument.
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ IFS="$save_ifs"
+
+ if test -n "$8"; then
+ $echo "$modename: too many parameters to \`-version-info'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ current="$2"
+ revision="$3"
+ age="$4"
+
+ # Check that each of the things are valid numbers.
+ case "$current" in
+ 0 | [1-9] | [1-9][0-9]*) ;;
+ *)
+ $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case "$revision" in
+ 0 | [1-9] | [1-9][0-9]*) ;;
+ *)
+ $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case "$age" in
+ 0 | [1-9] | [1-9][0-9]*) ;;
+ *)
+ $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test $age -gt $current; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case "$version_type" in
+ none) ;;
+
+ irix)
+ major=`expr $current - $age + 1`
+ versuffix="$major.$revision"
+ verstring="sgi$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test $loop != 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+ verstring="sgi$major.$iface:$verstring"
+ done
+ ;;
+
+ linux)
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ major=`expr $current - $age`
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test $loop != 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current";
+ ;;
+
+ windows)
+ # Like Linux, but with '-' rather than '.', since we only
+ # want one extension on Windows 95.
+ major=`expr $current - $age`
+ versuffix="-$major-$age-$revision"
+ ;;
+
+ *)
+ $echo "$modename: unknown library version type \`$version_type'" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ verstring="0.0"
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ dependency_libs="$deplibs"
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *)
+ # Add libc to deplibs on all other systems.
+ deplibs="$deplibs -lc"
+ ;;
+ esac
+ fi
+
+ # Create the output directory, or remove our outputs if we need to.
+ if test -d $output_objdir; then
+ $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
+ $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
+ else
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test $status -ne 0 && test ! -d $output_objdir; then
+ exit $status
+ fi
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ if test "$build_libtool_libs" = yes; then
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case "$deplibs_check_method" in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behaviour.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $rm conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $rm conftest
+ $C_compiler -o conftest conftest.c $deplibs
+ if test $? -eq 0 ; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ echo
+ echo "*** Warning: This library needs some functionality provided by $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+ # Error occured in the first compile. Let's try to salvage the situation:
+ # Compile a seperate program for each library.
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" ; then
+ $rm conftest
+ $C_compiler -o conftest conftest.c $i
+ # Did it work?
+ if test $? -eq 0 ; then
+ ldd_output=`ldd conftest`
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ echo
+ echo "*** Warning: This library needs some functionality provided by $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ droppeddeps=yes
+ echo
+ echo "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null \
+ | grep " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | sed 's/.* -> //'`
+ case "$potliblink" in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+ | sed 10q \
+ | egrep "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ echo "*** Warning: This library needs some functionality provided by $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
+ grep . >/dev/null; then
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ echo "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ # Get the real and link names of the library.
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ lib="$output_objdir/$realname"
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Ensure that we have .o objects for linkers which dislike .lo
+ # (e.g. aix) incase we are running --disable-static
+ for obj in $libobjs; do
+ oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
+ if test ! -f $oldobj; then
+ $show "${LN_S} $obj $oldobj"
+ $run ${LN_S} $obj $oldobj || exit $?
+ fi
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ eval cmds=\"$export_symbols_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex"; then
+ $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$mv "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+ fi
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "mkdir $gentop"
+ $run mkdir "$gentop"
+ status=$?
+ if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case "$xlib" in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "mkdir $xdir"
+ $run mkdir "$xdir"
+ status=$?
+ if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+ libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linkopts="$linkopts $flag"
+ fi
+
+ # Do each of the archive commands.
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
+ eval cmds=\"$archive_cmds\"
+ fi
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ *.lo | *.o | *.obj)
+ if test -n "$link_against_libtool_libs"; then
+ $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
+ exit 1
+ fi
+
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+ fi
+
+ case "$output" in
+ *.lo)
+ if test -n "$objs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit 1
+ fi
+ libobj="$output"
+ obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $run $rm $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${obj}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "mkdir $gentop"
+ $run mkdir "$gentop"
+ status=$?
+ if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case "$xlib" in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "mkdir $xdir"
+ $run mkdir "$xdir"
+ status=$?
+ if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+ reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
+
+ output="$obj"
+ eval cmds=\"$reload_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ $show "echo timestamp > $libobj"
+ $run eval "echo timestamp > $libobj" || exit $?
+ exit 0
+ fi
+
+ if test -n "$pic_flag"; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ eval cmds=\"$reload_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ else
+ # Just create a symlink.
+ $show $rm $libobj
+ $run $rm $libobj
+ $show "$LN_S $obj $libobj"
+ $run $LN_S $obj $libobj || exit $?
+ fi
+
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ ;;
+
+ # Anything else should be a program.
+ *)
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+ fi
+
+ if test "$preload" = yes; then
+ if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+ fi
+ fi
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$compile_rpath " in
+ *" $libdir "*) ;;
+ *) compile_rpath="$compile_rpath $libdir" ;;
+ esac
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
+
+ # Create the binary in the object directory, then wrap it.
+ if test ! -d $output_objdir; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test $status -ne 0 && test ! -d $output_objdir; then
+ exit $status
+ fi
+ fi
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ dlsyms=
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ dlsyms="${outputname}S.c"
+ else
+ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+ fi
+ fi
+
+ if test -n "$dlsyms"; then
+ case "$dlsyms" in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${outputname}.nm"
+
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+ # Parse the name list into a source file.
+ $show "creating $output_objdir/$dlsyms"
+
+ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ $show "generating symbol list for \`$output'"
+
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$output.exp"
+ $run $rm $export_symbols
+ $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+ $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+ fi
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+ name=`echo "$arg" | sed -e 's%^.*/%%'`
+ $run eval 'echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -z "$run"; then
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $mv "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$dlsyms"
+ fi
+
+ $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+ sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
+ -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
+ < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ {0, (lt_ptr_t) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ fi
+
+ pic_flag_for_symtable=
+ case "$host" in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+ # Transform the symbol file into the correct name.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit 1
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+ if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ $show "$link_command"
+ $run eval "$link_command"
+ status=$?
+
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
+ fi
+
+ exit $status
+ fi
+
+ if test -n "$shlibpath_var"; then
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+ case "$dir" in
+ [\\/]* | [A-Za-z]:[\\/]*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+ ;;
+ *)
+ # Relative path: add a thisdir entry.
+ rpath="$rpath\$thisdir/$dir:"
+ ;;
+ esac
+ done
+ temp_rpath="$rpath"
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+ $echo "$modename: \`$output' will be relinked during installation" 1>&2
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+
+ # Now create the wrapper script.
+ $show "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $echo for shipping.
+ if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+ case "$0" in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+ esac
+ qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if our run command is non-null.
+ if test -z "$run"; then
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
+ esac
+ $rm $output
+ trap "$rm $output; exit 1" 1 2 15
+
+ $echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variable:
+ link_against_libtool_libs='$link_against_libtool_libs'
+else
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ echo=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$echo will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $echo >> $output "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ echo >> $output "\
+ program=lt-'$outputname'
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$file\"
+ fi"
+
+ echo >> $output "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if (cd \"\$thisdir\" && eval \$relink_command); then :
+ else
+ $rm \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $rm \"\$progdir/\$program\";
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $rm \"\$progdir/\$file\"
+ fi"
+ else
+ echo >> $output "\
+ program='$outputname$exeext'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ echo >> $output "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $echo >> $output "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ *-*-cygwin* | *-*-mingw | *-*-os2*)
+ # win32 systems need to use the prog path for dll
+ # lookup to work
+ $echo >> $output "\
+ exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+ ;;
+ *)
+ $echo >> $output "\
+ # Export the path to the program.
+ PATH=\"\$progdir:\$PATH\"
+ export PATH
+
+ exec \$program \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $echo >> $output "\
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+ \$echo \"This script is just a wrapper for \$program.\" 1>&2
+ echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+ chmod +x $output
+ fi
+ exit 0
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "mkdir $gentop"
+ $run mkdir "$gentop"
+ status=$?
+ if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ # Add in members from convenience archives.
+ for xlib in $addlibs; do
+ # Extract the objects.
+ case "$xlib" in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "mkdir $xdir"
+ $run mkdir "$xdir"
+ status=$?
+ if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+ oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ eval cmds=\"$old_archive_from_new_cmds\"
+ else
+ # Ensure that we have .o objects in place incase we decided
+ # not to build a shared library, and have fallen back to building
+ # static libs even though --disable-static was passed!
+ for oldobj in $oldobjs; do
+ if test ! -f $oldobj; then
+ obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
+ $show "${LN_S} $obj $oldobj"
+ $run ${LN_S} $obj $oldobj || exit $?
+ fi
+ done
+
+ eval cmds=\"$old_archive_cmds\"
+ fi
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$generated"; then
+ $show "${rm}r$generated"
+ $run ${rm}r$generated
+ fi
+
+ # Now create the libtool archive.
+ case "$output" in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ $show "creating $output"
+
+ if test -n "$xrpath"; then
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ done
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+
+ # Only create the output if not a dry run.
+ if test -z "$run"; then
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ fi
+ $rm $output
+ $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$dlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'\
+"
+ done
+ fi
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
+ ;;
+ esac
+ exit 0
+ ;;
+
+ # libtool install mode
+ install)
+ modename="$modename: install"
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
+ # Aesthetically quote it.
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$arg "
+ arg="$1"
+ shift
+ else
+ install_prog=
+ arg="$nonopt"
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog$arg"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest="$arg"
+ continue
+ fi
+
+ case "$arg" in
+ -d) isdir=yes ;;
+ -f) prev="-f" ;;
+ -g) prev="-g" ;;
+ -m) prev="-m" ;;
+ -o) prev="-o" ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*) ;;
+
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest="$arg"
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog $arg"
+ done
+
+ if test -z "$install_prog"; then
+ $echo "$modename: you must specify an install program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ $echo "$modename: no file or destination specified" 1>&2
+ else
+ $echo "$modename: you must specify a destination" 1>&2
+ fi
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Strip any trailing slash from the destination.
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$destdir" = "X$dest" && destdir=.
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+ if test $# -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ fi
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case "$file" in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case "$file" in
+ *.a | *.lib)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ library_names=
+ old_library=
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+ realname="$2"
+ shift
+ shift
+
+ # Install the shared library and build the symlinks.
+ $show "$install_prog $dir/$realname $destdir/$realname"
+ $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
+
+ if test $# -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ for linkname
+ do
+ if test "$linkname" != "$realname"; then
+ $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ fi
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ eval cmds=\"$postinstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Install the pseudo-library for information purposes.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ instname="$dir/$name"i
+ $show "$install_prog $instname $destdir/$name"
+ $run eval "$install_prog $instname $destdir/$name" || exit $?
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case "$destfile" in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+ ;;
+ *.o | *.obj)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ if test -n "$destfile"; then
+ $show "$install_prog $file $destfile"
+ $run eval "$install_prog $file $destfile" || exit $?
+ fi
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+ $show "$install_prog $staticobj $staticdest"
+ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ fi
+ exit 0
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Do a test to see if this is really a libtool program.
+ if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ link_against_libtool_libs=
+ relink_command=
+
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$link_against_libtool_libs"; then
+ $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
+ exit 1
+ fi
+
+ finalize=yes
+ for lib in $link_against_libtool_libs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ # If there is no directory component, then add one.
+ case "$lib" in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+ libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir="/tmp"
+ test -n "$TMPDIR" && tmpdir="$TMPDIR"
+ tmpdir="$tmpdir/libtool-$$"
+ if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
+ else
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ ${rm}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ $echo "$modename: warning: cannot relink \`$file'" 1>&2
+ fi
+ else
+ # Install the binary that we compiled earlier.
+ file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ $show "$install_prog$stripme $file $destfile"
+ $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+ test -n "$outputname" && ${rm}r "$tmpdir"
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
+ # Do each command in the postinstall commands.
+ eval cmds=\"$old_postinstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$future_libdirs"; then
+ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+ fi
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+ exec $SHELL $0 --finish$current_libdirs
+ exit 1
+ fi
+
+ exit 0
+ ;;
+
+ # libtool finish mode
+ finish)
+ modename="$modename: finish"
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ eval cmds=\"$finish_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || admincmds="$admincmds
+ $cmd"
+ done
+ IFS="$save_ifs"
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $run eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ test "$show" = : && exit 0
+
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ echo " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ echo " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ echo " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+ echo "See any operating system documentation about shared libraries for"
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ echo "----------------------------------------------------------------------"
+ exit 0
+ ;;
+
+ # libtool execute mode
+ execute)
+ modename="$modename: execute"
+
+ # The first argument is the command name.
+ cmd="$nonopt"
+ if test -z "$cmd"; then
+ $echo "$modename: you must specify a COMMAND" 1>&2
+ $echo "$help"
+ exit 1
+ fi
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ if test ! -f "$file"; then
+ $echo "$modename: \`$file' is not a file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ dir=
+ case "$file" in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit 1
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ ;;
+
+ *)
+ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case "$file" in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+ args="$args \"$file\""
+ done
+
+ if test -z "$run"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+
+ # Restore saved enviroment variables
+ if test "${save_LC_ALL+set}" = set; then
+ LC_ALL="$save_LC_ALL"; export LC_ALL
+ fi
+ if test "${save_LANG+set}" = set; then
+ LANG="$save_LANG"; export LANG
+ fi
+
+ # Now actually exec the command.
+ eval "exec \$cmd$args"
+
+ $echo "$modename: cannot exec \$cmd$args"
+ exit 1
+ else
+ # Display what would be done.
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ $echo "$cmd$args"
+ exit 0
+ fi
+ ;;
+
+ # libtool uninstall mode
+ uninstall)
+ modename="$modename: uninstall"
+ rm="$nonopt"
+ files=
+
+ for arg
+ do
+ case "$arg" in
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ if test -z "$rm"; then
+ $echo "$modename: you must specify an RM program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ rmfiles="$file"
+
+ case "$name" in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $dir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
+
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
+
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ eval cmds=\"$postuninstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ eval cmds=\"$old_postuninstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ done
+ IFS="$save_ifs"
+ fi
+
+ # FIXME: should reinstall the best remaining shared library.
+ fi
+ ;;
+
+ *.lo)
+ if test "$build_old_libs" = yes; then
+ oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
+ rmfiles="$rmfiles $dir/$oldobj"
+ fi
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
+ ;;
+
+ *)
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
+ ;;
+ esac
+ done
+ exit 0
+ ;;
+
+ "")
+ $echo "$modename: you must specify a MODE" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+fi # test -z "$show_help"
+
+# We need to display help for each of the modes.
+case "$mode" in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+-n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --finish same as \`--mode=finish'
+ --help display this help message and exit
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
+ --version print version information
+
+MODE must be one of the following:
+
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE."
+ exit 0
+ ;;
+
+compile)
+ $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -static always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+execute)
+ $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+finish)
+ $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+install)
+ $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+link)
+ $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -static do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+uninstall)
+ $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+*)
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+esac
+
+echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
--- /dev/null
+++ b/common/id3lib/ltconfig
@@ -1,0 +1,3017 @@
+#! /bin/sh
+
+# ltconfig - Create a system-specific libtool.
+# Copyright (C) 1996-1999 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A lot of this script is taken from autoconf-2.10.
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+echo=echo
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec "$SHELL" "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# Find the correct PATH separator. Usually this is `:', but
+# DJGPP uses `;' like DOS.
+if test "X${PATH_SEPARATOR+set}" != "Xset"; then
+ UNAME=${UNAME-`uname 2>/dev/null`}
+ case X$UNAME in
+ *-DOS) PATH_SEPARATOR=';' ;;
+ *) PATH_SEPARATOR=':' ;;
+ esac
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
+
+if test "X${echo_test_string+set}" != "Xset"; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
+ test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
+ for dir in $PATH /usr/ucb; do
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running ltconfig again with it.
+ ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ echo='printf "%s\n"'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
+ test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
+ CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
+ test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# The name of this program.
+progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
+
+# Constants:
+PROGRAM=ltconfig
+PACKAGE=libtool
+VERSION=1.3.3
+TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
+rm="rm -f"
+
+help="Try \`$progname --help' for more information."
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+enable_shared=yes
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+enable_static=yes
+enable_fast_install=yes
+enable_dlopen=unknown
+enable_win32_dll=no
+ltmain=
+silent=
+srcdir=
+ac_config_guess=
+ac_config_sub=
+host=
+nonopt=
+ofile="$default_ofile"
+verify_host=yes
+with_gcc=no
+with_gnu_ld=no
+need_locks=yes
+ac_ext=c
+objext=o
+libext=a
+exeext=
+cache_file=
+
+old_AR="$AR"
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+old_CPPFLAGS="$CPPFLAGS"
+old_LDFLAGS="$LDFLAGS"
+old_LD="$LD"
+old_LN_S="$LN_S"
+old_LIBS="$LIBS"
+old_NM="$NM"
+old_RANLIB="$RANLIB"
+old_DLLTOOL="$DLLTOOL"
+old_OBJDUMP="$OBJDUMP"
+old_AS="$AS"
+
+# Parse the command line options.
+args=
+prev=
+for option
+do
+ case "$option" in
+ -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ eval "$prev=\$option"
+ prev=
+ continue
+ fi
+
+ case "$option" in
+ --help) cat <<EOM
+Usage: $progname [OPTION]... [HOST [LTMAIN]]
+
+Generate a system-specific libtool script.
+
+ --debug enable verbose shell tracing
+ --disable-shared do not build shared libraries
+ --disable-static do not build static libraries
+ --disable-fast-install do not optimize for fast installation
+ --enable-dlopen enable dlopen support
+ --enable-win32-dll enable building dlls on win32 hosts
+ --help display this help and exit
+ --no-verify do not verify that HOST is a valid host type
+-o, --output=FILE specify the output file [default=$default_ofile]
+ --quiet same as \`--silent'
+ --silent do not print informational messages
+ --srcdir=DIR find \`config.guess' in DIR
+ --version output version information and exit
+ --with-gcc assume that the GNU C compiler will be used
+ --with-gnu-ld assume that the C compiler uses the GNU linker
+ --disable-lock disable file locking
+ --cache-file=FILE configure cache file
+
+LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
+that provides basic libtool functionality.
+
+HOST is the canonical host system name [default=guessed].
+EOM
+ exit 0
+ ;;
+
+ --debug)
+ echo "$progname: enabling shell trace mode"
+ set -x
+ ;;
+
+ --disable-shared) enable_shared=no ;;
+
+ --disable-static) enable_static=no ;;
+
+ --disable-fast-install) enable_fast_install=no ;;
+
+ --enable-dlopen) enable_dlopen=yes ;;
+
+ --enable-win32-dll) enable_win32_dll=yes ;;
+
+ --quiet | --silent) silent=yes ;;
+
+ --srcdir) prev=srcdir ;;
+ --srcdir=*) srcdir="$optarg" ;;
+
+ --no-verify) verify_host=no ;;
+
+ --output | -o) prev=ofile ;;
+ --output=*) ofile="$optarg" ;;
+
+ --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
+
+ --with-gcc) with_gcc=yes ;;
+ --with-gnu-ld) with_gnu_ld=yes ;;
+
+ --disable-lock) need_locks=no ;;
+
+ --cache-file=*) cache_file="$optarg" ;;
+
+ -*)
+ echo "$progname: unrecognized option \`$option'" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *)
+ if test -z "$ltmain"; then
+ ltmain="$option"
+ elif test -z "$host"; then
+# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
+# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
+# echo "$progname: warning \`$option' is not a valid host type" 1>&2
+# fi
+ host="$option"
+ else
+ echo "$progname: too many arguments" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi ;;
+ esac
+done
+
+if test -z "$ltmain"; then
+ echo "$progname: you must specify a LTMAIN file" 1>&2
+ echo "$help" 1>&2
+ exit 1
+fi
+
+if test ! -f "$ltmain"; then
+ echo "$progname: \`$ltmain' does not exist" 1>&2
+ echo "$help" 1>&2
+ exit 1
+fi
+
+# Quote any args containing shell metacharacters.
+ltconfig_args=
+for arg
+do
+ case "$arg" in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ltconfig_args="$ltconfig_args '$arg'" ;;
+ *) ltconfig_args="$ltconfig_args $arg" ;;
+ esac
+done
+
+# A relevant subset of AC_INIT.
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 5 compiler messages saved in config.log
+# 6 checking for... messages and results
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>>./config.log
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+
+if test -n "$cache_file" && test -r "$cache_file"; then
+ echo "loading cache $cache_file within ltconfig"
+ . $cache_file
+fi
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+if test -z "$srcdir"; then
+ # Assume the source directory is the same one as the path to LTMAIN.
+ srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
+ test "$srcdir" = "$ltmain" && srcdir=.
+fi
+
+trap "$rm conftest*; exit 1" 1 2 15
+if test "$verify_host" = yes; then
+ # Check for config.guess and config.sub.
+ ac_aux_dir=
+ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/config.guess; then
+ ac_aux_dir=$ac_dir
+ break
+ fi
+ done
+ if test -z "$ac_aux_dir"; then
+ echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi
+ ac_config_guess=$ac_aux_dir/config.guess
+ ac_config_sub=$ac_aux_dir/config.sub
+
+ # Make sure we can run config.sub.
+ if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
+ else
+ echo "$progname: cannot run $ac_config_sub" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi
+
+ echo $ac_n "checking host system type""... $ac_c" 1>&6
+
+ host_alias=$host
+ case "$host_alias" in
+ "")
+ if host_alias=`$SHELL $ac_config_guess`; then :
+ else
+ echo "$progname: cannot guess host type; you must specify one" 1>&2
+ echo "$help" 1>&2
+ exit 1
+ fi ;;
+ esac
+ host=`$SHELL $ac_config_sub $host_alias`
+ echo "$ac_t$host" 1>&6
+
+ # Make sure the host verified.
+ test -z "$host" && exit 1
+
+elif test -z "$host"; then
+ echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
+ echo "$help" 1>&2
+ exit 1
+else
+ host_alias=$host
+fi
+
+# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+case "$host_os" in
+linux-gnu*) ;;
+linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+esac
+
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+case "$host_os" in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "${COLLECT_NAMES+set}" != set; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR cru $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+# Set a sane default for `AR'.
+test -z "$AR" && AR=ar
+
+# Set a sane default for `OBJDUMP'.
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+# If RANLIB is not set, then run the test.
+if test "${RANLIB+set}" != "set"; then
+ result=no
+
+ echo $ac_n "checking for ranlib... $ac_c" 1>&6
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then
+ RANLIB="ranlib"
+ result="ranlib"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+
+ echo "$ac_t$result" 1>&6
+fi
+
+if test -n "$RANLIB"; then
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+fi
+
+# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$AS" && AS=as
+
+# Check to see if we are using GCC.
+if test "$with_gcc" != yes || test -z "$CC"; then
+ # If CC is not set, then try to find GCC or a usable CC.
+ if test -z "$CC"; then
+ echo $ac_n "checking for gcc... $ac_c" 1>&6
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
+ CC="gcc"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+
+ if test -n "$CC"; then
+ echo "$ac_t$CC" 1>&6
+ else
+ echo "$ac_t"no 1>&6
+ fi
+ fi
+
+ # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
+ if test -z "$CC"; then
+ echo $ac_n "checking for cc... $ac_c" 1>&6
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
+ cc_rejected=no
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ if test -f $dir/cc || test -f $dir/cc$ac_exeext; then
+ if test "$dir/cc" = "/usr/ucb/cc"; then
+ cc_rejected=yes
+ continue
+ fi
+ CC="cc"
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test $cc_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same name, so the bogon will be chosen
+ # first if we set CC to just the name; use the full file name.
+ shift
+ set dummy "$dir/cc" "$@"
+ shift
+ CC="$@"
+ fi
+ fi
+
+ if test -n "$CC"; then
+ echo "$ac_t$CC" 1>&6
+ else
+ echo "$ac_t"no 1>&6
+ fi
+
+ if test -z "$CC"; then
+ echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
+ exit 1
+ fi
+ fi
+
+ # Now see if the compiler is really GCC.
+ with_gcc=no
+ echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
+ echo "$progname:581: checking whether we are using GNU C" >&5
+
+ $rm conftest.c
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+ if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ with_gcc=yes
+ fi
+ $rm conftest.c
+ echo "$ac_t$with_gcc" 1>&6
+fi
+
+# Allow CC to be a program name with arguments.
+set dummy $CC
+compiler="$2"
+
+echo $ac_n "checking for object suffix... $ac_c" 1>&6
+$rm conftest*
+echo 'int i = 1;' > conftest.c
+echo "$progname:603: checking for object suffix" >& 5
+if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
+ # Append any warnings to the config.log.
+ cat conftest.err 1>&5
+
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c) ;;
+ *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
+else
+ cat conftest.err 1>&5
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+fi
+$rm conftest*
+echo "$ac_t$objext" 1>&6
+
+echo $ac_n "checking for executable suffix... $ac_c" 1>&6
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_exeext="no"
+ $rm conftest*
+ echo 'main () { return 0; }' > conftest.c
+ echo "$progname:629: checking for executable suffix" >& 5
+ if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then
+ # Append any warnings to the config.log.
+ cat conftest.err 1>&5
+
+ for ac_file in conftest.*; do
+ case $ac_file in
+ *.c | *.err | *.$objext ) ;;
+ *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;;
+ esac
+ done
+ else
+ cat conftest.err 1>&5
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ $rm conftest*
+fi
+if test "X$ac_cv_exeext" = Xno; then
+ exeext=""
+else
+ exeext="$ac_cv_exeext"
+fi
+echo "$ac_t$ac_cv_exeext" 1>&6
+
+echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
+pic_flag=
+special_shlib_compile_flags=
+wl=
+link_static_flag=
+no_builtin_flag=
+
+if test "$with_gcc" = yes; then
+ wl='-Wl,'
+ link_static_flag='-static'
+
+ case "$host_os" in
+ beos* | irix5* | irix6* | osf3* | osf4*)
+ # PIC is the default for these OSes.
+ ;;
+ aix*)
+ # Below there is a dirty hack to force normal static linking with -ldl
+ # The problem is because libdl dynamically linked with both libc and
+ # libC (AIX C++ library), which obviously doesn't included in libraries
+ # list by gcc. This cause undefined symbols with -static flags.
+ # This hack allows C programs to be linked with "-static -ldl", but
+ # we not sure about C++ programs.
+ link_static_flag="$link_static_flag ${wl}-lC"
+ ;;
+ cygwin* | mingw* | os2*)
+ # We can build DLLs from non-PIC.
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ pic_flag='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ pic_flag=-Kconform_pic
+ fi
+ ;;
+ *)
+ pic_flag='-fPIC'
+ ;;
+ esac
+else
+ # PORTME Check for PIC flags for the system compiler.
+ case "$host_os" in
+ aix3* | aix4*)
+ # All AIX code is PIC.
+ link_static_flag='-bnso -bI:/lib/syscalls.exp'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ # Is there a better link_static_flag that works with the bundled CC?
+ wl='-Wl,'
+ link_static_flag="${wl}-a ${wl}archive"
+ pic_flag='+Z'
+ ;;
+
+ irix5* | irix6*)
+ wl='-Wl,'
+ link_static_flag='-non_shared'
+ # PIC (with -KPIC) is the default.
+ ;;
+
+ cygwin* | mingw* | os2*)
+ # We can build DLLs from non-PIC.
+ ;;
+
+ osf3* | osf4*)
+ # All OSF/1 code is PIC.
+ wl='-Wl,'
+ link_static_flag='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ pic_flag='-Kpic'
+ link_static_flag='-dn'
+ special_shlib_compile_flags='-belf'
+ ;;
+
+ solaris*)
+ pic_flag='-KPIC'
+ link_static_flag='-Bstatic'
+ wl='-Wl,'
+ ;;
+
+ sunos4*)
+ pic_flag='-PIC'
+ link_static_flag='-Bstatic'
+ wl='-Qoption ld '
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ pic_flag='-KPIC'
+ link_static_flag='-Bstatic'
+ wl='-Wl,'
+ ;;
+
+ uts4*)
+ pic_flag='-pic'
+ link_static_flag='-Bstatic'
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ pic_flag='-Kconform_pic'
+ link_static_flag='-Bstatic'
+ fi
+ ;;
+ *)
+ can_build_shared=no
+ ;;
+ esac
+fi
+
+if test -n "$pic_flag"; then
+ echo "$ac_t$pic_flag" 1>&6
+
+ # Check to make sure the pic_flag actually works.
+ echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
+ $rm conftest*
+ echo "int some_variable = 0;" > conftest.c
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $pic_flag -DPIC"
+ echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5
+ if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
+ # Append any warnings to the config.log.
+ cat conftest.err 1>&5
+
+ case "$host_os" in
+ hpux9* | hpux10* | hpux11*)
+ # On HP-UX, both CC and GCC only warn that PIC is supported... then they
+ # create non-PIC objects. So, if there were any warnings, we assume that
+ # PIC is not supported.
+ if test -s conftest.err; then
+ echo "$ac_t"no 1>&6
+ can_build_shared=no
+ pic_flag=
+ else
+ echo "$ac_t"yes 1>&6
+ pic_flag=" $pic_flag"
+ fi
+ ;;
+ *)
+ echo "$ac_t"yes 1>&6
+ pic_flag=" $pic_flag"
+ ;;
+ esac
+ else
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ can_build_shared=no
+ pic_flag=
+ echo "$ac_t"no 1>&6
+ fi
+ CFLAGS="$save_CFLAGS"
+ $rm conftest*
+else
+ echo "$ac_t"none 1>&6
+fi
+
+# Check to see if options -o and -c are simultaneously supported by compiler
+echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
+$rm -r conftest 2>/dev/null
+mkdir conftest
+cd conftest
+$rm conftest*
+echo "int some_variable = 0;" > conftest.c
+mkdir out
+# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+# that will create temporary files in the current directory regardless of
+# the output directory. Thus, making CWD read-only will cause this test
+# to fail, enabling locking or at least warning the user not to do parallel
+# builds.
+chmod -w .
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -o out/conftest2.o"
+echo "$progname:829: checking if $compiler supports -c -o file.o" >&5
+if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
+
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s out/conftest.err; then
+ echo "$ac_t"no 1>&6
+ compiler_c_o=no
+ else
+ echo "$ac_t"yes 1>&6
+ compiler_c_o=yes
+ fi
+else
+ # Append any errors to the config.log.
+ cat out/conftest.err 1>&5
+ compiler_c_o=no
+ echo "$ac_t"no 1>&6
+fi
+CFLAGS="$save_CFLAGS"
+chmod u+w .
+$rm conftest* out/*
+rmdir out
+cd ..
+rmdir conftest
+$rm -r conftest 2>/dev/null
+
+if test x"$compiler_c_o" = x"yes"; then
+ # Check to see if we can write to a .lo
+ echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
+ $rm conftest*
+ echo "int some_variable = 0;" > conftest.c
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -c -o conftest.lo"
+ echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5
+if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
+
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ echo "$ac_t"no 1>&6
+ compiler_o_lo=no
+ else
+ echo "$ac_t"yes 1>&6
+ compiler_o_lo=yes
+ fi
+ else
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ compiler_o_lo=no
+ echo "$ac_t"no 1>&6
+ fi
+ CFLAGS="$save_CFLAGS"
+ $rm conftest*
+else
+ compiler_o_lo=no
+fi
+
+# Check to see if we can do hard links to lock some files if needed
+hard_links="nottested"
+if test "$compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$ac_t$hard_links" 1>&6
+ $rm conftest*
+ if test "$hard_links" = no; then
+ echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+if test "$with_gcc" = yes; then
+ # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
+ echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
+ $rm conftest*
+ echo "int some_variable = 0;" > conftest.c
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
+ echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+ if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
+
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ echo "$ac_t"no 1>&6
+ compiler_rtti_exceptions=no
+ else
+ echo "$ac_t"yes 1>&6
+ compiler_rtti_exceptions=yes
+ fi
+ else
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ compiler_rtti_exceptions=no
+ echo "$ac_t"no 1>&6
+ fi
+ CFLAGS="$save_CFLAGS"
+ $rm conftest*
+
+ if test "$compiler_rtti_exceptions" = "yes"; then
+ no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
+ else
+ no_builtin_flag=' -fno-builtin'
+ fi
+
+fi
+
+# Check for any special shared library compilation flags.
+if test -n "$special_shlib_compile_flags"; then
+ echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
+ if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
+ else
+ echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
+ can_build_shared=no
+ fi
+fi
+
+echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
+$rm conftest*
+echo 'main(){return(0);}' > conftest.c
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $link_static_flag"
+echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5
+if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ echo "$ac_t$link_static_flag" 1>&6
+else
+ echo "$ac_t"none 1>&6
+ link_static_flag=
+fi
+LDFLAGS="$save_LDFLAGS"
+$rm conftest*
+
+if test -z "$LN_S"; then
+ # Check to see if we can use ln -s, or we need hard links.
+ echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
+ $rm conftest.dat
+ if ln -s X conftest.dat 2>/dev/null; then
+ $rm conftest.dat
+ LN_S="ln -s"
+ else
+ LN_S=ln
+ fi
+ if test "$LN_S" = "ln -s"; then
+ echo "$ac_t"yes 1>&6
+ else
+ echo "$ac_t"no 1>&6
+ fi
+fi
+
+# Make sure LD is an absolute path.
+if test -z "$LD"; then
+ ac_prog=ld
+ if test "$with_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
+ echo "$progname:991: checking for ld used by GCC" >&5
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we are not using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+ elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld... $ac_c" 1>&6
+ echo "$progname:1015: checking for GNU ld" >&5
+ else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+ echo "$progname:1018: checking for non-GNU ld" >&5
+ fi
+
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ fi
+
+ if test -n "$LD"; then
+ echo "$ac_t$LD" 1>&6
+ else
+ echo "$ac_t"no 1>&6
+ fi
+
+ if test -z "$LD"; then
+ echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
+ exit 1
+ fi
+fi
+
+# Check to see if it really is or is not GNU ld.
+echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
+# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+echo "$ac_t$with_gnu_ld" 1>&6
+
+# See if the linker supports building shared libraries.
+echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
+
+allow_undefined_flag=
+no_undefined_flag=
+need_lib_prefix=unknown
+need_version=unknown
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+archive_cmds=
+archive_expsym_cmds=
+old_archive_from_new_cmds=
+export_dynamic_flag_spec=
+whole_archive_flag_spec=
+thread_safe_flag_spec=
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+hardcode_shlibpath_var=unsupported
+runpath_var=
+always_export_symbols=no
+export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
+# include_expsyms should be a list of space-separated symbols to be *always*
+# included in the symbol list
+include_expsyms=
+# exclude_expsyms can be an egrep regular expression of symbols to exclude
+# it will be wrapped by ` (' and `)$', so one must not match beginning or
+# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+# as well as any symbol that contains `d'.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+# platforms (ab)use it in PIC code, but their linkers get confused if
+# the symbol is explicitly referenced. Since portable code cannot
+# rely on this symbol name, it's probably fine to never include it in
+# preloaded symbol tables.
+
+case "$host_os" in
+cygwin* | mingw*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$with_gcc" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case "$host_os" in
+ aix3* | aix4*)
+ # On AIX, the GNU linker is very broken
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can use
+ # them.
+ ld_shlibs=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+
+ # Extract the symbol export list from an `--export-all' def file,
+ # then regenerate the def file from the symbol export list, so that
+ # the compiled dll only exports the symbol export list.
+ export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
+ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
+ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~
+ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
+
+ archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
+ _lt_hint=1;
+ for symbol in `cat $export_symbols`; do
+ echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
+ _lt_hint=`expr 1 + \$_lt_hint`;
+ done~
+ test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
+ test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
+ $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+ $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+ $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
+
+ old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
+ ;;
+
+ netbsd*)
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
+ # can we support soname and/or expsyms with a.out? -oliva
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = yes; then
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ case $host_os in
+ cygwin* | mingw*)
+ # dlltool doesn't understand --whole-archive et. al.
+ whole_archive_flag_spec=
+ ;;
+ *)
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ ;;
+ esac
+ fi
+else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case "$host_os" in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$with_gcc" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix4*)
+ hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
+ hardcode_libdir_separator=':'
+ if test "$with_gcc" = yes; then
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ shared_flag='-shared'
+ else
+ shared_flag='${wl}-bM:SRE'
+ hardcode_direct=yes
+ fi
+ allow_undefined_flag=' ${wl}-berok'
+ archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
+ archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
+ case "$host_os" in aix4.[01]|aix4.[01].*)
+ # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
+ always_export_symbols=yes ;;
+ esac
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+
+ cygwin* | mingw*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib /OUT:$oldlib$oldobjs'
+ fix_srcfile_path='`cygpath -w $srcfile`'
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd*)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ case "$host_os" in
+ hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
+ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
+ esac
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_minus_L=yes # Not in the search PATH, but as the default
+ # location of the library.
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ irix5* | irix6*)
+ if test "$with_gcc" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF
+ fi
+ hardcode_libdir_flag_spec='${wl}-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ openbsd*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
+ ;;
+
+ osf3* | osf4*)
+ if test "$with_gcc" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z text'
+ # $CC -shared without GNU ld will not create a library from C++
+ # object files and a static libstdc++, better avoid it by now
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case "$host_os" in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
+ archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+echo "$ac_t$ld_shlibs" 1>&6
+test "$ld_shlibs" = no && can_build_shared=no
+
+if test -z "$NM"; then
+ echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
+ case "$NM" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
+ for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ NM="$ac_dir/nm -B"
+ break
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ NM="$ac_dir/nm -p"
+ break
+ else
+ NM=${NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$NM" && NM=nm
+ ;;
+ esac
+ echo "$ac_t$NM" 1>&6
+fi
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+# Define system-specific variables.
+case "$host_os" in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ ;;
+irix*)
+ symcode='[BCDEGRST]'
+ ;;
+solaris*)
+ symcode='[BDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
+ symcode='[ABCDGISTW]'
+fi
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Write the raw and C identifiers.
+ global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+ $rm conftest*
+ cat > conftest.c <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ echo "$progname:1592: checking if global_symbol_pipe works" >&5
+ if { (eval echo $progname:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { echo "$progname:1596: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
+
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if egrep ' nm_test_var$' "$nlist" >/dev/null; then
+ if egrep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.c
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
+
+ cat <<EOF >> conftest.c
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
+ cat <<\EOF >> conftest.c
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$objext conftstm.$objext
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$objext"
+ CFLAGS="$CFLAGS$no_builtin_flag"
+ if { (eval echo $progname:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ pipe_works=yes
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ LIBS="$save_LIBS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.c >&5
+ fi
+ $rm conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ global_symbol_pipe=
+ fi
+done
+if test "$pipe_works" = yes; then
+ echo "${ac_t}ok" 1>&6
+else
+ echo "${ac_t}failed" 1>&6
+fi
+
+if test -z "$global_symbol_pipe"; then
+ global_symbol_to_cdecl=
+fi
+
+# Check hardcoding attributes.
+echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var"; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$hardcode_shlibpath_var" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+echo "$ac_t$hardcode_action" 1>&6
+
+
+reload_flag=
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
+# PORTME Some linkers may need a different reload flag.
+reload_flag='-r'
+echo "$ac_t$reload_flag" 1>&6
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+# PORTME Fill in your ld.so characteristics
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+file_magic_cmd=
+file_magic_test_file=
+deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [regex]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given egrep regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
+case "$host_os" in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}.so$major'
+ ;;
+
+aix4*)
+ version_type=linux
+ # AIX has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ # We preserve .a as extension for shared libraries though AIX4.2
+ # and later linker supports .so
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
+ shlibpath_var=LIBPATH
+ deplibs_check_method=pass_all
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}.so'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ deplibs_check_method=pass_all
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+bsdi4*)
+ version_type=linux
+ library_names_spec='${libname}.so$major ${libname}.so'
+ soname_spec='${libname}.so'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=/shlib/libc.so
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw*)
+ version_type=windows
+ need_version=no
+ need_lib_prefix=no
+ if test "$with_gcc" = yes; then
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
+ else
+ library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
+ fi
+ dynamic_linker='Win32 ld.exe'
+ deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ file_magic_cmd='${OBJDUMP} -f'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case "$version_type" in
+ freebsd-elf*)
+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=`echo /usr/lib/libc.so*`
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ deplibs_check_method=unknown
+ library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
+ need_version=yes
+ ;;
+ esac
+ finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ case "$host_os" in
+ freebsd2* | freebsd3.[01]*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ dynamic_linker="$host_os dld.sl"
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
+ soname_spec='${libname}${release}.sl$major'
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6*)
+ version_type=irix
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}.so.$major'
+ library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so'
+ case "$host_os" in
+ irix5*)
+ libsuff= shlibsuff=
+ # this will be overridden with pass_all, but let us keep it just in case
+ deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+ ;;
+ *)
+ case "$LD" in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ # this will be overridden with pass_all, but let us keep it just in case
+ deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+ deplibs_check_method='pass_all'
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+
+ if test -f /lib/ld.so.1; then
+ dynamic_linker='GNU ld.so'
+ else
+ # Only the GNU ld.so supports shared libraries on MkLinux.
+ case "$host_cpu" in
+ powerpc*) dynamic_linker=no ;;
+ *) dynamic_linker='Linux ld.so' ;;
+ esac
+ fi
+ ;;
+
+netbsd*)
+ version_type=sunos
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
+ soname_spec='${libname}${release}.so$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+openbsd*)
+ version_type=sunos
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ need_version=no
+ fi
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+os2*)
+ libname_spec='$name'
+ need_lib_prefix=no
+ library_names_spec='$libname.dll $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4*)
+ version_type=osf
+ need_version=no
+ soname_spec='${libname}${release}.so'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ # this will be overridden with pass_all, but let us keep it just in case
+ deplibs_check_method='file_magic COFF format alpha shared library'
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=/shlib/libc.so
+ deplibs_check_method='pass_all'
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}.so$major'
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=/lib/libc.so
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case "$host_vendor" in
+ ncr)
+ deplibs_check_method='pass_all'
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ esac
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
+ soname_spec='$libname.so.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$ac_t$dynamic_linker" 1>&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+# Report the final consequences.
+echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
+
+# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in
+# configure.in, otherwise build static only libraries.
+case "$host_os" in
+cygwin* | mingw* | os2*)
+ if test x$can_build_shared = xyes; then
+ test x$enable_win32_dll = xno && can_build_shared=no
+ echo "checking if package supports dlls... $can_build_shared" 1>&6
+ fi
+;;
+esac
+
+if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
+ case "$deplibs_check_method" in
+ "file_magic "*)
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ egrep "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+fi
+
+echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case "$host_os" in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ test "$enable_shared" = yes && enable_static=no
+ ;;
+esac
+
+echo "$ac_t$enable_shared" 1>&6
+
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+
+echo "checking whether to build static libraries... $enable_static" 1>&6
+
+if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+echo $ac_n "checking for objdir... $ac_c" 1>&6
+rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+echo "$ac_t$objdir" 1>&6
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
+ lt_cv_dlopen=no lt_cv_dlopen_libs=
+echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "$progname:2170: checking for dlopen in -ldl" >&5
+ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2178 "ltconfig"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo $progname:2188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dlopen""... $ac_c" 1>&6
+echo "$progname:2207: checking for dlopen" >&5
+if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2212 "ltconfig"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+dlopen();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo $progname:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_dlopen=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_dlopen=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dlopen"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
+echo "$progname:2251: checking for dld_link in -ldld" >&5
+ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2259 "ltconfig"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link();
+
+int main() {
+dld_link()
+; return 0; }
+EOF
+if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for shl_load""... $ac_c" 1>&6
+echo "$progname:2288: checking for shl_load" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2293 "ltconfig"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+shl_load();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo $progname:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_shl_load=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_shl_load=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="shl_load"
+else
+ echo "$ac_t""no" 1>&6
+echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
+echo "$progname:2333: checking for shl_load in -ldld" >&5
+ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2341 "ltconfig"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load();
+
+int main() {
+shl_load()
+; return 0; }
+EOF
+if { (eval echo $progname:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+fi
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ fi
+
+ case "$lt_cv_dlopen" in
+ dlopen)
+for ac_hdr in dlfcn.h; do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "$progname:2395: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2400 "ltconfig"
+#include <$ac_hdr>
+int fnord = 0;
+EOF
+ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ if test "x$ac_cv_header_dlfcn_h" = xyes; then
+ CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+ fi
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
+echo "$progname:2433: checking whether a program can dlopen itself" >&5
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ lt_cv_dlopen_self=cross
+ else
+ cat > conftest.c <<EOF
+#line 2441 "ltconfig"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LTDL_GLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LTDL_GLOBAL DL_GLOBAL
+# else
+# define LTDL_GLOBAL 0
+# endif
+#endif
+
+/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LTDL_LAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LTDL_LAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LTDL_LAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LTDL_LAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LTDL_LAZY_OR_NOW DL_NOW
+# else
+# define LTDL_LAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+fnord() { int i=42;}
+main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
+ if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
+ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
+
+EOF
+if { (eval echo $progname:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ lt_cv_dlopen_self=yes
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ lt_cv_dlopen_self=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$lt_cv_dlopen_self" 1>&6
+
+ if test "$lt_cv_dlopen_self" = yes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
+echo "$progname:2506: checking whether a statically linked program can dlopen itself" >&5
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ lt_cv_dlopen_self_static=cross
+ else
+ cat > conftest.c <<EOF
+#line 2514 "ltconfig"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LTDL_GLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LTDL_GLOBAL DL_GLOBAL
+# else
+# define LTDL_GLOBAL 0
+# endif
+#endif
+
+/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LTDL_LAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LTDL_LAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LTDL_LAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LTDL_LAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LTDL_LAZY_OR_NOW DL_NOW
+# else
+# define LTDL_LAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+fnord() { int i=42;}
+main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
+ if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
+ if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
+
+EOF
+if { (eval echo $progname:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+ lt_cv_dlopen_self_static=yes
+else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ lt_cv_dlopen_self_static=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
+fi
+ ;;
+ esac
+
+ case "$lt_cv_dlopen_self" in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case "$lt_cv_dlopen_self_static" in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+# Copy echo and quote the copy, instead of the original, because it is
+# used later.
+ltecho="$echo"
+if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ ltecho="$CONFIG_SHELL \$0 --fallback-echo"
+fi
+LTSHELL="$SHELL"
+
+LTCONFIG_VERSION="$VERSION"
+
+# Only quote variables if we're using ltmain.sh.
+case "$ltmain" in
+*.sh)
+ # Now quote all the things that may contain metacharacters.
+ for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \
+ old_LD old_LDFLAGS old_LIBS \
+ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \
+ AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
+ reload_flag reload_cmds wl \
+ pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
+ thread_safe_flag_spec whole_archive_flag_spec libname_spec \
+ library_names_spec soname_spec \
+ RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
+ old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
+ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
+ finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
+ hardcode_libdir_flag_spec hardcode_libdir_separator \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
+
+ case "$var" in
+ reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case "$ltecho" in
+ *'\$0 --fallback-echo"')
+ ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+ trap "$rm \"$ofile\"; exit 1" 1 2 15
+ echo "creating $ofile"
+ $rm "$ofile"
+ cat <<EOF > "$ofile"
+#! $SHELL
+
+# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
+#
+# Copyright (C) 1996-1999 Free Software Foundation, Inc.
+# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="sed -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
+
+### BEGIN LIBTOOL CONFIG
+EOF
+ cfgfile="$ofile"
+ ;;
+
+*)
+ # Double-quote the variables that need it (for aesthetics).
+ for var in old_CC old_CFLAGS old_CPPFLAGS \
+ old_LD old_LDFLAGS old_LIBS \
+ old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do
+ eval "$var=\\\"\$var\\\""
+ done
+
+ # Just create a config file.
+ cfgfile="$ofile.cfg"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ echo "creating $cfgfile"
+ $rm "$cfgfile"
+ cat <<EOF > "$cfgfile"
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+EOF
+ ;;
+esac
+
+cat <<EOF >> "$cfgfile"
+# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
+# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\
+# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
+# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\
+# $0$ltconfig_args
+#
+# Compiler and other test output produced by $progname, useful for
+# debugging $progname, is in ./config.log if it exists.
+
+# The version of $progname that generated this script.
+LTCONFIG_VERSION=$LTCONFIG_VERSION
+
+# Shell to use when invoking shell scripts.
+SHELL=$LTSHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$ltecho
+
+# The archiver.
+AR=$AR
+
+# The default C compiler.
+CC=$CC
+
+# The linker used to build libraries.
+LD=$LD
+
+# Whether we need hard or soft links.
+LN_S=$LN_S
+
+# A BSD-compatible nm program.
+NM=$NM
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$reload_flag
+reload_cmds=$reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$wl
+
+# Object file suffix (normally "o").
+objext="$objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$pic_flag
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$compiler_c_o
+
+# Can we write directly to a .lo ?
+compiler_o_lo=$compiler_o_lo
+
+# Must we lock files when doing compilation ?
+need_locks=$need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$link_static_flag
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$RANLIB
+old_archive_cmds=$old_archive_cmds
+old_postinstall_cmds=$old_postinstall_cmds
+old_postuninstall_cmds=$old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$old_archive_from_new_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$archive_cmds
+archive_expsym_cmds=$archive_expsym_cmds
+postinstall_cmds=$postinstall_cmds
+postuninstall_cmds=$postuninstall_cmds
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$global_symbol_to_cdecl
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$include_expsyms
+
+EOF
+
+case "$ltmain" in
+*.sh)
+ echo '### END LIBTOOL CONFIG' >> "$ofile"
+ echo >> "$ofile"
+ case "$host_os" in
+ aix3*)
+ cat <<\EOF >> "$ofile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "${COLLECT_NAMES+set}" != set; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # Append the ltmain.sh script.
+ sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
+
+ chmod +x "$ofile"
+ ;;
+
+*)
+ # Compile the libtool program.
+ echo "FIXME: would compile $ltmain"
+ ;;
+esac
+
+test -n "$cache_file" || exit 0
+
+# AC_CACHE_SAVE
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+exit 0
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
--- /dev/null
+++ b/common/id3lib/ltmain.sh
@@ -1,0 +1,3975 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun ltconfig.
+#
+# Copyright (C) 1996-1999 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The name of this program.
+progname=`$echo "$0" | sed 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.3.3
+TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+SP2NL='tr \040 \012'
+NL2SP='tr \015\012 \040\040'
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+ save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+ save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+if test "$LTCONFIG_VERSION" != "$VERSION"; then
+ echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+fi
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ echo "$modename: not configured to build any kind of library" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+# Parse our command line options once, thoroughly.
+while test $# -gt 0
+do
+ arg="$1"
+ shift
+
+ case "$arg" in
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case "$prev" in
+ execute_dlfiles)
+ eval "$prev=\"\$$prev \$arg\""
+ ;;
+ *)
+ eval "$prev=\$arg"
+ ;;
+ esac
+
+ prev=
+ prevopt=
+ continue
+ fi
+
+ # Have we seen a non-optional argument yet?
+ case "$arg" in
+ --help)
+ show_help=yes
+ ;;
+
+ --version)
+ echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+ exit 0
+ ;;
+
+ --config)
+ sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
+ exit 0
+ ;;
+
+ --debug)
+ echo "$progname: enabling shell trace mode"
+ set -x
+ ;;
+
+ --dry-run | -n)
+ run=:
+ ;;
+
+ --features)
+ echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+ exit 0
+ ;;
+
+ --finish) mode="finish" ;;
+
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
+ --quiet | --silent)
+ show=:
+ ;;
+
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
+
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
+
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+fi
+
+if test -z "$show_help"; then
+
+ # Infer the operation mode.
+ if test -z "$mode"; then
+ case "$nonopt" in
+ *cc | *++ | gcc* | *-gcc*)
+ mode=link
+ for arg
+ do
+ case "$arg" in
+ -c)
+ mode=compile
+ break
+ ;;
+ esac
+ done
+ ;;
+ *db | *dbx | *strace | *truss)
+ mode=execute
+ ;;
+ *install*|cp|mv)
+ mode=install
+ ;;
+ *rm)
+ mode=uninstall
+ ;;
+ *)
+ # If we have no mode, but dlfiles were specified, then do execute mode.
+ test -n "$execute_dlfiles" && mode=execute
+
+ # Just use the default operation mode.
+ if test -z "$mode"; then
+ if test -n "$nonopt"; then
+ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+ else
+ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+ fi
+ fi
+ ;;
+ esac
+ fi
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$modename --help --mode=$mode' for more information."
+
+ # These modes are in order of execution frequency so that they run quickly.
+ case "$mode" in
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+ lastarg=
+ srcfile="$nonopt"
+ suppress_output=
+
+ user_target=no
+ for arg
+ do
+ # Accept any command-line options.
+ case "$arg" in
+ -o)
+ if test "$user_target" != "no"; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit 1
+ fi
+ user_target=next
+ ;;
+
+ -static)
+ build_old_libs=yes
+ continue
+ ;;
+ esac
+
+ case "$user_target" in
+ next)
+ # The next one is the -o target name
+ user_target=yes
+ continue
+ ;;
+ yes)
+ # We got the output file
+ user_target=set
+ libobj="$arg"
+ continue
+ ;;
+ esac
+
+ # Accept the current argument as the source file.
+ lastarg="$srcfile"
+ srcfile="$arg"
+
+ # Aesthetically quote the previous argument.
+
+ # Backslashify any backslashes, double quotes, and dollar signs.
+ # These are the only characters that are still specially
+ # interpreted inside of double-quoted scrings.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly in scan
+ # sets, so we specify it separately.
+ case "$lastarg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ # Add the previous argument to base_compile.
+ if test -z "$base_compile"; then
+ base_compile="$lastarg"
+ else
+ base_compile="$base_compile $lastarg"
+ fi
+ done
+
+ case "$user_target" in
+ set)
+ ;;
+ no)
+ # Get the name of the library object.
+ libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
+ *)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSfmso]'
+ case "$libobj" in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform=for ;;
+ esac
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+ case "$libobj" in
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+ *)
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $libobj"
+ else
+ removelist="$libobj"
+ fi
+
+ $run $rm $removelist
+ trap "$run $rm $removelist; exit 1" 1 2 15
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit 1" 1 2 15
+ else
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until ln "$0" "$lockfile" 2>/dev/null; do
+ $show "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+ echo $srcfile > "$lockfile"
+ fi
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ # All platforms use -DPIC, to notify preprocessed assembler code.
+ command="$base_compile $pic_flag -DPIC $srcfile"
+ if test "$build_old_libs" = yes; then
+ lo_libobj="$libobj"
+ dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$libobj"; then
+ dir="$objdir"
+ else
+ dir="$dir/$objdir"
+ fi
+ libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+
+ if test -d "$dir"; then
+ $show "$rm $libobj"
+ $run $rm $libobj
+ else
+ $show "$mkdir $dir"
+ $run $mkdir $dir
+ status=$?
+ if test $status -ne 0 && test ! -d $dir; then
+ exit $status
+ fi
+ fi
+ fi
+ if test "$compiler_o_lo" = yes; then
+ output_obj="$libobj"
+ command="$command -o $output_obj"
+ elif test "$compiler_c_o" = yes; then
+ output_obj="$obj"
+ command="$command -o $output_obj"
+ fi
+
+ $run $rm "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ test -n "$output_obj" && $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+ echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test x"$output_obj" != x"$libobj"; then
+ $show "$mv $output_obj $libobj"
+ if $run $mv $output_obj $libobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # If we have no pic_flag, then copy the object into place and finish.
+ if test -z "$pic_flag" && test "$build_old_libs" = yes; then
+ # Rename the .lo from within objdir to obj
+ if test -f $obj; then
+ $show $rm $obj
+ $run $rm $obj
+ fi
+
+ $show "$mv $libobj $obj"
+ if $run $mv $libobj $obj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+
+ # Now arrange that obj and lo_libobj become the same file
+ $show "$LN_S $obj $lo_libobj"
+ if $run $LN_S $obj $lo_libobj; then
+ exit 0
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Allow error messages only from the first compilation.
+ suppress_output=' >/dev/null 2>&1'
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ command="$base_compile $srcfile"
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ output_obj="$obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ $run $rm "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+ echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed
+ if test x"$output_obj" != x"$obj"; then
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we do not
+ # accidentally link it into a program.
+ if test "$build_libtool_libs" != yes; then
+ $show "echo timestamp > $libobj"
+ $run eval "echo timestamp > \$libobj" || exit $?
+ else
+ # Move the .lo from within objdir
+ $show "$mv $libobj $lo_libobj"
+ if $run $mv $libobj $lo_libobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+ fi
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $rm "$lockfile"
+ fi
+
+ exit 0
+ ;;
+
+ # libtool link mode
+ link)
+ modename="$modename: link"
+ C_compiler="$CC" # save it, to compile generated C sources
+ CC="$nonopt"
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invokation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+
+ # This is a source program that is used to create dlls on Windows
+ # Don't remove nor modify the starting and closing comments
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+ # This is a source program that is used to create import libraries
+ # on Windows for dlls which lack them. Don't remove nor modify the
+ # starting and closing comments
+# /* impgen.c starts here */
+# /* Copyright (C) 1999 Free Software Foundation, Inc.
+#
+# This file is part of GNU libtool.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# */
+#
+# #include <stdio.h> /* for printf() */
+# #include <unistd.h> /* for open(), lseek(), read() */
+# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
+# #include <string.h> /* for strdup() */
+#
+# static unsigned int
+# pe_get16 (fd, offset)
+# int fd;
+# int offset;
+# {
+# unsigned char b[2];
+# lseek (fd, offset, SEEK_SET);
+# read (fd, b, 2);
+# return b[0] + (b[1]<<8);
+# }
+#
+# static unsigned int
+# pe_get32 (fd, offset)
+# int fd;
+# int offset;
+# {
+# unsigned char b[4];
+# lseek (fd, offset, SEEK_SET);
+# read (fd, b, 4);
+# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# static unsigned int
+# pe_as32 (ptr)
+# void *ptr;
+# {
+# unsigned char *b = ptr;
+# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
+# }
+#
+# int
+# main (argc, argv)
+# int argc;
+# char *argv[];
+# {
+# int dll;
+# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
+# unsigned long export_rva, export_size, nsections, secptr, expptr;
+# unsigned long name_rvas, nexp;
+# unsigned char *expdata, *erva;
+# char *filename, *dll_name;
+#
+# filename = argv[1];
+#
+# dll = open(filename, O_RDONLY|O_BINARY);
+# if (!dll)
+# return 1;
+#
+# dll_name = filename;
+#
+# for (i=0; filename[i]; i++)
+# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
+# dll_name = filename + i +1;
+#
+# pe_header_offset = pe_get32 (dll, 0x3c);
+# opthdr_ofs = pe_header_offset + 4 + 20;
+# num_entries = pe_get32 (dll, opthdr_ofs + 92);
+#
+# if (num_entries < 1) /* no exports */
+# return 1;
+#
+# export_rva = pe_get32 (dll, opthdr_ofs + 96);
+# export_size = pe_get32 (dll, opthdr_ofs + 100);
+# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
+# secptr = (pe_header_offset + 4 + 20 +
+# pe_get16 (dll, pe_header_offset + 4 + 16));
+#
+# expptr = 0;
+# for (i = 0; i < nsections; i++)
+# {
+# char sname[8];
+# unsigned long secptr1 = secptr + 40 * i;
+# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
+# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
+# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
+# lseek(dll, secptr1, SEEK_SET);
+# read(dll, sname, 8);
+# if (vaddr <= export_rva && vaddr+vsize > export_rva)
+# {
+# expptr = fptr + (export_rva - vaddr);
+# if (export_rva + export_size > vaddr + vsize)
+# export_size = vsize - (export_rva - vaddr);
+# break;
+# }
+# }
+#
+# expdata = (unsigned char*)malloc(export_size);
+# lseek (dll, expptr, SEEK_SET);
+# read (dll, expdata, export_size);
+# erva = expdata - export_rva;
+#
+# nexp = pe_as32 (expdata+24);
+# name_rvas = pe_as32 (expdata+32);
+#
+# printf ("EXPORTS\n");
+# for (i = 0; i<nexp; i++)
+# {
+# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
+# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
+# }
+#
+# return 0;
+# }
+# /* impgen.c ends here */
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ compile_command="$CC"
+ finalize_command="$CC"
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ linkopts=
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ lib_search_path=
+ fi
+ # now prepend the system-specific ones
+ eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ link_against_libtool_libs=
+ ltlibs=
+ module=no
+ objs=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case "$arg" in
+ -all-static | -static)
+ if test "X$arg" = "X-all-static"; then
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ else
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ fi
+ build_libtool_libs=no
+ build_old_libs=yes
+ prefer_static_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test $# -gt 0; do
+ arg="$1"
+ shift
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case "$prev" in
+ output)
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
+ ;;
+ esac
+
+ case "$prev" in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
+ preload=yes
+ fi
+ case "$arg" in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ if test ! -f "$arg"; then
+ $echo "$modename: symbol file \`$arg' does not exist"
+ exit 1
+ fi
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case "$arg" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi
+
+ prevarg="$arg"
+
+ case "$arg" in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+ continue
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: not more than one -exported-symbols argument allowed"
+ exit 1
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -L*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+ # We need an absolute path.
+ case "$dir" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ absdir="$dir"
+ fi
+ dir="$absdir"
+ ;;
+ esac
+ case " $deplibs " in
+ *" $arg "*) ;;
+ *) deplibs="$deplibs $arg";;
+ esac
+ case " $lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir";;
+ esac
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2*)
+ dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
+ case ":$dllsearchpath:" in
+ ::) dllsearchpath="$dllsearchdir";;
+ *":$dllsearchdir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
+ esac
+ ;;
+ esac
+ ;;
+
+ -l*)
+ if test "$arg" = "-lc"; then
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+ # These systems don't actually have c library (as such)
+ continue
+ ;;
+ esac
+ elif test "$arg" = "-lm"; then
+ case "$host" in
+ *-*-cygwin* | *-*-beos*)
+ # These systems don't actually have math library (as such)
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+ case "$dir" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -static)
+ # If we have no pic_flag, then this is the same as -all-static.
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+
+ *.o | *.obj | *.a | *.lib)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A library object.
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
+ prev=
+ fi
+ libobjs="$libobjs $arg"
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ dlname=
+ libdir=
+ library_names=
+ old_library=
+
+ # Check to see that this really is a libtool archive.
+ if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variable installed.
+ installed=yes
+
+ # Read the .la file
+ # If there is no directory component, then add one.
+ case "$arg" in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+
+ if test -z "$linklib"; then
+ $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Find the relevant object directory and library name.
+ name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
+
+ if test "X$installed" = Xyes; then
+ dir="$libdir"
+ else
+ dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$arg"; then
+ dir="$objdir"
+ else
+ dir="$dir/$objdir"
+ fi
+ fi
+
+ if test -n "$dependency_libs"; then
+ # Extract -R and -L from dependency_libs
+ temp_deplibs=
+ for deplib in $dependency_libs; do
+ case "$deplib" in
+ -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ case " $rpath $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ -L*) case "$compile_command $temp_deplibs " in
+ *" $deplib "*) ;;
+ *) temp_deplibs="$temp_deplibs $deplib";;
+ esac
+ temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ case " $lib_search_path " in
+ *" $temp_dir "*) ;;
+ *) lib_search_path="$lib_search_path $temp_dir";;
+ esac
+ ;;
+ *) temp_deplibs="$temp_deplibs $deplib";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ if test -z "$libdir"; then
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $dir/$old_library"
+ old_convenience="$old_convenience $dir/$old_library"
+ deplibs="$deplibs$dependency_libs"
+ compile_command="$compile_command $dir/$old_library$dependency_libs"
+ finalize_command="$finalize_command $dir/$old_library$dependency_libs"
+ continue
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking statically,
+ # we need to preload.
+ prev=dlprefiles
+ else
+ # We should not create a dependency on this library, but we
+ # may need any libraries it requires.
+ compile_command="$compile_command$dependency_libs"
+ finalize_command="$finalize_command$dependency_libs"
+ prev=
+ continue
+ fi
+ fi
+
+ # The library was specified with -dlpreopen.
+ if test "$prev" = dlprefiles; then
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ dlprefiles="$dlprefiles $dir/$old_library"
+ else
+ dlprefiles="$dlprefiles $dir/$linklib"
+ fi
+ prev=
+ fi
+
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ link_against_libtool_libs="$link_against_libtool_libs $arg"
+ if test -n "$shlibpath_var"; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *) temp_rpath="$temp_rpath $dir" ;;
+ esac
+ fi
+
+ # We need an absolute path.
+ case "$dir" in
+ [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ absdir="$dir"
+ fi
+ ;;
+ esac
+
+ # This is the magic to use -rpath.
+ # Skip directories that are in the system default run-time
+ # search path, unless they have been requested with -R.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+
+ lib_linked=yes
+ case "$hardcode_action" in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ compile_command="$compile_command $dir/$linklib"
+ deplibs="$deplibs $dir/$linklib"
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2*)
+ dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
+ if test -n "$dllsearchpath"; then
+ dllsearchpath="$dllsearchpath:$dllsearchdir"
+ else
+ dllsearchpath="$dllsearchdir"
+ fi
+ ;;
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case "$host" in
+ *-*-sunos*)
+ compile_shlibpath="$compile_shlibpath$dir:"
+ ;;
+ esac
+ case "$compile_command " in
+ *" -L$dir "*) ;;
+ *) compile_command="$compile_command -L$dir";;
+ esac
+ compile_command="$compile_command -l$name"
+ deplibs="$deplibs -L$dir -l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ case ":$compile_shlibpath:" in
+ *":$dir:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$dir:";;
+ esac
+ compile_command="$compile_command -l$name"
+ deplibs="$deplibs -l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+
+ relink)
+ if test "$hardcode_direct" = yes; then
+ compile_command="$compile_command $absdir/$linklib"
+ deplibs="$deplibs $absdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ case "$compile_command " in
+ *" -L$absdir "*) ;;
+ *) compile_command="$compile_command -L$absdir";;
+ esac
+ compile_command="$compile_command -l$name"
+ deplibs="$deplibs -L$absdir -l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case ":$compile_shlibpath:" in
+ *":$absdir:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$absdir:";;
+ esac
+ compile_command="$compile_command -l$name"
+ deplibs="$deplibs -l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+
+ *)
+ lib_linked=no
+ ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ $echo "$modename: configuration error: unsupported hardcode properties"
+ exit 1
+ fi
+
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes; then
+ finalize_command="$finalize_command $libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ case "$finalize_command " in
+ *" -L$libdir "*) ;;
+ *) finalize_command="$finalize_command -L$libdir";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case ":$finalize_shlibpath:" in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ case "$finalize_command " in
+ *" -L$dir "*) ;;
+ *) finalize_command="$finalize_command -L$libdir";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ fi
+ else
+ # Transform directly to old archives if we don't build new libraries.
+ if test -n "$pic_flag" && test -z "$old_library"; then
+ $echo "$modename: cannot find static library for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_command="$compile_command $dir/$linklib"
+ finalize_command="$finalize_command $dir/$linklib"
+ else
+ case "$compile_command " in
+ *" -L$dir "*) ;;
+ *) compile_command="$compile_command -L$dir";;
+ esac
+ compile_command="$compile_command -l$name"
+ case "$finalize_command " in
+ *" -L$dir "*) ;;
+ *) finalize_command="$finalize_command -L$dir";;
+ esac
+ finalize_command="$finalize_command -l$name"
+ fi
+ fi
+
+ # Add in any libraries that this one depends upon.
+ compile_command="$compile_command$dependency_libs"
+ finalize_command="$finalize_command$dependency_libs"
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+ esac
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+ done
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+ libobjs_save="$libobjs"
+
+ case "$output" in
+ "")
+ $echo "$modename: you must specify an output file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *.a | *.lib)
+ if test -n "$link_against_libtool_libs"; then
+ $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
+ exit 1
+ fi
+
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+ fi
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ ;;
+
+ *.la)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case "$outputname" in
+ lib*)
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ if test "$module" = no; then
+ $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval libname=\"$libname_spec\"
+ else
+ libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ fi
+ ;;
+ esac
+
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
+
+ if test -n "$objs"; then
+ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
+ exit 1
+ fi
+
+ # How the heck are we supposed to write a wrapper for a shared library?
+ if test -n "$link_against_libtool_libs"; then
+ $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
+ exit 1
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
+ fi
+
+ set dummy $rpath
+ if test $# -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ libext=al
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+ dependency_libs="$deplibs"
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+ fi
+ else
+
+ # Parse the version information argument.
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ IFS="$save_ifs"
+
+ if test -n "$8"; then
+ $echo "$modename: too many parameters to \`-version-info'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ current="$2"
+ revision="$3"
+ age="$4"
+
+ # Check that each of the things are valid numbers.
+ case "$current" in
+ 0 | [1-9] | [1-9][0-9]*) ;;
+ *)
+ $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case "$revision" in
+ 0 | [1-9] | [1-9][0-9]*) ;;
+ *)
+ $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case "$age" in
+ 0 | [1-9] | [1-9][0-9]*) ;;
+ *)
+ $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if test $age -gt $current; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case "$version_type" in
+ none) ;;
+
+ irix)
+ major=`expr $current - $age + 1`
+ versuffix="$major.$revision"
+ verstring="sgi$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test $loop != 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+ verstring="sgi$major.$iface:$verstring"
+ done
+ ;;
+
+ linux)
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ major=`expr $current - $age`
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test $loop != 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current";
+ ;;
+
+ windows)
+ # Like Linux, but with '-' rather than '.', since we only
+ # want one extension on Windows 95.
+ major=`expr $current - $age`
+ versuffix="-$major-$age-$revision"
+ ;;
+
+ *)
+ $echo "$modename: unknown library version type \`$version_type'" 1>&2
+ echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ verstring="0.0"
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ dependency_libs="$deplibs"
+ case "$host" in
+ *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *)
+ # Add libc to deplibs on all other systems.
+ deplibs="$deplibs -lc"
+ ;;
+ esac
+ fi
+
+ # Create the output directory, or remove our outputs if we need to.
+ if test -d $output_objdir; then
+ $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
+ $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
+ else
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test $status -ne 0 && test ! -d $output_objdir; then
+ exit $status
+ fi
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ if test "$build_libtool_libs" = yes; then
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case "$deplibs_check_method" in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behaviour.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $rm conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $rm conftest
+ $C_compiler -o conftest conftest.c $deplibs
+ if test $? -eq 0 ; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ echo
+ echo "*** Warning: This library needs some functionality provided by $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+ # Error occured in the first compile. Let's try to salvage the situation:
+ # Compile a seperate program for each library.
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" ; then
+ $rm conftest
+ $C_compiler -o conftest conftest.c $i
+ # Did it work?
+ if test $? -eq 0 ; then
+ ldd_output=`ldd conftest`
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ echo
+ echo "*** Warning: This library needs some functionality provided by $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ droppeddeps=yes
+ echo
+ echo "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method
+ file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
+ for a_deplib in $deplibs; do
+ name="`expr $a_deplib : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null \
+ | grep " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | sed 's/.* -> //'`
+ case "$potliblink" in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+ | sed 10q \
+ | egrep "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ echo
+ echo "*** Warning: This library needs some functionality provided by $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
+ grep . >/dev/null; then
+ echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ echo "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ # Get the real and link names of the library.
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ lib="$output_objdir/$realname"
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Ensure that we have .o objects for linkers which dislike .lo
+ # (e.g. aix) incase we are running --disable-static
+ for obj in $libobjs; do
+ oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
+ if test ! -f $oldobj; then
+ $show "${LN_S} $obj $oldobj"
+ $run ${LN_S} $obj $oldobj || exit $?
+ fi
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ eval cmds=\"$export_symbols_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex"; then
+ $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$mv "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+ fi
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "mkdir $gentop"
+ $run mkdir "$gentop"
+ status=$?
+ if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case "$xlib" in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "mkdir $xdir"
+ $run mkdir "$xdir"
+ status=$?
+ if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+ libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linkopts="$linkopts $flag"
+ fi
+
+ # Do each of the archive commands.
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
+ eval cmds=\"$archive_cmds\"
+ fi
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ *.lo | *.o | *.obj)
+ if test -n "$link_against_libtool_libs"; then
+ $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
+ exit 1
+ fi
+
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+ fi
+
+ case "$output" in
+ *.lo)
+ if test -n "$objs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit 1
+ fi
+ libobj="$output"
+ obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $run $rm $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${obj}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "mkdir $gentop"
+ $run mkdir "$gentop"
+ status=$?
+ if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case "$xlib" in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "mkdir $xdir"
+ $run mkdir "$xdir"
+ status=$?
+ if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+ reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
+
+ output="$obj"
+ eval cmds=\"$reload_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ $show "echo timestamp > $libobj"
+ $run eval "echo timestamp > $libobj" || exit $?
+ exit 0
+ fi
+
+ if test -n "$pic_flag"; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ eval cmds=\"$reload_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ else
+ # Just create a symlink.
+ $show $rm $libobj
+ $run $rm $libobj
+ $show "$LN_S $obj $libobj"
+ $run $LN_S $obj $libobj || exit $?
+ fi
+
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ ;;
+
+ # Anything else should be a program.
+ *)
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+ fi
+
+ if test "$preload" = yes; then
+ if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+ fi
+ fi
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$compile_rpath " in
+ *" $libdir "*) ;;
+ *) compile_rpath="$compile_rpath $libdir" ;;
+ esac
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
+
+ # Create the binary in the object directory, then wrap it.
+ if test ! -d $output_objdir; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test $status -ne 0 && test ! -d $output_objdir; then
+ exit $status
+ fi
+ fi
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ dlsyms=
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ dlsyms="${outputname}S.c"
+ else
+ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+ fi
+ fi
+
+ if test -n "$dlsyms"; then
+ case "$dlsyms" in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${outputname}.nm"
+
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+ # Parse the name list into a source file.
+ $show "creating $output_objdir/$dlsyms"
+
+ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ $show "generating symbol list for \`$output'"
+
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$output.exp"
+ $run $rm $export_symbols
+ $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+ $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+ fi
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+ name=`echo "$arg" | sed -e 's%^.*/%%'`
+ $run eval 'echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -z "$run"; then
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $mv "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$dlsyms"
+ fi
+
+ $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+ sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
+ -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
+ < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ {0, (lt_ptr_t) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ fi
+
+ pic_flag_for_symtable=
+ case "$host" in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+ # Transform the symbol file into the correct name.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit 1
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+ if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ $show "$link_command"
+ $run eval "$link_command"
+ status=$?
+
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
+ fi
+
+ exit $status
+ fi
+
+ if test -n "$shlibpath_var"; then
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+ case "$dir" in
+ [\\/]* | [A-Za-z]:[\\/]*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+ ;;
+ *)
+ # Relative path: add a thisdir entry.
+ rpath="$rpath\$thisdir/$dir:"
+ ;;
+ esac
+ done
+ temp_rpath="$rpath"
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+ $echo "$modename: \`$output' will be relinked during installation" 1>&2
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+
+ # Now create the wrapper script.
+ $show "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $echo for shipping.
+ if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+ case "$0" in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+ esac
+ qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if our run command is non-null.
+ if test -z "$run"; then
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
+ esac
+ $rm $output
+ trap "$rm $output; exit 1" 1 2 15
+
+ $echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variable:
+ link_against_libtool_libs='$link_against_libtool_libs'
+else
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ echo=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$echo will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $echo >> $output "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ echo >> $output "\
+ program=lt-'$outputname'
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$file\"
+ fi"
+
+ echo >> $output "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if (cd \"\$thisdir\" && eval \$relink_command); then :
+ else
+ $rm \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $rm \"\$progdir/\$program\";
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $rm \"\$progdir/\$file\"
+ fi"
+ else
+ echo >> $output "\
+ program='$outputname$exeext'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ echo >> $output "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $echo >> $output "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ *-*-cygwin* | *-*-mingw | *-*-os2*)
+ # win32 systems need to use the prog path for dll
+ # lookup to work
+ $echo >> $output "\
+ exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+ ;;
+ *)
+ $echo >> $output "\
+ # Export the path to the program.
+ PATH=\"\$progdir:\$PATH\"
+ export PATH
+
+ exec \$program \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $echo >> $output "\
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+ \$echo \"This script is just a wrapper for \$program.\" 1>&2
+ echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+ chmod +x $output
+ fi
+ exit 0
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "mkdir $gentop"
+ $run mkdir "$gentop"
+ status=$?
+ if test $status -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ # Add in members from convenience archives.
+ for xlib in $addlibs; do
+ # Extract the objects.
+ case "$xlib" in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "mkdir $xdir"
+ $run mkdir "$xdir"
+ status=$?
+ if test $status -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+ oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ eval cmds=\"$old_archive_from_new_cmds\"
+ else
+ # Ensure that we have .o objects in place incase we decided
+ # not to build a shared library, and have fallen back to building
+ # static libs even though --disable-static was passed!
+ for oldobj in $oldobjs; do
+ if test ! -f $oldobj; then
+ obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
+ $show "${LN_S} $obj $oldobj"
+ $run ${LN_S} $obj $oldobj || exit $?
+ fi
+ done
+
+ eval cmds=\"$old_archive_cmds\"
+ fi
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$generated"; then
+ $show "${rm}r$generated"
+ $run ${rm}r$generated
+ fi
+
+ # Now create the libtool archive.
+ case "$output" in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ $show "creating $output"
+
+ if test -n "$xrpath"; then
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ done
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+
+ # Only create the output if not a dry run.
+ if test -z "$run"; then
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ fi
+ $rm $output
+ $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$dlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'\
+"
+ done
+ fi
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
+ ;;
+ esac
+ exit 0
+ ;;
+
+ # libtool install mode
+ install)
+ modename="$modename: install"
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
+ # Aesthetically quote it.
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$arg "
+ arg="$1"
+ shift
+ else
+ install_prog=
+ arg="$nonopt"
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog$arg"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest="$arg"
+ continue
+ fi
+
+ case "$arg" in
+ -d) isdir=yes ;;
+ -f) prev="-f" ;;
+ -g) prev="-g" ;;
+ -m) prev="-m" ;;
+ -o) prev="-o" ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*) ;;
+
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest="$arg"
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case "$arg" in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog $arg"
+ done
+
+ if test -z "$install_prog"; then
+ $echo "$modename: you must specify an install program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ $echo "$modename: no file or destination specified" 1>&2
+ else
+ $echo "$modename: you must specify a destination" 1>&2
+ fi
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Strip any trailing slash from the destination.
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$destdir" = "X$dest" && destdir=.
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+ if test $# -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ fi
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case "$file" in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case "$file" in
+ *.a | *.lib)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ library_names=
+ old_library=
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+ realname="$2"
+ shift
+ shift
+
+ # Install the shared library and build the symlinks.
+ $show "$install_prog $dir/$realname $destdir/$realname"
+ $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
+
+ if test $# -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ for linkname
+ do
+ if test "$linkname" != "$realname"; then
+ $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ fi
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ eval cmds=\"$postinstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Install the pseudo-library for information purposes.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ instname="$dir/$name"i
+ $show "$install_prog $instname $destdir/$name"
+ $run eval "$install_prog $instname $destdir/$name" || exit $?
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case "$destfile" in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+ ;;
+ *.o | *.obj)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ if test -n "$destfile"; then
+ $show "$install_prog $file $destfile"
+ $run eval "$install_prog $file $destfile" || exit $?
+ fi
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+ $show "$install_prog $staticobj $staticdest"
+ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ fi
+ exit 0
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Do a test to see if this is really a libtool program.
+ if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ link_against_libtool_libs=
+ relink_command=
+
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$link_against_libtool_libs"; then
+ $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
+ exit 1
+ fi
+
+ finalize=yes
+ for lib in $link_against_libtool_libs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ # If there is no directory component, then add one.
+ case "$lib" in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+ libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir="/tmp"
+ test -n "$TMPDIR" && tmpdir="$TMPDIR"
+ tmpdir="$tmpdir/libtool-$$"
+ if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
+ else
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ ${rm}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ $echo "$modename: warning: cannot relink \`$file'" 1>&2
+ fi
+ else
+ # Install the binary that we compiled earlier.
+ file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ $show "$install_prog$stripme $file $destfile"
+ $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+ test -n "$outputname" && ${rm}r "$tmpdir"
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
+ # Do each command in the postinstall commands.
+ eval cmds=\"$old_postinstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$future_libdirs"; then
+ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+ fi
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+ exec $SHELL $0 --finish$current_libdirs
+ exit 1
+ fi
+
+ exit 0
+ ;;
+
+ # libtool finish mode
+ finish)
+ modename="$modename: finish"
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ eval cmds=\"$finish_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || admincmds="$admincmds
+ $cmd"
+ done
+ IFS="$save_ifs"
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $run eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ test "$show" = : && exit 0
+
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ echo " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ echo " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ echo " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
+ echo "See any operating system documentation about shared libraries for"
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ echo "----------------------------------------------------------------------"
+ exit 0
+ ;;
+
+ # libtool execute mode
+ execute)
+ modename="$modename: execute"
+
+ # The first argument is the command name.
+ cmd="$nonopt"
+ if test -z "$cmd"; then
+ $echo "$modename: you must specify a COMMAND" 1>&2
+ $echo "$help"
+ exit 1
+ fi
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ if test ! -f "$file"; then
+ $echo "$modename: \`$file' is not a file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ dir=
+ case "$file" in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit 1
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ ;;
+
+ *)
+ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case "$file" in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case "$file" in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+ args="$args \"$file\""
+ done
+
+ if test -z "$run"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+
+ # Restore saved enviroment variables
+ if test "${save_LC_ALL+set}" = set; then
+ LC_ALL="$save_LC_ALL"; export LC_ALL
+ fi
+ if test "${save_LANG+set}" = set; then
+ LANG="$save_LANG"; export LANG
+ fi
+
+ # Now actually exec the command.
+ eval "exec \$cmd$args"
+
+ $echo "$modename: cannot exec \$cmd$args"
+ exit 1
+ else
+ # Display what would be done.
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ $echo "$cmd$args"
+ exit 0
+ fi
+ ;;
+
+ # libtool uninstall mode
+ uninstall)
+ modename="$modename: uninstall"
+ rm="$nonopt"
+ files=
+
+ for arg
+ do
+ case "$arg" in
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ if test -z "$rm"; then
+ $echo "$modename: you must specify an RM program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ rmfiles="$file"
+
+ case "$name" in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $dir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
+
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
+
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ eval cmds=\"$postuninstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ eval cmds=\"$old_postuninstall_cmds\"
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ done
+ IFS="$save_ifs"
+ fi
+
+ # FIXME: should reinstall the best remaining shared library.
+ fi
+ ;;
+
+ *.lo)
+ if test "$build_old_libs" = yes; then
+ oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
+ rmfiles="$rmfiles $dir/$oldobj"
+ fi
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
+ ;;
+
+ *)
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles
+ ;;
+ esac
+ done
+ exit 0
+ ;;
+
+ "")
+ $echo "$modename: you must specify a MODE" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+fi # test -z "$show_help"
+
+# We need to display help for each of the modes.
+case "$mode" in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+-n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --finish same as \`--mode=finish'
+ --help display this help message and exit
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
+ --version print version information
+
+MODE must be one of the following:
+
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE."
+ exit 0
+ ;;
+
+compile)
+ $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -static always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+execute)
+ $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+finish)
+ $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+install)
+ $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+link)
+ $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -static do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+uninstall)
+ $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+*)
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+esac
+
+echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
--- /dev/null
+++ b/common/id3lib/m4/.cvsignore
@@ -1,0 +1,1 @@
+Makefile
--- /dev/null
+++ b/common/id3lib/m4/Makefile.am
@@ -1,0 +1,38 @@
+# Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# The following rules are for m4 files
+# m4datadir = $(datadir)/aclocal
+
+# List your m4 macros here
+m4macros = \
+ lf_cc.m4 \
+ lf_cxx.m4 \
+ lf_cxx_convenience.m4 \
+ lf_nm.m4 \
+ lf_fortran.m4 \
+ lf_lisp.m4 \
+ lf_local.m4 \
+ lf_txtc.m4 \
+ lf_host_type.m4 \
+ lf_x11.m4 \
+ lf_texidoc.m4 \
+ lf_warnings.m4 \
+ lf_bash.m4
+
+# The following is boilerplate
+# m4data_DATA = $(m4macros)
+EXTRA_DIST = $(m4macros)
\ No newline at end of file
--- /dev/null
+++ b/common/id3lib/m4/Makefile.in
@@ -1,0 +1,230 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# The following rules are for m4 files
+# m4datadir = $(datadir)/aclocal
+
+# List your m4 macros here
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+m4macros = lf_cc.m4 lf_cxx.m4 lf_cxx_convenience.m4 lf_nm.m4 lf_fortran.m4 lf_lisp.m4 lf_local.m4 lf_txtc.m4 lf_host_type.m4 lf_x11.m4 lf_texidoc.m4 lf_warnings.m4 lf_bash.m4
+
+
+# The following is boilerplate
+# m4data_DATA = $(m4macros)
+EXTRA_DIST = $(m4macros)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = m4
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu m4/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/m4/lf_bash.m4
@@ -1,0 +1,42 @@
+dnl Copyright (C) 1998 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+dnl
+
+AC_DEFUN(LF_PROG_BASH,[
+ dnl Look for bash
+ AC_PATH_PROGS(BASH, bash sh, no)
+ if test "$BASH" = "no"
+ then
+ AC_MSG_ERROR([can not find a shell! How are you running this script?])
+ fi
+ dnl Make sure it is bash
+ AC_MSG_CHECKING([whether $BASH is GNU bash])
+ bash_output=`$BASH -version -c exit | grep GNU`
+ if test -n "$bash_output"
+ then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN([you need the GNU bash to build this package correctly!!])
+ fi
+ AC_SUBST(BASH)
+])
--- /dev/null
+++ b/common/id3lib/m4/lf_cc.m4
@@ -1,0 +1,42 @@
+dnl Autoconf support for C++
+dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+# -------------------------------------------------------------------------
+# Use this macro to configure your C compiler
+# When called the macro does the following things:
+# 1. It finds an appropriate C compiler.
+# If you passed the flag --with-cc=foo then it uses that
+# particular compiler
+# 2. Check whether the compiler works.
+# 3. Checks whether the compiler accepts the -g
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_CONFIGURE_CC,[
+ dnl Sing the song
+ AC_PROG_CC
+ AC_PROG_CPP
+ AC_AIX
+ AC_ISC_POSIX
+ AC_MINIX
+ AC_HEADER_STDC
+])
+
--- /dev/null
+++ b/common/id3lib/m4/lf_cxx.m4
@@ -1,0 +1,116 @@
+dnl Autoconf support for C++
+dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+# -----------------------------------------------------------------
+# This macro should be called to configure your C++ compiler.
+# When called, the macro does the following things:
+# 1. It finds an appropriate C++ compiler
+# If you passed the flag --with-cxx=foo, then it uses that
+# particular compiler
+# 2. Checks whether the compiler accepts the -g
+# ------------------------------------------------------------------
+
+AC_DEFUN(LF_CONFIGURE_CXX,[
+ AC_PROG_CXX
+ AC_PROG_CXXCPP
+ LF_CXX_PORTABILITY
+])
+
+# -----------------------------------------------------------------------
+# This macro tests the C++ compiler for various portability problem.
+# 1. Defines CXX_HAS_NO_BOOL if the compiler does not support the bool
+# data type
+# 2. Defines CXX_HAS_BUGGY_FOR_LOOPS if the compiler has buggy
+# scoping for the for-loop
+# Seperately we provide some config.h.bot code to be added to acconfig.h
+# that implements work-arounds for these problems.
+# -----------------------------------------------------------------------
+
+dnl ACCONFIG TEMPLATE
+dnl #undef CXX_HAS_BUGGY_FOR_LOOPS
+dnl #undef CXX_HAS_NO_BOOL
+dnl END ACCONFIG
+
+AC_DEFUN(LF_CXX_PORTABILITY,[
+
+ AC_PROVIDE([$0])
+
+ dnl
+ dnl Check for common C++ portability problems
+ dnl
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ dnl Check whether we have bool
+ AC_MSG_CHECKING(whether C++ has bool)
+ AC_TRY_RUN([main() { bool b1=true; bool b2=false; }],
+ [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no)
+ AC_DEFINE(CXX_HAS_NO_BOOL) ],
+ [ AC_MSG_WARN(Don't cross-compile)]
+ )
+
+ dnl Test whether C++ has buggy for-loops
+ AC_MSG_CHECKING(whether C++ has correct scoping in for-loops)
+ AC_TRY_COMPILE([#include <iostream.h>], [
+ for (int i=0;i<10;i++) { }
+ for (int i=0;i<10;i++) { }
+], [ AC_MSG_RESULT(yes) ],
+ [ AC_MSG_RESULT(no)
+ AC_DEFINE(CXX_HAS_BUGGY_FOR_LOOPS) ])
+
+ dnl Done with the portability checks
+ AC_LANG_RESTORE
+])
+
+dnl ACCONFIG BOTTOM
+dnl
+dnl // This file defines portability work-arounds for various proprietory
+dnl // C++ compilers
+dnl
+dnl // Workaround for compilers with buggy for-loop scoping
+dnl // That's quite a few compilers actually including recent versions of
+dnl // Dec Alpha cxx, HP-UX CC and SGI CC.
+dnl // The trivial "if" statement provides the correct scoping to the
+dnl // for loop
+dnl
+dnl #ifdef CXX_HAS_BUGGY_FOR_LOOPS
+dnl #undef for
+dnl #define for if(1) for
+dnl #endif
+dnl
+dnl //
+dnl // If the C++ compiler we use doesn't have bool, then
+dnl // the following is a near-perfect work-around.
+dnl // You must make sure your code does not depend on "int" and "bool"
+dnl // being two different types, in overloading for instance.
+dnl //
+dnl
+dnl #ifdef CXX_HAS_NO_BOOL
+dnl #define bool int
+dnl #define true 1
+dnl #define false 0
+dnl #endif
+dnl
+dnl END ACCONFIG
+
--- /dev/null
+++ b/common/id3lib/m4/lf_cxx_convenience.m4
@@ -1,0 +1,100 @@
+dnl Autoconf support for C++ convenience macros
+dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+# -----------------------------------------------------------------
+# This macro defines some convenient macros for C++ prorgramming
+# It requires LF_CXX_PORTABILITY
+# When called, the macro does the following things:
+# 1. Fortran-like looping macros.
+# 2. Java-like scoping qualifiers.
+# 3. An 18-digit approximation of pi
+# 3. USE_ASSERT if the user wants to use assertions
+# Seperately we provide some config.h.bot code to be added to acconfig.h
+# that implements work-arounds for these problems.
+# ------------------------------------------------------------------
+
+dnl ACCONFIG TEMPLATE
+dnl #undef NDEBUG
+dnl END ACCONFIG
+
+AC_DEFUN(LF_CXX_CONVENIENCE,[
+
+ dnl
+ dnl Define convenient C++ constructs
+ dnl
+
+ AC_REQUIRE([LF_CXX_PORTABILITY])
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ dnl Test whether the user wants to enable assertions
+ AC_MSG_CHECKING(whether user wants assertions)
+ AC_ARG_ENABLE(assert,
+ [ --disable-assert don't use cpp.h assert],
+ [ AC_DEFINE(NDEBUG)
+ AC_MSG_RESULT(no) ],
+ [ AC_MSG_RESULT(yes) ],
+ )
+
+ dnl Done with the portability checks
+ AC_LANG_RESTORE
+])
+
+dnl ACCONFIG BOTTOM
+dnl
+dnl // This file defines convenience macros for C++ programming
+dnl
+dnl
+dnl //
+dnl // Fortran-like integer looping macros
+dnl // these critters depend on the scoping work-around above
+dnl //
+dnl
+dnl #define loop(COUNTER,BEGIN,END) \
+dnl for (int COUNTER = BEGIN ; COUNTER <= END ; COUNTER ## ++)
+dnl
+dnl #define inverse_loop(COUNTER,END,BEGIN) \
+dnl for (int COUNTER = END; COUNTER >= BEGIN; COUNTER ## --)
+dnl
+dnl #define integer_loop(COUNTER,BEGIN,END,STEP) \
+dnl for (int COUNTER = BEGIN; COUNTER <= END; COUNTER += STEP)
+dnl
+dnl //
+dnl // Class protection levels
+dnl // addictive syntactic sugar to make coding nicer
+dnl //
+dnl
+dnl #define pub public:
+dnl #define pro protected:
+dnl #define pri private:
+dnl
+dnl //
+dnl // Every mathematician would like to know pi
+dnl // so this is as good a place as any to throw it in.
+dnl //
+dnl
+dnl #define pi 3.14159265358979324
+dnl
+dnl #include <assert.h>
+dnl
+dnl END ACCONFIG
--- /dev/null
+++ b/common/id3lib/m4/lf_fortran.m4
@@ -1,0 +1,696 @@
+dnl Copyright (C) 1996 John W. Eaton <jwe@bevo.che.wisc.edu>
+dnl Copyright (C) 1998 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# The following set of macros will allow you to mix Fortran and C or C++
+# in a portable manner. This work is based on the autoconf macros written
+# by John W. Eaton for GNU Octave, which is also distributed under the
+# terms of the GNU public license, but have been heavily modified by
+# Eleftherios Gkioulekas, to make them more generally usable.
+# The LF_PATH_F77_LIBS which is the most complicated part of this setup
+# is exclusively the work of John Eaton, who has more experience with this
+# stuff than I do. Look at newer versions of GNU Octave for improved versions
+# of this macro.
+
+# --------------------
+# -- Acconfig stuff --
+# --------------------
+
+# These macros define the following symbols
+dnl ACCONFIG TEMPLATE
+dnl #undef F77_APPEND_UNDERSCORE
+dnl #undef F77_UPPERCASE_NAMES
+dnl END ACCONFIG
+
+# Also, it is important that programs have access to the f77func macro
+# which is defined as follows:
+dnl ACCONFIG BOTTOM
+dnl #ifndef f77func
+dnl # if defined (F77_APPEND_UNDERSCORE)
+dnl # if defined (F77_UPPERCASE_NAMES)
+dnl # define f77func(f, F) F##_
+dnl # else
+dnl # define f77func(f, F) f##_
+dnl # endif
+dnl # else
+dnl # if defined (F77_UPPERCASE_NAMES)
+dnl # define f77func(f, F) F
+dnl # else
+dnl # define f77func(f, F) f
+dnl # endif
+dnl # endif
+dnl #endif
+dnl END ACCONFIG
+
+# -------------------------------------------------------------------------
+# This macro specifies that we want to prefer the proprietary compiler
+# if one is available. The default is to prefer the GNU compilers.
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_PROG_F77_PREFER_NATIVE_VERSION,[
+ lf_f77_prefer_native_version="yes"
+])
+
+# -------------------------------------------------------------------------
+# This macro specifies that we want to prefer an f2c compatible compiler
+# if possible.
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_PROG_F77_PREFER_F2C_COMPATIBILITY,[
+ lf_f77_prefer_native_version="no"
+])
+
+
+# -------------------------------------------------------------------------
+# This is the macro that you want to call if you want to use Fortran.
+# This macro sets F77 equal to a valid Fortran compiler and FFLAGS
+# to a set of flags to pass to that compiler.
+# Three options are considered:
+# 1) The GNU g77 compiler
+# 2) The f2c translator
+# 3) The proprietary compiler
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_PROG_F77,[
+ dnl Initialize the following use variables to false
+ dnl These variables indicate which compiler we want to use
+ lf_f77_use_f2c=false
+ lf_f77_use_g77=false
+ lf_f77_use_f77=false
+
+ dnl These variable indicates whether we want to build the f2c compiler
+ lf_f2c_build_local_copy=false
+
+ dnl Allow the user to force the use of the compiler of his choice
+ AC_ARG_WITH(f2c,
+ [ --with-f2c use f2c even if Fortran compiler is available],
+ [ if test "$withval" = no
+ then
+ lf_f77_use_f2c=false
+ else
+ lf_f77_use_f2c=true
+ fi ],
+ [ lf_f77_use_f2c=false ])
+
+ AC_ARG_WITH(g77,
+ [ --with-g77 use g77 to compile Fortran subroutines],
+ [ if test "$withval" = no
+ then
+ lf_f77_use_g77=false
+ else
+ lf_f77_use_g77=true
+ fi ],
+ [ lf_f77_use_g77=false ])
+
+ AC_ARG_WITH(f77,
+ [ --with-f77 use f77 to compile Fortran subroutines],
+ [ if test "$withval" = no
+ then
+ lf_f77_use_f77=false
+ else
+ lf_f77_use_f77=true
+ fi ],
+ [ lf_f77_use_f77=false ])
+
+ dnl Make sure that only one of the above options for Fortran compilers
+ dnl was specified (multiple "no" or --without-FOO options are ok).
+ dnl FIXME: still todo
+
+ dnl
+ dnl Now assign F77 with the appropriate Fortran compiler
+ dnl
+
+ dnl Check whether there have been any --with options overriding the
+ dnl default behaviour
+ if test "$lf_f77_use_f77" = true
+ then
+ if test "$with_f77" = yes
+ then
+ F77=f77
+ else
+ F77="$with_f77"
+ fi
+ AC_MSG_RESULT([defining F77 to be $F77])
+ elif test "$lf_f77_use_g77" = true
+ then
+ if test "$with_g77" = yes
+ then
+ F77=g77
+ else
+ F77="$with_g77"
+ fi
+ AC_MSG_RESULT([defining F77 to be $F77])
+ elif test "$lf_f77_use_f2c" = true
+ then
+ LF_PROG_F2C
+ dnl If we are not overriding the default behaviour then go
+ dnl ahead with the default behaviour
+ else
+ dnl Take into account whether we have a preference for a native
+ dnl version or the GNU version.
+ lf_f77_native_compiler_list="f77 f90 xlf cf77 fc"
+ if test "$lf_f77_prefer_native_version" = yes
+ then
+ AC_CHECK_PROGS(F77, [ $lf_f77_native_compiler_list g77 ], f2c)
+ else
+ AC_CHECK_PROGS(F77, [ g77 $lf_f77_native_compiler_list ], f2c)
+ fi
+ dnl Now update the variables lf_f77_use_[f77|g77|f2c] with the result
+ dnl of the behaviour up until now so that we can study and finalize this
+ dnl decision later
+ if test "$F77" = f2c
+ then
+ lf_f77_use_f2c=true
+ elif test "$F77" = g77
+ then
+ lf_f77_use_g77=true
+ else
+ lf_f77_use_f77=true
+ fi
+ dnl If we couldn't find a native or GNU Fortran compiler, then F77
+ dnl will be assigned a temporary value of 'f2c'. In this case, invoke
+ dnl the LF_PROG_F2C macro to get a more permanent assignment to F77.
+ if test "$F77" = f2c
+ then
+ LF_PROG_F2C
+ fi
+ fi
+
+ dnl One last paranoid check. It's possible that we're using the GNU Fortran
+ dnl compiler, under a name other than 'g77'. For example, perhaps the
+ dnl sysadmin symlinked it with 'f77' or something. So one last check to be
+ dnl sure
+ LF_PROG_F77_IS_G77
+ if test "$f77_is_g77" = true
+ then
+ lf_f77_use_f77=false
+ lf_f77_use_f2c=false
+ lf_f77_use_g77=true
+ fi
+
+ dnl At this point we have a correct representation of what kind of
+ dnl compiler we selected. Now we must confirm the decision.
+ dnl 1. If we have already decided to use f2c, there is nothing to confirm.
+ dnl This is the most portable way to do it.
+ dnl 2. If we are using g77 then just run the canonical additional tests that
+ dnl are needed.
+ dnl 3. If we are using f77 then we need to think about it more and perhaps
+ dnl reconsider if f2c compatibility is desired.
+ if test "$lf_f77_use_g77" = true
+ then
+ LF_PROG_NM
+ LF_PATH_F77_LIBS
+ LF_CHECK_F77_APPEND_UNDERSCORE
+ LF_CHECK_F77_UPPERCASE_NAMES
+ elif test "$lf_f77_use_f77" = true
+ then
+ LF_PROG_NM
+ LF_PATH_F77_LIBS
+ LF_CHECK_F77_APPEND_UNDERSCORE
+ LF_CHECK_F77_UPPERCASE_NAMES
+ LF_F77_IS_F2C_COMPATIBLE
+ dnl Now decide whether to really use this compiler or not
+ AC_MSG_CHECKING([whether to use the native compiler])
+ if test "$lf_f77_is_f2c_compatible" = no
+ then
+ if test "$lf_f77_prefer_native_version" = no ||
+ test -n "$lf_f77_prefer_native_version"
+ then
+ AC_MSG_RESULT(no)
+ dnl FIXME: Think! Do I need to check for g77 right here?
+ LF_PROG_F2C
+ fi
+ else
+ AC_MSG_RESULT(yes)
+ fi
+ fi
+
+ dnl Signal to Automake whether we want to build the locally distributed
+ dnl version of the f2c compiler
+ AM_CONDITIONAL(USE_F2C,test x$lf_f2c_build_local_copy = xtrue)
+
+ dnl By default, compile Fortran with optimization
+ FFLAGS="-O2"
+
+ dnl Export F77 and FLAGS to Automake
+ AC_SUBST(F77)
+ AC_SUBST(FFLAGS)
+])
+
+# --------------------------------------------------------------------------
+# This macro checks whether the f2c translator is available. If not
+# it checks whether the package has included a copy of the f2c oompiler.
+# By default if there is a widely installed f2c it is prefered. Otherwise
+# we prefer the locally distributed f2c. The --with-local-f2c flag will
+# force the locally distributed f2c to be used, if there is a problem with
+# the widely distributed one.
+# -lF77 -lI77
+# --------------------------------------------------------------------------
+
+AC_DEFUN(LF_PROG_F2C,[
+ dnl No matter what happens next, we want to link in the math libraries
+ dnl Late night fart: Mount, mount, mount...mount the dump tape please.
+ FLIBS=""
+ AC_CHECK_LIB(m, sin, [ FLIBS="-lm $FLIBS"])
+ AC_CHECK_LIB(ieee, main, [ FLIBS="-lieee $FLIBS"])
+
+ dnl Check whether we have an installed version of 'f2c'
+ AC_PATH_PROGS(F2C, f2c F2C, nope)
+
+ dnl If we do have an installed version of 'f2c' check whether we also
+ dnl have a copy of the libraries.
+
+ dnl The first snug is that in order to link the f2c libraries, on many
+ dnl systems it is necessary to link in the symbols MAIN_ and MAIN__ on
+ dnl which the libraries depend on. So, we need to make a one-night-stand
+ dnl such library on the spot.
+ rm -f conflib.a conftest.o conftest.c
+ cat > conftest.c << EOF
+int MAIN_ () { return 0; }
+int MAIN__() { return 0; }
+EOF
+ $CC $CFLAGS -c conftest.c 2>&1 1>&AC_FD_CC
+ ar rcu libconflib.a conftest.o 2>&1 1>&AC_FD_CC
+ if test -n "$RANLIB"
+ then
+ $RANLIB libconflib.a 2>&1 1>&AC_FD_CC
+ fi
+
+ dnl Now, the byzantine test for the f2c libraries.
+ dnl We need to check
+ dnl 1. The -lf2c -lieee -lm sequence
+ dnl 2. The -lF77 -lI77 -lieee -lm sequence
+ dnl 3. Flag that the libraries are not available, if we can't find them
+ lf_f2c_have_libf2c=false
+ lf_f2c_have_libF77=false
+ lf_f2c_have_libI77=false
+ AC_CHECK_LIB(f2c, f_open, [ lf_f2c_have_libf2c=true ],
+ [ lf_f2c_have_libf2c=false],
+ [ -L. -lconflib $FLIBS ])
+ if test "$lf_f2c_have_libf2c" = false
+ then
+ AC_CHECK_LIB(F77, d_sin, [ lf_f2c_have_libF77=true ],
+ [ lf_f2c_have_libF77=false ],
+ [ -L. -lconflib $FLIBS -lm ])
+ AC_CHECK_LIB(I77, f_rew, [ lf_f2c_have_libI77=true ],
+ [ lf_f2c_have_libI77=false ],
+ [ -L. -lconflib -lF77 $FLIBS ])
+ fi
+ rm -f libconflib.a conftest.o conftest.c
+
+ dnl Now determine whether we have a complete set of libraries
+ dnl If we do, then assign FLIBS and flag what type of libraries we have
+ lf_f2c_have_libraries=no
+ if test "$lf_f2c_have_libf2c" = true
+ then
+ lf_f2c_have_libraries=yes
+ FLIBS="-lf2c $FLIBS"
+ else
+ if test "$lf_f2c_have_libI77" = true && test "$lf_f2c_have_libF77" = true
+ then
+ lf_f2c_have_libraries=yes
+ FLIBS="-lF77 -lI77 $FLIBS"
+ fi
+ fi
+
+ dnl Now check whether we need to compile our own f2c
+ AC_MSG_CHECKING([whether to use local copy of f2c])
+ if test "$F2C" = nope || test "$lf_f2c_have_libraries" = no
+ then
+ dnl If yes, then check if there is a local copy present
+ if test -d fortran && test -d fortran/f2c && test -d fortran/libf2c
+ then
+ dnl If we do have a local copy present then use it
+ lf_f2c_build_local_copy=true
+ F2C="`pwd`/fortran/f2c/f2c"
+ FLIBS="`pwd`/fortran/libf2c/libf2c.a $FLIBS"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_ERROR([want local version of f2c, but one is not available.])
+ fi
+ else
+ dnl If no, then don't bother compiling the local copy
+ AC_MSG_RESULT(no)
+ fi
+
+ dnl We want to use the following flags on F2C
+ F2CFLAGS="-f -g -A"
+
+ dnl Export the F2C and F2CFLAGS variables to the f2c_comp script
+ AC_SUBST(F2C)
+ AC_SUBST(F2CFLAGS)
+
+ dnl Export the F77 and FFLAGS symbols to Automake
+ F77='$(SHELL) $(top_builddir)/f2c_comp'
+ FFLAGS=""
+ AC_SUBST(F77)
+ AC_SUBST(FFLAGS)
+ AC_SUBST(FLIBS)
+
+ dnl The f2c compiler appends underscores but does not use uppercase
+ dnl letters. We can not invoke a direct test because the compiler may
+ dnl not exist yet. Plus, there's no need to.
+ AC_DEFINE(F77_APPEND_UNDERSCORE,1)
+])
+
+# ---------------------------------------------------------------------------
+# THIS macro tests whether the compiler assigned to F77 is the GNU g77
+# compiler. If this is the gnu compiler, then set f77_is_g77 equal to "true".
+# Otherwise, it is set to be an empty string.
+# ---------------------------------------------------------------------------
+
+AC_DEFUN(LF_PROG_F77_IS_G77,[
+ AC_MSG_CHECKING([whether we are using GNU Fortran])
+ if AC_TRY_COMMAND([$F77 --version]) | egrep 'GNU Fortran' >/dev/null 2>&1
+ then
+ f77_is_g77=yes
+ else
+ f77_is_g77=no
+ fi
+ AC_MSG_RESULT([$f77_is_g77])
+])
+
+# -------------------------------------------------------------------------
+# Check whether the Fortran compiler uses uppercase external names.
+# If it does, then we define the macro F77_UPPERCASE_NAMES
+# Requires maybe the NM variable to be set to the nm program?
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_CHECK_F77_UPPERCASE_NAMES,[
+ AC_MSG_CHECKING([whether $F77 uses uppercase external names])
+ lf_cv_f77_uppercase_names=no
+ cat > conftest.f <<EOF
+ SUBROUTINE XXYYZZ
+ RETURN
+ END
+EOF
+ if ${F77-f77} -c conftest.f 1>&AC_FD_CC 2>&AC_FD_CC; then
+ if test "`$NM conftest.o | grep XXYYZZ`" != ""; then
+ lf_cv_f77_uppercase_names=yes
+ fi
+ fi
+ AC_MSG_RESULT([$lf_cv_f77_uppercase_names])
+ if test "$lf_cv_f77_uppercase_names" = yes; then
+ AC_DEFINE(F77_UPPERCASE_NAMES,1)
+ fi
+ rm -f conftest.f
+])
+
+AC_DEFUN(LF_CHECK_F77_APPEND_UNDERSCORE,[
+ AC_MSG_CHECKING([whether $F77 appends underscores to external names])
+ lf_cv_f77_append_underscore=no
+ cat > conftest.f <<EOF
+ SUBROUTINE XXYYZZ
+ RETURN
+ END
+EOF
+ if ${F77-f77} -c conftest.f 1>&AC_FD_CC 2>&AC_FD_CC; then
+ if test "$lf_cv_f77_uppercase_names" = yes; then
+ if test "`${NM} conftest.o | grep XXYYZZ_`" != ""; then
+ lf_cv_f77_append_underscore=yes
+ fi
+ else
+ if test "`${NM} conftest.o | grep xxyyzz_`" != ""; then
+ lf_cv_f77_append_underscore=yes
+ fi
+ fi
+ fi
+ AC_MSG_RESULT([$lf_cv_f77_append_underscore])
+ if test "$lf_cv_f77_append_underscore" = yes; then
+ AC_DEFINE(F77_APPEND_UNDERSCORE, 1)
+ fi
+ rm -f conftest.f
+])
+
+
+# -------------------------------------------------------------------------
+# This macro tests whether the compiler assigned to F77 is f2c compatible.
+# The answer; "yes" or "no" is stored in lf_f77_is_f2c_compatible
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_F77_IS_F2C_COMPATIBLE,[
+ AC_MSG_CHECKING([whether $F77 is f2c compatible])
+ trap 'rm -f ftest* ctest* core; exit 1' 1 3 15
+ lf_f77_is_f2c_compatible=no
+ cat > ftest.f <<EOF
+ INTEGER FUNCTION FORSUB (C, D)
+ CHARACTER *(*) C
+ INTEGER L
+ DOUBLE PRECISION D
+ L = LEN (C)
+ WRITE (*, '(A,1X,I2)') C(1:L), INT (D)
+ FORSUB = 1
+ RETURN
+ END
+EOF
+
+ ${F77-f77} -c ftest.f 1>&AC_FD_CC 2>&AC_FD_CC
+ changequote(, )dnl
+ cat > ctest.c <<EOF
+#include "confdefs.h"
+static char s[14];
+int main ()
+{
+ double d = 10.0;
+ int len;
+ strcpy (s, "FOO-I-HITHERE");
+ len = strlen (s);
+#ifdef F77_APPEND_UNDERSCORE
+ return (! forsub_ (s, &d, len));
+#else
+ return (! forsub (s, &d, len));
+#endif
+}
+#if defined (sun)
+int MAIN_ () { return 0; }
+#elif defined (linux) && defined (__ELF__)
+int MAIN__ () { return 0; }
+#endif
+EOF
+ changequote([, ])
+ if ${CC-cc} -c ctest.c 1>&AC_FD_CC 2>&AC_FD_CC; then
+ if ${CC-cc} -o ctest ctest.o ftest.o $FLIBS -lm 1>&AC_FD_CC 2>&AC_FD_CC; then
+ ctest_output=`./ctest 2>&1`
+ status=$?
+ if test $status -eq 0 && test "$ctest_output" = "FOO-I-HITHERE 10"; then
+ lf_f77_is_f2c_compatible=yes
+ fi
+ fi
+ fi
+ rm -f ftest* ctest* core
+ AC_MSG_RESULT($lf_f77_is_f2c_compatible)
+])
+
+# --------------------------------------------------------------------------
+# See what libraries are used by the Fortran compiler
+# Write a minimal program and compiler it with -v. I don't know what to
+# do if your compiler doesn't have -v
+# You must call LF_HOST_TYPE before calling this macro.
+# The result is returned in the variable FLIBS which is made
+# available in Makefile.am
+# ALSO: requires ac_cv_prog_gcc
+# --------------------------------------------------------------------------
+
+AC_DEFUN(LF_PATH_F77_LIBS,[
+ AC_MSG_CHECKING(for Fortran libraries)
+ dnl
+ dnl Write a minimal program and compile it with -v. I don't know
+ dnl what to do if your compiler doesn't have -v
+ dnl
+ changequote(, )dnl
+ echo " END" > conftest.f
+ foutput=`${F77-f77} -v -o conftest conftest.f 2>&1`
+ dnl
+ dnl The easiest thing to do for xlf output is to replace all the commas
+ dnl with spaces. Try to only do that if the output is really from xlf,
+ dnl since doing that causes problems on other systems.
+ dnl
+ xlf_p=`echo $foutput | grep xlfentry`
+ if test -n "$xlf_p"; then
+ foutput=`echo $foutput | sed 's/,/ /g'`
+ fi
+ dnl
+ ld_run_path=`echo $foutput | \
+ sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'`
+ dnl
+ dnl We are only supposed to find this on Solaris systems...
+ dnl Uh, the run path should be absolute, shouldn't it?
+ dnl
+ case "$ld_run_path" in
+ /*)
+ if test "$ac_cv_prog_gcc" = yes; then
+ ld_run_path="-Xlinker -R -Xlinker $ld_run_path"
+ else
+ ld_run_path="-R $ld_run_path"
+ fi
+ ;;
+ *)
+ ld_run_path=
+ ;;
+ esac
+ dnl
+ flibs=
+ lflags=
+ dnl
+ dnl If want_arg is set, we know we want the arg to be added to the list,
+ dnl so we don't have to examine it.
+ dnl
+ want_arg=
+ dnl
+ for arg in $foutput; do
+ old_want_arg=$want_arg
+ want_arg=
+ dnl
+ dnl None of the options that take arguments expect the argument to
+ dnl start with a -, so pretend we didn't see anything special.
+ dnl
+ if test -n "$old_want_arg"; then
+ case "$arg" in
+ -*)
+ old_want_arg=
+ ;;
+ esac
+ fi
+ case "$old_want_arg" in
+ '')
+ case $arg in
+ /*.a)
+ exists=false
+ for f in $lflags; do
+ if test x$arg = x$f; then
+ exists=true
+ fi
+ done
+ if $exists; then
+ arg=
+ else
+ lflags="$lflags $arg"
+ fi
+ ;;
+ -bI:*)
+ exists=false
+ for f in $lflags; do
+ if test x$arg = x$f; then
+ exists=true
+ fi
+ done
+ if $exists; then
+ arg=
+ else
+ if test "$ac_cv_prog_gcc" = yes; then
+ lflags="$lflags -Xlinker $arg"
+ else
+ lflags="$lflags $arg"
+ fi
+ fi
+ ;;
+ -lang* | -lcrt0.o | -lc | -lgcc)
+ arg=
+ ;;
+ -[lLR])
+ want_arg=$arg
+ arg=
+ ;;
+ -[lLR]*)
+ exists=false
+ for f in $lflags; do
+ if test x$arg = x$f; then
+ exists=true
+ fi
+ done
+ if $exists; then
+ arg=
+ else
+ case "$arg" in
+ -lkernel32)
+ case "$canonical_host_type" in
+ *-*-cygwin32)
+ ;;
+ *)
+ lflags="$lflags $arg"
+ ;;
+ esac
+ ;;
+ -lm)
+ ;;
+ *)
+ lflags="$lflags $arg"
+ ;;
+ esac
+ fi
+ ;;
+ -u)
+ want_arg=$arg
+ arg=
+ ;;
+ -Y)
+ want_arg=$arg
+ arg=
+ ;;
+ *)
+ arg=
+ ;;
+ esac
+ ;;
+ -[lLR])
+ arg="$old_want_arg $arg"
+ ;;
+ -u)
+ arg="-u $arg"
+ ;;
+ -Y)
+ dnl
+ dnl Should probably try to ensure unique directory options here too.
+ dnl This probably only applies to Solaris systems, and then will only
+ dnl work with gcc...
+ dnl
+ arg=`echo $arg | sed -e 's%^P,%%'`
+ SAVE_IFS=$IFS
+ IFS=:
+ list=
+ for elt in $arg; do
+ list="$list -L$elt"
+ done
+ IFS=$SAVE_IFS
+ arg="$list"
+ ;;
+ esac
+ dnl
+ if test -n "$arg"; then
+ flibs="$flibs $arg"
+ fi
+ done
+ if test -n "$ld_run_path"; then
+ flibs_result="$ld_run_path $flibs"
+ else
+ flibs_result="$flibs"
+ fi
+ changequote([, ])dnl
+ rm -f conftest.f conftest.o conftest
+ dnl
+ dnl Phew! Done! Now, output the result
+ dnl
+ FLIBS="$flibs_result"
+ AC_MSG_RESULT([$FLIBS])
+ AC_SUBST(FLIBS)
+])
+
+
+
+
+
+
+
--- /dev/null
+++ b/common/id3lib/m4/lf_host_type.m4
@@ -1,0 +1,45 @@
+dnl Autoconf support for C++
+dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+# -----------------------------------------------------------------------
+# This macro determines hardware-vendor-os information and
+# sets the variable ``canonical_host_type'' to that information
+# ------------------------------------------------------------------------
+
+dnl ACCONFIG TEMPLATE
+dnl #undef YOUR_OS
+dnl END ACCONFIG
+
+AC_DEFUN(LF_HOST_TYPE, [
+ AC_CANONICAL_HOST
+ if test -z "$host"
+ then
+ host=unknown
+ fi
+ canonical_host_type=$host
+ if test "$host" = unknown
+ then
+ AC_MSG_WARN(configuring for unknown system type)
+ fi
+ AC_SUBST(canonical_host_type)
+ AC_DEFINE_UNQUOTED(YOUR_OS,"$canonical_host_type")
+])
--- /dev/null
+++ b/common/id3lib/m4/lf_lisp.m4
@@ -1,0 +1,42 @@
+dnl Copyright (C) 1998 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+AC_DEFUN(LF_PATH_LISPDIR,[
+ dnl If set to t, that means we are running in a shell under Emacs.
+ dnl If you have an Emacs named "t", then use the full path.
+ test "$EMACS" = t && EMACS=
+ AC_PATH_PROG(EMACS, emacs xemacs, no)
+ if test "$EMACS" != "no"
+ then
+ AC_MSG_CHECKING([where .elc files should go])
+ dnl Emulate dirname with awk to obtain the directory in which emacs
+ dnl was installed
+ lf_emacs_prefix=`echo $EMACS |
+ awk -F/ '{ for (i=1; i<NF; i++) printf("%s/",$i) }' |
+ sed 's/\/bin\///g'`
+ dnl Now check whether the site-lisp directory is under
+ dnl lf_emacs_prefix/share/emacs/site-lisp
+ dnl lf_emacs_prefix/lib/emacs/site-lisp
+ lispdir="${lf_emacs_prefix}/share/emacs/site-lisp"
+ AC_MSG_RESULT($lispdir)
+ fi
+ AC_SUBST(lispdir)
+])
--- /dev/null
+++ b/common/id3lib/m4/lf_local.m4
@@ -1,0 +1,162 @@
+dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+# ------------------------------------------------------------------------
+# The following macro is useful for deep packages. It allows you to
+# link all the header files *.h under a certain set of directories
+# to be linked under an include directory from the toplevel.
+# To use this feature in your configure.in call:
+# LF_LINK_HEADERS(dir1 dir2 dir3 .... , [directory] )
+# where directory -> put links under include/directory
+# dir1 ... -> the directories with header files we want to link
+# WARNING: This macro will do --> rm -rf include
+# ------------------------------------------------------------------------
+
+AC_DEFUN(LF_LINK_HEADERS,[
+ # Find out how to link files if we haven't already
+ if test -z "$LN_S"
+ then
+ AC_PROG_LN_S
+ fi
+
+ # Remove the include directory if we haven't done that yet
+ if test -z "$lf_link_headers"
+ then
+ lf_link_headers="we are all Kosh"
+ rm -rf "$srcdir/include"
+ fi
+
+ # Get the directory from the second argument which is optional
+ ifelse([$2], ,
+ [lf_directory="$srcdir/include"] ,
+ [lf_directory="$srcdir/include/$2"])
+ ${srcdir}/mkinstalldirs "$lf_directory"
+
+ # Link them
+ lf_subdirs="`echo $1`"
+ for lf_dir in $lf_subdirs
+ do
+ # Otherwise go ahead and link
+ echo "linking headers from $srcdir/$lf_dir"
+ # Check if the Headers file exists
+ if test -f "$srcdir/$lf_dir/Headers"
+ then
+ for lf_file in `(cd $srcdir/$lf_dir; cat Headers)`
+ do
+ rm -f $lf_directory/$lf_file
+ $LN_S "`pwd`/$srcdir/$lf_dir/$lf_file" "$lf_directory/$lf_file"
+ done
+ else
+ echo "Warning: No Headers file for $srcdir/$lf_dir"
+ fi
+ done
+])
+
+# --------------------------------------------------------------------------
+# The following macro is useful for deep packages.
+# To use it in your configure.in call
+# LF_SET_INCLUDES(dir1 dir2 dir3 ...)
+# and in your Makefile.am set
+# @default-includes@
+# Then this symbol will be substituted with
+# INCLUDES = -I$(prefix) -I$(top_builddir)/include/dir1 ...
+# The prefix entry will be skipped if the prefix is equal to /usr/local
+# or /usr
+# --------------------------------------------------------------------------
+
+AC_DEFUN(LF_SET_INCLUDES,[
+ # See whether to put an entry for the prefix
+ if test "$prefix" = "/usr" || test "$prefix" = "/usr/local"
+ then
+ default_includes=""
+ else
+ default_includes="-I\$(prefix) "
+ fi
+
+ # Get the directory list
+ lf_dirs="`echo $1`"
+
+ # Check whether we have a lib directory. If so put it in
+ AC_MSG_CHECKING([whether sources have a lib directory])
+ if test -d "`pwd`/$srcdir/lib"
+ then
+ AC_MSG_RESULT([yes])
+ default_includes="$default_includes -I\$(top_srcdir)/lib"
+ else
+ AC_MSG_RESULT([no])
+ fi
+
+ # Now add in the directories. If the list is empty then just add include/
+ # If the list is not empty then add the subdirectories.
+ if test -z "$lf_dirs"
+ then
+ default_includes="$default_includes -I\$(top_srcdir)/include"
+ else
+ for lf_dir in $lf_dirs
+ do
+ default_includes="$default_includes -I\$(top_srcdir)/include/$lf_dir"
+ done
+ fi
+
+ # And that's it
+ AC_SUBST(default_includes)
+])
+
+AC_DEFUN(LF_LINK_HEADERS_FUCK,[
+ # If we haven't initialized then initialize
+ if test -z "$lf_link_headers_initialized"
+ then
+ lf_link_headers_initialized="we are all Kosh"
+ rm -rf include
+ rm -f config.includes
+ touch config.includes
+ AC_OUTPUT_COMMANDS([
+ cat config.includes | awk '{
+ print "lf_dir=" $$1
+ print "lf_directory=" $$2
+ print "echo \"Linking headers from $lf_dir\" "
+ print "if test -f \"$lf_dir/Headers\" "
+ print "then"
+ print " for lf_file in `(cd $lf_dir; cat Headers)`"
+ print " do"
+ print " rm -f $lf_directory/$lf_file"
+ print " ln `pwd`/$lf_dir/$lf_file $lf_directory/$lf_file"
+ print " done"
+ print "else"
+ print " echo \"Warning: No headers file for $lf_dir\" "
+ print "fi"
+ }' | sh
+ ])
+ fi
+
+ # Get the directory from the second argument which is optional
+ ifelse([$2], ,
+ [lf_directory=include] ,
+ [lf_directory=include/$2])
+ mkinstalldirs $lf_directory 2> /dev/null > /dev/null
+
+ # Go over the subdirectories and add entries to config.includes
+ lf_subdirs=`echo $1`
+ for lf_dir in $lf_subdirs
+ do
+ echo "$lf_dir $lf_directory" >> config.includes
+ done
+])
--- /dev/null
+++ b/common/id3lib/m4/lf_nm.m4
@@ -1,0 +1,64 @@
+dnl Copyright (C) 1996-1998 Free Software Foundation, Inc.
+dnl Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you distribute
+dnl this file as part of a program that contains a configuration script
+dnl generated by Autoconf, you may include it under the same distribution
+dnl terms that you use for the rest of that program.
+
+dnl This macro has been taken from libtool.m4
+dnl It detects how to call 'nm' in a BSD compatible way and stores
+dnl the result in NM.
+dnl I have had to cut and paste this file from the libtool distribution
+dnl and distribute it seperately because it confuses aclocal when all
+dnl the libtool macros get shoved into aclocal.m4
+dnl Also, we shouldn't have to force people to install libtool, if all
+dnl they want to do is Fortran.
+
+AC_DEFUN(LF_PROG_NM,
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(ac_cv_path_NM,
+[case "$NM" in
+/* | [A-Za-z]:\\*)
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac])
+NM="$ac_cv_path_NM"
+AC_MSG_RESULT([$NM])
+AC_SUBST(NM)
+])
--- /dev/null
+++ b/common/id3lib/m4/lf_texidoc.m4
@@ -1,0 +1,51 @@
+dnl Copyright (C) 1998 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+AC_DEFUN(LF_USE_TEXIDOC,[
+ dnl Check for the following utilities, needed by texidoc makefiles
+ AC_PATH_PROGS(PERL, perl perl5, nope)
+ AC_PATH_PROGS(TEX, tex, nope)
+ AC_PATH_PROGS(TEXI2DVI, texi2dvi, nope)
+ AC_PATH_PROGS(DVIPS, dvips, nope)
+
+ dnl Verify that all the needed programs are here, otherwise issue warnings
+ if test "$PERL" = nope
+ then
+ AC_MSG_WARN([missing perl. Need perl to build documentation.])
+ fi
+ if test "$TEX" = nope
+ then
+ AC_MSG_WARN([missing tex. Need tex to build documentation.])
+ fi
+ if test "$TEXI2DVI" = nope
+ then
+ AC_MSG_WARN([missing texi2dvi. Need texi2dvi to build documentation.])
+ fi
+ if test "$DVIPS" = nope
+ then
+ AC_MSG_WARN([missing dvips. Need dvips to build documentation.])
+ fi
+
+ dnl Export the pathnames to Automake
+ AC_SUBST(PERL)
+ AC_SUBST(TEXI2DVI)
+ AC_SUBST(DVIPS)
+])
--- /dev/null
+++ b/common/id3lib/m4/lf_txtc.m4
@@ -1,0 +1,35 @@
+dnl Copyright (C) 1998 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you distribute
+dnl this file as part of a program that contains a configuration script
+dnl generated by Autoconf, you may include it under the same distribution
+dnl terms that you use for the rest of that program.
+
+AC_DEFUN(LF_PROG_TXTC,[
+ AC_MSG_CHECKING(for the txtc compiler)
+ TXTC='$(SHELL) $(top_builddir)/txtc.sh'
+ if test -f $srcdir/txtc.sh.in
+ then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN([Cannot find the txtc.sh compiler.])
+ AC_MSG_WARN([Please use the mktxtc utility to generate one at the]),
+ AC_MSG_WARN([toplevel directory, otherwise this package will not compile.])
+ fi
+ AC_SUBST(TXTC)
+])
--- /dev/null
+++ b/common/id3lib/m4/lf_warnings.m4
@@ -1,0 +1,127 @@
+dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+# --------------------------------------------------------------------------
+# Check whether the C++ compiler accepts a certain flag
+# If it does it adds the flag to CXXFLAGS
+# If it does not then it returns an error to lf_ok
+# Usage:
+# LF_CHECK_CXX_FLAG(-flag1 -flag2 -flag3 ...)
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_CHECK_CXX_FLAG,[
+ echo 'void f(){}' > conftest.cc
+ for i in $1
+ do
+ AC_MSG_CHECKING([whether $CXX accepts $i])
+ if test -z "`${CXX} $i -c conftest.cc 2>&1`"
+ then
+ CXXFLAGS="${CXXFLAGS} $i"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+ rm -f conftest.cc conftest.o
+])
+
+# --------------------------------------------------------------------------
+# Check whether the C compiler accepts a certain flag
+# If it does it adds the flag to CFLAGS
+# If it does not then it returns an error to lf_ok
+# Usage:
+# LF_CHECK_CC_FLAG(-flag1 -flag2 -flag3 ...)
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_CHECK_CC_FLAG,[
+ echo 'void f(){}' > conftest.c
+ for i in $1
+ do
+ AC_MSG_CHECKING([whether $CC accepts $i])
+ if test -z "`${CC} $i -c conftest.c 2>&1`"
+ then
+ CFLAGS="${CFLAGS} $i"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+ rm -f conftest.c conftest.o
+])
+
+# --------------------------------------------------------------------------
+# Check whether the Fortran compiler accepts a certain flag
+# If it does it adds the flag to FFLAGS
+# If it does not then it returns an error to lf_ok
+# Usage:
+# LF_CHECK_F77_FLAG(-flag1 -flag2 -flag3 ...)
+# -------------------------------------------------------------------------
+
+AC_DEFUN(LF_CHECK_F77_FLAG,[
+ cat << EOF > conftest.f
+c....:++++++++++++++++++++++++
+ PROGRAM MAIN
+ PRINT*,'Hello World!'
+ END
+EOF
+ for i in $1
+ do
+ AC_MSG_CHECKING([whether $F77 accepts $i])
+ if test -z "`${F77} $i -c conftest.f 2>&1`"
+ then
+ FFLAGS="${FFLAGS} $i"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ done
+ rm -f conftest.f conftest.o
+])
+
+# ----------------------------------------------------------------------
+# Provide the configure script with an --with-warnings option that
+# turns on warnings. Call this command AFTER you have configured ALL your
+# compilers.
+# ----------------------------------------------------------------------
+
+AC_DEFUN(LF_SET_WARNINGS,[
+ dnl Check for --with-warnings
+ AC_MSG_CHECKING([whether user wants warnings])
+ AC_ARG_WITH(warnings,
+ [ --with-warnings Turn on warnings],
+ [ lf_warnings=yes ], [ lf_warnings=no ])
+ AC_MSG_RESULT($lf_warnings)
+
+ dnl Warnings for the two main compilers
+ cc_warning_flags="-Wall"
+ cxx_warning_flags="-Wall -Woverloaded-virtual -Wtemplate-debugging"
+ if test $lf_warnings = yes
+ then
+ if test -n "${CC}"
+ then
+ LF_CHECK_CC_FLAG($cc_warning_flags)
+ fi
+ if test -n "${CXX}"
+ then
+ LF_CHECK_CXX_FLAG($cxx_warning_flags)
+ fi
+ fi
+])
--- /dev/null
+++ b/common/id3lib/m4/lf_x11.m4
@@ -1,0 +1,39 @@
+dnl Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a configuration
+dnl script generated by Autoconf, you may include it under the same
+dnl distribution terms that you use for the rest of that program.
+
+
+#-----------------------------------------------------------------------
+# This macro searches for Xlib and when it finds it it adds the
+# appropriate flags to CXXFLAGS and export the link sequence to
+# the variable XLIB.
+# In your configure.in file add:
+# LF_PATH_XLIB
+# In your Makefile.am add
+# program_LDADD = .... $(XLIB)
+#------------------------------------------------------------------------
+
+AC_DEFUN(LF_PATH_XLIB,[
+ AC_PATH_XTRA
+ CXXFLAGS="$CXXFLAGS $X_CFLAGS"
+ XLIB="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+ AC_SUBST(XLIB)
+])
+
--- /dev/null
+++ b/common/id3lib/missing
@@ -1,0 +1,190 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+case "$1" in
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing - GNU libit 0.0"
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+ aclocal)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acinclude.m4' or \`configure.in'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`configure.in'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`acconfig.h' or \`configure.in'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ fi
+ touch $file
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequirements for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
--- /dev/null
+++ b/common/id3lib/mkinstalldirs
@@ -1,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id: mkinstalldirs,v 1.1 2002/01/21 08:16:20 menno Exp $
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
--- /dev/null
+++ b/common/id3lib/reconf
@@ -1,0 +1,24 @@
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+#!/bin/sh
+rm -f config.cache
+rm -f acconfig.h
+echo "- aclocal."
+aclocal -I m4
+echo "- autoconf."
+autoconf
+echo "- acconfig."
+./acconfig
+echo "- autoheader."
+autoheader
+echo "- automake."
+automake -a
+exit
--- /dev/null
+++ b/common/id3lib/rename.pl
@@ -1,0 +1,58 @@
+#!/usr/bin/perl
+
+%vars =
+ (
+ "__pFrameList" => "__frames",
+ "__pBinaryList" => "__binaries",
+ "__pFindCursor" => "__cursor",
+ "__bSyncOn" => "__is_unsync",
+ "__bCompression" => "__is_compressed",
+ "__bPadding" => "__is_padded",
+ "__bExtendedHeader" => "__is_extended",
+ "__bHasChanged" => "__changed",
+ "__bFileWritable" => "__is_file_writable",
+ "__fFileHandle" => "__file_handle",
+ "__ulFileSize" => "__file_size",
+ "__ulOldTagSize" => "__orig_tag_size",
+ "__ulExtraBytes" => "__extra_bytes",
+ "__bHasV1Tag" => "__has_v1_tag",
+ "__ulTagsToParse" => "__tags_to_parse",
+ "__sFileName" => "__file_name",
+ "s_ulInstances" => "__instances",
+ "__sEncryptionID" => "__encryption_id",
+ "__sGroupingID" => "__grouping_id",
+ "__bHasChanged" => "__changed",
+ "__auiFieldBits" => "__field_bitset",
+ "__ulNumFields" => "__num_fields",
+ "__apFields" => "__fields",
+ "__FrmHdr" => "__hdr",
+ "__eName" => "__id",
+ "__eType" => "__type",
+ "__ulFixedLength" => "__length",
+ "__eSpecBegin" => "__spec_begin",
+ "__eSpecEnd" => "__spec_end",
+ "__ulFlags" => "__flags",
+ "__bHasChanged" => "__changed",
+ "__sData" => "__data",
+ "__ulSize" => "__size",
+ "__eError" => "__error",
+ "__nErrLine" => "__line_num",
+ "__sErrFileName" => "__file_name",
+ "__sErrDesc" => "__description",
+ );
+
+#open(VARIABLES, "variables.txt") or die "Can't open variables.txt: $!\n";
+#while ($line = <VARIABLES>)
+# {
+# ($oldname, $newname) = split(" ", $line);
+# $vars{$oldname} = $newname;
+# }
+
+while (<>)
+ {
+ foreach $oldvar (sort keys %vars)
+ {
+ s/$oldvar/$vars{$oldvar}/g;
+ }
+ print;
+ }
--- /dev/null
+++ b/common/id3lib/src/.cvsignore
@@ -1,0 +1,35 @@
+.deps
+.libs
+Makefile
+bak
+c_wrapper.lo
+dll_wrapper.lo
+error.lo
+field.lo
+field_binary.lo
+field_integer.lo
+field_string_ascii.lo
+field_string_unicode.lo
+frame.lo
+frame_parse.lo
+frame_render.lo
+globals.lo
+header.lo
+header_frame.lo
+header_tag.lo
+int28.lo
+libid3.la
+misc_support.lo
+old
+spec.lo
+tag.lo
+tag_file.lo
+tag_find.lo
+tag_parse.lo
+tag_parse_lyrics3.lo
+tag_parse_v1.lo
+tag_render.lo
+tag_sync.lo
+uint28.lo
+utils.lo
+version.lo
--- /dev/null
+++ b/common/id3lib/src/Makefile.am
@@ -1,0 +1,63 @@
+# $Id: Makefile.am,v 1.1 2002/01/21 08:16:21 menno Exp $
+#
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+LT_VERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+
+if ID3_NEEDZLIB
+zlib_include = -I$(top_srcdir)/zlib/include
+else
+zlib_include =
+endif
+
+INCLUDES = \
+ @ID3LIB_DEBUG_FLAGS@ -I$(top_srcdir)/include/id3 -I$(top_srcdir)/include $(zlib_include)
+
+id3lib_sources = \
+ c_wrapper.cpp \
+ error.cpp \
+ field.cpp \
+ field_binary.cpp \
+ field_integer.cpp \
+ field_string_ascii.cpp \
+ field_string_unicode.cpp \
+ frame.cpp \
+ frame_parse.cpp \
+ frame_render.cpp \
+ globals.cpp \
+ header.cpp \
+ header_frame.cpp \
+ header_tag.cpp \
+ misc_support.cpp \
+ spec.cpp \
+ tag.cpp \
+ tag_file.cpp \
+ tag_find.cpp \
+ tag_parse.cpp \
+ tag_parse_lyrics3.cpp \
+ tag_parse_v1.cpp \
+ tag_render.cpp \
+ tag_sync.cpp \
+ uint28.cpp \
+ utils.cpp
+
+lib_LTLIBRARIES = libid3.la
+
+libid3_la_SOURCES = $(id3lib_sources)
+if ID3_NEEDZLIB
+LDADD = $(top_builddir)/zlib/src/libz.la
+else
+libid3_la_LIBADD = -lz
+endif
+libid3_la_LDFLAGS = \
+ -version-info $(LT_VERSION) \
+ -release $(LT_RELEASE) \
+ -export-dynamic
--- /dev/null
+++ b/common/id3lib/src/Makefile.in
@@ -1,0 +1,420 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# $Id: Makefile.in,v 1.1 2002/01/21 08:16:21 menno Exp $
+#
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+LT_VERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+@ID3_NEEDZLIB_TRUE@zlib_include = -I$(top_srcdir)/zlib/include
+@ID3_NEEDZLIB_FALSE@zlib_include =
+
+INCLUDES = @ID3LIB_DEBUG_FLAGS@ -I$(top_srcdir)/include/id3 -I$(top_srcdir)/include $(zlib_include)
+
+
+id3lib_sources = c_wrapper.cpp error.cpp field.cpp field_binary.cpp field_integer.cpp field_string_ascii.cpp field_string_unicode.cpp frame.cpp frame_parse.cpp frame_render.cpp globals.cpp header.cpp header_frame.cpp header_tag.cpp misc_support.cpp spec.cpp tag.cpp tag_file.cpp tag_find.cpp tag_parse.cpp tag_parse_lyrics3.cpp tag_parse_v1.cpp tag_render.cpp tag_sync.cpp uint28.cpp utils.cpp
+
+
+lib_LTLIBRARIES = libid3.la
+
+libid3_la_SOURCES = $(id3lib_sources)
+@ID3_NEEDZLIB_TRUE@LDADD = $(top_builddir)/zlib/src/libz.la
+@ID3_NEEDZLIB_FALSE@libid3_la_LIBADD = -lz
+libid3_la_LDFLAGS = -version-info $(LT_VERSION) -release $(LT_RELEASE) -export-dynamic
+
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(lib_LTLIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+@ID3_NEEDZLIB_FALSE@libid3_la_DEPENDENCIES =
+libid3_la_OBJECTS = c_wrapper.lo error.lo field.lo field_binary.lo \
+field_integer.lo field_string_ascii.lo field_string_unicode.lo frame.lo \
+frame_parse.lo frame_render.lo globals.lo header.lo header_frame.lo \
+header_tag.lo misc_support.lo spec.lo tag.lo tag_file.lo tag_find.lo \
+tag_parse.lo tag_parse_lyrics3.lo tag_parse_v1.lo tag_render.lo \
+tag_sync.lo uint28.lo utils.lo
+CXXFLAGS = @CXXFLAGS@
+CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+DEP_FILES = .deps/c_wrapper.P .deps/error.P .deps/field.P \
+.deps/field_binary.P .deps/field_integer.P .deps/field_string_ascii.P \
+.deps/field_string_unicode.P .deps/frame.P .deps/frame_parse.P \
+.deps/frame_render.P .deps/globals.P .deps/header.P \
+.deps/header_frame.P .deps/header_tag.P .deps/misc_support.P \
+.deps/spec.P .deps/tag.P .deps/tag_file.P .deps/tag_find.P \
+.deps/tag_parse.P .deps/tag_parse_lyrics3.P .deps/tag_parse_v1.P \
+.deps/tag_render.P .deps/tag_sync.P .deps/uint28.P .deps/utils.P
+SOURCES = $(libid3_la_SOURCES)
+OBJECTS = $(libid3_la_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .cpp .lo .o .s
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-libLTLIBRARIES:
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+
+distclean-libLTLIBRARIES:
+
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+ done
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+libid3.la: $(libid3_la_OBJECTS) $(libid3_la_DEPENDENCIES)
+ $(CXXLINK) -rpath $(libdir) $(libid3_la_LDFLAGS) $(libid3_la_OBJECTS) $(libid3_la_LIBADD) $(LIBS)
+.cpp.o:
+ $(CXXCOMPILE) -c $<
+.cpp.lo:
+ $(LTCXXCOMPILE) -c $<
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = src
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+ @echo '$(COMPILE) -c $<'; \
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.c
+ @echo '$(LTCOMPILE) -c $<'; \
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+
+%.o: %.cpp
+ @echo '$(CXXCOMPILE) -c $<'; \
+ $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.cpp
+ @echo '$(LTCXXCOMPILE) -c $<'; \
+ $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-libLTLIBRARIES
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-libLTLIBRARIES
+uninstall: uninstall-am
+all-am: Makefile $(LTLIBRARIES)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \
+ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
+ clean-depend clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-libLTLIBRARIES distclean-compile \
+ distclean-libtool distclean-tags distclean-depend \
+ distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-libLTLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+mostlyclean-libtool distclean-libtool clean-libtool \
+maintainer-clean-libtool tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/src/c_wrapper.cpp
@@ -1,0 +1,877 @@
+// $Id: c_wrapper.cpp,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include "tag.h"
+#include "id3.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+ // tag wrappers
+
+ ID3_C_EXPORT
+ ID3Tag *ID3Tag_New(void)
+ {
+ ID3_Tag* tag = NULL;
+ try
+ {
+ tag = new ID3_Tag;
+ }
+ catch (...)
+ {
+ }
+
+ return (ID3Tag *) tag;
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Tag_Delete(ID3Tag *tag)
+ {
+ try
+ {
+ if (tag)
+ {
+ delete (ID3_Tag*) tag;
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Tag_Clear(ID3Tag *tag)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag*) tag)->Clear();
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ bool ID3Tag_HasChanged(const ID3Tag *tag)
+ {
+ bool changed = false;
+
+ try
+ {
+ if (tag)
+ {
+ changed = ((const ID3_Tag * ) tag)->HasChanged();
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return changed;
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Tag_SetUnsync(ID3Tag *tag, bool unsync)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->SetUnsync(unsync);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Tag_SetExtendedHeader(ID3Tag *tag, bool ext)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->SetExtendedHeader(ext);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Tag_SetCompression(ID3Tag *tag, bool comp)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->SetCompression(comp);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Tag_SetPadding(ID3Tag *tag, bool pad)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->SetPadding(pad);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Tag_AddFrame(ID3Tag *tag, const ID3Frame *frame)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->AddFrame((const ID3_Frame *) frame);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Tag_AttachFrame(ID3Tag *tag, ID3Frame *frame)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->AttachFrame((ID3_Frame *) frame);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Tag_AddFrames(ID3Tag *tag, const ID3Frame *frames, size_t num)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->AddFrames((const ID3_Frame *) frames, num);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ ID3Frame* ID3Tag_RemoveFrame(ID3Tag *tag, const ID3Frame *frame)
+ {
+ ID3_Frame* rem_frame = NULL;
+ try
+ {
+ if (tag)
+ {
+ rem_frame = (((ID3_Tag *) tag)->RemoveFrame((const ID3_Frame *) frame));
+ }
+ }
+ catch (...)
+ {
+ }
+ return (ID3Frame*) rem_frame;
+ }
+
+
+ ID3_C_EXPORT
+ ID3_Err ID3Tag_Parse(ID3Tag *tag, const uchar header[ ID3_TAGHEADERSIZE ],
+ const uchar *buffer)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->Parse(header, buffer);
+ }
+ }
+ catch (ID3_Error &err)
+ {
+ return err.GetErrorID();
+ }
+ return ID3E_NoError;
+ }
+
+
+ ID3_C_EXPORT
+ size_t ID3Tag_Link(ID3Tag *tag, const char *fileName)
+ {
+ size_t offset = 0;
+
+ try
+ {
+ if (tag)
+ {
+ offset = ((ID3_Tag *) tag)->Link(fileName);
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return offset;
+ }
+
+
+ ID3_C_EXPORT
+ ID3_Err ID3Tag_Update(ID3Tag *tag)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->Update();
+ }
+ }
+ catch (ID3_Error &err)
+ {
+ return err.GetErrorID();
+ }
+
+ return ID3E_NoError;
+ }
+
+ ID3_C_EXPORT
+ ID3_Err ID3Tag_UpdateByTagType(ID3Tag *tag, flags_t tag_type)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->Update(tag_type);
+ }
+ }
+ catch (ID3_Error &err)
+ {
+ return err.GetErrorID();
+ }
+
+ return ID3E_NoError;
+ }
+
+
+ ID3_C_EXPORT
+ ID3_Err ID3Tag_Strip(ID3Tag *tag, flags_t ulTagFlags)
+ {
+ try
+ {
+ if (tag)
+ {
+ ((ID3_Tag *) tag)->Strip(ulTagFlags);
+ }
+ }
+ catch (ID3_Error &err)
+ {
+ return err.GetErrorID();
+ }
+
+ return ID3E_NoError;
+ }
+
+
+ ID3_C_EXPORT
+ ID3Frame *ID3Tag_FindFrameWithID(const ID3Tag *tag, ID3_FrameID id)
+ {
+ ID3_Frame *frame = NULL;
+
+ try
+ {
+ if (tag)
+ {
+ frame = ((const ID3_Tag *) tag)->Find(id);
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return (ID3Frame *) frame;
+ }
+
+
+ ID3_C_EXPORT
+ ID3Frame *ID3Tag_FindFrameWithINT(const ID3Tag *tag, ID3_FrameID id,
+ ID3_FieldID fld, uint32 data)
+ {
+ ID3_Frame *frame = NULL;
+
+ try
+ {
+ if (tag)
+ {
+ frame = ((const ID3_Tag *) tag)->Find(id, fld, data);
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return (ID3Frame *) frame;
+ }
+
+
+ ID3_C_EXPORT
+ ID3Frame *ID3Tag_FindFrameWithASCII(const ID3Tag *tag, ID3_FrameID id,
+ ID3_FieldID fld, const char *data)
+ {
+ ID3_Frame *frame = NULL;
+
+ try
+ {
+ if (tag)
+ {
+ frame = ((const ID3_Tag *) tag)->Find(id, fld, data);
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return (ID3Frame *) frame;
+ }
+
+
+ ID3_C_EXPORT
+ ID3Frame *ID3Tag_FindFrameWithUNICODE(const ID3Tag *tag, ID3_FrameID id,
+ ID3_FieldID fld, const unicode_t *data)
+ {
+ ID3_Frame *frame = NULL;
+
+ try
+ {
+ if (tag)
+ {
+ frame = ((const ID3_Tag *) tag)->Find(id, fld, data);
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return (ID3Frame *) frame;
+ }
+
+
+ ID3_C_EXPORT
+ size_t ID3Tag_NumFrames(const ID3Tag *tag)
+ {
+ size_t num = 0;
+
+ try
+ {
+ if (tag)
+ {
+ num = ((const ID3_Tag *) tag)->NumFrames();
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return num;
+ }
+
+
+ ID3_C_EXPORT
+ ID3Frame *ID3Tag_GetFrameNum(const ID3Tag *tag, index_t num)
+ {
+ ID3_Frame *frame = NULL;
+
+ try
+ {
+ if (tag)
+ {
+ frame = ((const ID3_Tag *) tag)->GetFrameNum(num);
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return (ID3Frame *) frame;
+ }
+
+
+ // frame wrappers
+
+ ID3_C_EXPORT
+ ID3Frame *ID3Frame_New(void)
+ {
+ ID3_Frame* frame = NULL;
+ try
+ {
+ frame = new ID3_Frame;
+ }
+ catch (...)
+ {
+ }
+
+ return (ID3Frame *) frame;
+ }
+
+ ID3_C_EXPORT
+ ID3Frame *ID3Frame_NewID(ID3_FrameID id)
+ {
+ ID3_Frame* frame = NULL;
+ try
+ {
+ frame = new ID3_Frame(id);
+ }
+ catch (...)
+ {
+ }
+
+ return (ID3Frame *) frame;
+ }
+
+ ID3_C_EXPORT
+ void ID3Frame_Delete(ID3Frame *frame)
+ {
+ try
+ {
+ if (frame)
+ {
+ delete (ID3_Frame *) frame;
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Frame_Clear(ID3Frame *frame)
+ {
+ try
+ {
+ if (frame)
+ {
+ ((ID3_Frame *) frame)->Clear();
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Frame_SetID(ID3Frame *frame, ID3_FrameID id)
+ {
+ try
+ {
+ if (frame)
+ {
+ ((ID3_Frame *) frame)->SetID(id);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ ID3_FrameID ID3Frame_GetID(const ID3Frame *frame)
+ {
+ ID3_FrameID id = ID3FID_NOFRAME;
+
+ try
+ {
+ if (frame)
+ {
+ id = ((const ID3_Frame *) frame)->GetID();
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return id;
+ }
+
+
+ ID3_C_EXPORT
+ ID3Field *ID3Frame_GetField(const ID3Frame *frame, ID3_FieldID name)
+ {
+ ID3_Field *field = NULL;
+
+ try
+ {
+ if (frame)
+ {
+ field = &( ((const ID3_Frame *) frame)->Field(name));
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return (ID3Field *) field;
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Frame_SetCompression(ID3Frame *frame, bool comp)
+ {
+ try
+ {
+ if (frame)
+ {
+ ((ID3_Frame *) frame)->SetCompression(comp);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ bool ID3Frame_GetCompression(const ID3Frame *frame)
+ {
+ try
+ {
+ if (frame)
+ {
+ return ((const ID3_Frame *) frame)->GetCompression();
+ }
+ }
+ catch (...)
+ {
+ }
+ return false;
+ }
+
+
+ // field wrappers
+
+
+ ID3_C_EXPORT
+ void ID3Field_Clear(ID3Field *field)
+ {
+ try
+ {
+ if (field)
+ {
+ ((ID3_Field *) field)->Clear();
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ size_t ID3Field_Size(const ID3Field *field)
+ {
+ size_t size = 0;
+
+ try
+ {
+ if (field)
+ {
+ size = ((const ID3_Field *) field)->Size();
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return size;
+ }
+
+
+ ID3_C_EXPORT
+ size_t ID3Field_GetNumTextItems(const ID3Field *field)
+ {
+ size_t items = 0;
+
+ try
+ {
+ if (field)
+ {
+ items = ((const ID3_Field *) field)->GetNumTextItems();
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return items;
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Field_SetINT(ID3Field *field, uint32 data)
+ {
+ try
+ {
+ if (field)
+ {
+ ((ID3_Field *) field)->Set(data);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ uint32 ID3Field_GetINT(const ID3Field *field)
+ {
+ uint32 value = 0;
+
+ try
+ {
+ if (field)
+ {
+ value = ((const ID3_Field *) field)->Get();
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return value;
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Field_SetUNICODE(ID3Field *field, const unicode_t *string)
+ {
+ try
+ {
+ if (field)
+ {
+ ((ID3_Field *) field)->Set(string);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ size_t ID3Field_GetUNICODE(const ID3Field *field, unicode_t *buffer,
+ size_t maxChars, index_t itemNum)
+ {
+ size_t numChars = 0;
+
+ try
+ {
+ if (field)
+ {
+ numChars = ((const ID3_Field *) field)->Get(buffer, maxChars, itemNum);
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return numChars;
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Field_AddUNICODE(ID3Field *field, const unicode_t *string)
+ {
+ try
+ {
+ if (field)
+ {
+ ((ID3_Field *) field)->Add(string);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Field_SetASCII(ID3Field *field, const char *string)
+ {
+ try
+ {
+ if (field)
+ {
+ ((ID3_Field *) field)->Set(string);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ size_t ID3Field_GetASCII(const ID3Field *field, char *buffer,
+ size_t maxChars, index_t itemNum)
+ {
+ size_t numChars = 0;
+
+ try
+ {
+ if (field)
+ {
+ numChars = ((const ID3_Field *) field)->Get(buffer, maxChars, itemNum);
+ }
+ }
+ catch (...)
+ {
+ }
+
+ return numChars;
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Field_AddASCII(ID3Field *field, const char *string)
+ {
+ try
+ {
+ if (field)
+ {
+ ((ID3_Field *) field)->Add(string);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Field_SetBINARY(ID3Field *field, const uchar *data, size_t size)
+ {
+ try
+ {
+ if (field)
+ {
+ ((ID3_Field *) field)->Set(data, size);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Field_GetBINARY(const ID3Field *field, uchar *buffer, size_t buffLength)
+ {
+ try
+ {
+ if (field)
+ {
+ ((const ID3_Field *) field)->Get(buffer, buffLength);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Field_FromFile(ID3Field *field, const char *fileName)
+ {
+ try
+ {
+ if (field)
+ {
+ ((ID3_Field *) field)->FromFile(fileName);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+
+ ID3_C_EXPORT
+ void ID3Field_ToFile(const ID3Field *field, const char *fileName)
+ {
+ try
+ {
+ if (field)
+ {
+ ((const ID3_Field *) field)->ToFile(fileName);
+ }
+ }
+ catch (...)
+ {
+ }
+ }
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
--- /dev/null
+++ b/common/id3lib/src/error.cpp
@@ -1,0 +1,93 @@
+// $Id: error.cpp,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+
+#include <string.h>
+#include "error.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+static char *ID3_ErrorDescs[] =
+{
+ "no error",
+ "out of memory",
+ "no source/dest data specified",
+ "improperly formatted id3 tag",
+ "no buffer specified",
+ "buffer is insufficient in size",
+ "invalid frame id",
+ "field not found",
+ "unknown field type",
+ "tag is already attached to a file",
+ "invalid tag version",
+ "file not found",
+ "trying to write to a read-only file",
+ "error in zlib compression library"
+};
+
+ID3_Error::ID3_Error(ID3_Err eCode, const char *sFileName,
+ size_t nLine, const char *sDesc)
+{
+ __error = eCode;
+ __line_num = nLine;
+ size_t nFileNameLen = strlen(sFileName);
+ size_t nDescLen = strlen(sDesc);
+
+ __file_name = new char[nFileNameLen+1];
+ __description = new char[nDescLen+1];
+ strncpy(__file_name, sFileName, nFileNameLen+1);
+ strncpy(__description, sDesc, nDescLen+1);
+}
+
+
+ID3_Err ID3_Error::GetErrorID() const
+{
+ return __error;
+}
+
+
+char *ID3_Error::GetErrorType() const
+{
+ return ID3_ErrorDescs[__error];
+}
+
+char *ID3_Error::GetErrorDesc() const
+{
+ return __description;
+}
+
+char *ID3_Error::GetErrorFile() const
+{
+ return __file_name;
+}
+
+
+size_t ID3_Error::GetErrorLine() const
+{
+ return __line_num;
+}
--- /dev/null
+++ b/common/id3lib/src/field.cpp
@@ -1,0 +1,1060 @@
+// $Id: field.cpp,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include "field.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// This is used for unimplemented frames so that their data is preserved when
+// parsing and rendering
+static ID3_FieldDef ID3FD_Unimplemented[] =
+{
+ {
+ ID3FN_DATA, // FIELD NAME
+ ID3FTY_BINARY, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ }
+};
+
+const ID3_FieldDef* ID3_FieldDef::DEFAULT = ID3FD_Unimplemented;
+
+static ID3_FieldDef ID3FD_URL[] =
+{
+ {
+ ID3FN_URL, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_UserURL[] =
+{
+ {
+ ID3FN_TEXTENC, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DESCRIPTION, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR | ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_URL, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_Text[] =
+{
+ {
+ ID3FN_TEXTENC, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_TEXT, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+
+static ID3_FieldDef ID3FD_UserText[] =
+{
+ {
+ ID3FN_TEXTENC, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DESCRIPTION, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR | ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_TEXT, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+
+static ID3_FieldDef ID3FD_GeneralText[] =
+{
+ {
+ ID3FN_TEXTENC, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_LANGUAGE, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 3, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DESCRIPTION, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR | ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_TEXT, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_TermsOfUse[] =
+{
+ {
+ ID3FN_TEXTENC, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_LANGUAGE, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 3, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_TEXT, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_LinkedInfo[] =
+{
+ {
+ ID3FN_ID, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 3, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_2_1, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_ID, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 4, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_URL, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_TEXT, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_Picture[] =
+{
+ {
+ ID3FN_TEXTENC, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_IMAGEFORMAT, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 3, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_2_1, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_MIMETYPE, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_PICTURETYPE, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DESCRIPTION, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR | ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DATA, // FIELD NAME
+ ID3FTY_BINARY, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_GEO[] =
+{
+ {
+ ID3FN_TEXTENC, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_MIMETYPE, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_FILENAME, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR | ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DESCRIPTION, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR | ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DATA, // FIELD NAME
+ ID3FTY_BINARY, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_UFI[] =
+{
+ {
+ ID3FN_OWNER, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DATA, // FIELD NAME
+ ID3FTY_BINARY, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_PlayCounter[] =
+{
+ {
+ ID3FN_COUNTER, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 4, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_Popularimeter[] =
+{
+ {
+ ID3FN_EMAIL, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_RATING, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_COUNTER, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 4, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_Private[] =
+{
+ {
+ ID3FN_OWNER, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DATA, // FIELD NAME
+ ID3FTY_BINARY, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+
+static ID3_FieldDef ID3FD_Registration[] =
+{
+ {
+ ID3FN_OWNER, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_ID, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DATA, // FIELD NAME
+ ID3FTY_BINARY, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_3_0, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_InvolvedPeople[] =
+{
+ {
+ ID3FN_TEXTENC, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_TEXT, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_TEXTLIST, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+static ID3_FieldDef ID3FD_CDM[] =
+{
+ {
+ ID3FN_DATA, // FIELD NAME
+ ID3FTY_BINARY, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_2_1, // INITIAL SPEC
+ ID3V2_2_1, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ }
+};
+
+static ID3_FieldDef ID3FD_SyncLyrics[] =
+{
+ {
+ ID3FN_TEXTENC, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_LANGUAGE, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 3, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_TIMESTAMPFORMAT, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_CONTENTTYPE, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DESCRIPTION, // FIELD NAME
+ ID3FTY_TEXTSTRING, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_CSTR | ID3FF_ENCODABLE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_DATA, // FIELD NAME
+ ID3FTY_BINARY, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+
+
+/*
+ * Currently unused
+ */
+#if defined __UNDEFINED__
+static ID3_FieldDef ID3FD_Volume[] =
+{
+ {
+ ID3FN_VOLUMEADJ, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_NUMBITS, // FIELD NAME
+ ID3FTY_INTEGER, // FIELD TYPE
+ 1, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_NONE, // FLAGS
+ ID3FN_NOFIELD // LINKED FIELD
+ },
+ {
+ ID3FN_VOLCHGRIGHT, // FIELD NAME
+ ID3FTY_BITFIELD, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_ADJUSTEDBY, // FLAGS
+ ID3FN_NUMBITS // LINKED FIELD
+ },
+ {
+ ID3FN_VOLCHGLEFT, // FIELD NAME
+ ID3FTY_BITFIELD, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_ADJUSTEDBY, // FLAGS
+ ID3FN_NUMBITS // LINKED FIELD
+ },
+ {
+ ID3FN_PEAKVOLRIGHT, // FIELD NAME
+ ID3FTY_BITFIELD, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_ADJUSTEDBY, // FLAGS
+ ID3FN_NUMBITS // LINKED FIELD
+ },
+ {
+ ID3FN_PEAKVOLLEFT, // FIELD NAME
+ ID3FTY_BITFIELD, // FIELD TYPE
+ 0, // FIXED LEN
+ ID3V2_EARLIEST, // INITIAL SPEC
+ ID3V2_LATEST, // ENDING SPEC
+ ID3FF_ADJUSTEDBY, // FLAGS
+ ID3FN_NUMBITS // LINKED FIELD
+ },
+ { ID3FN_NOFIELD }
+};
+#endif /* __UNEFINED__ */
+
+// **** Currently Implemented Frames
+// APIC PIC ID3FID_PICTURE Attached picture
+// COMM COM ID3FID_COMMENT Comments
+// ENCR ID3FID_CRYPTOREG Encryption method registration
+// GEOB GEO ID3FID_GENERALOBJECT General encapsulated object
+// GRID ID3FID_GROUPINGREG Group identification registration
+// IPLS IPL ID3FID_INVOLVEDPEOPLE Involved people list
+// LINK LNK ID3FID_LINKEDINFO Linked information
+// PCNT CNT ID3FID_PLAYCOUNTER Play counter
+// POPM POP ID3FID_POPULARIMETER Popularimeter
+// PRIV ID3FID_PRIVATE Private frame
+// SYLT SLT ID3FID_SYNCEDLYRICS Synchronized lyric/text
+// TALB TAL ID3FID_ALBUM Album/Movie/Show title
+// TBPM TBP ID3FID_BPM BPM (beats per minute)
+// TCOM TCM ID3FID_COMPOSER Composer
+// TCON TCO ID3FID_CONTENTTYPE Content type
+// TCOP TCR ID3FID_COPYRIGHT Copyright message
+// TDAT TDA ID3FID_DATE Date
+// TDLY TDY ID3FID_PLAYLISTDELAY Playlist delay
+// TENC TEN ID3FID_ENCODEDBY Encoded by
+// TEXT TXT ID3FID_LYRICIST Lyricist/Text writer
+// TFLT TFT ID3FID_FILETYPE File type
+// TIME TKE ID3FID_TIME Time
+// TIT1 TIM ID3FID_CONTENTGROUP Content group description
+// TIT2 TT1 ID3FID_TITLE Title/songname/content description
+// TIT3 TT2 ID3FID_SUBTITLE Subtitle/Description refinement
+// TKEY TT3 ID3FID_INITIALKEY Initial key
+// TLAN TLA ID3FID_LANGUAGE Language(s)
+// TLEN TLE ID3FID_SONGLEN Length
+// TMED TMT ID3FID_MEDIATYPE Media type
+// TOAL TOT ID3FID_ORIGALBUM Original album/movie/show title
+// TOFN TOF ID3FID_ORIGFILENAME Original filename
+// TOLY TOL ID3FID_ORIGLYRICIST Original lyricist(s)/text writer(s)
+// TOPE TOA ID3FID_ORIGARTIST Original artist(s)/performer(s)
+// TORY TOR ID3FID_ORIGYEAR Original release year
+// TOWN ID3FID_FILEOWNER File owner/licensee
+// TPE1 TP1 ID3FID_LEADARTIST Lead performer(s)/Soloist(s)
+// TPE2 TP2 ID3FID_BAND Band/orchestra/accompaniment
+// TPE3 TP3 ID3FID_CONDUCTOR Conductor/performer refinement
+// TPE4 TP4 ID3FID_MIXARTIST Interpreted, remixed, or otherwise modified
+// TPOS TPA ID3FID_PARTINSET Part of a set
+// TPUB TPB ID3FID_PUBLISHER Publisher
+// TRCK TRK ID3FID_TRACKNUM Track number/Position in set
+// TRDA TRD ID3FID_RECORDINGDATES Recording dates
+// TRSN TRN ID3FID_NETRADIOSTATION Internet radio station name
+// TRSO TRO ID3FID_NETRADIOOWNER Internet radio station owner
+// TSIZ TSI ID3FID_SIZE Size
+// TSRC TRC ID3FID_ISRC ISRC (international standard recording code)
+// TSSE TSS ID3FID_ENCODERSETTINGS Software/Hardware and encoding settings
+// TXXX TXX ID3FID_USERTEXT User defined text information
+// TYER TYE ID3FID_YEAR Year
+// UFID UFI ID3FID_UNIQUEFILEID Unique file identifier
+// USER ID3FID_TERMSOFUSE Terms of use
+// USLT ULT ID3FID_UNSYNCEDLYRICS Unsynchronized lyric/text transcription
+// WCOM WCM ID3FID_WWWCOMMERCIALINFO Commercial information
+// WCOP WCM ID3FID_WWWCOPYRIGHT Copyright/Legal infromation
+// WOAF WCP ID3FID_WWWAUDIOFILE Official audio file webpage
+// WOAR WAF ID3FID_WWWARTIST Official artist/performer webpage
+// WOAS WAR ID3FID_WWWAUDIOSOURCE Official audio source webpage
+// WORS WAS ID3FID_WWWRADIOPAGE Official internet radio station homepage
+// WPAY WRA ID3FID_WWWPAYMENT Payment
+// WPUB WPY ID3FID_WWWPUBLISHER Official publisher webpage
+// WXXX WXX ID3FID_WWWUSER User defined URL link
+// CDM ID3FID_METACOMPRESSION Compressed data meta frame
+
+// **** Currently unimplemented frames
+// AENC CRA ID3FID_AUDIOCRYPTO Audio encryption
+// COMR ID3FID_COMMERCIAL Commercial frame
+// EQUA EQU ID3FID_EQUALIZATION Equalization
+// ETCO ETC ID3FID_EVENTTIMING Event timing codes
+// MCDI MCI ID3FID_CDID Music CD identifier
+// MLLT MLL ID3FID_MPEGLOOKUP MPEG location lookup table
+// OWNE ID3FID_OWNERSHIP Ownership frame
+// POSS ID3FID_POSITIONSYNC Position synchronisation frame
+// RBUF BUF ID3FID_BUFFERSIZE Recommended buffer size
+// RVAD RVA ID3FID_VOLUMEADJ Relative volume adjustment
+// RVRB REV ID3FID_REVERB Reverb
+// SYTC STC ID3FID_SYNCEDTEMPO Synchronized tempo codes
+// CRM ID3FID_METACRYPTO Encrypted meta frame
+static ID3_FrameDef ID3_FrameDefs[] =
+{
+ // short long tag file
+ // frame id id id discrd discrd field defs description
+ {ID3FID_AUDIOCRYPTO, "CRA", "AENC", false, false, ID3FD_Unimplemented, "Audio encryption"},
+ {ID3FID_PICTURE, "PIC", "APIC", false, false, ID3FD_Picture, "Attached picture"},
+ {ID3FID_COMMENT, "COM", "COMM", false, false, ID3FD_GeneralText, "Comments"},
+ {ID3FID_COMMERCIAL, "" , "COMR", false, false, ID3FD_Unimplemented, "Commercial"},
+ {ID3FID_CRYPTOREG, "" , "ENCR", false, false, ID3FD_Registration, "Encryption method registration"},
+ {ID3FID_EQUALIZATION, "EQU", "EQUA", false, true, ID3FD_Unimplemented, "Equalization"},
+ {ID3FID_EVENTTIMING, "ETC", "ETCO", false, true, ID3FD_Unimplemented, "Event timing codes"},
+ {ID3FID_GENERALOBJECT, "GEO", "GEOB", false, false, ID3FD_GEO, "General encapsulated object"},
+ {ID3FID_GROUPINGREG, "" , "GRID", false, false, ID3FD_Registration, "Group identification registration"},
+ {ID3FID_INVOLVEDPEOPLE, "IPL", "IPLS", false, false, ID3FD_InvolvedPeople,"Involved people list"},
+ {ID3FID_LINKEDINFO, "LNK", "LINK", false, false, ID3FD_LinkedInfo, "Linked information"},
+ {ID3FID_CDID, "MCI", "MCDI", false, false, ID3FD_Unimplemented, "Music CD identifier"},
+ {ID3FID_MPEGLOOKUP, "MLL", "MLLT", false, true, ID3FD_Unimplemented, "MPEG location lookup table"},
+ {ID3FID_OWNERSHIP, "" , "OWNE", false, false, ID3FD_Unimplemented, "Ownership frame"},
+ {ID3FID_PLAYCOUNTER, "CNT", "PCNT", false, false, ID3FD_PlayCounter, "Play counter"},
+ {ID3FID_POPULARIMETER, "POP", "POPM", false, false, ID3FD_Popularimeter, "Popularimeter"},
+ {ID3FID_POSITIONSYNC, "" , "POSS", false, true, ID3FD_Unimplemented, "Position synchronisation frame"},
+ {ID3FID_PRIVATE, "" , "PRIV", false, false, ID3FD_Private, "Private frame"},
+ {ID3FID_BUFFERSIZE, "BUF", "RBUF", false, false, ID3FD_Unimplemented, "Recommended buffer size"},
+ {ID3FID_VOLUMEADJ, "RVA", "RVAD", false, true, ID3FD_Unimplemented, "Relative volume adjustment"},
+ {ID3FID_REVERB, "REV", "RVRB", false, false, ID3FD_Unimplemented, "Reverb"},
+ {ID3FID_SYNCEDLYRICS, "SLT", "SYLT", false, false, ID3FD_SyncLyrics, "Synchronized lyric/text"},
+ {ID3FID_SYNCEDTEMPO, "STC", "SYTC", false, true, ID3FD_Unimplemented, "Synchronized tempo codes"},
+ {ID3FID_ALBUM, "TAL", "TALB", false, false, ID3FD_Text, "Album/Movie/Show title"},
+ {ID3FID_BPM, "TBP", "TBPM", false, false, ID3FD_Text, "BPM (beats per minute)"},
+ {ID3FID_COMPOSER, "TCM", "TCOM", false, false, ID3FD_Text, "Composer"},
+ {ID3FID_CONTENTTYPE, "TCO", "TCON", false, false, ID3FD_Text, "Content type"},
+ {ID3FID_COPYRIGHT, "TCR", "TCOP", false, false, ID3FD_Text, "Copyright message"},
+ {ID3FID_DATE, "TDA", "TDAT", false, false, ID3FD_Text, "Date"},
+ {ID3FID_PLAYLISTDELAY, "TDY", "TDLY", false, false, ID3FD_Text, "Playlist delay"},
+ {ID3FID_ENCODEDBY, "TEN", "TENC", false, true, ID3FD_Text, "Encoded by"},
+ {ID3FID_LYRICIST, "TXT", "TEXT", false, false, ID3FD_Text, "Lyricist/Text writer"},
+ {ID3FID_FILETYPE, "TFT", "TFLT", false, false, ID3FD_Text, "File type"},
+ {ID3FID_INITIALKEY, "TKE", "TKEY", false, false, ID3FD_Text, "Initial key"},
+ {ID3FID_TIME, "TIM", "TIME", false, false, ID3FD_Text, "Time"},
+ {ID3FID_CONTENTGROUP, "TT1", "TIT1", false, false, ID3FD_Text, "Content group description"},
+ {ID3FID_TITLE, "TT2", "TIT2", false, false, ID3FD_Text, "Title/songname/content description"},
+ {ID3FID_SUBTITLE, "TT3", "TIT3", false, false, ID3FD_Text, "Subtitle/Description refinement"},
+ {ID3FID_LANGUAGE, "TLA", "TLAN", false, false, ID3FD_Text, "Language(s)"},
+ {ID3FID_SONGLEN, "TLE", "TLEN", false, true, ID3FD_Text, "Length"},
+ {ID3FID_MEDIATYPE, "TMT", "TMED", false, false, ID3FD_Text, "Media type"},
+ {ID3FID_ORIGALBUM, "TOT", "TOAL", false, false, ID3FD_Text, "Original album/movie/show title"},
+ {ID3FID_ORIGFILENAME, "TOF", "TOFN", false, false, ID3FD_Text, "Original filename"},
+ {ID3FID_ORIGLYRICIST, "TOL", "TOLY", false, false, ID3FD_Text, "Original lyricist(s)/text writer(s)"},
+ {ID3FID_ORIGARTIST, "TOA", "TOPE", false, false, ID3FD_Text, "Original artist(s)/performer(s)"},
+ {ID3FID_ORIGYEAR, "TOR", "TORY", false, false, ID3FD_Text, "Original release year"},
+ {ID3FID_FILEOWNER, "" , "TOWN", false, false, ID3FD_Text, "File owner/licensee"},
+ {ID3FID_LEADARTIST, "TP1", "TPE1", false, false, ID3FD_Text, "Lead performer(s)/Soloist(s)"},
+ {ID3FID_BAND, "TP2", "TPE2", false, false, ID3FD_Text, "Band/orchestra/accompaniment"},
+ {ID3FID_CONDUCTOR, "TP3", "TPE3", false, false, ID3FD_Text, "Conductor/performer refinement"},
+ {ID3FID_MIXARTIST, "TP4", "TPE4", false, false, ID3FD_Text, "Interpreted, remixed, or otherwise modified by"},
+ {ID3FID_PARTINSET, "TPA", "TPOS", false, false, ID3FD_Text, "Part of a set"},
+ {ID3FID_PUBLISHER, "TPB", "TPUB", false, false, ID3FD_Text, "Publisher"},
+ {ID3FID_TRACKNUM, "TRK", "TRCK", false, false, ID3FD_Text, "Track number/Position in set"},
+ {ID3FID_RECORDINGDATES, "TRD", "TRDA", false, false, ID3FD_Text, "Recording dates"},
+ {ID3FID_NETRADIOSTATION, "TRN", "TRSN", false, false, ID3FD_Text, "Internet radio station name"},
+ {ID3FID_NETRADIOOWNER, "TRO", "TRSO", false, false, ID3FD_Text, "Internet radio station owner"},
+ {ID3FID_SIZE, "TSI", "TSIZ", false, true, ID3FD_Text, "Size"},
+ {ID3FID_ISRC, "TRC", "TSRC", false, false, ID3FD_Text, "ISRC (international standard recording code)"},
+ {ID3FID_ENCODERSETTINGS, "TSS", "TSSE", false, false, ID3FD_Text, "Software/Hardware and settings used for encoding"},
+ {ID3FID_USERTEXT, "TXX", "TXXX", false, false, ID3FD_UserText, "User defined text information"},
+ {ID3FID_YEAR, "TYE", "TYER", false, false, ID3FD_Text, "Year"},
+ {ID3FID_UNIQUEFILEID, "UFI", "UFID", false, false, ID3FD_UFI, "Unique file identifier"},
+ {ID3FID_TERMSOFUSE, "" , "USER", false, false, ID3FD_TermsOfUse, "Terms of use"},
+ {ID3FID_UNSYNCEDLYRICS, "ULT", "USLT", false, false, ID3FD_GeneralText, "Unsynchronized lyric/text transcription"},
+ {ID3FID_WWWCOMMERCIALINFO, "WCM", "WCOM", false, false, ID3FD_URL, "Commercial information"},
+ {ID3FID_WWWCOPYRIGHT, "WCP", "WCOP", false, false, ID3FD_URL, "Copyright/Legal infromation"},
+ {ID3FID_WWWAUDIOFILE, "WAF", "WOAF", false, false, ID3FD_URL, "Official audio file webpage"},
+ {ID3FID_WWWARTIST, "WAR", "WOAR", false, false, ID3FD_URL, "Official artist/performer webpage"},
+ {ID3FID_WWWAUDIOSOURCE, "WAS", "WOAS", false, false, ID3FD_URL, "Official audio source webpage"},
+ {ID3FID_WWWRADIOPAGE, "WRA", "WORS", false, false, ID3FD_URL, "Official internet radio station homepage"},
+ {ID3FID_WWWPAYMENT, "WPY", "WPAY", false, false, ID3FD_URL, "Payment"},
+ {ID3FID_WWWPUBLISHER, "WPB", "WPUB", false, false, ID3FD_URL, "Official publisher webpage"},
+ {ID3FID_WWWUSER, "WXX", "WXXX", false, false, ID3FD_UserURL, "User defined URL link"},
+ {ID3FID_METACRYPTO, "CRM", "" , false, false, ID3FD_Unimplemented, "Encrypted meta frame"},
+ {ID3FID_METACOMPRESSION, "CDM", "" , false, false, ID3FD_CDM, "Compressed data meta frame"},
+ {ID3FID_NOFRAME}
+};
+
+ID3_Field::ID3_Field()
+ : __id(ID3FN_NOFIELD),
+ __type(ID3FTY_INTEGER),
+ __length(0),
+ __spec_begin(ID3V2_EARLIEST),
+ __spec_end(ID3V2_LATEST),
+ __flags(0),
+ __changed(false),
+ __data(NULL),
+ __size(0),
+ __enc(ID3TE_NONE)
+{
+ Clear();
+}
+
+ID3_Field::~ID3_Field()
+{
+ this->Clear();
+}
+
+void
+ID3_Field::Clear()
+{
+ if (__data != NULL && __size > 0 && __type != ID3FTY_INTEGER)
+ {
+ delete[] __data;
+ }
+
+ __type = ID3FTY_INTEGER;
+ __data = NULL;
+ __size = sizeof (uint32);
+ __changed = true;
+ __enc = ID3TE_NONE;
+
+ return ;
+}
+
+bool
+ID3_Field::HasChanged()
+{
+ return __changed;
+}
+
+size_t ID3_Field::Size() const
+{
+ return BinSize(false);
+}
+
+size_t ID3_Field::BinSize(bool withExtras) const
+{
+ size_t bytes = 0;
+
+ bytes = __size;
+
+ // check to see if we are within the legal limit for this field 0 means
+ // arbitrary length field
+ if (__length > 0)
+ {
+ bytes = __length;
+ }
+ else if (withExtras)
+ {
+ if (NULL == __data && __size > 0)
+ {
+ bytes = (__flags & ID3FF_CSTR) ? sizeof(unicode_t) : 0;
+ }
+
+ // if we are a Unicode string, add 2 bytes for the BOM (but only if there
+ // is a string to render - regardless of NULL)
+ if (ID3TE_UNICODE == this->GetEncoding() && __data != NULL && __size > 0)
+ {
+ bytes += sizeof(unicode_t);
+ }
+
+ // if we are an ASCII string, divide by sizeof(unicode_t) because
+ // internally we store the string as Unicode, so the ASCII version will
+ // only be half as long
+ if (__type == ID3FTY_TEXTSTRING && this->GetEncoding() != ID3TE_UNICODE)
+ {
+ bytes /= sizeof(unicode_t);
+ }
+ }
+ else if (__type == ID3FTY_TEXTSTRING)
+ {
+ // because it seems that the application called us via ID3_Field::Size()
+ // we are going to return the number of characters, not bytes. since we
+ // store every string internally as unicode, we will divide the 'bytes'
+ // variable by the size of a unicode character (should be two bytes)
+ // because Unicode strings have twice as many bytes as they do characters
+ bytes /= sizeof(unicode_t);
+ }
+
+ return bytes;
+}
+
+size_t ID3_Field::Parse(const uchar *buffer, size_t buffSize)
+{
+ size_t bytesUsed = 0;
+
+ switch (this->GetType())
+ {
+ case ID3FTY_INTEGER:
+ bytesUsed = ParseInteger(buffer, buffSize);
+ break;
+
+ case ID3FTY_BINARY:
+ bytesUsed = ParseBinary(buffer, buffSize);
+ break;
+
+ case ID3FTY_TEXTSTRING:
+ if (this->GetEncoding() == ID3TE_UNICODE)
+ {
+ bytesUsed = ParseUnicodeString(buffer, buffSize);
+ }
+ else
+ {
+ bytesUsed = ParseASCIIString(buffer, buffSize);
+ }
+ break;
+
+ default:
+ ID3_THROW(ID3E_UnknownFieldType);
+ break;
+ }
+
+ return bytesUsed;
+}
+
+ID3_FrameDef *
+ID3_FindFrameDef(const ID3_FrameID id)
+{
+ ID3_FrameDef *info = NULL;
+
+ for (index_t cur = 0; ID3_FrameDefs[cur].eID != ID3FID_NOFRAME; cur++)
+ {
+ if (ID3_FrameDefs[cur].eID == id)
+ {
+ info = &ID3_FrameDefs[cur];
+ break;
+ }
+ }
+
+ return info;
+}
+
+ID3_FrameID
+ID3_FindFrameID(const char *id)
+{
+ ID3_FrameID fid = ID3FID_NOFRAME;
+
+ for (index_t cur = 0; ID3_FrameDefs[cur].eID != ID3FID_NOFRAME; cur++)
+ {
+ if (((strcmp(ID3_FrameDefs[cur].sShortTextID, id) == 0) &&
+ strlen(id) == 3) ||
+ ((strcmp(ID3_FrameDefs[cur].sLongTextID, id) == 0) &&
+ strlen(id) == 4))
+ {
+ fid = ID3_FrameDefs[cur].eID;
+ break;
+ }
+ }
+
+ return fid;
+}
+
+size_t ID3_Field::Render(uchar *buffer) const
+{
+ size_t bytesUsed = 0;
+
+ switch (this->GetType())
+ {
+ case ID3FTY_INTEGER:
+ bytesUsed = RenderInteger(buffer);
+ break;
+
+ case ID3FTY_BINARY:
+ bytesUsed = RenderBinary(buffer);
+ break;
+
+ case ID3FTY_TEXTSTRING:
+ if (this->GetEncoding() == ID3TE_UNICODE)
+ {
+ bytesUsed = RenderUnicodeString(buffer);
+ }
+ else
+ {
+ bytesUsed = RenderASCIIString(buffer);
+ }
+ break;
+
+ default:
+ ID3_THROW (ID3E_UnknownFieldType);
+ break;
+ }
+
+ return bytesUsed;
+}
+
+ID3_Field &
+ID3_Field::operator=( const ID3_Field &rhs )
+{
+ if (this != &rhs)
+ {
+ switch (rhs.GetType())
+ {
+ case ID3FTY_INTEGER:
+ {
+ *this = rhs.Get();
+ break;
+ }
+ case ID3FTY_TEXTSTRING:
+ case ID3FTY_BINARY:
+ {
+ this->Set(rhs.__data, rhs.__size);
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+ }
+ __type = rhs.__type;
+ return *this;
+}
+
+bool ID3_Field::SetEncoding(ID3_TextEnc enc)
+{
+ bool changed = this->IsEncodable() && (enc != this->GetEncoding()) &&
+ (ID3TE_NONE < enc && enc < ID3TE_NUMENCODINGS);
+ if (changed)
+ {
+ __enc = enc;
+ __changed = true;
+ }
+ return changed;
+}
--- /dev/null
+++ b/common/id3lib/src/field_binary.cpp
@@ -1,0 +1,151 @@
+// $Id: field_binary.cpp,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+
+#include <stdio.h>
+#include <memory.h>
+#include "field.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+void ID3_Field::Set(const uchar *newData, size_t newSize)
+{
+ Clear();
+
+ if (newSize > 0)
+ {
+ __data = new uchar[newSize];
+ if (NULL == __data)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ if (newData != NULL)
+ {
+ memcpy(__data, newData, newSize);
+ }
+ else
+ {
+ memset(__data, 0, newSize);
+ }
+ __size = newSize;
+
+ __type = ID3FTY_BINARY;
+ __changed = true;
+ }
+
+ return ;
+}
+
+
+void ID3_Field::Get(uchar *buffer, size_t buffLength) const
+{
+ if (NULL == buffer)
+ {
+ ID3_THROW(ID3E_NoBuffer);
+ }
+
+ if (__data != NULL && __size > 0)
+ {
+ memcpy(buffer, __data, MIN(buffLength, __size));
+ }
+}
+
+
+void ID3_Field::FromFile(const char *info)
+{
+ if (!info)
+ {
+ return;
+ }
+
+ FILE* temp_file = fopen(info, "rb");
+ if (temp_file != NULL)
+ {
+ fseek(temp_file, 0, SEEK_END);
+ size_t fileSize = ftell(temp_file);
+ fseek(temp_file, 0, SEEK_SET);
+
+ uchar* buffer = new uchar[fileSize];
+ if (buffer != NULL)
+ {
+ fread(buffer, 1, fileSize, temp_file);
+
+ this->Set(buffer, fileSize);
+
+ delete [] buffer;
+ }
+
+ fclose(temp_file);
+ }
+
+ return ;
+}
+
+
+void ID3_Field::ToFile(const char *info) const
+{
+ if (NULL == info)
+ {
+ ID3_THROW(ID3E_NoData);
+ }
+
+ if ((__data != NULL) && (__size > 0))
+ {
+ FILE* temp_file = fopen(info, "wb");
+ if (temp_file != NULL)
+ {
+ fwrite(__data, 1, __size, temp_file);
+ fclose(temp_file);
+ }
+ }
+
+ return ;
+}
+
+
+size_t
+ID3_Field::ParseBinary(const uchar *buffer, size_t nSize)
+{
+ // copy the remaining bytes, unless we're fixed length, in which case copy
+ // the minimum of the remaining bytes vs. the fixed length
+ size_t bytesUsed = (__length > 0 ? MIN(nSize, __length) : nSize);
+ this->Set(buffer, bytesUsed);
+ __changed = false;
+
+ return bytesUsed;
+}
+
+
+size_t ID3_Field::RenderBinary(uchar *buffer) const
+{
+ size_t bytesUsed = BinSize();
+ memcpy(buffer, (uchar *) __data, bytesUsed);
+ __changed = false;
+ return bytesUsed;
+}
--- /dev/null
+++ b/common/id3lib/src/field_integer.cpp
@@ -1,0 +1,87 @@
+// $Id: field_integer.cpp,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include "field.h"
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+ID3_Field& ID3_Field::operator=(uint32 newData)
+{
+ this->Set(newData);
+ return *this;
+}
+
+
+void ID3_Field::Set(uint32 newData)
+{
+ Clear();
+
+ // Ack! This is terrible!
+ __data = (uchar *) newData;
+ __size = sizeof(uint32);
+ __type = ID3FTY_INTEGER;
+ __changed = true;
+
+ return ;
+}
+
+
+uint32 ID3_Field::Get() const
+{
+ return (uint32) __data;
+}
+
+
+size_t ID3_Field::ParseInteger(const uchar *buffer, size_t nSize)
+{
+ size_t nBytes = 0;
+
+ if (buffer != NULL && nSize > 0)
+ {
+ nBytes = MIN(nSize, sizeof(uint32));
+
+ if (__length > 0)
+ {
+ nBytes = MIN(__length, nBytes);
+ }
+
+ Set(ParseNumber(buffer, nBytes));
+ __changed = false;
+ }
+
+ return nBytes;
+}
+
+
+size_t ID3_Field::RenderInteger(uchar *buffer) const
+{
+ size_t bytesUsed = RenderNumber(buffer, (uint32) __data, this->BinSize());
+ __changed = false;
+ return bytesUsed;
+}
--- /dev/null
+++ b/common/id3lib/src/field_string_ascii.cpp
@@ -1,0 +1,235 @@
+// $Id: field_string_ascii.cpp,v 1.1 2002/01/21 08:16:21 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include <stdlib.h>
+#include "field.h"
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+ID3_Field& ID3_Field::operator= (const char *string)
+{
+ Set(string);
+
+ return *this;
+}
+
+
+// the ::Set() function for ASCII
+
+void ID3_Field::Set(const char *sString)
+{
+ if (sString != NULL)
+ {
+ Clear();
+ size_t nStrLen = (0 == __length) ? strlen(sString) : __length;
+ unicode_t *temp = new unicode_t[nStrLen + 1];
+ if (NULL == temp)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ mbstoucs(temp, sString, nStrLen + 1);
+
+ Set(temp);
+ delete [] temp;
+
+ this->SetEncoding(ID3TE_ASCII);
+ __type = ID3FTY_TEXTSTRING;
+ }
+
+ return ;
+}
+
+
+// the ::Get() function for ASCII
+
+size_t ID3_Field::Get(char* buffer, size_t maxLength, index_t itemNum) const
+{
+ unicode_t* unicode_buffer = new unicode_t[maxLength];
+ if (NULL == unicode_buffer)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ size_t len = Get(unicode_buffer, maxLength, itemNum);
+
+ char* ascii_buffer = new char[len + 1];
+ if (NULL == ascii_buffer)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ ucstombs(ascii_buffer, unicode_buffer, len + 1);
+
+ size_t ascii_len = strlen(ascii_buffer);
+ size_t length = MIN(ascii_len, maxLength);
+
+ strncpy(buffer, ascii_buffer, length);
+ buffer[length] = '\0';
+
+ delete [] ascii_buffer;
+
+ delete [] unicode_buffer;
+
+ return length;
+}
+
+
+void ID3_Field::Add(const char *sString)
+{
+ if (sString)
+ {
+ unicode_t *unicode_buffer;
+
+ unicode_buffer = new unicode_t[strlen(sString) + 1];
+ if (NULL == unicode_buffer)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ mbstoucs(unicode_buffer, sString, strlen(sString) + 1);
+ Add(unicode_buffer);
+ delete [] unicode_buffer;
+
+ this->SetEncoding(ID3TE_ASCII);
+ __type = ID3FTY_TEXTSTRING;
+ }
+}
+
+
+size_t
+ID3_Field::ParseASCIIString(const uchar *buffer, size_t nSize)
+{
+ size_t bytesUsed = 0;
+ char *temp = NULL;
+
+ if (__length > 0)
+ {
+ // The string is of fixed length
+ bytesUsed = __length;
+ }
+ else if (!(__flags & ID3FF_CSTR) || (__flags & ID3FF_LIST))
+ {
+ // If the string isn't null-terminated or if it is null divided, we're
+ // assured this is the last field of of the frame, and we can claim the
+ // remaining bytes for ourselves
+ bytesUsed = nSize;
+ }
+ else
+ {
+ while (bytesUsed < nSize && buffer[bytesUsed] != '\0')
+ {
+ bytesUsed++;
+ }
+ }
+
+ if (0 == bytesUsed)
+ {
+ Set("");
+ }
+ // This check needs to come before the check for ID3FF_CSTR
+ else if (__flags & ID3FF_LIST)
+ {
+ const char *sBuffer = (const char *) buffer;
+ for (size_t i = 0; i < bytesUsed; i += strlen(&sBuffer[i]) + 1)
+ {
+ Add(&sBuffer[i]);
+ }
+ }
+ // This check needs to come after the check for ID3FF_LIST
+ else if (__flags & ID3FF_CSTR)
+ {
+ Set((const char *)buffer);
+ }
+ else
+ {
+ // Sanity check our indices and sizes before we start copying memory
+ if (bytesUsed > nSize)
+ {
+ ID3_THROW_DESC(ID3E_BadData, "field information invalid");
+ }
+
+ temp = new char[bytesUsed + 1];
+ if (NULL == temp)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ memcpy(temp, buffer, bytesUsed);
+ temp[bytesUsed] = '\0';
+ Set(temp);
+
+ delete [] temp;
+ }
+
+ if (__flags & ID3FF_CSTR && !(__flags & ID3FF_LIST))
+ {
+ bytesUsed++;
+ }
+
+ __changed = false;
+
+ return bytesUsed;
+}
+
+
+size_t ID3_Field::RenderASCIIString(uchar *buffer) const
+{
+ size_t nChars = BinSize();
+
+ if ((NULL != __data) && (nChars > 0))
+ {
+ ucstombs((char *) buffer, (unicode_t *) __data, nChars);
+
+ // now we convert the internal dividers to what they are supposed to be
+ for (index_t i = 0; i < nChars; i++)
+ {
+ if ('\1' == buffer[i])
+ {
+ char sub = '/';
+
+ if (__flags & ID3FF_LIST)
+ {
+ sub = '\0';
+ }
+ buffer[i] = sub;
+ }
+ }
+ }
+
+ if ((1 == nChars) && (__flags & ID3FF_CSTR))
+ {
+ buffer[0] = '\0';
+ }
+
+ __changed = false;
+
+ return nChars;
+}
--- /dev/null
+++ b/common/id3lib/src/field_string_unicode.cpp
@@ -1,0 +1,341 @@
+// $Id: field_string_unicode.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include <stdlib.h>
+#include "field.h"
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// this function is another way of using Set()
+
+ID3_Field& ID3_Field::operator= (const unicode_t *string)
+{
+ Set(string);
+
+ return *this;
+}
+
+
+// this is Set()
+
+void ID3_Field::Set(const unicode_t *string)
+{
+ size_t nBytes = (0 == __length) ? ucslen(string) : __length;
+
+ // we can simply increment the nBytes count here because we just pilfer
+ // the NULL which is present in the string which was passed to us
+ if (__flags & ID3FF_CSTR)
+ {
+ nBytes++;
+ }
+
+ // doubling the nBytes because Unicode is twice the size of ASCII
+ nBytes *= sizeof(unicode_t);
+
+ Set((uchar *) string, nBytes);
+
+ this->SetEncoding(ID3TE_UNICODE);
+ __type = ID3FTY_TEXTSTRING;
+ __changed = true;
+
+ return ;
+}
+
+
+void ID3_Field::Add(const unicode_t *string)
+{
+ if (NULL == __data)
+ {
+ Set(string);
+ }
+ else
+ {
+ unicode_t *uBuffer = (unicode_t *) __data;
+
+ // +1 is for the NULL at the end and the other +1 is for the list divider
+ size_t newLen = ucslen(string) + ucslen(uBuffer) + 1 + 1;
+
+ unicode_t *temp = new unicode_t[newLen];
+ if (NULL == temp)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ ucscpy(temp, uBuffer);
+
+ // I use the value 1 as a divider because then I can change it to either a
+ // '/' or a NULL at render time. This allows easy use of these functions
+ // for text lists or in the IPLS frame
+ temp[ucslen(uBuffer)] = L'\001';
+ ucscpy(&temp[ucslen(uBuffer) + 1], string);
+ temp[newLen - 1] = NULL_UNICODE;
+
+ Set(temp);
+
+ delete [] temp;
+ }
+
+ return ;
+}
+
+
+// this is Get()
+
+size_t ID3_Field::Get(unicode_t *buffer, size_t maxChars, index_t itemNum) const
+{
+ size_t charsUsed = 0;
+
+ // check to see if there is a string in the frame to copy before we even try
+ if (NULL != __data)
+ {
+ lsint nullOffset = 0;
+
+ if (__flags & ID3FF_CSTR)
+ {
+ nullOffset = -1;
+ }
+
+ // first we must find which element is being sought to make sure it exists
+ // before we try to get it
+ if (itemNum <= GetNumTextItems() && itemNum > 0)
+ {
+ unicode_t *source = (unicode_t *) __data;
+ size_t posn = 0;
+ size_t sourceLen = 0;
+ index_t curItemNum = 1;
+
+ // now we find that element and set the souvre pointer
+ while (curItemNum < itemNum)
+ {
+ while (*source != L'\001' && *source != L'\0' && posn <
+ ((__size / sizeof(unicode_t)) + nullOffset))
+ {
+ source++, posn++;
+ }
+
+ source++;
+ curItemNum++;
+ }
+
+ // now that we are positioned at the first character of the string we
+ // want, find the end of it
+ while (source[sourceLen] != L'\001' && source[sourceLen] != L'\0' &&
+ posn <((__size / sizeof(unicode_t) + nullOffset)))
+ {
+ sourceLen++, posn++;
+ }
+
+ if (NULL == buffer)
+ {
+ ID3_THROW(ID3E_NoBuffer);
+ }
+
+ size_t actualChars = MIN(maxChars, sourceLen);
+
+ ucsncpy(buffer, source, actualChars);
+ if (actualChars < maxChars)
+ {
+ buffer[actualChars] = L'\0';
+ }
+ charsUsed = actualChars;
+ }
+ }
+
+ return charsUsed;
+}
+
+
+size_t ID3_Field::GetNumTextItems() const
+{
+ size_t numItems = 0;
+
+ if (NULL != __data)
+ {
+ index_t posn = 0;
+
+ numItems++;
+
+ while (posn < __size)
+ {
+ if (__data[posn++] == L'\001')
+ {
+ numItems++;
+ }
+ }
+ }
+
+ return numItems;
+}
+
+
+size_t
+ID3_Field::ParseUnicodeString(const uchar *buffer, size_t nSize)
+{
+ size_t nBytes = 0;
+ unicode_t *temp = NULL;
+ if (__length > 0)
+ {
+ nBytes = __length;
+ }
+ else
+ {
+ if (__flags & ID3FF_CSTR)
+ {
+ while (nBytes < nSize &&
+ !(buffer[nBytes] == 0 && buffer[nBytes + 1] == 0))
+ {
+ nBytes += sizeof(unicode_t);
+ }
+ }
+ else
+ {
+ nBytes = nSize;
+ }
+ }
+
+ if (nBytes > 0)
+ {
+ // Sanity check our indices and sizes before we start copying memory
+ if (nBytes > nSize)
+ {
+ ID3_THROW_DESC(ID3E_BadData, "field information invalid");
+ }
+
+ temp = new unicode_t[(nBytes / sizeof(unicode_t)) + 1];
+ if (NULL == temp)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ size_t loc = 0;
+
+ memcpy(temp, buffer, nBytes);
+ temp[nBytes / sizeof(unicode_t)] = NULL_UNICODE;
+
+ // if there is a BOM, skip past it and check to see if we need to swap
+ // the byte order around
+ if (temp[0] == 0xFEFF || temp[0] == 0xFFFE)
+ {
+ loc++;
+
+ // if we need to swap the byte order
+ /* TODO: Determine if this the correct check to make sure bytes should
+ be swapped. For example, the example tag 230-unicode.tag (found in
+ the distrubitution) has two unicode sections, each that begin with
+ the FEFF magic number. Each unicode character is, as usual, two
+ bytes. The first byte is the ascii equivalent; the second is null.
+ Is this the "correct" encoding? When a little-endian parses each of
+ those characters, the bytes are swapped, so they essentially end up
+ as the ascii equivalent automatically. The FEFF magic number is also
+ swapped, so the number is evaluated as FFFE. The original code below
+ forced byteswapping if the value of the first unicode character was
+ not equal to 0xFEFF. This doesn't work for a little-endian machine,
+ though, since, as the rest of the code now stands, swapping the bytes
+ will not create a correct parse. Therefore, the code swaps bytes
+ only when the value is equal to FEFF.
+ */
+ if (temp[0] == 0xFEFF)
+ {
+ for (index_t i = loc; i < ucslen(temp); i++)
+ {
+ uchar
+ u1 = ((uchar *)(&temp[i]))[0],
+ u2 = ((uchar *)(&temp[i]))[1];
+ temp[i] = (u1 << 8) | u2;
+ }
+ }
+ }
+
+ Set(&temp[loc]);
+
+ delete [] temp;
+ }
+
+ if (__flags & ID3FF_CSTR)
+ {
+ nBytes += sizeof(unicode_t);
+ }
+
+ __changed = false;
+
+ return nBytes;
+}
+
+
+size_t ID3_Field::RenderUnicodeString(uchar *buffer) const
+{
+ size_t nBytes = 0;
+
+ nBytes = BinSize();
+
+ if (NULL != __data && __size && nBytes)
+ {
+ // we render at sizeof(unicode_t) bytes into the buffer because we make
+ // room for the Unicode BOM
+ memcpy(&buffer[sizeof(unicode_t)], (uchar *) __data,
+ nBytes - sizeof(unicode_t));
+
+ unicode_t *ourString = (unicode_t *) &buffer[sizeof(unicode_t)];
+ // now we convert the internal dividers to what they are supposed to be
+ for (index_t i = sizeof(unicode_t); i < this->Size(); i++)
+ {
+ if (ourString[i] == 0x01)
+ {
+ unicode_t sub = L'/';
+
+ if (__flags & ID3FF_LIST)
+ {
+ sub = L'\0';
+ }
+
+ ourString[i] = sub;
+ }
+ }
+ }
+
+ if (nBytes)
+ {
+ // render the BOM
+ unicode_t *BOM = (unicode_t *) buffer;
+ BOM[0] = 0xFFFE;
+ }
+
+ if (nBytes == sizeof(unicode_t) && (__flags & ID3FF_CSTR))
+ {
+ for (size_t i = 0; i < sizeof(unicode_t); i++)
+ {
+ buffer[i] = 0;
+ }
+ }
+
+ __changed = false;
+
+ return nBytes;
+}
--- /dev/null
+++ b/common/id3lib/src/frame.cpp
@@ -1,0 +1,353 @@
+// $Id: frame.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include "tag.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+ID3_Frame::ID3_Frame(ID3_FrameID id)
+ : __changed(false),
+ __field_bitset(NULL),
+ __num_fields(0),
+ __fields(NULL),
+ __encryption_id('\0'),
+ __grouping_id('\0'),
+ __bad_parse(false)
+{
+
+ _InitFieldBits();
+ SetID(id);
+}
+
+ID3_Frame::ID3_Frame(const ID3_FrameHeader &hdr)
+ : __changed(false),
+ __field_bitset(NULL),
+ __num_fields(0),
+ __fields(NULL),
+ __hdr(hdr),
+ __encryption_id('\0'),
+ __grouping_id('\0'),
+ __bad_parse(false)
+{
+ this->_InitFieldBits();
+ this->_InitFields();
+}
+
+ID3_Frame::ID3_Frame(const ID3_Frame& frame)
+ : __changed(false),
+ __field_bitset(NULL),
+ __num_fields(0),
+ __fields(NULL),
+ __encryption_id('\0'),
+ __grouping_id('\0'),
+ __bad_parse(false)
+{
+ _InitFieldBits();
+ *this = frame;
+}
+
+void ID3_Frame::_InitFieldBits()
+{
+ size_t lWordsForFields =
+ (((uint32) ID3FN_LASTFIELDID) - 1) / (sizeof(uint32) * 8);
+
+ if ((((uint32) ID3FN_LASTFIELDID) - 1) % (sizeof(uint32) * 8) != 0)
+ {
+ lWordsForFields++;
+ }
+
+ if (__field_bitset != NULL)
+ {
+ delete [] __field_bitset;
+ }
+ __field_bitset = new uint32[lWordsForFields];
+ if (NULL == __field_bitset)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ for (index_t i = 0; i < lWordsForFields; i++)
+ {
+ __field_bitset[i] = 0;
+ }
+}
+
+ID3_Frame::~ID3_Frame()
+{
+ Clear();
+
+ if (__field_bitset != NULL)
+ {
+ delete [] __field_bitset;
+ }
+}
+
+bool ID3_Frame::_ClearFields()
+{
+ index_t i;
+ if (!__num_fields || !__fields)
+ {
+ return false;
+ }
+ for (i = 0; i < __num_fields; i++)
+ {
+ delete __fields[i];
+ }
+
+ delete [] __fields;
+ __fields = NULL;
+
+ size_t lWordsForFields =
+ (((uint32) ID3FN_LASTFIELDID) - 1) / (sizeof(uint32) * 8);
+
+ if ((((uint32) ID3FN_LASTFIELDID) - 1) % (sizeof(uint32) * 8) != 0)
+ {
+ lWordsForFields++;
+ }
+
+ for (i = 0; i < lWordsForFields; i++)
+ {
+ __field_bitset[i] = 0;
+ }
+
+ __changed = true;
+ return true;
+}
+
+void ID3_Frame::Clear()
+{
+ this->_ClearFields();
+ __hdr.Clear();
+ __encryption_id = '\0';
+ __grouping_id = '\0';
+ __num_fields = 0;
+ __fields = NULL;
+}
+
+void ID3_Frame::_InitFields()
+{
+ const ID3_FrameDef* info = __hdr.GetFrameDef();
+ if (NULL == info)
+ {
+ ID3_THROW(ID3E_InvalidFrameID);
+ }
+
+ __num_fields = 0;
+
+ while (info->aeFieldDefs[__num_fields].eID != ID3FN_NOFIELD)
+ {
+ __num_fields++;
+ }
+
+ __fields = new ID3_Field * [__num_fields];
+ if (NULL == __fields)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ for (index_t i = 0; i < __num_fields; i++)
+ {
+ __fields[i] = new ID3_Field;
+ if (NULL == __fields[i])
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ __fields[i]->__id = info->aeFieldDefs[i].eID;
+ __fields[i]->__type = info->aeFieldDefs[i].eType;
+ __fields[i]->__length = info->aeFieldDefs[i].ulFixedLength;
+ __fields[i]->__spec_begin = info->aeFieldDefs[i].eSpecBegin;
+ __fields[i]->__spec_end = info->aeFieldDefs[i].eSpecEnd;
+ __fields[i]->__flags = info->aeFieldDefs[i].ulFlags;
+
+ // tell the frame that this field is present
+ BS_SET(__field_bitset, __fields[i]->__id);
+ }
+
+ __changed = true;
+}
+
+bool ID3_Frame::SetID(ID3_FrameID id)
+{
+ bool changed = (this->GetID() != id);
+ if (changed)
+ {
+ this->_SetID(id);
+ __changed = true;
+ }
+ return changed;
+}
+
+bool ID3_Frame::_SetID(ID3_FrameID id)
+{
+ bool changed = this->_ClearFields();
+ changed = __hdr.SetFrameID(id) || changed;
+ this->_InitFields();
+ return changed;
+}
+
+ID3_FrameID ID3_Frame::GetID() const
+{
+ return __hdr.GetFrameID();
+}
+
+
+bool ID3_Frame::SetSpec(ID3_V2Spec spec)
+{
+ return __hdr.SetSpec(spec);
+}
+
+ID3_V2Spec ID3_Frame::GetSpec() const
+{
+ return __hdr.GetSpec();
+}
+
+lsint ID3_Frame::_FindField(ID3_FieldID fieldName) const
+{
+
+ if (BS_ISSET(__field_bitset, fieldName))
+ {
+ for (lsint num = 0; num < (lsint) __num_fields; num++)
+ {
+ if (__fields[num]->__id == fieldName)
+ {
+ return num;
+ }
+ }
+ }
+
+ return -1;
+}
+
+ID3_Field& ID3_Frame::Field(ID3_FieldID fieldName) const
+{
+ lsint fieldNum = _FindField(fieldName);
+
+ if (fieldNum < 0)
+ {
+ ID3_THROW(ID3E_FieldNotFound);
+ }
+
+ return *__fields[fieldNum];
+}
+
+size_t ID3_Frame::Size()
+{
+ size_t bytesUsed = __hdr.Size();
+
+ if (this->_GetEncryptionID())
+ {
+ bytesUsed++;
+ }
+
+ if (this->_GetGroupingID())
+ {
+ bytesUsed++;
+ }
+
+ ID3_TextEnc enc = ID3TE_ASCII;
+ for (ID3_Field** fi = __fields; fi != __fields + __num_fields; fi++)
+ {
+ if (*fi && (*fi)->InScope(this->GetSpec()))
+ {
+ if ((*fi)->GetID() == ID3FN_TEXTENC)
+ {
+ enc = (ID3_TextEnc) (*fi)->Get();
+ }
+ else
+ {
+ (*fi)->SetEncoding(enc);
+ }
+ bytesUsed += (*fi)->BinSize();
+ }
+ }
+
+ return bytesUsed;
+}
+
+
+bool ID3_Frame::HasChanged() const
+{
+ bool changed = __changed;
+
+ for (ID3_Field** fi = __fields; !changed && fi != __fields + __num_fields; fi++)
+ {
+ if (*fi && (*fi)->InScope(this->GetSpec()))
+ {
+ changed = (*fi)->HasChanged();
+ }
+ }
+
+ return changed;
+}
+
+ID3_Frame &
+ID3_Frame::operator=( const ID3_Frame &rFrame )
+{
+ if (this != &rFrame)
+ {
+ ID3_FrameID eID = rFrame.GetID();
+ SetID(eID);
+ for (size_t nIndex = 0; nIndex < __num_fields; nIndex++)
+ {
+ if (rFrame.__fields[nIndex] != NULL)
+ {
+ *(__fields[nIndex]) = *(rFrame.__fields[nIndex]);
+ }
+ }
+ this->_SetEncryptionID(rFrame._GetEncryptionID());
+ this->_SetGroupingID(rFrame._GetGroupingID());
+ this->SetCompression(rFrame.GetCompression());
+ this->SetSpec(rFrame.GetSpec());
+ __bad_parse = false;
+ __changed = false;
+ }
+ return *this;
+}
+
+const char* ID3_Frame::GetDescription(ID3_FrameID eFrameID)
+{
+ ID3_FrameDef* myFrameDef = ID3_FindFrameDef(eFrameID);
+ if (myFrameDef != NULL)
+ {
+ return myFrameDef->sDescription;
+ }
+ return NULL;
+}
+
+const char* ID3_Frame::GetDescription() const
+{
+ const ID3_FrameDef* def = __hdr.GetFrameDef();
+ if (def)
+ {
+ return def->sDescription;
+ }
+ return NULL;
+}
+
--- /dev/null
+++ b/common/id3lib/src/frame_parse.cpp
@@ -1,0 +1,154 @@
+// $Id: frame_parse.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <zlib.h>
+#include "frame.h"
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+size_t ID3_Frame::Parse(const uchar * const buffer, size_t size)
+{
+ __bad_parse = false;
+ const size_t hdr_size = __hdr.Parse(buffer, size);
+
+ if (!hdr_size)
+ {
+ return 0;
+ }
+
+ // data is the part of the frame buffer that appears after the header
+ const uchar* data = &buffer[hdr_size];
+ const size_t data_size = __hdr.GetDataSize();
+ size_t extras = 0;
+ // how many bytes remain to be parsed
+ size_t remainder = data_size - MIN(extras, data_size);
+
+ unsigned long expanded_size = 0;
+ if (__hdr.GetCompression())
+ {
+ expanded_size = ParseNumber(&data[extras]);
+ extras += sizeof(uint32);
+ }
+
+ if (__hdr.GetEncryption())
+ {
+ this->_SetEncryptionID(data[extras++]);
+ }
+
+ if (__hdr.GetGrouping())
+ {
+ this->_SetGroupingID(data[extras++]);
+ }
+
+ data += extras;
+
+ // expand out the data if it's compressed
+ uchar* expanded_data = NULL;
+ if (__hdr.GetCompression())
+ {
+ expanded_data = new uchar[expanded_size];
+
+ uncompress(expanded_data, &expanded_size, data, remainder);
+ data = expanded_data;
+ remainder = expanded_size;
+ }
+
+ // set the type of frame based on the parsed header
+ this->_ClearFields();
+ this->_InitFields();
+ try
+ {
+ ID3_TextEnc enc = ID3TE_ASCII; // set the default encoding
+ ID3_V2Spec spec = this->GetSpec();
+ // parse the frame's fields
+ for (ID3_Field** fi = __fields; fi != __fields + __num_fields; fi++)
+ {
+ if (!*fi)
+ {
+ // Ack! Why is the field NULL? Log this...
+ continue;
+ }
+ if (remainder == 0)
+ {
+ // there's no remaining data to parse!
+ __bad_parse = true;
+ break;
+ }
+
+ if (!(*fi)->InScope(spec))
+ {
+ // this field isn't in scope, so don't attempt to parse into it
+ // rather, give it some reasonable default value in case someone tries
+ // to access it
+ switch ((*fi)->GetType())
+ {
+ case ID3FTY_INTEGER:
+ **fi = (uint32) 0;
+ break;
+ default:
+ **fi = "";
+ break;
+ }
+ // now continue with the rest of the fields
+ continue;
+ }
+
+ (*fi)->SetEncoding(enc);
+ size_t frame_size = (*fi)->Parse(data, remainder);
+
+ if (0 == frame_size)
+ {
+ // nothing to parse! ack! parse error...
+ __bad_parse = true;
+ break;
+ }
+
+ if ((*fi)->GetID() == ID3FN_TEXTENC)
+ {
+ enc = static_cast<ID3_TextEnc>((*fi)->Get());
+ }
+
+ data += frame_size;
+ remainder -= MIN(frame_size, remainder);
+ }
+ }
+ catch (...)
+ {
+ // TODO: log this!
+ //cerr << "*** parsing error!" << endl;
+ // There's been an error in the parsing of the frame.
+ __bad_parse = true;
+ }
+
+ __changed = false;
+
+ delete [] expanded_data;
+
+ return MIN(hdr_size + data_size, size);
+}
--- /dev/null
+++ b/common/id3lib/src/frame_render.cpp
@@ -1,0 +1,163 @@
+// $Id: frame_render.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include <memory.h>
+#include <zlib.h>
+#include "tag.h"
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// Ideally, Render should render the frame in the order it is parsed, starting
+// with the header, then any extra info (resulting from header flags), and then
+// the frame data, one field at a time. This, unfortunately, isn't possible.
+// In order to render the frame header, the data size must be known. One could
+// query the fields' sizes before rendering them, but it would be faster to
+// render the fields and add their sizes (which is calculated and returned in
+// the fields' Render function) at the same time.
+//
+// Even if we determined this extra processing to be acceptable, it isn't
+// possible to precompute the frame data size without rendering them all when
+// compression is enabled. When compression is enabled, then the header
+// contains the size of the compressed data. So all the fields need to
+// rendered to a buffer and compressed before the data size can even be
+// calculated in this scenario. And the compressed data might even be
+// discarded if it is no smaller than the uncompressed data.
+//
+// So, Render should progress more-or-less as follows. The fields should be
+// rendered to the target buffer at its desired position (after the projected
+// header and extra bytes (at most 2)). If compression has been specified,
+// then compress it into a temporary buffer. If the compressed size is smaller
+// than the uncompressed data, copy the temp buffer to the correct place in the
+// target buffer. Finally, render the header and the extra info. The
+// encryption and grouping id's shouldn't be rendered until after the
+// compression takes place, since they will be rendered to a different spots in
+// the buffer depending on whether or not the data is compressed. This is
+// because the uncompressed data size must come after before the id's if the
+// the data is compressed, but won't be rendered if the data isn't compressed.
+//
+// One could probably implement Render more "naturally" by using more
+// dynamically allocated buffers, but that would degrade performance. Whether
+// or not this performance degradation would cause a significant impact on the
+// overall performane of typeical apps should be looked in to.
+//
+// So, in short, Render is a more complicated function than it should be, but
+// it doesn't look like there's a much better way that's any faster.
+size_t ID3_Frame::Render(uchar *buffer) const
+{
+ if (NULL == buffer)
+ {
+ ID3_THROW(ID3E_NoBuffer);
+ }
+
+ uchar e_id = this->_GetEncryptionID(), g_id = this->_GetGroupingID();
+ size_t decompressed_size = 0;
+ size_t extras = ( e_id > 0 ? 1 : 0 ) + ( g_id > 0 ? 1 : 0 );
+ ID3_FrameHeader hdr = __hdr;
+
+ const size_t hdr_size = hdr.Size();
+
+ // 1. Write out the field data to the buffer, with the assumption that
+ // we won't be decompressing, since this is the usual behavior
+ ID3_TextEnc enc = ID3TE_ASCII;
+ size_t data_size = 0;
+
+ for (ID3_Field** fi = __fields; fi != __fields + __num_fields; fi++)
+ {
+ if ((*fi)->GetID() == ID3FN_TEXTENC)
+ {
+ enc = static_cast<ID3_TextEnc>((*fi)->Get());
+ }
+
+ if (*fi && (*fi)->InScope(ID3V2_LATEST))
+ {
+ (*fi)->SetEncoding(enc);
+ data_size += (*fi)->Render(&buffer[data_size + hdr_size + extras]);
+ }
+ }
+
+ // 2. Attempt to compress if specified
+ if (this->GetCompression())
+ {
+ // The zlib documentation specifies that the destination size needs to be
+ // an unsigned long at least 0.1% larger than the source buffer, plus 12
+ // bytes
+ unsigned long new_data_size = data_size + (data_size / 10) + 12;
+
+ uchar* compressed_data = new uchar[new_data_size];
+ if (NULL == compressed_data)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ if (compress(compressed_data, &new_data_size, &buffer[hdr_size + extras],
+ data_size) != Z_OK)
+ {
+ ID3_THROW(ID3E_zlibError);
+ }
+
+ // if the compression actually saves space...
+ if ((new_data_size + sizeof(uint32)) < data_size)
+ {
+ // add 4 bytes to 'extras' for the decompressed size
+ extras += sizeof(uint32);
+
+ memcpy(&buffer[hdr_size + extras], compressed_data, new_data_size);
+
+ decompressed_size = data_size;
+ data_size = new_data_size;
+ }
+
+ delete [] compressed_data;
+ }
+
+ // determine which flags need to be set
+ hdr.SetDataSize(data_size + extras);
+ hdr.SetEncryption(e_id > 0);
+ hdr.SetGrouping(g_id > 0);
+ hdr.SetCompression(decompressed_size > 0);
+
+ hdr.Render(buffer);
+ uchar* data = buffer + hdr_size;
+ if (decompressed_size)
+ {
+ data += RenderNumber(data, decompressed_size);
+ }
+ if (e_id)
+ {
+ *data++ = e_id;
+ }
+ if (g_id)
+ {
+ *data++ = g_id;
+ }
+ __changed = false;
+
+ return hdr_size + extras + data_size;
+}
--- /dev/null
+++ b/common/id3lib/src/globals.cpp
@@ -1,0 +1,52 @@
+// $Id: globals.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include "globals.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#if 0
+ const char * const ID3LIB_NAME = __ID3LIB_NAME;
+ const char * const ID3LIB_DATE = __ID3LIB_DATE;
+ const char * const ID3LIB_VERSION = __ID3LIB_VERSION;
+ const char * const ID3LIB_FULL_NAME = __ID3LIB_FULLNAME;
+ const int ID3LIB_MAJOR_VERSION = __ID3LIB_MAJOR_VERSION;
+ const int ID3LIB_MINOR_VERSION = __ID3LIB_MINOR_VERSION;
+ const int ID3LIB_PATCH_VERSION = __ID3LIB_PATCH_VERSION;
+ const int ID3LIB_INTERFACE_AGE = __ID3LIB_INTERFACE_AGE;
+ const int ID3LIB_BINARY_AGE = __ID3LIB_BINARY_AGE;
+#endif
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null
+++ b/common/id3lib/src/header.cpp
@@ -1,0 +1,59 @@
+// $Id: header.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include "header.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+static const ID3_Header::Info _spec_info[] =
+{
+ // SIZEOF SIZEOF SIZEOF EXT EXT EXPERIM
+ // FRID FRSZ FRFL HEADER SIZE BIT
+ { 3, 3, 0, false, 0, false }, // ID3V2_2_0
+ { 3, 3, 0, true, 8, true }, // ID3V2_2_1
+ { 4, 4, 2, false, 10, false } // ID3V2_3_0
+};
+
+bool ID3_Header::SetSpec(ID3_V2Spec spec)
+{
+ bool changed = false;
+ if (spec < ID3V2_EARLIEST || spec > ID3V2_LATEST)
+ {
+ changed = __spec != ID3V2_UNKNOWN;
+ __spec = ID3V2_UNKNOWN;
+ __info = NULL;
+ }
+ else
+ {
+ changed = __spec != spec;
+ __spec = spec;
+ __info = &_spec_info[__spec - ID3V2_EARLIEST];
+ }
+ __changed = __changed || changed;
+ return changed;
+}
--- /dev/null
+++ b/common/id3lib/src/header_frame.cpp
@@ -1,0 +1,228 @@
+// $Id: header_frame.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include <memory.h>
+#include "header_frame.h"
+#include "error.h"
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+void ID3_FrameHeader::SetUnknownFrame(const char* id)
+{
+ Clear();
+ __frame_def = new ID3_FrameDef;
+ if (NULL == __frame_def)
+ {
+ // log this;
+ return;
+ }
+ __frame_def->eID = ID3FID_NOFRAME;
+ __frame_def->bTagDiscard = false;
+ __frame_def->bFileDiscard = false;
+ __frame_def->aeFieldDefs = (ID3_FieldDef *) ID3_FieldDef::DEFAULT;
+ if (strlen(id) <= 3)
+ {
+ strcpy(__frame_def->sShortTextID, id);
+ strcpy(__frame_def->sLongTextID, "");
+ }
+ else
+ {
+ strncpy(__frame_def->sLongTextID, id, 4);
+ strcpy(__frame_def->sShortTextID, "");
+ }
+ __dyn_frame_def = true;
+}
+
+bool ID3_FrameHeader::SetFrameID(ID3_FrameID id)
+{
+ if (id == ID3FID_NOFRAME || id == this->GetFrameID())
+ {
+ return false;
+ }
+ __frame_def = ID3_FindFrameDef(id);
+ __flags.set(TAGALTER, __frame_def->bTagDiscard);
+ __flags.set(FILEALTER, __frame_def->bFileDiscard);
+
+ __changed = true;
+ return true;
+}
+
+size_t ID3_FrameHeader::Size() const
+{
+ if (!__info)
+ {
+ return 0;
+ }
+ return
+ __info->frame_bytes_id +
+ __info->frame_bytes_size +
+ __info->frame_bytes_flags;
+}
+
+size_t ID3_FrameHeader::Parse(const uchar *buffer, size_t size)
+{
+ size_t index = 0;
+ char text_id[5];
+
+ if (!__info)
+ {
+ return 0;
+ }
+
+ strncpy(text_id, (char *) buffer, __info->frame_bytes_id);
+ text_id[__info->frame_bytes_id] = '\0';
+ index += __info->frame_bytes_id;
+
+ ID3_FrameID fid = ID3_FindFrameID(text_id);
+ if (ID3FID_NOFRAME == fid)
+ {
+ this->SetUnknownFrame(text_id);
+ }
+ else
+ {
+ this->SetFrameID(fid);
+ }
+
+ this->SetDataSize(ParseNumber(&buffer[index], __info->frame_bytes_size));
+ index += __info->frame_bytes_size;
+
+ __flags.add(ParseNumber(&buffer[index], __info->frame_bytes_flags));
+ index += __info->frame_bytes_flags;
+
+ return index;
+}
+
+size_t ID3_FrameHeader::Render(uchar *buffer) const
+{
+ size_t size = 0;
+
+ if (NULL == __frame_def)
+ {
+ // TODO: log this
+ return 0;
+ //ID3_THROW(ID3E_InvalidFrameID);
+ }
+ char *text_id;
+ if (__info->frame_bytes_id == strlen(__frame_def->sShortTextID))
+ {
+ text_id = __frame_def->sShortTextID;
+ }
+ else
+ {
+ text_id = __frame_def->sLongTextID;
+ }
+
+ memcpy(&buffer[size], (uchar *) text_id, __info->frame_bytes_id);
+ size += __info->frame_bytes_id;
+
+ size += RenderNumber(&buffer[size], __data_size, __info->frame_bytes_size);
+ size += RenderNumber(&buffer[size], __flags.get(), __info->frame_bytes_flags);
+
+ return size;
+}
+
+const char* ID3_FrameHeader::GetTextID() const
+{
+ char *text_id = "";
+ if (__info && __frame_def)
+ {
+ if (__info->frame_bytes_id == strlen(__frame_def->sShortTextID))
+ {
+ text_id = __frame_def->sShortTextID;
+ }
+ else
+ {
+ text_id = __frame_def->sLongTextID;
+ }
+ }
+ return text_id;
+}
+
+ID3_FrameHeader& ID3_FrameHeader::operator=(const ID3_FrameHeader& hdr)
+{
+ if (this != &hdr)
+ {
+ this->Clear();
+ this->ID3_Header::operator=(hdr);
+ if (!hdr.__dyn_frame_def)
+ {
+ __frame_def = hdr.__frame_def;
+ }
+ else
+ {
+ __frame_def = new ID3_FrameDef;
+ if (NULL == __frame_def)
+ {
+ // TODO: throw something here...
+ }
+ __frame_def->eID = hdr.__frame_def->eID;
+ __frame_def->bTagDiscard = hdr.__frame_def->bTagDiscard;
+ __frame_def->bFileDiscard = hdr.__frame_def->bFileDiscard;
+ __frame_def->aeFieldDefs = hdr.__frame_def->aeFieldDefs;
+ strcpy(__frame_def->sShortTextID, hdr.__frame_def->sShortTextID);
+ strcpy(__frame_def->sLongTextID, hdr.__frame_def->sLongTextID);
+ __dyn_frame_def = true;
+ }
+ }
+ return *this;
+}
+
+ID3_FrameID ID3_FrameHeader::GetFrameID() const
+{
+ ID3_FrameID eID = ID3FID_NOFRAME;
+ if (NULL != __frame_def)
+ {
+ eID = __frame_def->eID;
+ }
+
+ return eID;
+}
+
+const ID3_FrameDef *ID3_FrameHeader::GetFrameDef() const
+{
+ return __frame_def;
+}
+
+bool ID3_FrameHeader::Clear()
+{
+ bool changed = this->ID3_Header::Clear();
+ if (__dyn_frame_def)
+ {
+ delete __frame_def;
+ __dyn_frame_def = false;
+ changed = true;
+ }
+ if (__frame_def)
+ {
+ __frame_def = NULL;
+ changed = true;
+ }
+ return changed;
+}
--- /dev/null
+++ b/common/id3lib/src/header_tag.cpp
@@ -1,0 +1,129 @@
+// $Id: header_tag.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include "header_tag.h"
+#include "uint28.h"
+#include "utils.h"
+#include "tag.h"
+#include <string.h>
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+const char* const ID3_TagHeader::ID = "ID3";
+
+bool ID3_TagHeader::SetSpec(ID3_V2Spec spec)
+{
+ bool changed = this->ID3_Header::SetSpec(spec);
+ if (changed)
+ {
+ if (__info)
+ {
+ __flags.set(EXPERIMENTAL, __info->is_experimental);
+ __flags.set(EXTENDED, __info->is_extended);
+ }
+ }
+ return changed;
+}
+
+size_t ID3_TagHeader::Size() const
+{
+ size_t bytesUsed = ID3_TagHeader::SIZE;
+
+ if (__info->is_extended)
+ {
+ bytesUsed += __info->extended_bytes + sizeof(uint32);
+ }
+
+ return bytesUsed;
+}
+
+
+size_t ID3_TagHeader::Render(uchar *buffer) const
+{
+ size_t size = 0;
+
+ memcpy(&buffer[size], (uchar *) ID, strlen(ID));
+ size += strlen(ID);
+
+ buffer[size++] = ID3_V2SpecToVer(ID3V2_LATEST);
+ buffer[size++] = ID3_V2SpecToRev(ID3V2_LATEST);
+
+ // set the flags byte in the header
+ buffer[size++] = static_cast<uchar>(__flags.get() & MASK8);
+
+ uint28 size28(this->GetDataSize());
+ size28.Render(&buffer[size]);
+ size += sizeof(uint32);
+
+ // now we render the extended header
+ if (__flags.test(EXTENDED))
+ {
+ size += RenderNumber(&buffer[size], __info->extended_bytes);
+ }
+
+ return size;
+}
+
+size_t ID3_TagHeader::Parse(const uchar* data, size_t size)
+{
+ if (!(ID3_IsTagHeader(data) > 0))
+ {
+ return 0;
+ }
+
+ size_t tag_size = SIZE;
+
+ // The spec version is determined with the MAJOR and MINOR OFFSETs
+ uchar major = data[MAJOR_OFFSET];
+ uchar minor = data[MINOR_OFFSET];
+ this->SetSpec(ID3_VerRevToV2Spec(major, minor));
+
+ // Get the flags at the appropriate offset
+ __flags.set(static_cast<ID3_Flags::TYPE>(data[FLAGS_OFFSET]));
+
+ // set the data size
+ uint28 data_size = uint28(&data[SIZE_OFFSET]);
+ this->SetDataSize(data_size.to_uint32());
+
+ if (__flags.test(EXTENDED))
+ {
+ if (this->GetSpec() == ID3V2_2_1)
+ {
+ // okay, if we are ID3v2.2.1, then let's skip over the extended header
+ // for now because I am lazy
+ }
+
+ if (this->GetSpec() == ID3V2_3_0)
+ {
+ // okay, if we are ID3v2.3.0, then let's actually parse the extended
+ // header (for now, we skip it because we are lazy)
+ }
+ }
+
+ return tag_size;
+}
--- /dev/null
+++ b/common/id3lib/src/int28.cpp
@@ -1,0 +1,94 @@
+// $Id: int28.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include "int28.h"
+#include "misc_support.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+int28::int28(uint32 val)
+{
+ set(val);
+}
+
+
+int28::int28(uchar val[sizeof(uint32)])
+{
+ set(val);
+}
+
+void int28::set(uchar val[sizeof(uint32)])
+{
+ for (size_t i = 0; i < sizeof(uint32); i++)
+ {
+ __acValue[i] = val[i];
+ }
+
+ uchar bytes [4];
+ bytes[0] = (uchar) ((__acValue[0] >> 3) & MASK4);
+ bytes[1] = (uchar)(((__acValue[1] >> 2) & MASK5) | ((__acValue[0] & MASK3) << 5));
+ bytes[2] = (uchar)(((__acValue[2] >> 1) & MASK6) | ((__acValue[1] & MASK2) << 6));
+ bytes[3] = (uchar)(((__acValue[3] >> 0) & MASK7) | ((__acValue[2] & MASK1) << 7));
+
+ __nValue = ParseNumber(bytes);
+}
+
+void int28::set(uint32 val)
+{
+ __nValue = val;
+ for (size_t i = 0; i < sizeof(uint32); i++)
+ {
+ __acValue[sizeof(uint32) - 1 - i] =
+ (uchar) (((val >> (i * 7)) & MASK7) & MASK8);
+ }
+}
+
+uint32 int28::get(void)
+{
+ return __nValue;
+}
+
+uchar int28::operator[](size_t posn)
+{
+ return __acValue[posn];
+}
+
+ostream& operator<<(ostream& out, int28& val)
+{
+ out.write(val.__acValue, sizeof(uint32));
+ return out;
+}
+
+
+istream& operator>>(istream& in, int28& val)
+{
+ uchar temp [sizeof(uint32)];
+ in.read(temp, sizeof(temp));
+ val = temp;
+ return in;
+}
--- /dev/null
+++ b/common/id3lib/src/misc_support.cpp
@@ -1,0 +1,838 @@
+// $Id: misc_support.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdio.h>
+#include "misc_support.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+char *ID3_GetString(const ID3_Frame *frame, ID3_FieldID fldName, size_t nIndex)
+{
+ char *sText = NULL;
+ if (NULL != frame)
+ {
+ size_t nText = frame->Field(fldName).Size();
+ sText = new char[nText + 1];
+ try
+ {
+ frame->Field(fldName).Get(sText, nText, nIndex);
+ }
+ catch (ID3_Err&)
+ {
+ delete [] sText;
+ return NULL;
+ }
+ sText[nText] = '\0';
+ }
+ return sText;
+}
+
+char *ID3_GetArtist(const ID3_Tag *tag)
+{
+ char *sArtist = NULL;
+ if (NULL == tag)
+ {
+ return sArtist;
+ }
+
+ ID3_Frame *pFrame = NULL;
+ if ((pFrame = tag->Find(ID3FID_LEADARTIST)) ||
+ (pFrame = tag->Find(ID3FID_BAND)) ||
+ (pFrame = tag->Find(ID3FID_CONDUCTOR)) ||
+ (pFrame = tag->Find(ID3FID_COMPOSER)))
+ {
+ sArtist = ID3_GetString(pFrame, ID3FN_TEXT);
+ }
+ return sArtist;
+}
+
+ID3_Frame* ID3_AddArtist(ID3_Tag *tag, const char *text, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ if (NULL != tag && NULL != text && strlen(text) > 0)
+ {
+ if (bReplace)
+ {
+ ID3_RemoveArtists(tag);
+ }
+ if (bReplace ||
+ (tag->Find(ID3FID_LEADARTIST) == NULL &&
+ tag->Find(ID3FID_BAND) == NULL &&
+ tag->Find(ID3FID_CONDUCTOR) == NULL &&
+ tag->Find(ID3FID_COMPOSER) == NULL))
+ {
+ pFrame = new ID3_Frame(ID3FID_LEADARTIST);
+ if (pFrame)
+ {
+ pFrame->Field(ID3FN_TEXT) = text;
+ tag->AttachFrame(pFrame);
+ }
+ }
+ }
+
+ return pFrame;
+}
+
+size_t ID3_RemoveArtists(ID3_Tag *tag)
+{
+ size_t nRemoved = 0;
+ ID3_Frame *pFrame = NULL;
+
+ if (NULL == tag)
+ {
+ return nRemoved;
+ }
+
+ while ((pFrame = tag->Find(ID3FID_LEADARTIST)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+ while ((pFrame = tag->Find(ID3FID_BAND)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+ while ((pFrame = tag->Find(ID3FID_CONDUCTOR)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+ while ((pFrame = tag->Find(ID3FID_COMPOSER)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+
+ return nRemoved;
+}
+
+char *ID3_GetAlbum(const ID3_Tag *tag)
+{
+ char *sAlbum = NULL;
+ if (NULL == tag)
+ {
+ return sAlbum;
+ }
+
+ ID3_Frame *pFrame = tag->Find(ID3FID_ALBUM);
+ if (pFrame != NULL)
+ {
+ sAlbum = ID3_GetString(pFrame, ID3FN_TEXT);
+ }
+ return sAlbum;
+}
+
+ID3_Frame* ID3_AddAlbum(ID3_Tag *tag, const char *text, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ if (NULL != tag && NULL != text && strlen(text) > 0)
+ {
+ if (bReplace)
+ {
+ ID3_RemoveAlbums(tag);
+ }
+ if (bReplace || tag->Find(ID3FID_ALBUM) == NULL)
+ {
+ pFrame = new ID3_Frame(ID3FID_ALBUM);
+ if (pFrame)
+ {
+ pFrame->Field(ID3FN_TEXT) = text;
+ tag->AttachFrame(pFrame);
+ }
+ }
+ }
+
+ return pFrame;
+}
+
+size_t ID3_RemoveAlbums(ID3_Tag *tag)
+{
+ size_t nRemoved = 0;
+ ID3_Frame *pFrame = NULL;
+
+ if (NULL == tag)
+ {
+ return nRemoved;
+ }
+
+ while ((pFrame = tag->Find(ID3FID_ALBUM)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+
+ return nRemoved;
+}
+
+char *ID3_GetTitle(const ID3_Tag *tag)
+{
+ char *sTitle = NULL;
+ if (NULL == tag)
+ {
+ return sTitle;
+ }
+
+ ID3_Frame *pFrame = tag->Find(ID3FID_TITLE);
+ if (pFrame != NULL)
+ {
+ sTitle = ID3_GetString(pFrame, ID3FN_TEXT);
+ }
+ return sTitle;
+}
+
+ID3_Frame* ID3_AddTitle(ID3_Tag *tag, const char *text, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ if (NULL != tag && NULL != text && strlen(text) > 0)
+ {
+ if (bReplace)
+ {
+ ID3_RemoveTitles(tag);
+ }
+ if (bReplace || tag->Find(ID3FID_TITLE) == NULL)
+ {
+ pFrame = new ID3_Frame(ID3FID_TITLE);
+ if (pFrame)
+ {
+ pFrame->Field(ID3FN_TEXT) = text;
+ tag->AttachFrame(pFrame);
+ }
+ }
+ }
+
+ return pFrame;
+}
+
+size_t ID3_RemoveTitles(ID3_Tag *tag)
+{
+ size_t nRemoved = 0;
+ ID3_Frame *pFrame = NULL;
+
+ if (NULL == tag)
+ {
+ return nRemoved;
+ }
+
+ while ((pFrame = tag->Find(ID3FID_TITLE)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+
+ return nRemoved;
+}
+
+char *ID3_GetYear(const ID3_Tag *tag)
+{
+ char *sYear = NULL;
+ if (NULL == tag)
+ {
+ return sYear;
+ }
+
+ ID3_Frame *pFrame = tag->Find(ID3FID_YEAR);
+ if (pFrame != NULL)
+ {
+ sYear = ID3_GetString(pFrame, ID3FN_TEXT);
+ }
+ return sYear;
+}
+
+ID3_Frame* ID3_AddYear(ID3_Tag *tag, const char *text, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ if (NULL != tag && NULL != text && strlen(text) > 0)
+ {
+ if (bReplace)
+ {
+ ID3_RemoveYears(tag);
+ }
+ if (bReplace || tag->Find(ID3FID_YEAR) == NULL)
+ {
+ pFrame = new ID3_Frame(ID3FID_YEAR);
+ if (NULL != pFrame)
+ {
+ pFrame->Field(ID3FN_TEXT) = text;
+ tag->AttachFrame(pFrame);
+ }
+ }
+ }
+
+ return pFrame;
+}
+
+size_t ID3_RemoveYears(ID3_Tag *tag)
+{
+ size_t nRemoved = 0;
+ ID3_Frame *pFrame = NULL;
+
+ if (NULL == tag)
+ {
+ return nRemoved;
+ }
+
+ while ((pFrame = tag->Find(ID3FID_YEAR)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+
+ return nRemoved;
+}
+
+char *ID3_GetComment(const ID3_Tag *tag)
+{
+ char *sComment = NULL;
+ if (NULL == tag)
+ {
+ return sComment;
+ }
+
+ ID3_Frame *pFrame = tag->Find(ID3FID_COMMENT);
+ if (pFrame != NULL)
+ {
+ sComment = ID3_GetString(pFrame, ID3FN_TEXT);
+ }
+ return sComment;
+}
+
+ID3_Frame* ID3_AddComment(ID3_Tag *tag, const char *sComment,
+ const char *sDescription, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ if (NULL != tag &&
+ NULL != sComment &&
+ NULL != sDescription &&
+ strlen(sComment) > 0)
+ {
+ bool bAdd = true;
+ if (bReplace)
+ {
+ ID3_RemoveComments(tag, sDescription);
+ }
+ else
+ {
+ // See if there is already a comment with this description
+ for (size_t nCount = 0; nCount < tag->NumFrames(); nCount++)
+ {
+ pFrame = tag->GetFrameNum(nCount);
+ if (pFrame->GetID() == ID3FID_COMMENT)
+ {
+ char *sDesc = ID3_GetString(pFrame, ID3FN_DESCRIPTION);
+ if (strcmp(sDesc, sDescription) == 0)
+ {
+ bAdd = false;
+ }
+ delete [] sDesc;
+ if (!bAdd)
+ {
+ break;
+ }
+ }
+ }
+ }
+ if (bAdd)
+ {
+ pFrame = new ID3_Frame(ID3FID_COMMENT);
+ if (NULL != pFrame)
+ {
+ pFrame->Field(ID3FN_LANGUAGE) = "eng";
+ pFrame->Field(ID3FN_DESCRIPTION) = sDescription;
+ pFrame->Field(ID3FN_TEXT) = sComment;
+ tag->AttachFrame(pFrame);
+ }
+ }
+ }
+ return pFrame;
+}
+
+// Remove all comments with the given description (remove all comments if
+// sDescription is NULL)
+size_t ID3_RemoveComments(ID3_Tag *tag, const char *sDescription)
+{
+ size_t nRemoved = 0;
+
+ if (NULL == tag)
+ {
+ return nRemoved;
+ }
+
+ for (size_t nCount = 0; nCount < tag->NumFrames(); nCount++)
+ {
+ ID3_Frame *pFrame = tag->GetFrameNum(nCount);
+ if (pFrame->GetID() == ID3FID_COMMENT)
+ {
+ bool bRemove = false;
+ // A null description means remove all comments
+ if (NULL == sDescription)
+ {
+ bRemove = true;
+ }
+ else
+ {
+ // See if the description we have matches the description of the
+ // current comment. If so, set the "remove the comment" flag to true.
+ char *sDesc = ID3_GetString(pFrame, ID3FN_DESCRIPTION);
+ if (strcmp(sDesc, sDescription) == 0)
+ {
+ bRemove = true;
+ }
+ delete [] sDesc;
+ }
+ if (bRemove)
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+ }
+ }
+
+ return nRemoved;
+}
+
+char *ID3_GetTrack(const ID3_Tag *tag)
+{
+ char *sTrack = NULL;
+ if (NULL == tag)
+ {
+ return sTrack;
+ }
+
+ ID3_Frame *pFrame = tag->Find(ID3FID_TRACKNUM);
+ if (pFrame != NULL)
+ {
+ sTrack = ID3_GetString(pFrame, ID3FN_TEXT);
+ }
+ return sTrack;
+}
+
+size_t ID3_GetTrackNum(const ID3_Tag *tag)
+{
+ char *sTrack = ID3_GetTrack(tag);
+ size_t nTrack = 0;
+ if (NULL != sTrack)
+ {
+ nTrack = atoi(sTrack);
+ delete [] sTrack;
+ }
+ return nTrack;
+}
+
+ID3_Frame* ID3_AddTrack(ID3_Tag *tag, uchar ucTrack, uchar ucTotal, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ if (NULL != tag && ucTrack > 0)
+ {
+ if (bReplace)
+ {
+ ID3_RemoveTracks(tag);
+ }
+ if (bReplace || NULL == tag->Find(ID3FID_TRACKNUM))
+ {
+ ID3_Frame *trackFrame = new ID3_Frame(ID3FID_TRACKNUM);
+ if (trackFrame)
+ {
+ char *sTrack = NULL;
+ if (0 == ucTotal)
+ {
+ sTrack = new char[4];
+ sprintf(sTrack, "%lu", (luint) ucTrack);
+ }
+ else
+ {
+ sTrack = new char[8];
+ sprintf(sTrack, "%lu/%lu", (luint) ucTrack, (luint) ucTotal);
+ }
+
+ trackFrame->Field(ID3FN_TEXT) = sTrack;
+ tag->AttachFrame(trackFrame);
+
+ delete [] sTrack;
+ }
+ }
+ }
+
+ return pFrame;
+}
+
+size_t ID3_RemoveTracks(ID3_Tag *tag)
+{
+ size_t nRemoved = 0;
+ ID3_Frame *pFrame = NULL;
+
+ if (NULL == tag)
+ {
+ return nRemoved;
+ }
+
+ while ((pFrame = tag->Find(ID3FID_TRACKNUM)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+
+ return nRemoved;
+}
+
+char *ID3_GetGenre(const ID3_Tag *tag)
+{
+ char *sGenre = NULL;
+ if (NULL == tag)
+ {
+ return sGenre;
+ }
+
+ ID3_Frame *pFrame = tag->Find(ID3FID_CONTENTTYPE);
+ if (pFrame != NULL)
+ {
+ sGenre = ID3_GetString(pFrame, ID3FN_TEXT);
+ }
+
+ return sGenre;
+}
+
+size_t ID3_GetGenreNum(const ID3_Tag *tag)
+{
+ char *sGenre = ID3_GetGenre(tag);
+ size_t ulGenre = 0xFF;
+ if (NULL == sGenre)
+ {
+ return ulGenre;
+ }
+
+ // If the genre string begins with "(ddd)", where "ddd" is a number, then
+ // "ddd" is the genre number---get it
+ if (sGenre[0] == '(')
+ {
+ char *pCur = &sGenre[1];
+ while (isdigit(*pCur))
+ {
+ pCur++;
+ }
+ if (*pCur == ')')
+ {
+ // if the genre number is greater than 255, its invalid.
+ ulGenre = MIN(0xFF, atoi(&sGenre[1]));
+ }
+ }
+
+ delete [] sGenre;
+ return ulGenre;
+}
+
+ID3_Frame* ID3_AddGenre(ID3_Tag *tag, size_t ucGenre, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ if (NULL != tag && 0xFF != ucGenre)
+ {
+ if (bReplace)
+ {
+ ID3_RemoveGenres(tag);
+ }
+ if (bReplace || NULL == tag->Find(ID3FID_CONTENTTYPE))
+ {
+ pFrame = new ID3_Frame(ID3FID_CONTENTTYPE);
+ if (NULL != pFrame)
+ {
+ char sGenre[6];
+ sprintf(sGenre, "(%lu)", (luint) ucGenre);
+
+ pFrame->Field(ID3FN_TEXT) = sGenre;
+ tag->AttachFrame(pFrame);
+ }
+ }
+ }
+
+ return pFrame;
+}
+
+size_t ID3_RemoveGenres(ID3_Tag *tag)
+{
+ size_t nRemoved = 0;
+ ID3_Frame *pFrame = NULL;
+
+ if (NULL == tag)
+ {
+ return nRemoved;
+ }
+
+ while ((pFrame = tag->Find(ID3FID_CONTENTTYPE)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+
+ return nRemoved;
+}
+
+char *ID3_GetLyrics(const ID3_Tag *tag)
+{
+ char *sLyrics = NULL;
+ if (NULL == tag)
+ {
+ return sLyrics;
+ }
+
+ ID3_Frame *pFrame = tag->Find(ID3FID_UNSYNCEDLYRICS);
+ if (pFrame != NULL)
+ {
+ sLyrics = ID3_GetString(pFrame, ID3FN_TEXT);
+ }
+ return sLyrics;
+}
+
+ID3_Frame* ID3_AddLyrics(ID3_Tag *tag, const char *text, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ if (NULL != tag && strlen(text) > 0)
+ {
+ if (bReplace)
+ {
+ ID3_RemoveLyrics(tag);
+ }
+ if (bReplace || tag->Find(ID3FID_UNSYNCEDLYRICS) == NULL)
+ {
+ pFrame = new ID3_Frame(ID3FID_UNSYNCEDLYRICS);
+ if (NULL != pFrame)
+ {
+ pFrame->Field(ID3FN_LANGUAGE) = "eng";
+ pFrame->Field(ID3FN_TEXT) = text;
+ tag->AttachFrame(pFrame);
+ }
+ }
+ }
+
+ return pFrame;
+}
+
+size_t ID3_RemoveLyrics(ID3_Tag *tag)
+{
+ size_t nRemoved = 0;
+ ID3_Frame *pFrame = NULL;
+
+ if (NULL == tag)
+ {
+ return nRemoved;
+ }
+
+ while ((pFrame = tag->Find(ID3FID_UNSYNCEDLYRICS)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+
+ return nRemoved;
+}
+
+char *ID3_GetLyricist(const ID3_Tag *tag)
+{
+ char *sLyricist = NULL;
+ if (NULL == tag)
+ {
+ return sLyricist;
+ }
+
+ ID3_Frame *pFrame = tag->Find(ID3FID_LYRICIST);
+ if (pFrame != NULL)
+ {
+ sLyricist = ID3_GetString(pFrame, ID3FN_TEXT);
+ }
+ return sLyricist;
+}
+
+ID3_Frame* ID3_AddLyricist(ID3_Tag *tag, const char *text, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ if (NULL != tag && NULL != text && strlen(text) > 0)
+ {
+ if (bReplace)
+ {
+ ID3_RemoveLyricist(tag);
+ }
+ if (bReplace || (tag->Find(ID3FID_LYRICIST) == NULL))
+ {
+ pFrame = new ID3_Frame(ID3FID_LYRICIST);
+ if (pFrame)
+ {
+ pFrame->Field(ID3FN_TEXT) = text;
+ tag->AttachFrame(pFrame);
+ }
+ }
+ }
+
+ return pFrame;
+}
+
+size_t ID3_RemoveLyricist(ID3_Tag *tag)
+{
+ size_t nRemoved = 0;
+ ID3_Frame *pFrame = NULL;
+
+ if (NULL == tag)
+ {
+ return nRemoved;
+ }
+
+ while ((pFrame = tag->Find(ID3FID_LYRICIST)))
+ {
+ tag->RemoveFrame(pFrame);
+ nRemoved++;
+ }
+
+ return nRemoved;
+}
+
+ID3_Frame* ID3_AddSyncLyrics(ID3_Tag *tag, const char *lang, const char *desc,
+ const uchar *text, size_t textsize, bool bReplace)
+{
+ ID3_Frame* pFrame = NULL;
+ // language and descriptor should be mandatory
+ if ((NULL == lang) || (NULL == desc))
+ {
+ return NULL;
+ }
+
+ // check if a SYLT frame of this language or descriptor already exists
+ ID3_Frame* pFrameExist = tag->Find(ID3FID_SYNCEDLYRICS, ID3FN_LANGUAGE,
+ (char *) lang);
+ if (!pFrameExist)
+ {
+ pFrameExist = tag->Find(ID3FID_SYNCEDLYRICS, ID3FN_DESCRIPTION,
+ (char *) desc);
+ }
+
+ if (NULL != tag && NULL != text)
+ {
+ if (bReplace && pFrameExist)
+ {
+ tag->RemoveFrame (pFrameExist);
+ pFrameExist = NULL;
+ }
+
+ // if the frame still exist, cannot continue
+ if (pFrameExist)
+ {
+ return NULL;
+ }
+
+ ID3_Frame* pFrame = new ID3_Frame(ID3FID_SYNCEDLYRICS);
+ if (NULL == pFrame)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ pFrame->Field(ID3FN_LANGUAGE) = lang;
+ pFrame->Field(ID3FN_DESCRIPTION) = desc;
+ pFrame->Field(ID3FN_DATA).Set(text, textsize);
+ tag->AttachFrame(pFrame);
+ }
+
+ return pFrame;
+}
+
+ID3_Frame *ID3_GetSyncLyricsInfo(const ID3_Tag *tag, const char *lang,
+ const char *desc, size_t& stampformat,
+ size_t& type, size_t& size)
+{
+ // check if a SYLT frame of this language or descriptor exists
+ ID3_Frame* pFrameExist = NULL;
+ if (NULL != lang)
+ {
+ // search through language
+ pFrameExist = tag->Find(ID3FID_SYNCEDLYRICS, ID3FN_LANGUAGE, lang);
+ }
+ else if (NULL != desc)
+ {
+ // search through descriptor
+ pFrameExist = tag->Find(ID3FID_SYNCEDLYRICS, ID3FN_DESCRIPTION, desc);
+ }
+ else
+ {
+ // both language and description not specified, search the first SYLT frame
+ pFrameExist = tag->Find(ID3FID_SYNCEDLYRICS);
+ }
+
+ if (!pFrameExist)
+ {
+ return NULL;
+ }
+
+ // get the lyrics time stamp format
+ stampformat = pFrameExist->Field (ID3FN_TIMESTAMPFORMAT).Get ();
+
+ // get the lyrics content type
+ type = pFrameExist->Field (ID3FN_CONTENTTYPE).Get ();
+
+ // get the lyrics size
+ size = pFrameExist->Field (ID3FN_DATA).Size ();
+
+ // return the frame pointer for further uses
+ return pFrameExist;
+}
+
+ID3_Frame *ID3_GetSyncLyrics(const ID3_Tag *tag, const char *lang,
+ const char *desc, const uchar *pData, size_t& size)
+{
+ // check if a SYLT frame of this language or descriptor exists
+ ID3_Frame* pFrameExist = NULL;
+ if (NULL != lang)
+ {
+ // search through language
+ pFrameExist = tag->Find(ID3FID_SYNCEDLYRICS, ID3FN_LANGUAGE, lang);
+ }
+ else if (NULL != desc)
+ {
+ // search through descriptor
+ pFrameExist = tag->Find(ID3FID_SYNCEDLYRICS, ID3FN_DESCRIPTION, desc);
+ }
+ else
+ {
+ // both language and description not specified, search the first SYLT frame
+ pFrameExist = tag->Find(ID3FID_SYNCEDLYRICS);
+ }
+
+ if (NULL == pFrameExist)
+ {
+ return NULL;
+ }
+
+ // get the lyrics size
+ size_t datasize = pFrameExist->Field(ID3FN_DATA).Size();
+ size = MIN(size, datasize);
+
+ // get the lyrics data
+ pData = pFrameExist->Field (ID3FN_DATA).GetBinary();
+
+ // return the frame pointer for further uses
+ return pFrameExist;
+}
+
--- /dev/null
+++ b/common/id3lib/src/spec.cpp
@@ -1,0 +1,93 @@
+// $Id: spec.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "spec.h"
+
+ID3_V2Spec ID3_VerRevToV2Spec(uchar ver, uchar rev)
+{
+ ID3_V2Spec spec = ID3V2_UNKNOWN;
+ if (2 == ver)
+ {
+ if (0 == rev)
+ {
+ spec = ID3V2_2_0;
+ }
+ else if (1 == rev)
+ {
+ spec = ID3V2_2_1;
+ }
+ }
+ else if (3 == ver)
+ {
+ if (0 == rev)
+ {
+ spec = ID3V2_3_0;
+ }
+ }
+
+ return spec;
+}
+
+uchar ID3_V2SpecToVer(ID3_V2Spec spec)
+{
+ uchar ver = 0;
+ switch (spec)
+ {
+ case ID3V2_2_0:
+ case ID3V2_2_1:
+ ver = 2;
+ break;
+ case ID3V2_3_0:
+ ver = 3;
+ break;
+ default:
+ break;
+ }
+ return ver;
+}
+
+uchar ID3_V2SpecToRev(ID3_V2Spec spec)
+{
+ uchar rev = 0;
+ switch (spec)
+ {
+ case ID3V2_2_0:
+ case ID3V2_3_0:
+ rev = 0;
+ break;
+ case ID3V2_2_1:
+ rev = 1;
+ break;
+ default:
+ break;
+ }
+ return rev;
+}
+
--- /dev/null
+++ b/common/id3lib/src/tag.cpp
@@ -1,0 +1,587 @@
+// $Id: tag.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#include "tag.h"
+#include "uint28.h"
+#include <string.h>
+
+#ifdef MAXPATHLEN
+# define ID3_PATH_LENGTH (MAXPATHLEN + 1)
+#elif defined (PATH_MAX)
+# define ID3_PATH_LENGTH (PATH_MAX + 1)
+#else /* !MAXPATHLEN */
+# define ID3_PATH_LENGTH (2048 + 1)
+#endif /* !MAXPATHLEN && !PATH_MAX */
+
+/** \class ID3_Tag
+ ** \brief The representative class of an id3 tag.
+ **
+ ** This is the 'container' class for everything else. It is through an
+ ** ID3_Tag that most of the productive stuff happens.
+ ** Let's look at what's
+ ** required to start using ID3v2 tags.
+ **
+ ** \code
+ ** #include <id3/tag.h>
+ ** \endcode
+ **
+ ** This simple \c #include does it all. In order to read an
+ ** existing tag, do the following:
+ **
+ ** \code
+ ** ID3_Tag myTag;
+ ** myTag.Link("something.mp3");
+ ** \endcode
+ **
+ ** That is all there is to it. Now all you have to do is use the
+ ** Find() method to locate the frames you are interested in
+ ** is the following:
+ **
+ ** \code
+ ** ID3_Frame *myFrame;
+ ** if (myTag.Find(ID3FID_TITLE) == myFrame)
+ ** {
+ ** char title[1024];
+ ** myFrame->Field(ID3FN_TEXT).Get(title, 1024);
+ ** cout << "Title: " << title << endl;
+ ** }
+ ** \endcode
+ **
+ ** This code snippet locates the ID3FID_TITLE frame and copies the contents of
+ ** the text field into a buffer and displays the buffer. Not difficult, eh?
+ **
+ ** When using the ID3_Tag::Link() method, you automatically gain access to any
+ ** ID3v1/1.1, ID3v2, and Lyrics3 v2.0 tags present in the file. The class
+ ** will automaticaly parse and convert any of these foreign tag formats into
+ ** ID3v2 tags. Also, id3lib will correctly parse any correctly formatted
+ ** 'CDM' frames from the unreleased ID3v2 2.01 draft specification.
+ **
+ ** \author Dirk Mahoney
+ ** \version $Id: tag.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+ ** \sa ID3_Frame
+ ** \sa ID3_Field
+ ** \sa ID3_Err
+ **/
+
+/** Analyses a buffer to determine if we have a valid ID3v2 tag header.
+ ** If so, return the total number of bytes (including the header) to
+ ** read so we get all of the tag
+ **/
+size_t ID3_Tag::IsV2Tag(const uchar* const data)
+{
+ lsint tagSize = 0;
+
+ if (strncmp(ID3_TagHeader::ID, (char *)data, ID3_TagHeader::ID_SIZE) == 0 &&
+ data[ID3_TagHeader::MAJOR_OFFSET] < 0xFF &&
+ data[ID3_TagHeader::MINOR_OFFSET] < 0xFF &&
+ data[ID3_TagHeader::SIZE_OFFSET + 0] < 0x80 &&
+ data[ID3_TagHeader::SIZE_OFFSET + 1] < 0x80 &&
+ data[ID3_TagHeader::SIZE_OFFSET + 2] < 0x80 &&
+ data[ID3_TagHeader::SIZE_OFFSET + 3] < 0x80)
+ {
+ uint28 data_size(&data[ID3_TagHeader::SIZE_OFFSET]);
+ tagSize = data_size.to_uint32() + ID3_TagHeader::SIZE;
+ }
+
+ return tagSize;
+}
+
+int32 ID3_IsTagHeader(const uchar data[ID3_TAGHEADERSIZE])
+{
+ size_t size = ID3_Tag::IsV2Tag(data);
+
+ if (!size)
+ {
+ return -1;
+ }
+
+ return size - ID3_TagHeader::SIZE;
+}
+
+void ID3_RemoveFromList(ID3_Elem *which, ID3_Elem **list)
+{
+ ID3_Elem *cur = *list;
+
+ if (cur == which)
+ {
+ *list = which->pNext;
+ delete which;
+ which = NULL;
+ }
+ else
+ {
+ while (cur)
+ {
+ if (cur->pNext == which)
+ {
+ cur->pNext = which->pNext;
+ delete which;
+ which = NULL;
+ break;
+ }
+ else
+ {
+ cur = cur->pNext;
+ }
+ }
+ }
+}
+
+
+void ID3_ClearList(ID3_Elem *list)
+{
+ ID3_Elem *next = NULL;
+ for (ID3_Elem *cur = list; cur; cur = next)
+ {
+ next = cur->pNext;
+ delete cur;
+ }
+}
+
+/** Copies a frame to the tag. The frame parameter can thus safely be deleted
+ ** or allowed to go out of scope.
+ **
+ ** Operator<< supports the addition of a pointer to a frame object, or
+ ** the frame object itself.
+ **
+ ** \code
+ ** ID3_Frame *pFrame, frame;
+ ** p_frame = &frame;
+ ** myTag << pFrame;
+ ** myTag << frame;
+ ** \endcode
+ **
+ ** Both these methods copy the given frame to the tag---the tag creates its
+ ** own copy of the frame.
+ **
+ ** \name operator<<
+ ** \param frame The frame to be added to the tag.
+ **/
+ID3_Tag& operator<<(ID3_Tag& tag, const ID3_Frame& frame)
+{
+ tag.AddFrame(frame);
+
+ return tag;
+}
+
+
+ID3_Tag& operator<<(ID3_Tag& tag, const ID3_Frame *frame)
+{
+ tag.AddFrame(frame);
+
+ return tag;
+}
+
+
+/** Default constructor; it can accept an optional filename as a parameter.
+ **
+ ** If this file exists, it will be opened and all id3lib-supported tags will
+ ** be parsed and converted to id3v2 if necessary. After the conversion, the
+ ** file will remain unchanged, and will continue to do so until you use the
+ ** Update() method on the tag (if you choose to Update() at all).
+ **
+ ** \param name The filename of the mp3 file to link to
+ **/
+ID3_Tag::ID3_Tag(const char *name)
+ : __frames(NULL),
+ __file_name(new char[ID3_PATH_LENGTH]),
+ __file_handle(NULL)
+
+{
+ this->Clear();
+ if (name)
+ {
+ this->Link(name);
+ }
+}
+
+/** Standard copy constructor.
+ **
+ ** \param tag What is copied into this tag
+ **/
+ID3_Tag::ID3_Tag(const ID3_Tag &tag)
+ : __frames(NULL),
+ __file_name(new char[ID3_PATH_LENGTH]),
+ __file_handle(NULL)
+{
+ *this = tag;
+}
+
+ID3_Tag::~ID3_Tag()
+{
+ this->Clear();
+
+ delete [] __file_name;
+}
+
+/** Clears the object and disassociates it from any files.
+ **
+ ** It frees any resources for which the object is responsible, and the
+ ** object is now free to be used again for any new or existing tag.
+ **/
+void ID3_Tag::Clear()
+{
+ this->CloseFile();
+
+ if (__frames)
+ {
+ ID3_ClearList(__frames);
+ __frames = NULL;
+ }
+ __num_frames = 0;
+ __cursor = NULL;
+ __is_padded = true;
+
+ __hdr.Clear();
+ __hdr.SetSpec(ID3V2_LATEST);
+
+ __file_size = 0;
+ __starting_bytes = 0;
+ __ending_bytes = 0;
+ __is_file_writable = false;
+
+ __tags_to_parse.clear();
+ __file_tags.clear();
+
+ __changed = true;
+}
+
+
+void ID3_Tag::AddFrame(const ID3_Frame& frame)
+{
+ this->AddFrame(&frame);
+}
+
+/** Attaches a frame to the tag; the tag doesn't take responsibility for
+ ** releasing the frame's memory when tag goes out of scope.
+ **
+ ** Optionally, operator<< can also be used to attach a frame to a tag. To
+ ** use, simply supply its parameter a pointer to the ID3_Frame object you wish
+ ** to attach.
+ **
+ ** \code
+ ** ID3_Frame myFrame;
+ ** myTag.AddFrame(&myFrame);
+ ** \endcode
+ **
+ ** As stated, this method attaches the frames to the tag---the tag does
+ ** not create its own copy of the frame. Frames created by an application
+ ** must exist until the frame is removed or the tag is finished with it.
+ **
+ ** \param pFrame A pointer to the frame that is being added to the tag.
+ ** \sa ID3_Frame
+ **/
+void ID3_Tag::AddFrame(const ID3_Frame *frame)
+{
+ if (frame)
+ {
+ ID3_Frame* new_frame = new ID3_Frame(*frame);
+ this->AttachFrame(new_frame);
+ }
+}
+
+/** Attaches a frame to the tag; the tag takes responsibility for
+ ** releasing the frame's memory when tag goes out of scope.
+ **
+ ** This method accepts responsibility for the attached frame's memory, and
+ ** will delete the frame and its contents when the tag goes out of scope or is
+ ** deleted. Therefore, be sure the frame isn't "Attached" to other tags.
+ **
+ ** \code
+ ** ID3_Frame *frame = new ID3_Frame;
+ ** myTag.AttachFrame(frame);
+ ** \endcode
+ **
+ ** \param frame A pointer to the frame that is being added to the tag.
+ **/
+void ID3_Tag::AttachFrame(ID3_Frame *frame)
+{
+ ID3_Elem *elem;
+
+ if (NULL == frame)
+ {
+ ID3_THROW(ID3E_NoData);
+ }
+
+ elem = new ID3_Elem;
+ if (NULL == elem)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ elem->pNext = __frames;
+ elem->pFrame = frame;
+
+ __frames = elem;
+ __num_frames++;
+ __cursor = NULL;
+
+ __changed = true;
+}
+
+
+/** Copies an array of frames to the tag.
+ **
+ ** This method copies each frame in an array to the tag. As in
+ ** AddFrame, the tag adds a copy of the frame, and it assumes responsiblity
+ ** for freeing the frames' memory when the tag goes out of scope.
+ **
+ ** \code
+ ** ID3_Frame myFrames[10];
+ ** myTag.AddFrames(myFrames, 10);
+ ** \endcode
+ **
+ ** \sa ID3_Frame
+ ** \sa ID3_Frame#AddFrame
+ ** \param pNewFrames A pointer to an array of frames to be added to the tag.
+ ** \param nFrames The number of frames in the array pNewFrames.
+ **/
+void ID3_Tag::AddFrames(const ID3_Frame *frames, size_t numFrames)
+{
+ for (index_t i = numFrames - 1; i >= 0; i--)
+ {
+ AddFrame(frames[i]);
+ }
+}
+
+
+/** Removes a frame from the tag.
+ **
+ ** If you already own the frame object in question, then you should already
+ ** have a pointer to the frame you want to delete. If not, or if you wish to
+ ** delete a pre-existing frame (from a tag you have parsed, for example), the
+ ** use one of the Find methods to obtain a frame pointer to pass to this
+ ** method.
+ **
+ ** \code
+ ** ID3_Frame *someFrame;
+ ** if (someFrame = myTag.Find(ID3FID_TITLE))
+ ** {
+ ** myTag.RemoveFrame(someFrame);
+ ** }
+ ** \endcode
+ **
+ ** \sa ID3_Tag#Find
+ ** \param pOldFrame A pointer to the frame that is to be removed from the
+ ** tag
+ **/
+ID3_Frame* ID3_Tag::RemoveFrame(const ID3_Frame *frame)
+{
+ ID3_Frame *the_frame = NULL;
+ ID3_Elem *elem = Find(frame);
+ if (NULL != elem)
+ {
+ the_frame = elem->pFrame;
+ //assert(the_frame == frame);
+ elem->pFrame = NULL;
+ ID3_RemoveFromList(elem, &__frames);
+ --__num_frames;
+ }
+
+ return the_frame;
+}
+
+
+/** Indicates whether the tag has been altered since the last parse, render,
+ ** or update.
+ **
+ ** If you have a tag linked to a file, you do not need this method since the
+ ** Update() method will check for changes before writing the tag.
+ **
+ ** This method is primarily intended as a status indicator for applications
+ ** and for applications that use the Parse() and Render() methods.
+ **
+ ** Setting a field, changed the ID of an attached frame, setting or grouping
+ ** or encryption IDs, and clearing a frame or field all constitute a change
+ ** to the tag, as do calls to the SetUnsync(), SetExtendedHeader(), and
+ ** SetPadding() methods.
+ **
+ ** \code
+ ** if (myTag.HasChanged())
+ ** {
+ ** // render and output the tag
+ ** }
+ ** \endcode
+ **
+ ** \return Whether or not the tag has been altered.
+ **/
+bool ID3_Tag::HasChanged() const
+{
+ bool changed = __changed;
+
+ if (! changed)
+ {
+ ID3_Elem *cur = __frames;
+
+ while (cur)
+ {
+ if (cur->pFrame)
+ {
+ changed = cur->pFrame->HasChanged();
+ }
+
+ if (changed)
+ {
+ break;
+ }
+ else
+ {
+ cur = cur->pNext;
+ }
+ }
+ }
+
+ return changed;
+}
+
+bool ID3_Tag::SetSpec(ID3_V2Spec spec)
+{
+ bool changed = __hdr.SetSpec(spec);
+ __changed = __changed || changed;
+ return changed;
+}
+
+ID3_V2Spec ID3_Tag::GetSpec() const
+{
+ return __hdr.GetSpec();
+}
+
+/** Turns unsynchronization on or off, dependant on the value of the boolean
+ ** parameter.
+ **
+ ** If you call this method with 'false' as the parameter, the
+ ** binary tag will not be unsync'ed, regardless of whether the tag should
+ ** be. This option is useful when the file is only going to be used by
+ ** ID3v2-compliant software. See the id3v2 standard document for futher
+ ** details on unsync.
+ **
+ ** Be default, tags are created without unsync.
+ **
+ ** \code
+ ** myTag.SetUnsync(false);
+ ** \endcode
+ **
+ ** \param bSync Whether the tag should be unsynchronized
+ **/
+bool ID3_Tag::SetUnsync(bool b)
+{
+ bool changed = __hdr.SetUnsync(b);
+ __changed = changed || __changed;
+ return changed;
+}
+
+
+/** Turns extended header rendering on or off, dependant on the value of the
+ ** boolean parameter.
+ **
+ ** This option is currently ignored as id3lib doesn't yet create extended
+ ** headers. This option only applies when rendering tags for id3v2 versions
+ ** that support extended headers.
+ **
+ ** By default, id3lib will generate extended headers for all tags in which
+ ** extended headers are supported.
+ **
+ ** \code
+ ** myTag.SetExtendedHeader(true);
+ ** \endcode
+ **
+ ** \param bExt Whether to render an extended header
+ **/
+bool ID3_Tag::SetExtendedHeader(bool ext)
+{
+ bool changed = __hdr.SetExtended(ext);
+ __changed = changed || __changed;
+ return changed;
+}
+
+/** Turns padding on or off, dependant on the value of the boolean
+ ** parameter.
+ **
+ ** When using id3v2 tags in association with files, id3lib can optionally
+ ** add padding to the tags to ensure minmal file write times when updating
+ ** the tag in the future.
+ **
+ ** When the padding option is switched on, id3lib automatically creates
+ ** padding according to the 'ID3v2 Programming Guidelines'. Specifically,
+ ** enough padding will be added to round out the entire file (song plus
+ ** tag) to an even multiple of 2K. Padding will only be created when the
+ ** tag is attached to a file and that file is not empty (aside from a
+ ** pre-existing tag).
+ **
+ ** id3lib's addition to the guidelines for padding, is that if frames are
+ ** removed from a pre-existing tag (or the tag simply shrinks because of
+ ** other reasons), the new tag will continue to stay the same size as the
+ ** old tag (with padding making the difference of course) until such time as
+ ** the padding is greater than 4K. When this happens, the padding will be
+ ** reduced and the new tag will be smaller than the old.
+ **
+ ** By default, padding is switched on.
+ **
+ ** \code
+ ** myTag.SetPadding(false);
+ ** \endcode
+ **
+ ** \param bPad Whether or not render the tag with padding.
+ **/
+bool ID3_Tag::SetPadding(bool pad)
+{
+ bool changed = (__is_padded != pad);
+ __changed = changed || __changed;
+ if (changed)
+ {
+ __is_padded = pad;
+ }
+
+ return changed;
+}
+
+
+ID3_Tag &
+ID3_Tag::operator=( const ID3_Tag &rTag )
+{
+ if (this != &rTag)
+ {
+ Clear();
+ size_t nFrames = rTag.NumFrames();
+ for (size_t nIndex = 0; nIndex < nFrames; nIndex++)
+ {
+ ID3_Frame *frame = new ID3_Frame;
+ // Copy the frames in reverse order so that they appear in the same order
+ // as the original tag when rendered.
+ *frame = *(rTag[nFrames - nIndex - 1]);
+ AttachFrame(frame);
+ }
+ }
+ return *this;
+}
--- /dev/null
+++ b/common/id3lib/src/tag_file.cpp
@@ -1,0 +1,436 @@
+// $Id: tag_file.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include <stdio.h>
+
+#if defined WIN32
+# include <windows.h>
+static int truncate(const char *path, size_t length)
+{
+ int result = -1;
+ HANDLE fh;
+
+ fh = ::CreateFile(path,
+ GENERIC_WRITE | GENERIC_READ,
+ 0,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+
+ if(INVALID_HANDLE_VALUE != fh)
+ {
+ SetFilePointer(fh, length, NULL, FILE_BEGIN);
+ SetEndOfFile(fh);
+ CloseHandle(fh);
+ result = 0;
+ }
+
+ return result;
+}
+
+// prevents a weird error I was getting compiling this under windows
+# if defined CreateFile
+# undef CreateFile
+# endif
+
+#else
+# include <unistd.h>
+#endif
+
+#if defined HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "tag.h"
+
+bool exists(const char *name)
+{
+ bool doesExist = false;
+ FILE *in = NULL;
+
+ if (NULL == name)
+ {
+ return false;
+ }
+
+ in = fopen(name, "rb");
+ doesExist = (NULL != in);
+ if (doesExist)
+ {
+ fclose(in);
+ }
+
+ return doesExist;
+}
+
+
+
+ID3_Err ID3_Tag::CreateFile()
+{
+ CloseFile();
+
+ // Create a new file
+ __file_handle = fopen(__file_name, "wb+");
+
+ // Check to see if file could not be created
+ if (NULL == __file_handle)
+ {
+ return ID3E_ReadOnly;
+ }
+
+ // Determine the size of the file
+ fseek(__file_handle, 0, SEEK_END);
+ __file_size = ftell(__file_handle);
+ fseek(__file_handle, 0, SEEK_SET);
+
+ return ID3E_NoError;
+}
+
+ID3_Err ID3_Tag::OpenFileForWriting()
+{
+ CloseFile();
+ __file_size = 0;
+ if (exists(__file_name))
+ {
+ // Try to open the file for reading and writing.
+ __file_handle = fopen(__file_name, "rb+");
+ }
+ else
+ {
+ return ID3E_NoFile;
+ }
+
+ // Check to see if file could not be opened for writing
+ if (NULL == __file_handle)
+ {
+ return ID3E_ReadOnly;
+ }
+
+ // Determine the size of the file
+ fseek(__file_handle, 0, SEEK_END);
+ __file_size = ftell(__file_handle);
+ fseek(__file_handle, 0, SEEK_SET);
+
+ return ID3E_NoError;
+}
+
+ID3_Err ID3_Tag::OpenFileForReading()
+{
+ CloseFile();
+ __file_size = 0;
+
+ __file_handle = fopen(__file_name, "rb");
+
+ if (NULL == __file_handle)
+ {
+ return ID3E_NoFile;
+ }
+
+ // Determine the size of the file
+ fseek(__file_handle, 0, SEEK_END);
+ __file_size = ftell(__file_handle);
+ fseek(__file_handle, 0, SEEK_SET);
+
+ return ID3E_NoError;
+}
+
+bool ID3_Tag::CloseFile()
+{
+ bool bReturn = ((NULL != __file_handle) && (0 == fclose(__file_handle)));
+ if (bReturn)
+ {
+ __file_handle = NULL;
+ }
+ return bReturn;
+}
+
+size_t ID3_Tag::Link(const char *fileInfo, bool parseID3v1, bool parseLyrics3)
+{
+ flags_t tt = ID3TT_NONE;
+ if (parseID3v1)
+ {
+ tt |= ID3TT_ID3V1;
+ }
+ if (parseLyrics3)
+ {
+ tt |= ID3TT_LYRICS;
+ }
+ return this->Link(fileInfo, tt);
+}
+
+/** Attaches a file to the tag, parses the file, and adds any tag information
+ ** found in the file to the tag.
+ **
+ ** Use this method if you created your ID3_Tag object without supplying a
+ ** parameter to the constructor (maybe you created an array of ID3_Tag
+ ** pointers). This is the preferred method of interacting with files, since
+ ** id3lib can automatically do things like parse foreign tag formats and
+ ** handle padding when linked to a file. When a tag is linked to a file,
+ ** you do not need to use the <a href="#Size">Size</a>, <a
+ ** href="#Render">Render</a>, or <a href="#Parse">Parse</a> methods or the
+ ** <code>ID3_IsTagHeader</code> function---id3lib will take care of those
+ ** details for you. The single parameter is a pointer to a file name.
+ **
+ ** Link returns a 'luint' which is the byte position within the file that
+ ** the audio starts (i.e., where the id3v2 tag ends).
+ **
+ ** \code
+ ** ID3_Tag *myTag;
+ ** if (myTag = new ID3_Tag)
+ ** {
+ ** myTag->Link("mysong.mp3");
+ **
+ ** // do whatever we want with the tag
+ ** // ...
+ **
+ ** // setup all our rendering parameters
+ ** myTag->SetUnsync(false);
+ ** myTag->SetExtendedHeader(true);
+ ** myTag->SetCompression(true);
+ ** myTag->SetPadding(true);
+ **
+ ** // write any changes to the file
+ ** myTag->Update()
+ **
+ ** // free the tag
+ ** delete myTag;
+ ** }
+ ** \endcode
+ **
+ ** @see ID3_IsTagHeader
+ ** @param fileInfo The filename of the file to link to.
+ **/
+size_t ID3_Tag::Link(const char *fileInfo, flags_t tag_types)
+{
+ __tags_to_parse.set(tag_types);
+
+ if (NULL == fileInfo)
+ {
+ return 0;
+ }
+
+ // if we were attached to some other file then abort
+ if (__file_handle != NULL)
+ {
+ // Log this
+ CloseFile();
+ //ID3_THROW(ID3E_TagAlreadyAttached);
+ }
+
+ strcpy(__file_name, fileInfo);
+
+ if (ID3E_NoError != OpenFileForReading())
+ {
+ __starting_bytes = 0;
+ }
+ else
+ {
+ __starting_bytes = ParseFromHandle();
+
+ CloseFile();
+ }
+
+ if (__starting_bytes > 0)
+ {
+ __starting_bytes += ID3_TagHeader::SIZE;
+ }
+
+ // the file size represents the file size _without_ the beginning ID3v2 tag
+ // info
+ __file_size -= MIN(__file_size, __starting_bytes);
+ return __starting_bytes;
+}
+
+/** Renders the tag and writes it to the attached file; the type of tag
+ ** rendered can be specified as a parameter. The default is to update only
+ ** the ID3v2 tag. See the ID3_TagType enumeration for the constants that
+ ** can be used.
+ **
+ ** Make sure the rendering parameters are set before calling the method.
+ ** See the Link dcoumentation for an example of this method in use.
+ **
+ ** \sa ID3_TagType
+ ** \sa Link
+ ** \param tt The type of tag to update.
+ **/
+flags_t ID3_Tag::Update(flags_t ulTagFlag)
+{
+ OpenFileForWriting();
+ if (NULL == __file_handle)
+ {
+ CreateFile();
+ }
+ flags_t tags = ID3TT_NONE;
+
+ if ((ulTagFlag & ID3TT_ID3V2) && HasChanged())
+ {
+ RenderV2ToHandle();
+ tags |= ID3TT_ID3V2;
+ }
+
+ if ((ulTagFlag & ID3TT_ID3V1) &&
+ (!this->HasTagType(ID3TT_ID3V1) || this->HasChanged()))
+ {
+ RenderV1ToHandle();
+ tags |= ID3TT_ID3V1;
+ }
+ CloseFile();
+ return tags;
+}
+
+/** Strips the tag(s) from the attached file. The type of tag stripped
+ ** can be specified as a parameter. The default is to strip all tag types.
+ **
+ ** \param tt The type of tag to strip
+ ** \sa ID3_TagType@see
+ **/
+flags_t ID3_Tag::Strip(flags_t ulTagFlag)
+{
+ flags_t ulTags = ID3TT_NONE;
+
+ if (!(ulTagFlag & ID3TT_ID3V1) && !(ulTagFlag & ID3TT_ID3V2))
+ {
+ return ulTags;
+ }
+
+ // First remove the v2 tag, if requested
+ if (ulTagFlag & ID3TT_ID3V2 && __starting_bytes > 0)
+ {
+ OpenFileForWriting();
+ __file_size -= __starting_bytes;
+
+ // We will remove the id3v2 tag in place: since it comes at the beginning
+ // of the file, we'll effectively move all the data that comes after the
+ // tag back n bytes, where n is the size of the id3v2 tag. Once we've
+ // copied the data, we'll truncate the file.
+ //
+ // To copy the data, we'll need to keep two "pointers" in the file: one
+ // will mark where to read from next, the other will indicate where to
+ // write to.
+ long nNextRead, nNextWrite;
+ nNextWrite = ftell(__file_handle);
+ // Set the read pointer past the tag
+ fseek(__file_handle, __starting_bytes, SEEK_CUR);
+ nNextRead = ftell(__file_handle);
+
+ uchar aucBuffer[BUFSIZ];
+
+ // The nBytesRemaining variable indicates how many bytes are to be copied
+ size_t nBytesToCopy = __file_size;
+
+ // Here we reduce the nBytesToCopy by the size of any tags that appear
+ // at the end of the file (e.g the id3v1 and lyrics tag). This isn't
+ // strictly necessary, since the truncation stage will remove these,
+ // but this check prevents us from copying them unnecessarily.
+ if ((__ending_bytes > 0) && (ulTagFlag & ID3TT_ID3V1))
+ {
+ nBytesToCopy -= __ending_bytes;
+ }
+
+ // The nBytesRemaining variable indicates how many bytes are left to be
+ // moved in the actual file.
+ // The nBytesCopied variable keeps track of how many actual bytes were
+ // copied (or moved) so far.
+ size_t
+ nBytesRemaining = nBytesToCopy,
+ nBytesCopied = 0;
+ while (! feof(__file_handle))
+ {
+ // Move to the next read position
+ fseek(__file_handle, nNextRead, SEEK_SET);
+ size_t
+ nBytesToRead = MIN(nBytesRemaining - nBytesCopied, BUFSIZ),
+ nBytesRead = fread(aucBuffer, 1, nBytesToRead, __file_handle);
+ // Now that we've read, mark the current spot as the next spot for
+ // reading
+ nNextRead = ftell(__file_handle);
+
+ if (nBytesRead > 0)
+ {
+ // Move to the next write position
+ fseek(__file_handle, nNextWrite, SEEK_SET);
+ size_t nBytesWritten = fwrite(aucBuffer, 1, nBytesRead, __file_handle);
+ if (nBytesRead > nBytesWritten)
+ {
+ // TODO: log this
+ //cerr << "--- attempted to write " << nBytesRead << " bytes, "
+ // << "only wrote " << nBytesWritten << endl;
+ }
+ // Marke the current spot as the next write position
+ nNextWrite = ftell(__file_handle);
+ nBytesCopied += nBytesWritten;
+ }
+
+ if (nBytesCopied == nBytesToCopy)
+ {
+ break;
+ }
+ if (nBytesToRead < BUFSIZ)
+ {
+ break;
+ }
+ }
+ CloseFile();
+ }
+
+ size_t nNewFileSize = __file_size;
+
+ if ((__ending_bytes > 0) && (ulTagFlag & ID3TT_ID3V1))
+ {
+ // if we're stripping the ID3v1 tag, be sure to reduce the file size by
+ // those bytes
+ nNewFileSize -= __ending_bytes;
+ ulTags |= ID3TT_ID3V1;
+ }
+
+ if ((ulTagFlag & ID3TT_ID3V2) && (__starting_bytes > 0))
+ {
+ // If we're stripping the ID3v2 tag, there's no need to adjust the new
+ // file size, since it doesn't account for the ID3v2 tag size
+ ulTags |= ID3TT_ID3V2;
+ }
+ else
+ {
+ // add the original ID3v2 tag size since we don't want to delete it, and
+ // the new file size represents the file size _not_ counting the ID3v2
+ // tag
+ nNewFileSize += __starting_bytes;
+ }
+
+ if (ulTags && (truncate(__file_name, nNewFileSize) == -1))
+ {
+ ID3_THROW(ID3E_NoFile);
+ }
+
+ __starting_bytes = (ulTags & ID3TT_ID3V2) ? 0 : __starting_bytes;
+ __ending_bytes -= (ulTags & ID3TT_ID3V1) ? MIN(__ending_bytes, ID3_V1_LEN) : 0;
+
+ __changed = __file_tags.remove(ulTags) || __changed;
+
+ return ulTags;
+}
--- /dev/null
+++ b/common/id3lib/src/tag_find.cpp
@@ -1,0 +1,306 @@
+// $Id: tag_find.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <string.h>
+#include "tag.h"
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+ /** Returns a pointer to the next ID3_Frame with the given ID3_FrameID;
+ ** returns NULL if no such frame found.
+ **
+ ** If there are multiple frames in the tag with the same ID (which, for some
+ ** frames, is allowed), then subsequent calls to <a href="#Find">Find</a>
+ ** will return subsequent frame pointers, wrapping if necessary.
+ **
+ ** \code
+ ** ID3_Frame *myFrame;
+ ** if (myFrame = myTag.Find(ID3FID_TITLE))
+ ** {
+ ** // do something with the frame, like copy
+ ** // the contents into a buffer, display the
+ ** // contents in a window, etc.
+ ** // ...
+ ** }
+ ** \endcode
+ **
+ ** You may optionally supply to more parameters ot this method, being an
+ ** ID3_FieldID and a value of some sort. Depending on the field name/ID you
+ ** supply, you may supply an integer, a char* or a unicode_t* as the third
+ ** parameter. If you supply an ID3_FrameID, you must also supply a data
+ ** value to compare against.
+ **
+ ** This method will then return the first frame that has a matching frame
+ ** ID, and which has a field with the same name as that which you supplied
+ ** in the second parameter, whose calue matches that which you supplied as
+ ** the third parameter. For example:
+ **
+ ** \code
+ ** ID3_Frame *myFrame;
+ ** if (myFrame = myTag.Find(ID3FID_TITLE, ID3FN_TEXT, "Nirvana"))
+ ** {
+ ** // found it, do something with it.
+ ** // ...
+ ** }
+ ** \endcode
+ **
+ ** This example will return the first TITLE frame and whose TEXT field is
+ ** 'Nirvana'. Currently there is no provision for things like 'contains',
+ ** 'greater than', or 'less than'. If there happens to be more than one of
+ ** these frames, subsequent calls to the <a href="#Find">Find</a> method
+ ** will return subsequent frames and will wrap around to the beginning.
+ **
+ ** Another example...
+ **
+ ** \code
+ ** ID3_Frame *myFrame;
+ ** if (myFrame = myTag.Find(ID3FID_COMMENT, ID3FN_TEXTENC, ID3TE_UNICODE))
+ ** {
+ ** // found it, do something with it.
+ ** // ...
+ ** }
+ ** \endcode
+ **
+ ** This returns the first COMMENT frame that uses Unicode as its text
+ ** encdoing.
+ **
+ ** @name Find
+ ** @param id The ID of the frame that is to be located
+ ** @return A pointer to the first frame found that has the given frame id,
+ ** or NULL if no such frame.
+ **/
+ID3_Elem *ID3_Tag::Find(const ID3_Frame *frame) const
+{
+ ID3_Elem *elem = NULL;
+
+ for (ID3_Elem *cur = __frames; NULL != cur; cur = cur->pNext)
+ {
+ if (cur->pFrame == frame)
+ {
+ elem = cur;
+ break;
+ }
+ }
+
+ return elem;
+}
+
+ID3_Frame *ID3_Tag::Find(ID3_FrameID id) const
+{
+ ID3_Frame *frame = NULL;
+
+ // reset the cursor if it isn't set
+ if (NULL == __cursor)
+ {
+ __cursor = __frames;
+ }
+
+ for (int iCount = 0; iCount < 2 && frame == NULL; iCount++)
+ {
+ // We want to cycle through the list to find the matching frame. We
+ // should start from the cursor, search each successive frame, wrapping
+ // if necessary. The enclosing loop and the assignment statments below
+ // ensure that we first start at the cursor and search to the end of the
+ // list and, if unsuccessful, start from the beginning of the list and
+ // search to the cursor.
+ ID3_Elem
+ *pStart = (0 == iCount ? __cursor : __frames),
+ *pFinish = (0 == iCount ? NULL : __cursor);
+ // search from the cursor to the end
+ for (ID3_Elem *cur = pStart; cur != pFinish; cur = cur->pNext)
+ {
+ if ((cur->pFrame != NULL) && (cur->pFrame->GetID() == id))
+ {
+ // We've found a valid frame. Set the cursor to be the next element
+ frame = cur->pFrame;
+ __cursor = cur->pNext;
+ break;
+ }
+ }
+ }
+
+ return frame;
+}
+
+ID3_Frame *ID3_Tag::Find(ID3_FrameID id, ID3_FieldID fld, const char *data) const
+{
+ ID3_Frame *frame = NULL;
+ unicode_t *temp;
+
+ temp = new unicode_t[strlen(data) + 1];
+ if (NULL == temp)
+ ID3_THROW(ID3E_NoMemory);
+
+ mbstoucs(temp, data, strlen(data) + 1);
+
+ frame = Find(id, fld, temp);
+
+ delete[] temp;
+
+ return frame;
+}
+
+ID3_Frame *ID3_Tag::Find(ID3_FrameID id, ID3_FieldID fld, const unicode_t *data) const
+{
+ ID3_Frame *frame = NULL;
+
+ // reset the cursor if it isn't set
+ if (NULL == __cursor)
+ __cursor = __frames;
+
+ for (int iCount = 0; iCount < 2 && frame == NULL; iCount++)
+ {
+ // We want to cycle through the list to find the matching frame. We
+ // should start from the cursor, search each successive frame, wrapping
+ // if necessary. The enclosing loop and the assignment statments below
+ // ensure that we first start at the cursor and search to the end of the
+ // list and, if unsuccessful, start from the beginning of the list and
+ // search to the cursor.
+ ID3_Elem
+ *pStart = (0 == iCount ? __cursor : __frames),
+ *pFinish = (0 == iCount ? NULL : __cursor);
+ // search from the cursor to the end
+ for (ID3_Elem *cur = pStart; cur != pFinish; cur = cur->pNext)
+ {
+ if ((cur->pFrame != NULL) && (cur->pFrame->GetID() == id) &&
+ (data != NULL) && ucslen(data) > 0 &&
+ cur->pFrame->Contains(fld))
+ {
+ size_t ulSize = cur->pFrame->Field(fld).BinSize();
+ unicode_t *wsBuffer = new unicode_t[ulSize];
+
+ if (NULL == wsBuffer)
+ ID3_THROW(ID3E_NoMemory);
+
+ cur->pFrame->Field(fld).Get(wsBuffer, ulSize);
+
+ bool bInFrame = (ucscmp(wsBuffer, data) == 0);
+
+ delete [] wsBuffer;
+
+ if (bInFrame)
+ {
+ // We've found a valid frame. Set cursor to be the next element
+ frame = cur->pFrame;
+ __cursor = cur->pNext;
+ break;
+ }
+ }
+ }
+ }
+
+ return frame;
+}
+
+ID3_Frame *ID3_Tag::Find(ID3_FrameID id, ID3_FieldID fld, uint32 data) const
+{
+ ID3_Frame *frame = NULL;
+
+ // reset the cursor if it isn't set
+ if (NULL == __cursor)
+ __cursor = __frames;
+
+ for (int iCount = 0; iCount < 2 && frame == NULL; iCount++)
+ {
+ // We want to cycle through the list to find the matching frame. We
+ // should start from the cursor, search each successive frame, wrapping
+ // if necessary. The enclosing loop and the assignment statments below
+ // ensure that we first start at the cursor and search to the end of the
+ // list and, if unsuccessful, start from the beginning of the list and
+ // search to the cursor.
+ ID3_Elem
+ *pStart = (0 == iCount ? __cursor : __frames),
+ *pFinish = (0 == iCount ? NULL : __cursor);
+ // search from the cursor to the end
+ for (ID3_Elem *cur = pStart; cur != pFinish; cur = cur->pNext)
+ {
+ if ((cur->pFrame != NULL) && (cur->pFrame->GetID() == id) &&
+ (cur->pFrame->Field(fld).Get() == data))
+ {
+ // We've found a valid frame. Set the cursor to be the next element
+ frame = cur->pFrame;
+ __cursor = cur->pNext;
+ break;
+ }
+ }
+ }
+
+ return frame;
+}
+
+ /** Returns a pointer to the frame with the given index; returns NULL if
+ ** there is no such frame at that index.
+ **
+ ** Optionally, <a href="#operator[]">operator[]</a> can be used as an
+ ** alternative to this method. Indexing is 0-based (that is, the first
+ ** frame is number 0, and the last frame in a tag that holds n frames is
+ ** n-1).
+ **
+ ** If you wish to have a more comlex searching facility, then at least for
+ ** now you will have to devise it yourself and implement it useing these
+ ** methods.
+ **
+ ** @param nIndex The index of the frame that is to be retrieved
+ ** @return A pointer to the requested frame, or NULL if no such frame.
+ **/
+ID3_Frame *ID3_Tag::GetFrameNum(index_t num) const
+{
+ const size_t num_frames = this->NumFrames();
+ if (num >= num_frames)
+ {
+ return NULL;
+ }
+
+ ID3_Frame *frame = NULL;
+ index_t curNum = num_frames;
+ for (ID3_Elem *cur = __frames; cur != NULL; cur = cur->pNext)
+ {
+ // compare and advance counter
+ if (num == --curNum)
+ {
+ frame = cur->pFrame;
+ break;
+ }
+ }
+
+ return frame;
+}
+
+/** Returns a pointer to the frame with the given index; returns NULL if
+ ** there is no such frame at that index.
+ **
+ ** @name operator[]
+ ** @param nIndex The index of the frame that is to be retrieved
+ ** @return A pointer to the requested frame, or NULL if no such frame.
+ ** @see #GetFrameNum
+ **/
+ID3_Frame *ID3_Tag::operator[](index_t num) const
+{
+ return GetFrameNum(num);
+}
--- /dev/null
+++ b/common/id3lib/src/tag_parse.cpp
@@ -1,0 +1,234 @@
+// $Id: tag_parse.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+#include <zlib.h>
+#include "tag.h"
+#include "uint28.h"
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+size_t ID3_ParseFrames(ID3_Tag& tag, const uchar* const data, size_t size)
+{
+ const uchar* const data_end = data + size;
+ size_t total_size = 0;
+ size_t frame_size = 0;
+ for (const uchar* p = data; p < data_end && *p != '\0'; p += frame_size)
+ {
+ ID3_Frame* f = new ID3_Frame;
+ f->SetSpec(tag.GetSpec());
+ frame_size = f->Parse(p, data_end - p);
+ total_size += frame_size;
+
+ if (f->BadParse())
+ {
+ // bad parse! we can't attach this frame. should probably log this
+ // TODO: log this
+ delete f;
+ }
+ else if (!frame_size)
+ {
+ // There is a problem.
+ // If the frame size is 0, then we can't progress.
+ // TODO: log this
+ delete f;
+ // Break for now.
+ break;
+ }
+ else if (f->GetID() != ID3FID_METACOMPRESSION)
+ {
+ // a good, uncompressed frame. attach away!
+ tag.AttachFrame(f);
+ }
+ else
+ {
+ // hmm. an ID3v2.2.1 compressed frame. It contains 1 or more compressed
+ // frames. Uncompress and call ParseFrames recursively.
+ const uchar* const bin = f->Field(ID3FN_DATA).GetBinary();
+ if (*bin != 'z')
+ {
+ // unknown compression method
+ // TODO: log this
+ }
+ else
+ {
+ uint32 new_size = ParseNumber(&bin[1]);
+
+ uchar* uncompressed = new uchar[new_size];
+
+ uncompress(uncompressed, (luint *) &new_size,
+ &bin[1 + sizeof(uint32)],
+ f->GetDataSize() - sizeof(uint32) - 1);
+
+ if (ID3_ParseFrames(tag, uncompressed, new_size) != new_size)
+ {
+ // hmm. it didn't parse the entire uncompressed data. wonder why.
+ // TODO: log this.
+ }
+
+ delete [] uncompressed;
+ }
+ }
+ }
+
+ return total_size;
+}
+
+/** Turns a binary tag into a series of ID3_Frame objects attached to the
+ ** tag.
+ **
+ ** \code
+ ** ID3_Tag myTag;
+ ** uchar header[ID3_TAGHEADERSIZE];
+ ** uchar *buffer;
+ ** luint tagSize;
+ **
+ ** // get ID3_TAGHEADERSIZE from a socket or somewhere
+ ** // ...
+ **
+ ** if ((tagSize = ID3_IsTagHeader(ourSourceBuffer)) > -1)
+ ** {
+ ** // read a further 'tagSize' bytes in
+ ** // from our data source
+ ** // ...
+ **
+ ** if (buffer = new uchar[tagSize])
+ ** {
+ ** // now we will call ID3_Tag::Parse()
+ ** // with these values (explained later)
+ ** myTag.Parse(header, buffer);
+ **
+ ** // do something with the objects,
+ ** // like look for titles, artists, etc.
+ ** // ...
+ **
+ ** // free the buffer
+ ** delete [] buffer;
+ ** }
+ ** }
+ ** \endcode
+ **
+ ** @see ID3_Frame
+ ** @param header The byte header read in from the data source.
+ ** @param buffer The remainder of the tag (not including the data source)
+ ** read in from the data source.
+ **/
+size_t ID3_Tag::Parse(const uchar header[ID3_TagHeader::SIZE],
+ const uchar *buffer)
+{
+ size_t hdr_size = __hdr.Parse(header, ID3_TagHeader::SIZE);
+ if (!hdr_size)
+ {
+ return 0;
+ }
+
+ size_t data_size = __hdr.GetDataSize();
+ uchar* unsynced_data = NULL;
+ if (__hdr.GetUnsync())
+ {
+ unsynced_data = new uchar[data_size];
+ memcpy(unsynced_data, buffer, data_size);
+ data_size = ID3_ReSync(unsynced_data, data_size);
+ buffer = unsynced_data;
+ }
+
+ ID3_ParseFrames(*this, buffer, data_size);
+
+ // set the flag which says that the tag hasn't changed
+ __changed = false;
+
+ delete [] unsynced_data;
+
+ return hdr_size + data_size;
+}
+
+
+size_t ID3_Tag::ParseFromHandle()
+{
+ size_t size = 0;
+
+ if (NULL == __file_handle)
+ {
+ ID3_THROW(ID3E_NoData);
+ }
+
+ if (__tags_to_parse.test(ID3TT_ID3V2))
+ {
+ if (fseek(__file_handle, 0, SEEK_SET) != 0)
+ {
+ return 0;
+ //ID3_THROW_DESC(ID3E_NoFile,
+ //"ID3_Tag::ParseFromHandle: Ack! Couldn't seek");
+ }
+
+ uchar header[ID3_TAGHEADERSIZE];
+ if (fread(header, 1, sizeof(header), __file_handle) == 0)
+ {
+ return 0;
+ //ID3_THROW_DESC(ID3E_NoFile,
+ // "ID3_Tag::ParseFromHandle: Ack! Couldn't read");
+ }
+
+ lsint tagSize = ID3_IsTagHeader(header);
+ if (tagSize > 0)
+ {
+ uchar* bin = new uchar[tagSize];
+ if (NULL == bin)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ if (fread(bin, 1, tagSize, __file_handle) == 0)
+ {
+ return 0;
+ //ID3_THROW_DESC(ID3E_NoFile,
+ // "ID3_Tag::ParseFromHandle: Ack! Couldn't read");
+ }
+
+ this->Parse(header, bin);
+ size = tagSize;
+
+ delete[] bin;
+ }
+ }
+
+ if (__tags_to_parse.test(ID3TT_LYRICS))
+ {
+ ParseLyrics3();
+ }
+
+ if (__tags_to_parse.test(ID3TT_ID3V1))
+ {
+ ParseID3v1();
+ }
+
+ return size;
+}
--- /dev/null
+++ b/common/id3lib/src/tag_parse_lyrics3.cpp
@@ -1,0 +1,512 @@
+// $Id: tag_parse_lyrics3.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+#include "tag.h"
+#include "utils.h"
+#include "misc_support.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+luint ID3_CRLFtoLF(char *buffer, luint size)
+{
+ luint newSize = 0;
+ char *dest = buffer;
+ char *source = buffer;
+
+ if (NULL == buffer || size == 0)
+ {
+ // TODO: log this
+ return 0;
+ // ID3_THROW(ID3E_NoData);
+ }
+
+ while (source < (buffer + size))
+ {
+ if (*source == 0x0D)
+ {
+ source++;
+ }
+ else
+ {
+ *dest++ = *source++;
+ }
+ }
+
+ newSize = dest - buffer;
+
+ return newSize;
+}
+
+
+luint ID3_StripTimeStamps(char *buffer, luint size)
+{
+ luint newSize = 0;
+ char *dest = buffer;
+ char *source = buffer;
+
+ if ((buffer == NULL) || (size == 0))
+ {
+ // TODO: log this
+ return 0;
+ // ID3_THROW(ID3E_NoData);
+ }
+
+ while (source < (buffer + size))
+ {
+ if (*source == '[')
+ {
+ source += 7;
+ }
+ else
+ {
+ *dest++ = *source++;
+ }
+ }
+
+ newSize = dest - buffer;
+
+ return newSize;
+}
+
+luint ID3_RenderTimeStamp(uchar* buffer, luint ms, bool lf)
+{
+ uchar* dest = buffer;
+
+ // put synch identifier
+ *dest++ = '\0';
+
+ // put timestamp
+ dest += RenderNumber(dest, ms, sizeof(uint32));
+ if (lf)
+ {
+ // put the LF
+ *dest++ = 0x0A;
+ }
+
+ return dest - buffer;
+}
+
+luint ID3_Lyrics3ToSylt(uchar *buffer, luint size)
+{
+ if ((buffer == NULL) || (size == 0))
+ {
+ // TODO: log this
+ return 0;
+ //ID3_THROW(ID3E_NoData);
+ }
+
+ uchar *dest = buffer;
+ uchar *source = buffer;
+ luint ms;
+ bool lf = false, first = true;
+
+ while (source < (buffer + size))
+ {
+ if (0x0A == *source)
+ {
+ lf = true;
+ source++;
+ }
+ else if ('[' != *source)
+ {
+ *dest++ = *source++;
+ }
+ else
+ {
+ // check if first timestamp
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ dest += ID3_RenderTimeStamp(dest, ms, lf);
+ }
+
+ // timestamp found skip [
+ source++;
+
+ // get minutes and ms
+ size_t minutes = strtol((char*)source, NULL, 10);
+
+ // skip :
+ source += 3;
+
+ size_t seconds = strtol((char*)source, NULL, 10);
+
+ // skip ]
+ source += 3;
+
+ // get seconds and ms
+ ms = ((60 * minutes) + seconds) * 1000;
+ }
+ }
+
+ dest += ID3_RenderTimeStamp(dest, ms, lf);
+
+ return dest - buffer;
+}
+
+void ID3_Tag::ParseLyrics3()
+{
+ if (NULL == __file_handle)
+ {
+ // TODO: log this
+ return;
+ // ID3_THROW(ID3E_NoData);
+ }
+
+ uchar buffer[18];
+
+ fseek(__file_handle, -143, SEEK_END);
+ fread(buffer, 1, 18, __file_handle);
+
+ // first check for an ID3v1 tag
+ if (memcmp(&buffer[15], "TAG", 3) == 0)
+ {
+ // check for lyrics
+ if (memcmp(&buffer[6], "LYRICSEND", 9) == 0)
+ {
+ // we have a Lyrics3 v1.00 tag
+
+ // get the position of LYRICSEND string in file
+ int filelen = __file_size;
+ int lyrendpos = filelen - 137;
+
+ // read the maximum Lyrics3 v1.00 tag size (5100 bytes) + some extra byte
+ int bytesToRead = 5100 + 100;
+ fseek(__file_handle, -(bytesToRead+143), SEEK_END);
+ uchar *bufflyr;
+ bufflyr = new uchar[bytesToRead];
+ if (NULL == bufflyr)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+ fread(bufflyr, 1, bytesToRead, __file_handle);
+
+ // search for LYRICSBEGIN
+ bool bFoundBegin = false;
+ int pos = 0;
+ for (; pos < bytesToRead; pos++)
+ {
+ if (bufflyr[pos] == 'L')
+ {
+ // found ?
+ if (memcmp(&bufflyr[pos], "LYRICSBEGIN", 11) == 0)
+ {
+ // yes
+ bFoundBegin = true;
+ break;
+ }
+ // still not found
+ }
+ }
+
+ if (!bFoundBegin)
+ {
+ // invalid tag
+ delete[] bufflyr;
+ return;
+ }
+
+ delete[] bufflyr;
+
+ // extract lyrics text
+ pos += 11;
+ int lyrbeginpos = filelen - ((bytesToRead+143) - pos);
+ int lyrsize = lyrendpos - lyrbeginpos;
+
+ fseek(__file_handle, lyrbeginpos, SEEK_SET);
+ bufflyr = new uchar[lyrsize];
+ if (NULL == bufflyr)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+ fread(bufflyr, 1, lyrsize, __file_handle);
+
+ char *text;
+ luint newSize;
+
+ newSize = ID3_CRLFtoLF((char *) bufflyr, lyrsize);
+
+ text = new char[newSize + 1];
+ if (NULL == text)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ text[newSize] = 0;
+
+ memcpy(text, bufflyr, newSize);
+ delete[] bufflyr;
+
+ ID3_Frame *pLyrFrame = ID3_AddLyrics(this, text);
+ if (NULL != pLyrFrame)
+ {
+ pLyrFrame->Field(ID3FN_LANGUAGE) = "eng";
+ pLyrFrame->Field(ID3FN_DESCRIPTION) = "Converted from Lyrics3 v1.00";
+ }
+
+ delete[] text;
+ }
+
+ else if (memcmp(&buffer[6], "LYRICS200", 9) == 0)
+ {
+ // we have a Lyrics3 v2.00 tag
+ luint lyricsSize;
+
+ ID3_Frame *pLyrFrame = NULL;
+ char *textInf = NULL;
+
+ buffer[6] = 0;
+ lyricsSize = atoi((char *) buffer);
+
+ fseek(__file_handle, -18 - lyricsSize, SEEK_CUR);
+ fread(buffer, 1, 11, __file_handle);
+
+ if (memcmp(buffer, "LYRICSBEGIN", 11) == 0)
+ {
+ luint bytesToRead = lyricsSize - 11;
+ uchar *buff2;
+
+ __ending_bytes += lyricsSize + 9 + 6;
+
+ buff2 = new uchar[bytesToRead];
+ if (NULL == buff2)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ luint posn = 0;
+ bool stampsUsed = false;
+
+ fread(buff2, 1, bytesToRead, __file_handle);
+
+ while (posn < bytesToRead)
+ {
+ uchar fid[4];
+ uchar sizeT[6];
+ luint size;
+
+ fid[3] = 0;
+ sizeT[5] = 0;
+
+ memcpy(fid, &buff2[posn], 3);
+ memcpy(sizeT, &buff2[posn + 3], 5);
+ size = atoi((char *) sizeT);
+
+ // the IND field
+ if (strcmp((char *) fid, "IND") == 0)
+ {
+ if (buff2[posn + 8 + 1] == '1')
+ {
+ stampsUsed = true;
+ }
+ }
+
+ // the TITLE field
+ if (strcmp((char *) fid, "ETT") == 0)
+ {
+ char *text;
+
+ text = new char[size + 1];
+ if (NULL == text)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ text[size] = '\0';
+ memcpy(text, &buff2[posn + 8], size);
+
+ ID3_AddTitle(this, text);
+
+ delete[] text;
+ }
+
+ // the ARTIST field
+ if (strcmp((char *) fid, "EAR") == 0)
+ {
+ char *text;
+
+ text = new char[size + 1];
+ if (NULL == text)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ text[size] = 0;
+ memcpy(text, &buff2[posn + 8], size);
+
+ ID3_AddArtist(this, text);
+
+ delete[] text;
+ }
+
+ // the ALBUM field
+ if (strcmp((char *) fid, "EAL") == 0)
+ {
+ char *text;
+
+ text = new char[size + 1];
+ if (NULL == text)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ text[size] = 0;
+ memcpy(text, &buff2[posn + 8], size);
+
+ ID3_AddAlbum(this, text);
+
+ delete[] text;
+ }
+
+ // the Lyrics/Music AUTHOR field
+ if (strcmp((char *) fid, "AUT") == 0)
+ {
+ char *text;
+
+ text = new char[size + 1];
+ if (NULL == text)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ text[size] = 0;
+ memcpy(text, &buff2[posn + 8], size);
+
+ ID3_AddLyricist(this, text);
+
+ delete[] text;
+ }
+
+ // the INFORMATION field
+ if (strcmp((char *) fid, "INF") == 0)
+ {
+ luint newSize;
+
+ newSize = ID3_CRLFtoLF((char *) & buff2[posn + 8], size);
+
+ textInf = new char[newSize + 1];
+ if (NULL == textInf)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ textInf[newSize] = 0;
+
+ memcpy(textInf, &buff2[posn + 8], newSize);
+
+ // if already found the lyrics text use this field as description
+ if (NULL != pLyrFrame)
+ pLyrFrame->Field(ID3FN_DESCRIPTION) = textInf;
+ }
+
+ // the LYRICS field
+ if (strcmp((char *) fid, "LYR") == 0)
+ {
+ uchar *text;
+ luint newSize;
+
+ newSize = ID3_CRLFtoLF((char *) & buff2[posn + 8], size);
+
+ if (!stampsUsed)
+ {
+ text = new uchar[newSize + 1];
+ if (NULL == text)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ text[newSize] = 0;
+
+ memcpy(text, &buff2[posn + 8], newSize);
+
+ pLyrFrame = ID3_AddLyrics(this, (const char*) text);
+ if (pLyrFrame)
+ {
+ pLyrFrame->Field(ID3FN_LANGUAGE) = "eng";
+
+ // if already found an INF field, use it as description
+ if (NULL != textInf)
+ {
+ pLyrFrame->Field(ID3FN_DESCRIPTION) = textInf;
+ }
+ else
+ {
+ pLyrFrame->Field(ID3FN_DESCRIPTION) =
+ "Converted from Lyrics3 v2.00";
+ }
+ }
+
+ delete[] text;
+ }
+
+ // convert lyrics into a SYLT frame Content Descriptor
+ newSize = ID3_Lyrics3ToSylt (& buff2[posn + 8], newSize);
+
+ text = new uchar[newSize + 1];
+ if (NULL == text)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ text[newSize] = 0;
+
+ memcpy(text, &buff2[posn + 8], newSize);
+
+ // if already found an INF field, use it as description
+ const char* description =
+ (textInf ? textInf : "Converted from Lyrics3 v2.00");
+ pLyrFrame =
+ ID3_AddSyncLyrics(this, "eng", description, text, newSize);
+ if (pLyrFrame)
+ {
+ pLyrFrame->Field(ID3FN_TIMESTAMPFORMAT) = ID3TSF_MS;
+ pLyrFrame->Field(ID3FN_CONTENTTYPE) = ID3CT_LYRICS;
+ }
+
+ delete[] text;
+ }
+
+ posn += size + 8;
+ }
+
+ delete [] buff2;
+ if (NULL != textInf)
+ {
+ delete[] textInf;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+++ b/common/id3lib/src/tag_parse_v1.cpp
@@ -1,0 +1,153 @@
+// $Id: tag_parse_v1.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include <stdio.h>
+#include <string.h>
+#include <memory.h>
+#include "tag.h"
+#include "misc_support.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+void ID3_RemoveTrailingSpaces(char *buffer, luint length)
+{
+ for (lsint i = length - 1; i > -1 && 0x20 == buffer[i]; i--)
+ {
+ buffer[i] = '\0';
+ }
+
+ return ;
+}
+
+
+void ID3_Tag::ParseID3v1(void)
+{
+ if (NULL == __file_handle)
+ {
+ ID3_THROW(ID3E_NoData);
+ }
+
+ ID3V1_Tag tagID3v1;
+
+ // posn ourselves at 128 bytes from the end of the file
+ if (fseek(__file_handle, 0-ID3_V1_LEN, SEEK_END) != 0)
+ {
+ return;
+ // TODO: This is a bad error message. Make it more descriptive
+ //ID3_THROW(ID3E_NoData);
+ }
+
+
+ // read the next 128 bytes in;
+ if (fread(tagID3v1.sID, 1, ID3_V1_LEN_ID, __file_handle) != ID3_V1_LEN_ID)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+
+ // check to see if it was a tag
+ if (memcmp(tagID3v1.sID, "TAG", ID3_V1_LEN_ID) == 0)
+ {
+ // guess so, let's start checking the v2 tag for frames which are the
+ // equivalent of the v1 fields. When we come across a v1 field that has
+ // no current equivalent v2 frame, we create the frame, copy the data
+ // from the v1 frame and attach it to the tag
+
+ __file_tags.add(ID3TT_ID3V1);
+ __ending_bytes += ID3_V1_LEN;
+
+ // the TITLE field/frame
+ if (fread(tagID3v1.sTitle, 1, ID3_V1_LEN_TITLE, __file_handle) != ID3_V1_LEN_TITLE)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+ tagID3v1.sTitle[ID3_V1_LEN_TITLE] = '\0';
+ ID3_RemoveTrailingSpaces(tagID3v1.sTitle, ID3_V1_LEN_TITLE);
+ ID3_AddTitle(this, tagID3v1.sTitle);
+
+ // the ARTIST field/frame
+ if (fread(tagID3v1.sArtist, 1, ID3_V1_LEN_ARTIST, __file_handle) !=
+ ID3_V1_LEN_ARTIST)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+ tagID3v1.sArtist[ID3_V1_LEN_ARTIST] = '\0';
+ ID3_RemoveTrailingSpaces(tagID3v1.sArtist, ID3_V1_LEN_ARTIST);
+ ID3_AddArtist(this, tagID3v1.sArtist);
+
+ // the ALBUM field/frame
+ if (fread(tagID3v1.sAlbum, 1, ID3_V1_LEN_ALBUM, __file_handle) != ID3_V1_LEN_ALBUM)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+ tagID3v1.sAlbum[ID3_V1_LEN_ALBUM] = '\0';
+ ID3_RemoveTrailingSpaces(tagID3v1.sAlbum, ID3_V1_LEN_ALBUM);
+ ID3_AddAlbum(this, tagID3v1.sAlbum);
+
+ // the YEAR field/frame
+ if (fread(tagID3v1.sYear, 1, ID3_V1_LEN_YEAR, __file_handle) != ID3_V1_LEN_YEAR)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+ tagID3v1.sYear[ID3_V1_LEN_YEAR] = '\0';
+ ID3_RemoveTrailingSpaces(tagID3v1.sYear, ID3_V1_LEN_YEAR);
+ ID3_AddYear(this, tagID3v1.sYear);
+
+ // the COMMENT field/frame
+ if (fread(tagID3v1.sComment, 1, ID3_V1_LEN_COMMENT, __file_handle) !=
+ ID3_V1_LEN_COMMENT)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+ tagID3v1.sComment[ID3_V1_LEN_COMMENT] = '\0';
+ if ('\0' != tagID3v1.sComment[ID3_V1_LEN_COMMENT - 2] ||
+ '\0' == tagID3v1.sComment[ID3_V1_LEN_COMMENT - 1])
+ {
+ ID3_RemoveTrailingSpaces(tagID3v1.sComment, ID3_V1_LEN_COMMENT);
+ }
+ else
+ {
+ // This is an id3v1.1 tag. The last byte of the comment is the track
+ // number.
+ ID3_RemoveTrailingSpaces(tagID3v1.sComment, ID3_V1_LEN_COMMENT - 1);
+ ID3_AddTrack(this, tagID3v1.sComment[ID3_V1_LEN_COMMENT - 1]);
+ }
+ ID3_AddComment(this, tagID3v1.sComment, STR_V1_COMMENT_DESC);
+
+ // the GENRE field/frame
+ fread(&tagID3v1.ucGenre, 1, ID3_V1_LEN_GENRE, __file_handle);
+ ID3_AddGenre(this, tagID3v1.ucGenre);
+ }
+
+ return ;
+}
--- /dev/null
+++ b/common/id3lib/src/tag_render.cpp
@@ -1,0 +1,547 @@
+// $Id: tag_render.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <fstream.h>
+#include <memory.h>
+#include "tag.h"
+#include "misc_support.h"
+#include "utils.h"
+
+#ifdef MAXPATHLEN
+# define ID3_PATH_LENGTH (MAXPATHLEN + 1)
+#elif defined (PATH_MAX)
+# define ID3_PATH_LENGTH (PATH_MAX + 1)
+#else /* !MAXPATHLEN */
+# define ID3_PATH_LENGTH (2048 + 1)
+#endif /* !MAXPATHLEN && !PATH_MAX */
+
+size_t RenderFrames(uchar* buffer, const ID3_Elem* cur)
+{
+ size_t size = 0;
+ if (cur)
+ {
+ size = RenderFrames(buffer, cur->pNext);
+ size += cur->pFrame->Render(&buffer[size]);
+ }
+ return size;
+}
+
+/** Renders a binary image of the tag into the supplied buffer.
+ **
+ ** See <a href="#Size">Size</a> for an example. This method returns the
+ ** actual number of the bytes of the buffer used to store the tag. This
+ ** will be no more than the size of the buffer itself, because
+ ** <a href="#Size">Size</a> over estimates the required buffer size when
+ ** padding is enabled.
+ **
+ ** Before calling this method, it is advisable to call <a
+ ** href="#HasChanged">HasChanged</a> first as this will let you know
+ ** whether you should bother rendering the tag.
+ **
+ ** @see ID3_IsTagHeader
+ ** @see ID3_Tag#HasChanged
+ ** @return The actual number of the bytes of the buffer used to store the
+ ** tag
+ ** @param buffer The buffer that will contain the rendered tag.
+ **/
+size_t ID3_Tag::Render(uchar *buffer) const
+{
+ // There has to be at least one frame for there to be a tag...
+ if (this->NumFrames() == 0)
+ {
+ return 0;
+ }
+
+ if (NULL == buffer)
+ {
+ // log this
+ return 0;
+ //ID3_THROW(ID3E_NoBuffer);
+ }
+
+ ID3_TagHeader hdr;
+ hdr.SetSpec(ID3V2_LATEST);
+ size_t hdr_size = hdr.Size();
+ size_t bytesUsed = hdr_size;
+
+ // set up the encryption and grouping IDs
+
+ // ...
+ size_t frame_bytes = RenderFrames(&buffer[bytesUsed], __frames);
+ if (frame_bytes == 0)
+ {
+ return 0;
+ }
+
+ bytesUsed += frame_bytes;
+
+ if (this->GetUnsync())
+ {
+ size_t newTagSize = ID3_GetUnSyncSize(&buffer[hdr_size],
+ bytesUsed - hdr_size);
+ if (newTagSize > 0 && (newTagSize + hdr_size) > bytesUsed)
+ {
+ uchar* tempz = new uchar[newTagSize];
+ if (NULL == tempz)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ ID3_UnSync(tempz, newTagSize, &buffer[hdr_size],
+ bytesUsed - hdr_size);
+ hdr.SetUnsync(true);
+
+ memcpy(&buffer[hdr_size], tempz, newTagSize);
+ bytesUsed = newTagSize + hdr_size;
+ delete[] tempz;
+ }
+ }
+
+ // zero the remainder of the buffer so that our padding bytes are zero
+ luint nPadding = PaddingSize(bytesUsed);
+
+ memset(&buffer[bytesUsed], '\0', nPadding);
+ bytesUsed += nPadding;
+
+ hdr.SetDataSize(bytesUsed - hdr_size);
+ hdr.Render(buffer);
+
+ // set the flag which says that the tag hasn't changed
+ __changed = false;
+
+ return bytesUsed;
+}
+
+ /** Returns an over estimate of the number of bytes required to store a
+ ** binary version of a tag.
+ **
+ ** When using <a href="#Render">Render</a> to render a binary tag to a
+ ** memory buffer, first use the result of this call to allocate a buffer of
+ ** unsigned chars.
+ **
+ ** \code
+ ** luint tagSize;
+ ** uchar *buffer;
+ ** if (myTag.HasChanged())
+ ** {
+ ** if ((tagSize= myTag.Size()) > 0)
+ ** {
+ ** if (buffer = new uchar[tagSize])
+ ** {
+ ** luint actualSize = myTag.Render(buffer);
+ ** // do something useful with the first
+ ** // 'actualSize' bytes of the buffer,
+ ** // like push it down a socket
+ ** delete [] buffer;
+ ** }
+ ** }
+ ** }
+ ** \endcode
+ **
+ ** @see #Render
+ ** @return The (overestimated) number of bytes required to store a binary
+ ** version of a tag
+ **/
+size_t ID3_Tag::Size() const
+{
+ if (!this->NumFrames())
+ {
+ return 0;
+ }
+ ID3_Elem *cur = __frames;
+ ID3_TagHeader hdr;
+
+ hdr.SetSpec(this->GetSpec());
+ size_t bytesUsed = hdr.Size();
+
+ size_t frame_bytes = 0;
+ while (cur)
+ {
+ if (cur->pFrame)
+ {
+ cur->pFrame->SetSpec(this->GetSpec());
+ frame_bytes += cur->pFrame->Size();
+ }
+
+ cur = cur->pNext;
+ }
+
+ if (!frame_bytes)
+ {
+ return 0;
+ }
+
+ bytesUsed += frame_bytes;
+ // add 30% for sync
+ if (this->GetUnsync())
+ {
+ bytesUsed += bytesUsed / 3;
+ }
+
+ bytesUsed += PaddingSize(bytesUsed);
+ return bytesUsed;
+}
+
+
+void ID3_Tag::RenderExtHeader(uchar *buffer)
+{
+ if (this->GetSpec() == ID3V2_3_0)
+ {
+ }
+
+ return ;
+}
+
+
+ /** Renders an id3v1.1 version of the tag into the supplied buffer.
+ **
+ ** @return The actual number of the bytes of the buffer used to store the
+ ** tag (should always be 128)
+ ** @param buffer The buffer that will contain the id3v1.1 tag.
+ **/
+size_t ID3_Tag::RenderV1(uchar *buffer) const
+{
+ // Sanity check our buffer
+ if (NULL == buffer)
+ {
+ ID3_THROW(ID3E_NoBuffer);
+ }
+
+ // pCur is used to mark where to next write in the buffer
+ // sTemp is used as a temporary string pointer for functions that return
+ // dynamically created strings
+ char* pCur = (char *) buffer;
+ char* sTemp = NULL;
+
+ // The default char for a v1 tag is null
+ memset(buffer, '\0', ID3_V1_LEN);
+
+ // Write the TAG identifier
+ strncpy(pCur, "TAG", ID3_V1_LEN_ID);
+ pCur = &pCur[ID3_V1_LEN_ID];
+
+ // Write the TITLE
+ sTemp = ID3_GetTitle(this);
+ if (sTemp != NULL)
+ {
+ strncpy(pCur, sTemp, ID3_V1_LEN_TITLE);
+ delete [] sTemp;
+ }
+ pCur = &pCur[ID3_V1_LEN_TITLE];
+
+ // Write the ARTIST
+ sTemp = ID3_GetArtist(this);
+ if (sTemp != NULL)
+ {
+ strncpy(pCur, sTemp, ID3_V1_LEN_ARTIST);
+ delete [] sTemp;
+ }
+ pCur = &pCur[ID3_V1_LEN_ARTIST];
+
+ // Write the ALBUM
+ sTemp = ID3_GetAlbum(this);
+ if (sTemp != NULL)
+ {
+ strncpy(pCur, sTemp, ID3_V1_LEN_ALBUM);
+ delete [] sTemp;
+ }
+ pCur = &pCur[ID3_V1_LEN_ALBUM];
+
+ // Write the YEAR
+ sTemp = ID3_GetYear(this);
+ if (sTemp != NULL)
+ {
+ strncpy(pCur, sTemp, ID3_V1_LEN_YEAR);
+ delete [] sTemp;
+ }
+ pCur = &pCur[ID3_V1_LEN_YEAR];
+
+ // Write the COMMENT
+ sTemp = ID3_GetComment(this);
+ if (sTemp != NULL)
+ {
+ strncpy(pCur, sTemp, ID3_V1_LEN_COMMENT);
+ delete [] sTemp;
+ }
+ pCur = &pCur[ID3_V1_LEN_COMMENT];
+
+ // Write the TRACK, if it isn't 0
+ luint nTrack = ID3_GetTrackNum(this);
+ if (0 != nTrack)
+ {
+ pCur -= 2;
+ pCur[0] = '\0';
+ pCur[1] = (uchar) nTrack;
+ pCur += 2;
+ }
+
+ // Write the GENRE
+ pCur[0] = (uchar) ID3_GetGenreNum(this);
+
+ return ID3_V1_LEN;
+}
+
+void ID3_Tag::RenderV1ToHandle()
+{
+ uchar sTag[ID3_V1_LEN];
+ char sID[ID3_V1_LEN_ID];
+
+ RenderV1(sTag);
+
+ if (__file_handle == NULL)
+ {
+ // log this
+ ID3_THROW(ID3E_NoData);
+ // cerr << "*** Ack! __file_handle is null!" << endl;
+ }
+
+ if (ID3_V1_LEN > __file_size)
+ {
+ if (fseek(__file_handle, 0, SEEK_END) != 0)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+ }
+ else
+ {
+ // We want to check if there is already an id3v1 tag, so we can write over
+ // it. First, seek to the beginning of any possible id3v1 tag
+ if (fseek(__file_handle, 0-ID3_V1_LEN, SEEK_END) != 0)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+
+ // Read in the TAG characters
+ if (fread(sID, 1, ID3_V1_LEN_ID, __file_handle) != ID3_V1_LEN_ID)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+
+ // If those three characters are TAG, then there's a preexisting id3v1 tag,
+ // so we should set the file cursor so we can overwrite it with a new tag.
+ if (memcmp(sID, "TAG", ID3_V1_LEN_ID) == 0)
+ {
+ if (fseek(__file_handle, 0-ID3_V1_LEN, SEEK_END) != 0)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+ }
+ // Otherwise, set the cursor to the end of the file so we can append on
+ // the new tag.
+ else
+ {
+ if (fseek(__file_handle, 0, SEEK_END) != 0)
+ {
+ // TODO: This is a bad error message. Make it more descriptive
+ ID3_THROW(ID3E_NoData);
+ }
+ }
+ }
+
+ fwrite(sTag, sizeof(uchar), ID3_V1_LEN, __file_handle);
+ __file_tags.add(ID3TT_ID3V1);
+}
+
+void ID3_Tag::RenderV2ToHandle()
+{
+ uchar *buffer;
+
+ if (NULL == __file_handle)
+ {
+ ID3_THROW(ID3E_NoData);
+ }
+
+ size_t size = this->Size();
+ if (!size)
+ {
+ return;
+ }
+
+ buffer = new uchar[size];
+ if (NULL == buffer)
+ {
+ ID3_THROW(ID3E_NoMemory);
+ }
+
+ size = this->Render(buffer);
+ if (0 == size)
+ {
+ delete [] buffer;
+ return;
+ }
+
+ // if the new tag fits perfectly within the old and the old one
+ // actually existed (ie this isn't the first tag this file has had)
+ if ((0 == __starting_bytes && 0 == __file_size) ||
+ (size == __starting_bytes))
+ {
+ fseek(__file_handle, 0, SEEK_SET);
+ fwrite(buffer, 1, size, __file_handle);
+ __starting_bytes = size;
+ }
+ else
+ {
+#if !defined HAVE_MKSTEMP
+ // This section is for Windows folk
+
+ FILE *tempOut = tmpfile();
+ if (NULL == tempOut)
+ {
+ ID3_THROW(ID3E_ReadOnly);
+ }
+
+ fwrite(buffer, 1, size, tempOut);
+
+ fseek(__file_handle, __starting_bytes, SEEK_SET);
+
+ uchar buffer2[BUFSIZ];
+ while (! feof(__file_handle))
+ {
+ size_t nBytes = fread(buffer2, 1, BUFSIZ, __file_handle);
+ fwrite(buffer2, 1, nBytes, tempOut);
+ }
+
+ rewind(tempOut);
+ freopen(__file_name, "wb+", __file_handle);
+
+ while (!feof(tempOut))
+ {
+ size_t nBytes = fread(buffer2, 1, BUFSIZ, tempOut);
+ fwrite(buffer2, 1, nBytes, __file_handle);
+ }
+
+ fclose(tempOut);
+
+ __starting_bytes = size;
+#else
+
+ // else we gotta make a temp file, copy the tag into it, copy the
+ // rest of the old file after the tag, delete the old file, rename
+ // this new file to the old file's name and update the __file_handle
+
+ const char sTmpSuffix[] = ".XXXXXX";
+ if (strlen(__file_name) + strlen(sTmpSuffix) > ID3_PATH_LENGTH)
+ {
+ ID3_THROW_DESC(ID3E_NoFile, "filename too long");
+ }
+ char sTempFile[ID3_PATH_LENGTH];
+ strcpy(sTempFile, __file_name);
+ strcat(sTempFile, sTmpSuffix);
+
+ int fd = mkstemp(sTempFile);
+ if (fd < 0)
+ {
+ remove(sTempFile);
+ ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
+ }
+
+ ofstream tmpOut(sTempFile);
+ if (!tmpOut.is_open())
+ {
+ remove(sTempFile);
+ ID3_THROW(ID3E_ReadOnly);
+ }
+ tmpOut.write(buffer, size);
+ fseek(__file_handle, __starting_bytes, SEEK_SET);
+
+ uchar buffer2[BUFSIZ];
+ while (! feof(__file_handle))
+ {
+ size_t nBytes = fread(buffer2, 1, BUFSIZ, __file_handle);
+ tmpOut.write(buffer2, nBytes);
+ }
+
+ tmpOut.close();
+
+ CloseFile();
+
+ remove(__file_name);
+ rename(sTempFile, __file_name);
+
+ OpenFileForWriting();
+
+ __starting_bytes = size;
+#endif
+ }
+
+ delete[] buffer;
+
+ return ;
+}
+
+
+#define ID3_PADMULTIPLE (2048)
+#define ID3_PADMAX (4096)
+
+
+size_t ID3_Tag::PaddingSize(size_t curSize) const
+{
+ luint newSize = 0;
+
+ // if padding is switched off or there is no attached file
+ if (! __is_padded || __file_size == 0)
+ {
+ return 0;
+ }
+
+ // if the old tag was large enough to hold the new tag, then we will simply
+ // pad out the difference - that way the new tag can be written without
+ // shuffling the rest of the song file around
+ if (__starting_bytes && (__starting_bytes >= curSize) &&
+ (__starting_bytes - curSize) < ID3_PADMAX)
+ {
+ newSize = __starting_bytes;
+ }
+ else
+ {
+ luint tempSize = curSize + __file_size;
+
+ // this method of automatic padding rounds the COMPLETE FILE up to the
+ // nearest 2K. If the file will already be an even multiple of 2K (with
+ // the tag included) then we just add another 2K of padding
+ tempSize = ((tempSize / ID3_PADMULTIPLE) + 1) * ID3_PADMULTIPLE;
+
+ // the size of the new tag is the new filesize minus the audio data
+ newSize = tempSize - __file_size;
+ }
+
+ return newSize - curSize;
+}
--- /dev/null
+++ b/common/id3lib/src/tag_sync.cpp
@@ -1,0 +1,118 @@
+// $Id: tag_sync.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// To be used when reading an ID3v2-tag
+// Transforms all FF 00 sequences into FF
+
+size_t ID3_ReSync(uchar *data, size_t size)
+{
+ const uchar* src = data;
+ const uchar* end = data + size;
+ uchar* dest = data;
+ for (; src < end; src++, dest++)
+ {
+ if (src > dest)
+ {
+ *dest = *src;
+ }
+ if (0xFF == src[0] && src + 1 < end && 0x00 == src[1])
+ {
+ src++;
+ }
+ }
+
+ return dest - data;
+}
+
+// Determine if pCur is at a point in the pStart buffer where unsyncing is
+// necessary
+bool ID3_ShouldUnsync(const uchar *cur, const uchar *start, const size_t size)
+{
+ // The current byte is a sync if it's equal to 0xFF and
+ // 1) It's the last byte in the file, or
+ // 2) It comes before 111xxxxx (second part of an mp3 sync), or
+ // 3) It comes before 00000000 (consequence of unsyncing)
+ return
+ ( cur >= start ) &&
+ ( cur < start + size) &&
+ ( cur[0] == 0xFF) && // first sync
+ ((cur + 1 == (start + size)) || // last byte?
+ (cur[1] >= 0xE0) || // second sync
+ (cur[1] == 0x00)); // second null
+}
+
+// How big will the tag be after we unsync?
+size_t ID3_GetUnSyncSize(uchar *pBuffer, size_t size)
+{
+ size_t new_size = size;
+
+ // Determine the size needed for the destination data
+ for (uchar *cur = pBuffer; cur < pBuffer + size; cur++)
+ {
+ if (ID3_ShouldUnsync(cur, pBuffer, size))
+ {
+ new_size++;
+ }
+ }
+
+ return new_size;
+}
+
+
+// To be used when writing an ID3v2-tag
+// Transforms:
+// 11111111 111xxxxx -> 11111111 00000000 111xxxxx
+// 11111111 00000000 -> 11111111 00000000 00000000
+// 11111111 <EOF> -> 11111111 00000000 <EOF>
+
+void ID3_UnSync(uchar *dest_data, size_t dest_size,
+ const uchar *src_data, size_t src_size)
+{
+ const uchar *src;
+ uchar *dest;
+ // Now do the real transformation
+ for (src = src_data, dest = dest_data;
+ (src < src_data + src_size) && (dest < dest_data + dest_size);
+ src++, dest++)
+ {
+ // Copy the current character from source to destination
+ *dest = *src;
+
+ // If we're at a sync point in the source, insert an extra null character
+ // in the destination buffer
+ if (ID3_ShouldUnsync(src, src_data, src_size))
+ {
+ dest++;
+ *dest = '\0';
+ }
+ }
+}
--- /dev/null
+++ b/common/id3lib/src/uint28.cpp
@@ -1,0 +1,74 @@
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// $Id: uint28.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include "uint28.h"
+#include <string.h>
+#include <iomanip.h>
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+uint28& uint28::operator=(const uchar* const data)
+{
+ __value = 0;
+ for (size_t i = 0; i < sizeof(uint32); ++i)
+ {
+ __value = (__value << 7) | static_cast<uint32>(data[i]) & MASK7;
+ }
+ return *this;
+}
+
+void uint28::Render(uchar* data) const
+{
+ memset(data, '\0', sizeof(uint32));
+
+ for (uint32 val = this->to_uint32(), i = 0; i < sizeof(uint32);
+ val >>= 7, ++i)
+ {
+ data[sizeof(uint32) - i - 1] = static_cast<uchar>(val & MASK7);
+ }
+
+ // return data;
+}
+
+ostream& operator<<(ostream& os, uint28& val)
+{
+ uchar data[sizeof(uint32)];
+ val.Render(data);
+ for (uchar* p = data; p != data + sizeof(uint32); ++p)
+ {
+ os << *p;
+ }
+ return os;
+}
+
+
+istream& operator>>(istream& in, uint28& val)
+{
+ uchar data[sizeof(uint32) + 1];
+ in >> setw(sizeof(uint32) + 1) >> data;
+ val = data;
+ return in;
+}
--- /dev/null
+++ b/common/id3lib/src/utils.cpp
@@ -1,0 +1,163 @@
+// $Id: utils.cpp,v 1.1 2002/01/21 08:16:22 menno Exp $
+
+// id3lib: a C++ library for creating and manipulating id3v1/v2 tags
+// Copyright 1999, 2000 Scott Thomas Haug
+
+// This library is free software; you can redistribute it and/or modify it
+// under the terms of the GNU Library General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or (at your
+// option) any later version.
+//
+// This library is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+// License for more details.
+//
+// You should have received a copy of the GNU Library General Public License
+// along with this library; if not, write to the Free Software Foundation,
+// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// The id3lib authors encourage improvements and optimisations to be sent to
+// the id3lib coordinator. Please see the README file for details on where to
+// send such submissions. See the AUTHORS file for a list of people who have
+// contributed to id3lib. See the ChangeLog file for a list of changes to
+// id3lib. These files are distributed with id3lib at
+// http://download.sourceforge.net/id3lib/
+
+#include "utils.h"
+
+#if defined HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if defined ID3_UNDEFINED
+namespace id3
+{
+#endif /* ID3_UNDEFINED */
+
+ // Extract a 32-bit number from a 4-byte character array
+ uint32 ParseNumber(const uchar *buffer, size_t size)
+ {
+ size_t num = 0;
+ for (size_t nIndex = 0; nIndex < size; nIndex++)
+ {
+ num <<= 8;
+ num |= buffer[nIndex];
+ }
+ return num;
+ }
+
+ size_t RenderNumber(uchar *buffer, uint32 val, size_t size)
+ {
+ uint32 num = val;
+ for (size_t i = 0; i < size; i++)
+ {
+ buffer[size - i - 1] = (uchar)(num & MASK8);
+ num >>= 8;
+ }
+ return size;
+ }
+
+ // converts an ASCII string into a Unicode one
+
+ void mbstoucs(unicode_t *unicode, const char *ascii, size_t len)
+ {
+ if (NULL != ascii && NULL != unicode)
+ {
+ for (index_t i = 0; i < len; i++)
+ {
+ unicode[i] = ascii[i] & 0xFF;
+ }
+ }
+ }
+
+ // converts a Unicode string into ASCII
+
+ void ucstombs(char *ascii, const unicode_t *unicode, size_t len)
+ {
+ if (NULL != unicode && NULL != ascii)
+ {
+ for (index_t i = 0; i < len; i++)
+ {
+ ascii[i] = unicode[i] & 0x00FF;
+ }
+ }
+ }
+
+ size_t ucslen(const unicode_t *unicode)
+ {
+ if (NULL != unicode)
+ {
+ for (size_t size = 0; true; size++)
+ {
+ if (NULL_UNICODE == unicode[size])
+ {
+ return size;
+ }
+ }
+ }
+ return 0;
+ }
+
+ void ucscpy(unicode_t *dest, const unicode_t *src)
+ {
+ if (NULL != dest && NULL != src)
+ {
+ size_t i;
+ for (i = 0; NULL_UNICODE != src[i]; i++)
+ {
+ dest[i] = src[i];
+ }
+ dest[i] = NULL_UNICODE;
+ }
+ }
+
+ void ucsncpy(unicode_t *dest, const unicode_t *src, size_t len)
+ {
+ if (NULL != dest && NULL != src)
+ {
+ size_t i;
+ for (i = 0; i < len && NULL_UNICODE != src[i]; i++)
+ {
+ dest[i] = src[i];
+ }
+ for (; i < len; i++)
+ {
+ dest[i] = NULL_UNICODE;
+ }
+ }
+ }
+
+ int ucscmp(const unicode_t *s1, const unicode_t *s2)
+ {
+ return ucsncmp(s1, s2, (size_t) -1);
+ }
+
+ int ucsncmp(const unicode_t *s1, const unicode_t *s2, size_t len)
+ {
+ if (NULL == s1 && NULL == s2)
+ {
+ return 0;
+ }
+ if (NULL == s1)
+ {
+ return 1;
+ }
+ if (NULL == s2)
+ {
+ return -1;
+ }
+ for (size_t i = 0; true; i++)
+ {
+ if ((NULL_UNICODE == s1[i]) || (NULL_UNICODE == s2[i]) ||
+ (s1[i] != s2[i]) || (i + 1 == len))
+ {
+ return s2[i] - s1[i];
+ }
+ }
+ }
+
+#if defined ID3_UNDEFINED
+}
+#endif /* ID3_UNDEFINED */
+
--- /dev/null
+++ b/common/id3lib/stamp-h.in
@@ -1,0 +1,1 @@
+timestamp
--- /dev/null
+++ b/common/id3lib/win32/config.h
@@ -1,0 +1,116 @@
+/* config.h. Generated automatically by configure. */
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+/*
+** This file has been automatically generated by 'acconfig' from aclocal.m4
+** Copyright (C) 1988 Eleftherios Gkioulekas <lf@amath.washington.edu>
+**
+** This file is free software; as a special exception the author gives
+** unlimited permission to copy and/or distribute it, with or without
+** modifications, as long as this notice is preserved.
+**
+** This program is distributed in the hope that it will be useful, but
+** WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+** implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+/* This is the top section */
+
+
+/* Define to empty if the keyword does not work. */
+/* #undef const */
+
+/* Define as __inline if that's what the C compiler calls it. */
+/* #undef inline */
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* And now the rest of the boys */
+/* #undef CXX_HAS_BUGGY_FOR_LOOPS */
+/* #undef CXX_HAS_NO_BOOL */
+
+/* config.h defines these preprocesser symbols to be used by id3lib for
+ * determining internal versioning information. The intent is that these
+ * macros will be made available int the library via functions or static
+ * methods.
+ */
+/* Defines which version of id3lib is being used (int) */
+#define ID3LIB_VERSION (3)
+/* Defines which revision of id3lib is being used (int) */
+#define ID3LIB_REVISION (0)
+/* Defines which patch of id3lib is being used (int) */
+#define ID3LIB_PATCH (6)
+/* The date of this id3lib release */
+#define ID3LIB_DATE ": 1999/12/03 00:47:51 "
+/* The identifying string of this id3lib */
+#define ID3LIB_FULLNAME "id3lib-3.0.6"
+
+/* Define if you have the ftruncate function. */
+/* #define HAVE_FTRUNCATE 1 */
+
+/* Define if you have the <ctype.h> header file. */
+#define HAVE_CTYPE_H 1
+
+/* Define if you have the <iostream.h> header file. */
+#define HAVE_IOSTREAM_H 1
+
+/* Define if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define if you have the <unistd.h> header file. */
+/*#define HAVE_UNISTD_H 1 */
+
+/* Define if you have the <wchar.h> header file. */
+#define HAVE_WCHAR_H 1
+
+/* Define if you have the <zlib.h> header file. */
+#define HAVE_ZLIB_H 1
+
+/* Define if you have the z library (-lz). */
+/* #define HAVE_LIBZ 1 */
+
+/* Name of package */
+#define PACKAGE "id3lib"
+
+/* Version number of package */
+#define VERSION "3.6.0"
+
+/* This is the bottom section */
+
+// This file defines portability work-arounds for various proprietory
+// C++ compilers
+
+// Workaround for compilers with buggy for-loop scoping
+// That's quite a few compilers actually including recent versions of
+// Dec Alpha cxx, HP-UX CC and SGI CC.
+// The trivial "if" statement provides the correct scoping to the
+// for loop
+
+#ifdef CXX_HAS_BUGGY_FOR_LOOPS
+/* #undef for */
+#define for if(1) for
+#endif
+
+//
+// If the C++ compiler we use doesn't have bool, then
+// the following is a near-perfect work-around.
+// You must make sure your code does not depend on "int" and "bool"
+// being two different types, in overloading for instance.
+//
+
+#ifdef CXX_HAS_NO_BOOL
+#define bool int
+#define true 1
+#define false 0
+#endif
+
+#define MAXPATHLEN 1024
\ No newline at end of file
--- /dev/null
+++ b/common/id3lib/zlib/.cvsignore
@@ -1,0 +1,1 @@
+Makefile
--- /dev/null
+++ b/common/id3lib/zlib/Makefile.am
@@ -1,0 +1,11 @@
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+SUBDIRS = include lib prj src
--- /dev/null
+++ b/common/id3lib/zlib/Makefile.in
@@ -1,0 +1,318 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+SUBDIRS = include lib prj src
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu zlib/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+@SET_MAKE@
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = zlib
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu zlib/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am:
+uninstall: uninstall-recursive
+all-am: Makefile
+all-redirect: all-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-tags clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-tags distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-recursive
+
+maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
+ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+
+.PHONY: install-data-recursive uninstall-data-recursive \
+install-exec-recursive uninstall-exec-recursive installdirs-recursive \
+uninstalldirs-recursive all-recursive check-recursive \
+installcheck-recursive info-recursive dvi-recursive \
+mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/zlib/include/.cvsignore
@@ -1,0 +1,1 @@
+Makefile
--- /dev/null
+++ b/common/id3lib/zlib/include/Makefile.am
@@ -1,0 +1,24 @@
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+EXTRA_DIST = \
+ deflate.h \
+ infblock.h \
+ infcodes.h \
+ inffast.h \
+ inffixed.h \
+ inftrees.h \
+ infutil.h \
+ trees.h \
+ zconf.h \
+ zlib.h \
+ zutil.h
+
+
--- /dev/null
+++ b/common/id3lib/zlib/include/Makefile.in
@@ -1,0 +1,215 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ../..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+EXTRA_DIST = deflate.h infblock.h infcodes.h inffast.h inffixed.h inftrees.h infutil.h trees.h zconf.h zlib.h zutil.h
+
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../../config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu zlib/include/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = zlib/include
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu zlib/include/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/zlib/include/deflate.h
@@ -1,0 +1,318 @@
+/* deflate.h -- internal compression state
+ * Copyright (C) 1995-1998 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id: deflate.h,v 1.1 2002/01/21 08:16:22 menno Exp $ */
+
+#ifndef _DEFLATE_H
+#define _DEFLATE_H
+
+#include "zutil.h"
+
+/* ===========================================================================
+ * Internal compression state.
+ */
+
+#define LENGTH_CODES 29
+/* number of length codes, not counting the special END_BLOCK code */
+
+#define LITERALS 256
+/* number of literal bytes 0..255 */
+
+#define L_CODES (LITERALS+1+LENGTH_CODES)
+/* number of Literal or Length codes, including the END_BLOCK code */
+
+#define D_CODES 30
+/* number of distance codes */
+
+#define BL_CODES 19
+/* number of codes used to transfer the bit lengths */
+
+#define HEAP_SIZE (2*L_CODES+1)
+/* maximum heap size */
+
+#define MAX_BITS 15
+/* All codes must not exceed MAX_BITS bits */
+
+#define INIT_STATE 42
+#define BUSY_STATE 113
+#define FINISH_STATE 666
+/* Stream status */
+
+
+/* Data structure describing a single value and its code string. */
+typedef struct ct_data_s {
+ union {
+ ush freq; /* frequency count */
+ ush code; /* bit string */
+ } fc;
+ union {
+ ush dad; /* father node in Huffman tree */
+ ush len; /* length of bit string */
+ } dl;
+} FAR ct_data;
+
+#define Freq fc.freq
+#define Code fc.code
+#define Dad dl.dad
+#define Len dl.len
+
+typedef struct static_tree_desc_s static_tree_desc;
+
+typedef struct tree_desc_s {
+ ct_data *dyn_tree; /* the dynamic tree */
+ int max_code; /* largest code with non zero frequency */
+ static_tree_desc *stat_desc; /* the corresponding static tree */
+} FAR tree_desc;
+
+typedef ush Pos;
+typedef Pos FAR Posf;
+typedef unsigned IPos;
+
+/* A Pos is an index in the character window. We use short instead of int to
+ * save space in the various tables. IPos is used only for parameter passing.
+ */
+
+typedef struct internal_state {
+ z_streamp strm; /* pointer back to this zlib stream */
+ int status; /* as the name implies */
+ Bytef *pending_buf; /* output still pending */
+ ulg pending_buf_size; /* size of pending_buf */
+ Bytef *pending_out; /* next pending byte to output to the stream */
+ int pending; /* nb of bytes in the pending buffer */
+ int noheader; /* suppress zlib header and adler32 */
+ Byte data_type; /* UNKNOWN, BINARY or ASCII */
+ Byte method; /* STORED (for zip only) or DEFLATED */
+ int last_flush; /* value of flush param for previous deflate call */
+
+ /* used by deflate.c: */
+
+ uInt w_size; /* LZ77 window size (32K by default) */
+ uInt w_bits; /* log2(w_size) (8..16) */
+ uInt w_mask; /* w_size - 1 */
+
+ Bytef *window;
+ /* Sliding window. Input bytes are read into the second half of the window,
+ * and move to the first half later to keep a dictionary of at least wSize
+ * bytes. With this organization, matches are limited to a distance of
+ * wSize-MAX_MATCH bytes, but this ensures that IO is always
+ * performed with a length multiple of the block size. Also, it limits
+ * the window size to 64K, which is quite useful on MSDOS.
+ * To do: use the user input buffer as sliding window.
+ */
+
+ ulg window_size;
+ /* Actual size of window: 2*wSize, except when the user input buffer
+ * is directly used as sliding window.
+ */
+
+ Posf *prev;
+ /* Link to older string with same hash index. To limit the size of this
+ * array to 64K, this link is maintained only for the last 32K strings.
+ * An index in this array is thus a window index modulo 32K.
+ */
+
+ Posf *head; /* Heads of the hash chains or NIL. */
+
+ uInt ins_h; /* hash index of string to be inserted */
+ uInt hash_size; /* number of elements in hash table */
+ uInt hash_bits; /* log2(hash_size) */
+ uInt hash_mask; /* hash_size-1 */
+
+ uInt hash_shift;
+ /* Number of bits by which ins_h must be shifted at each input
+ * step. It must be such that after MIN_MATCH steps, the oldest
+ * byte no longer takes part in the hash key, that is:
+ * hash_shift * MIN_MATCH >= hash_bits
+ */
+
+ long block_start;
+ /* Window position at the beginning of the current output block. Gets
+ * negative when the window is moved backwards.
+ */
+
+ uInt match_length; /* length of best match */
+ IPos prev_match; /* previous match */
+ int match_available; /* set if previous match exists */
+ uInt strstart; /* start of string to insert */
+ uInt match_start; /* start of matching string */
+ uInt lookahead; /* number of valid bytes ahead in window */
+
+ uInt prev_length;
+ /* Length of the best match at previous step. Matches not greater than this
+ * are discarded. This is used in the lazy match evaluation.
+ */
+
+ uInt max_chain_length;
+ /* To speed up deflation, hash chains are never searched beyond this
+ * length. A higher limit improves compression ratio but degrades the
+ * speed.
+ */
+
+ uInt max_lazy_match;
+ /* Attempt to find a better match only when the current match is strictly
+ * smaller than this value. This mechanism is used only for compression
+ * levels >= 4.
+ */
+# define max_insert_length max_lazy_match
+ /* Insert new strings in the hash table only if the match length is not
+ * greater than this length. This saves time but degrades compression.
+ * max_insert_length is used only for compression levels <= 3.
+ */
+
+ int level; /* compression level (1..9) */
+ int strategy; /* favor or force Huffman coding*/
+
+ uInt good_match;
+ /* Use a faster search when the previous match is longer than this */
+
+ int nice_match; /* Stop searching when current match exceeds this */
+
+ /* used by trees.c: */
+ /* Didn't use ct_data typedef below to supress compiler warning */
+ struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
+ struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
+ struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
+
+ struct tree_desc_s l_desc; /* desc. for literal tree */
+ struct tree_desc_s d_desc; /* desc. for distance tree */
+ struct tree_desc_s bl_desc; /* desc. for bit length tree */
+
+ ush bl_count[MAX_BITS+1];
+ /* number of codes at each bit length for an optimal tree */
+
+ int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
+ int heap_len; /* number of elements in the heap */
+ int heap_max; /* element of largest frequency */
+ /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
+ * The same heap array is used to build all trees.
+ */
+
+ uch depth[2*L_CODES+1];
+ /* Depth of each subtree used as tie breaker for trees of equal frequency
+ */
+
+ uchf *l_buf; /* buffer for literals or lengths */
+
+ uInt lit_bufsize;
+ /* Size of match buffer for literals/lengths. There are 4 reasons for
+ * limiting lit_bufsize to 64K:
+ * - frequencies can be kept in 16 bit counters
+ * - if compression is not successful for the first block, all input
+ * data is still in the window so we can still emit a stored block even
+ * when input comes from standard input. (This can also be done for
+ * all blocks if lit_bufsize is not greater than 32K.)
+ * - if compression is not successful for a file smaller than 64K, we can
+ * even emit a stored file instead of a stored block (saving 5 bytes).
+ * This is applicable only for zip (not gzip or zlib).
+ * - creating new Huffman trees less frequently may not provide fast
+ * adaptation to changes in the input data statistics. (Take for
+ * example a binary file with poorly compressible code followed by
+ * a highly compressible string table.) Smaller buffer sizes give
+ * fast adaptation but have of course the overhead of transmitting
+ * trees more frequently.
+ * - I can't count above 4
+ */
+
+ uInt last_lit; /* running index in l_buf */
+
+ ushf *d_buf;
+ /* Buffer for distances. To simplify the code, d_buf and l_buf have
+ * the same number of elements. To use different lengths, an extra flag
+ * array would be necessary.
+ */
+
+ ulg opt_len; /* bit length of current block with optimal trees */
+ ulg static_len; /* bit length of current block with static trees */
+ uInt matches; /* number of string matches in current block */
+ int last_eob_len; /* bit length of EOB code for last block */
+
+#ifdef DEBUG
+ ulg compressed_len; /* total bit length of compressed file mod 2^32 */
+ ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
+#endif
+
+ ush bi_buf;
+ /* Output buffer. bits are inserted starting at the bottom (least
+ * significant bits).
+ */
+ int bi_valid;
+ /* Number of valid bits in bi_buf. All bits above the last valid bit
+ * are always zero.
+ */
+
+} FAR deflate_state;
+
+/* Output a byte on the stream.
+ * IN assertion: there is enough room in pending_buf.
+ */
+#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
+
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+/* Minimum amount of lookahead, except at the end of the input file.
+ * See deflate.c for comments about the MIN_MATCH+1.
+ */
+
+#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
+/* In order to simplify the code, particularly on 16 bit machines, match
+ * distances are limited to MAX_DIST instead of WSIZE.
+ */
+
+ /* in trees.c */
+void _tr_init OF((deflate_state *s));
+int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
+void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
+ int eof));
+void _tr_align OF((deflate_state *s));
+void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
+ int eof));
+
+#define d_code(dist) \
+ ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
+/* Mapping from a distance to a distance code. dist is the distance - 1 and
+ * must not have side effects. _dist_code[256] and _dist_code[257] are never
+ * used.
+ */
+
+#ifndef DEBUG
+/* Inline versions of _tr_tally for speed: */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+ extern uch _length_code[];
+ extern uch _dist_code[];
+#else
+ extern const uch _length_code[];
+ extern const uch _dist_code[];
+#endif
+
+# define _tr_tally_lit(s, c, flush) \
+ { uch cc = (c); \
+ s->d_buf[s->last_lit] = 0; \
+ s->l_buf[s->last_lit++] = cc; \
+ s->dyn_ltree[cc].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+# define _tr_tally_dist(s, distance, length, flush) \
+ { uch len = (length); \
+ ush dist = (distance); \
+ s->d_buf[s->last_lit] = dist; \
+ s->l_buf[s->last_lit++] = len; \
+ dist--; \
+ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
+ s->dyn_dtree[d_code(dist)].Freq++; \
+ flush = (s->last_lit == s->lit_bufsize-1); \
+ }
+#else
+# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
+# define _tr_tally_dist(s, distance, length, flush) \
+ flush = _tr_tally(s, distance, length)
+#endif
+
+#endif
--- /dev/null
+++ b/common/id3lib/zlib/include/infblock.h
@@ -1,0 +1,39 @@
+/* infblock.h -- header to use infblock.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+struct inflate_blocks_state;
+typedef struct inflate_blocks_state FAR inflate_blocks_statef;
+
+extern inflate_blocks_statef * inflate_blocks_new OF((
+ z_streamp z,
+ check_func c, /* check function */
+ uInt w)); /* window size */
+
+extern int inflate_blocks OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int)); /* initial return code */
+
+extern void inflate_blocks_reset OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ uLongf *)); /* check value on output */
+
+extern int inflate_blocks_free OF((
+ inflate_blocks_statef *,
+ z_streamp));
+
+extern void inflate_set_dictionary OF((
+ inflate_blocks_statef *s,
+ const Bytef *d, /* dictionary */
+ uInt n)); /* dictionary length */
+
+extern int inflate_blocks_sync_point OF((
+ inflate_blocks_statef *s));
--- /dev/null
+++ b/common/id3lib/zlib/include/infcodes.h
@@ -1,0 +1,27 @@
+/* infcodes.h -- header to use infcodes.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+struct inflate_codes_state;
+typedef struct inflate_codes_state FAR inflate_codes_statef;
+
+extern inflate_codes_statef *inflate_codes_new OF((
+ uInt, uInt,
+ inflate_huft *, inflate_huft *,
+ z_streamp ));
+
+extern int inflate_codes OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+
+extern void inflate_codes_free OF((
+ inflate_codes_statef *,
+ z_streamp ));
+
--- /dev/null
+++ b/common/id3lib/zlib/include/inffast.h
@@ -1,0 +1,17 @@
+/* inffast.h -- header to use inffast.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+extern int inflate_fast OF((
+ uInt,
+ uInt,
+ inflate_huft *,
+ inflate_huft *,
+ inflate_blocks_statef *,
+ z_streamp ));
--- /dev/null
+++ b/common/id3lib/zlib/include/inffixed.h
@@ -1,0 +1,151 @@
+/* inffixed.h -- table for decoding fixed codes
+ * Generated automatically by the maketree.c program
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+local uInt fixed_bl = 9;
+local uInt fixed_bd = 5;
+local inflate_huft fixed_tl[] = {
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
+ {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
+ {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
+ {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
+ {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
+ {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
+ {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
+ {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
+ {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
+ {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
+ {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
+ {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
+ {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
+ {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
+ {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
+ {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
+ {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
+ {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
+ {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
+ {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
+ {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
+ {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
+ {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
+ {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
+ {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
+ {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
+ {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
+ {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
+ {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
+ {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
+ {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
+ {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
+ {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
+ {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
+ {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
+ {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
+ {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
+ {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
+ {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
+ {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
+ {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
+ {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
+ {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
+ {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
+ {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
+ {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
+ {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
+ {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
+ {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
+ {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
+ {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
+ {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
+ {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
+ {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
+ {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
+ {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
+ {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
+ {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
+ {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
+ {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
+ {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
+ {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
+ {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
+ {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
+ };
+local inflate_huft fixed_td[] = {
+ {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
+ {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
+ {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
+ {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
+ {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
+ {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
+ {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
+ {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
+ };
--- /dev/null
+++ b/common/id3lib/zlib/include/inftrees.h
@@ -1,0 +1,58 @@
+/* inftrees.h -- header to use inftrees.c
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* Huffman code lookup table entry--this entry is four bytes for machines
+ that have 16-bit pointers (e.g. PC's in the small or medium model). */
+
+typedef struct inflate_huft_s FAR inflate_huft;
+
+struct inflate_huft_s {
+ union {
+ struct {
+ Byte Exop; /* number of extra bits or operation */
+ Byte Bits; /* number of bits in this code or subcode */
+ } what;
+ uInt pad; /* pad structure to a power of 2 (4 bytes for */
+ } word; /* 16-bit, 8 bytes for 32-bit int's) */
+ uInt base; /* literal, length base, distance base,
+ or table offset */
+};
+
+/* Maximum size of dynamic tree. The maximum found in a long but non-
+ exhaustive search was 1004 huft structures (850 for length/literals
+ and 154 for distances, the latter actually the result of an
+ exhaustive search). The actual maximum is not known, but the
+ value below is more than safe. */
+#define MANY 1440
+
+extern int inflate_trees_bits OF((
+ uIntf *, /* 19 code lengths */
+ uIntf *, /* bits tree desired/actual depth */
+ inflate_huft * FAR *, /* bits tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+extern int inflate_trees_dynamic OF((
+ uInt, /* number of literal/length codes */
+ uInt, /* number of distance codes */
+ uIntf *, /* that many (total) code lengths */
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ inflate_huft * FAR *, /* literal/length tree result */
+ inflate_huft * FAR *, /* distance tree result */
+ inflate_huft *, /* space for trees */
+ z_streamp)); /* for messages */
+
+extern int inflate_trees_fixed OF((
+ uIntf *, /* literal desired/actual bit depth */
+ uIntf *, /* distance desired/actual bit depth */
+ inflate_huft * FAR *, /* literal/length tree result */
+ inflate_huft * FAR *, /* distance tree result */
+ z_streamp)); /* for memory allocation */
--- /dev/null
+++ b/common/id3lib/zlib/include/infutil.h
@@ -1,0 +1,98 @@
+/* infutil.h -- types and macros common to blocks and codes
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+#ifndef _INFUTIL_H
+#define _INFUTIL_H
+
+typedef enum {
+ TYPE, /* get type bits (3, including end bit) */
+ LENS, /* get lengths for stored */
+ STORED, /* processing stored block */
+ TABLE, /* get table lengths */
+ BTREE, /* get bit lengths tree for a dynamic block */
+ DTREE, /* get length, distance trees for a dynamic block */
+ CODES, /* processing fixed or dynamic block */
+ DRY, /* output remaining window bytes */
+ DONE, /* finished last block, done */
+ BAD} /* got a data error--stuck here */
+inflate_block_mode;
+
+/* inflate blocks semi-private state */
+struct inflate_blocks_state {
+
+ /* mode */
+ inflate_block_mode mode; /* current inflate_block mode */
+
+ /* mode dependent information */
+ union {
+ uInt left; /* if STORED, bytes left to copy */
+ struct {
+ uInt table; /* table lengths (14 bits) */
+ uInt index; /* index into blens (or border) */
+ uIntf *blens; /* bit lengths of codes */
+ uInt bb; /* bit length tree depth */
+ inflate_huft *tb; /* bit length decoding tree */
+ } trees; /* if DTREE, decoding info for trees */
+ struct {
+ inflate_codes_statef
+ *codes;
+ } decode; /* if CODES, current state */
+ } sub; /* submode */
+ uInt last; /* true if this block is the last block */
+
+ /* mode independent information */
+ uInt bitk; /* bits in bit buffer */
+ uLong bitb; /* bit buffer */
+ inflate_huft *hufts; /* single malloc for tree space */
+ Bytef *window; /* sliding window */
+ Bytef *end; /* one byte after sliding window */
+ Bytef *read; /* window read pointer */
+ Bytef *write; /* window write pointer */
+ check_func checkfn; /* check function */
+ uLong check; /* check on output */
+
+};
+
+
+/* defines for inflate input/output */
+/* update pointers and return */
+#define UPDBITS {s->bitb=b;s->bitk=k;}
+#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
+#define UPDOUT {s->write=q;}
+#define UPDATE {UPDBITS UPDIN UPDOUT}
+#define LEAVE {UPDATE return inflate_flush(s,z,r);}
+/* get bytes and bits */
+#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
+#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
+#define NEXTBYTE (n--,*p++)
+#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define DUMPBITS(j) {b>>=(j);k-=(j);}
+/* output bytes */
+#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)
+#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}
+#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
+#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
+#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
+#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
+/* load local pointers */
+#define LOAD {LOADIN LOADOUT}
+
+/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
+extern uInt inflate_mask[17];
+
+/* copy as much as possible from the sliding window to the output area */
+extern int inflate_flush OF((
+ inflate_blocks_statef *,
+ z_streamp ,
+ int));
+
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+#endif
--- /dev/null
+++ b/common/id3lib/zlib/include/trees.h
@@ -1,0 +1,128 @@
+/* header created automatically with -DGEN_TREES_H */
+
+local const ct_data static_ltree[L_CODES+2] = {
+{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
+{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
+{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
+{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
+{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
+{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
+{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
+{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
+{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
+{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
+{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
+{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
+{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
+{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
+{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
+{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
+{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
+{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
+{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
+{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
+{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
+{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
+{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
+{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
+{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
+{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
+{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
+{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
+{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
+{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
+{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
+{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
+{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
+{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
+{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
+{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
+{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
+{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
+{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
+{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
+{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
+{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
+{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
+{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
+{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
+{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
+{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
+{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
+{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
+{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
+{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
+{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
+{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
+{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
+{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
+{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
+{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
+{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
+};
+
+local const ct_data static_dtree[D_CODES] = {
+{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
+{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
+{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
+{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
+{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
+{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
+};
+
+const uch _dist_code[DIST_CODE_LEN] = {
+ 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
+ 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
+10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
+15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
+18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
+29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
+};
+
+const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
+13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
+17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
+19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
+22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
+23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
+};
+
+local const int base_length[LENGTH_CODES] = {
+0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
+64, 80, 96, 112, 128, 160, 192, 224, 0
+};
+
+local const int base_dist[D_CODES] = {
+ 0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
+ 32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
+ 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
+};
+
--- /dev/null
+++ b/common/id3lib/zlib/include/zconf.h
@@ -1,0 +1,279 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zconf.h,v 1.1 2002/01/21 08:16:22 menno Exp $ */
+
+#ifndef _ZCONF_H
+#define _ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ */
+#ifdef Z_PREFIX
+# define deflateInit_ z_deflateInit_
+# define deflate z_deflate
+# define deflateEnd z_deflateEnd
+# define inflateInit_ z_inflateInit_
+# define inflate z_inflate
+# define inflateEnd z_inflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateCopy z_deflateCopy
+# define deflateReset z_deflateReset
+# define deflateParams z_deflateParams
+# define inflateInit2_ z_inflateInit2_
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateReset z_inflateReset
+# define compress z_compress
+# define compress2 z_compress2
+# define uncompress z_uncompress
+# define adler32 z_adler32
+# define crc32 z_crc32
+# define get_crc_table z_get_crc_table
+
+# define Byte z_Byte
+# define uInt z_uInt
+# define uLong z_uLong
+# define Bytef z_Bytef
+# define charf z_charf
+# define intf z_intf
+# define uIntf z_uIntf
+# define uLongf z_uLongf
+# define voidpf z_voidpf
+# define voidp z_voidp
+#endif
+
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+# define WIN32
+#endif
+#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
+# ifndef __32BIT__
+# define __32BIT__
+# endif
+#endif
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#if defined(MSDOS) && !defined(__32BIT__)
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
+# define STDC
+#endif
+#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
+# ifndef STDC
+# define STDC
+# endif
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const
+# endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Old Borland C incorrectly complains about missing returns: */
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+# define NEED_DUMMY_RETURN
+#endif
+
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+#endif
+#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
+# ifndef __32BIT__
+# define SMALL_MEDIUM
+# define FAR _far
+# endif
+#endif
+
+/* Compile with -DZLIB_DLL for Windows DLL support */
+#if defined(ZLIB_DLL)
+# if defined(_WINDOWS) || defined(WINDOWS)
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR _cdecl _export
+# endif
+# endif
+# if defined (__BORLANDC__)
+# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
+# include <windows.h>
+# define ZEXPORT __declspec(dllexport) WINAPI
+# define ZEXPORTRVA __declspec(dllexport) WINAPIV
+# else
+# if defined (_Windows) && defined (__DLL__)
+# define ZEXPORT _export
+# define ZEXPORTVA _export
+# endif
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# if defined (ZLIB_DLL)
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+#endif
+
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(MACOS) && !defined(TARGET_OS_MAC)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef Byte FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <sys/types.h> /* for off_t */
+# include <unistd.h> /* for SEEK_* and off_t */
+# define z_off_t off_t
+#endif
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+# pragma map(deflateInit_,"DEIN")
+# pragma map(deflateInit2_,"DEIN2")
+# pragma map(deflateEnd,"DEEND")
+# pragma map(inflateInit_,"ININ")
+# pragma map(inflateInit2_,"ININ2")
+# pragma map(inflateEnd,"INEND")
+# pragma map(inflateSync,"INSY")
+# pragma map(inflateSetDictionary,"INSEDI")
+# pragma map(inflate_blocks,"INBL")
+# pragma map(inflate_blocks_new,"INBLNE")
+# pragma map(inflate_blocks_free,"INBLFR")
+# pragma map(inflate_blocks_reset,"INBLRE")
+# pragma map(inflate_codes_free,"INCOFR")
+# pragma map(inflate_codes,"INCO")
+# pragma map(inflate_fast,"INFA")
+# pragma map(inflate_flush,"INFLU")
+# pragma map(inflate_mask,"INMA")
+# pragma map(inflate_set_dictionary,"INSEDI2")
+# pragma map(inflate_copyright,"INCOPY")
+# pragma map(inflate_trees_bits,"INTRBI")
+# pragma map(inflate_trees_dynamic,"INTRDY")
+# pragma map(inflate_trees_fixed,"INTRFI")
+# pragma map(inflate_trees_free,"INTRFR")
+#endif
+
+#endif /* _ZCONF_H */
--- /dev/null
+++ b/common/id3lib/zlib/include/zlib.h
@@ -1,0 +1,893 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.1.3, July 9th, 1998
+
+ Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
+ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef _ZLIB_H
+#define _ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.1.3"
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed
+ data. This version of the library supports only one compression method
+ (deflation) but other algorithms will be added later and will have the same
+ stream interface.
+
+ Compression can be done in a single step if the buffers are large
+ enough (for example if an input file is mmap'ed), or can be done by
+ repeated calls of the compression function. In the latter case, the
+ application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never
+ crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total nb of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total nb of bytes output so far */
+
+ char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ alloc_func zalloc; /* used to allocate the internal state */
+ free_func zfree; /* used to free the internal state */
+ voidpf opaque; /* private data object passed to zalloc and zfree */
+
+ int data_type; /* best guess about the data type: ascii or binary */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ The application must update next_in and avail_in when avail_in has
+ dropped to zero. It must update next_out and avail_out when avail_out
+ has dropped to zero. The application must initialize zalloc, zfree and
+ opaque before calling the init function. All other fields are set by the
+ compression library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this
+ if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+ pointers returned by zalloc for objects of exactly 65536 bytes *must*
+ have their offset normalized to zero. The default allocation function
+ provided by this library ensures this (see zutil.c). To reduce memory
+ requirements and avoid any allocation of 64K objects, at the expense of
+ compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or
+ progress reports. After compression, total_in holds the total size of
+ the uncompressed data and may be saved for use in the decompressor
+ (particularly if the decompressor wants to decompress everything in
+ a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+/* Allowed flush values; see deflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_ASCII 1
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+ /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is
+ not compatible with the zlib.h header file used by the application.
+ This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller.
+ If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+ use default allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at
+ all (the input data is simply copied a block at a time).
+ Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+ compression (currently equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION).
+ msg is set to null if there is no error message. deflateInit does not
+ perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce some
+ output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications).
+ Some output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating avail_in or avail_out accordingly; avail_out
+ should never be zero before the call. The application can consume the
+ compressed output when it wants, for example when the output buffer is full
+ (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+ and with zero avail_out, it must be called again after making room in the
+ output buffer because there might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In particular
+ avail_in is zero after the call if enough output space has been provided
+ before the call.) Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ the compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out).
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there
+ was enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the
+ stream are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least
+ 0.1% larger than avail_in plus 12 bytes. If deflate does not return
+ Z_STREAM_END, then it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update data_type if it can make a good guess about
+ the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect
+ the compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero).
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case,
+ msg may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+ value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller. msg is set to null if there is no error
+ message. inflateInit does not perform any decompression apart from reading
+ the zlib header if present: this will be done by inflate(). (So next_in and
+ avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may some
+ introduce some output latency (reading input without producing any output)
+ except when forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing
+ will resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there
+ is no more input data or no more space in the output buffer (see below
+ about the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating the next_* and avail_* values accordingly.
+ The application can consume the uncompressed output when it wants, for
+ example when the output buffer is full (avail_out == 0), or after each
+ call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+ must be called again after making room in the output buffer because there
+ might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
+ output as possible to the output buffer. The flushing behavior of inflate is
+ not specified for values of the flush parameter other than Z_SYNC_FLUSH
+ and Z_FINISH, but the current implementation actually flushes as much output
+ as possible anyway.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step
+ (a single call of inflate), the parameter flush should be set to
+ Z_FINISH. In this case all pending input is processed and all pending
+ output is flushed; avail_out must be large enough to hold all the
+ uncompressed data. (The size of the uncompressed data may have been saved
+ by the compressor for this purpose.) The next operation on this stream must
+ be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+ is never required, but can be used to inform inflate that a faster routine
+ may be used for the single inflate() call.
+
+ If a preset dictionary is needed at this point (see inflateSetDictionary
+ below), inflate sets strm-adler to the adler32 checksum of the
+ dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
+ it sets strm->adler to the adler32 checksum of all output produced
+ so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
+ an error code as described below. At the end of the stream, inflate()
+ checks that its computed adler32 checksum is equal to that saved by the
+ compressor and returns Z_STREAM_END only if the checksum is correct.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect
+ adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
+ (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if no progress is possible or if there was not
+ enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
+ case, the application may then call inflateSync to look for a good
+ compression block.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by
+ the caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but
+ is slow and reduces compression ratio; memLevel=9 uses maximum memory
+ for optimal speed. The default value is 8. See zconf.h for total memory
+ usage as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match). Filtered data consists mostly of small values with a
+ somewhat random distribution. In this case, the compression algorithm is
+ tuned to compress them better. The effect of Z_FILTERED is to force more
+ Huffman coding and less string matching; it is somewhat intermediate
+ between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
+ the compression ratio but not the correctness of the compressed output even
+ if it is not set appropriately.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+ method). msg is set to null if there is no error message. deflateInit2 does
+ not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any
+ call of deflate. The compressor and decompressor must use exactly the same
+ dictionary (see inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size in
+ deflate or deflate2. Thus the strings most likely to be useful should be
+ put at the end of the dictionary, not at the front.
+
+ Upon return of this function, strm->adler is set to the Adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The Adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.)
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if the compression method is bsort). deflateSetDictionary does not
+ perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and
+ can consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state.
+ The stream will keep the same compression level and any other attributes
+ that may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different
+ strategy. If the compression level is changed, the input available so far
+ is compressed with the old level (and may be flushed); the new level will
+ take effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to
+ be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+ if strm->avail_out was zero.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. If a compressed stream with a larger window size is given as
+ input, inflate() will return with the error code Z_DATA_ERROR instead of
+ trying to allocate a larger window.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
+ memLevel). msg is set to null if there is no error message. inflateInit2
+ does not perform any decompression apart from reading the zlib header if
+ present: this will be done by inflate(). (So next_in and avail_in may be
+ modified, but next_out and avail_out are unchanged.)
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate
+ if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the Adler32 value returned by this call of
+ inflate. The compressor and decompressor must use exactly the same
+ dictionary (see deflateSetDictionary).
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect Adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+ or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+ case, the application may save the current current value of total_in which
+ indicates where valid compressed data was found. In the error case, the
+ application may repeatedly call inflateSync, providing more input each time,
+ until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state.
+ The stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+
+ /* utility functions */
+
+/*
+ The following utility functions are implemented on top of the
+ basic stream-oriented functions. To simplify the interface, some
+ default options are assumed (compression level and memory usage,
+ standard memory allocation functions). The source code of these
+ utility functions can easily be modified if you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Compresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be at least 0.1% larger than
+ sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
+ compressed buffer.
+ This function can be used to compress a whole file at once if the
+ input file is mmap'ed.
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+
+
+typedef voidp gzFile;
+
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+/*
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb") but can also include a compression level
+ ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+ Huffman only compression as in "wb1h". (See the description
+ of deflateInit2 for more information about the strategy parameter.)
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression.
+
+ gzopen returns NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR). */
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+ gzdopen() associates a gzFile with the file descriptor fd. File
+ descriptors are obtained from calls like open, dup, creat, pipe or
+ fileno (in the file has been previously opened with fopen).
+ The mode parameter is as in gzopen.
+ The next call of gzclose on the returned gzFile will also close the
+ file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+ descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+ gzdopen returns NULL if there was insufficient memory to allocate
+ the (de)compression state.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+ Reads the given number of uncompressed bytes from the compressed file.
+ If the input file was not in gzip format, gzread copies the given number
+ of bytes into the buffer.
+ gzread returns the number of uncompressed bytes actually read (0 for
+ end of file, -1 for error). */
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ const voidp buf, unsigned len));
+/*
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of uncompressed bytes actually written
+ (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+/*
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or
+ a newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. The string is then terminated with a null
+ character.
+ gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function. The return value is the zlib
+ error number (see function gzerror below). gzflush returns Z_OK if
+ the flush parameter is Z_FINISH and all output could be flushed.
+ gzflush should be called only when strictly necessary because it can
+ degrade compression.
+*/
+
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+/*
+ Sets the starting position for the next gzread or gzwrite on the
+ given compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+/*
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+/*
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state. The return value is the zlib
+ error number (see function gzerror below).
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+ Returns the error message for the last error which occurred on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occurred in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+*/
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the
+ compression library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is NULL, this function returns
+ the required initial value for the checksum.
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster. Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+/*
+ Update a running crc with the bytes buf[0..len-1] and return the updated
+ crc. If buf is NULL, this function returns the required initial value
+ for the crc. Pre- and post-conditioning (one's complement) is performed
+ within this function so it shouldn't be done by the application.
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+#define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+
+
+#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char * ZEXPORT zError OF((int err));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZLIB_H */
--- /dev/null
+++ b/common/id3lib/zlib/include/zutil.h
@@ -1,0 +1,220 @@
+/* zutil.h -- internal interface and configuration of the compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* @(#) $Id: zutil.h,v 1.1 2002/01/21 08:16:22 menno Exp $ */
+
+#ifndef _Z_UTIL_H
+#define _Z_UTIL_H
+
+#include "zlib.h"
+
+#ifdef STDC
+# include <stddef.h>
+# include <string.h>
+# include <stdlib.h>
+#endif
+#ifdef NO_ERRNO_H
+ extern int errno;
+#else
+# include <errno.h>
+#endif
+
+#ifndef local
+# define local static
+#endif
+/* compile with -Dlocal if your debugger can't find static symbols */
+
+typedef unsigned char uch;
+typedef uch FAR uchf;
+typedef unsigned short ush;
+typedef ush FAR ushf;
+typedef unsigned long ulg;
+
+extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
+/* (size given to avoid silly warnings with Visual C++) */
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
+#define ERR_RETURN(strm,err) \
+ return (strm->msg = (char*)ERR_MSG(err), (err))
+/* To be used only when the state is known to be valid */
+
+ /* common constants */
+
+#ifndef DEF_WBITS
+# define DEF_WBITS MAX_WBITS
+#endif
+/* default windowBits for decompression. MAX_WBITS is for compression only */
+
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+/* default memLevel */
+
+#define STORED_BLOCK 0
+#define STATIC_TREES 1
+#define DYN_TREES 2
+/* The three kinds of block type */
+
+#define MIN_MATCH 3
+#define MAX_MATCH 258
+/* The minimum and maximum match lengths */
+
+#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
+ /* target dependencies */
+
+#ifdef MSDOS
+# define OS_CODE 0x00
+# if defined(__TURBOC__) || defined(__BORLANDC__)
+# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+ /* Allow compilation with ANSI keywords only enabled */
+ void _Cdecl farfree( void *block );
+ void *_Cdecl farmalloc( unsigned long nbytes );
+# else
+# include <alloc.h>
+# endif
+# else /* MSC or DJGPP */
+# include <malloc.h>
+# endif
+#endif
+
+#ifdef OS2
+# define OS_CODE 0x06
+#endif
+
+#ifdef WIN32 /* Window 95 & Windows NT */
+# define OS_CODE 0x0b
+#endif
+
+#if defined(VAXC) || defined(VMS)
+# define OS_CODE 0x02
+# define F_OPEN(name, mode) \
+ fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+#endif
+
+#ifdef AMIGA
+# define OS_CODE 0x01
+#endif
+
+#if defined(ATARI) || defined(atarist)
+# define OS_CODE 0x05
+#endif
+
+#if defined(MACOS) || defined(TARGET_OS_MAC)
+# define OS_CODE 0x07
+# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fdopen */
+# else
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# endif
+# endif
+#endif
+
+#ifdef __50SERIES /* Prime/PRIMOS */
+# define OS_CODE 0x0F
+#endif
+
+#ifdef TOPS20
+# define OS_CODE 0x0a
+#endif
+
+#if defined(_BEOS_) || defined(RISCOS)
+# define fdopen(fd,mode) NULL /* No fdopen() */
+#endif
+
+#if (defined(_MSC_VER) && (_MSC_VER > 600))
+# define fdopen(fd,type) _fdopen(fd,type)
+#endif
+
+
+ /* Common defaults */
+
+#ifndef OS_CODE
+# define OS_CODE 0x03 /* assume Unix */
+#endif
+
+#ifndef F_OPEN
+# define F_OPEN(name, mode) fopen((name), (mode))
+#endif
+
+ /* functions */
+
+#ifdef HAVE_STRERROR
+ extern char *strerror OF((int));
+# define zstrerror(errnum) strerror(errnum)
+#else
+# define zstrerror(errnum) ""
+#endif
+
+#if defined(pyr)
+# define NO_MEMCPY
+#endif
+#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
+ /* Use our own functions for small and medium model with MSC <= 5.0.
+ * You may have to use the same strategy for Borland C (untested).
+ * The __SC__ check is for Symantec.
+ */
+# define NO_MEMCPY
+#endif
+#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
+# define HAVE_MEMCPY
+#endif
+#ifdef HAVE_MEMCPY
+# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
+# define zmemcpy _fmemcpy
+# define zmemcmp _fmemcmp
+# define zmemzero(dest, len) _fmemset(dest, 0, len)
+# else
+# define zmemcpy memcpy
+# define zmemcmp memcmp
+# define zmemzero(dest, len) memset(dest, 0, len)
+# endif
+#else
+ extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+ extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+ extern void zmemzero OF((Bytef* dest, uInt len));
+#endif
+
+/* Diagnostic functions */
+#ifdef DEBUG
+# include <stdio.h>
+ extern int z_verbose;
+ extern void z_error OF((char *m));
+# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+# define Trace(x) {if (z_verbose>=0) fprintf x ;}
+# define Tracev(x) {if (z_verbose>0) fprintf x ;}
+# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
+#else
+# define Assert(cond,msg)
+# define Trace(x)
+# define Tracev(x)
+# define Tracevv(x)
+# define Tracec(c,x)
+# define Tracecv(c,x)
+#endif
+
+
+typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
+ uInt len));
+voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
+void zcfree OF((voidpf opaque, voidpf ptr));
+
+#define ZALLOC(strm, items, size) \
+ (*((strm)->zalloc))((strm)->opaque, (items), (size))
+#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
+#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
+#endif /* _Z_UTIL_H */
--- /dev/null
+++ b/common/id3lib/zlib/lib/.cvsignore
@@ -1,0 +1,1 @@
+Makefile
--- /dev/null
+++ b/common/id3lib/zlib/lib/Makefile.am
@@ -1,0 +1,10 @@
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
--- /dev/null
+++ b/common/id3lib/zlib/lib/Makefile.in
@@ -1,0 +1,212 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ../..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../../config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu zlib/lib/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = zlib/lib
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu zlib/lib/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/zlib/prj/.cvsignore
@@ -1,0 +1,1 @@
+Makefile
--- /dev/null
+++ b/common/id3lib/zlib/prj/Makefile.am
@@ -1,0 +1,14 @@
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+EXTRA_DIST = zlib.dsp zlib.dsw zlib.mak
+
+
+
--- /dev/null
+++ b/common/id3lib/zlib/prj/Makefile.in
@@ -1,0 +1,214 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ../..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+EXTRA_DIST = zlib.dsp zlib.dsw zlib.mak
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../../config.h
+CONFIG_CLEAN_FILES =
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu zlib/prj/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+tags: TAGS
+TAGS:
+
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = zlib/prj
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu zlib/prj/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/zlib/prj/zlib.dsp
@@ -1,0 +1,242 @@
+# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=zlib - Win32 NASM Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "zlib.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 NASM Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "zlib - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "zlib - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "zlib - Win32 NASM Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "zlib - Win32 NASM Release" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath "H/PC Ver. 2.00"
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x809
+# ADD RSC /l 0x809
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /FR /YX /FD /c
+# ADD BASE RSC /l 0x809
+# ADD RSC /l 0x809
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "zlib___W"
+# PROP BASE Intermediate_Dir "zlib___W"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /GX /Z7 /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x809
+# ADD RSC /l 0x809
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo /out:"zlib.lib"
+# ADD LIB32 /nologo /out:"..\zlib.lib"
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "zlib___0"
+# PROP BASE Intermediate_Dir "zlib___0"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x809
+# ADD RSC /l 0x809
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo /out:"zlib.lib"
+# ADD LIB32 /nologo /out:"..\zlib.lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "zlib - Win32 Release"
+# Name "zlib - Win32 Debug"
+# Name "zlib - Win32 NASM Debug"
+# Name "zlib - Win32 NASM Release"
+# Begin Group "source"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\src\adler32.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\compress.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\crc32.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\deflate.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\gzio.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\infblock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\infcodes.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\inffast.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\inflate.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\inftrees.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\infutil.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\trees.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\uncompr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\src\zutil.c
+# End Source File
+# End Group
+# Begin Group "include"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\include\deflate.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\infblock.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\infcodes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\inffast.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\inffixed.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\inftrees.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\infutil.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\trees.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\zconf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\zlib.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\include\zutil.h
+# End Source File
+# End Group
+# End Target
+# End Project
--- /dev/null
+++ b/common/id3lib/zlib/prj/zlib.dsw
@@ -1,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "zlib"=.\zlib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
--- /dev/null
+++ b/common/id3lib/zlib/prj/zlib.mak
@@ -1,0 +1,1180 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on zlib.dsp
+!IF "$(CFG)" == ""
+CFG=zlib - Win32 NASM Debug
+!MESSAGE No configuration specified. Defaulting to zlib - Win32 NASM Debug.
+!ENDIF
+
+!IF "$(CFG)" != "zlib - Win32 Release" && "$(CFG)" != "zlib - Win32 Debug" &&\
+ "$(CFG)" != "zlib - Win32 NASM Debug" && "$(CFG)" !=\
+ "zlib - Win32 NASM Release"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 NASM Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "zlib - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "zlib - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "zlib - Win32 NASM Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE "zlib - Win32 NASM Release" (based on "Win32 (x86) Static Library")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+CPP=cl.exe
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+
+!IF "$(RECURSE)" == "0"
+
+ALL : "..\zlib.lib"
+
+!ELSE
+
+ALL : "..\zlib.lib"
+
+!ENDIF
+
+CLEAN :
+ -@erase "$(INTDIR)\adler32.obj"
+ -@erase "$(INTDIR)\compress.obj"
+ -@erase "$(INTDIR)\crc32.obj"
+ -@erase "$(INTDIR)\deflate.obj"
+ -@erase "$(INTDIR)\gzio.obj"
+ -@erase "$(INTDIR)\infblock.obj"
+ -@erase "$(INTDIR)\infcodes.obj"
+ -@erase "$(INTDIR)\inffast.obj"
+ -@erase "$(INTDIR)\inflate.obj"
+ -@erase "$(INTDIR)\inftrees.obj"
+ -@erase "$(INTDIR)\infutil.obj"
+ -@erase "$(INTDIR)\trees.obj"
+ -@erase "$(INTDIR)\uncompr.obj"
+ -@erase "$(INTDIR)\vc50.idb"
+ -@erase "$(INTDIR)\zutil.obj"
+ -@erase "..\zlib.lib"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D\
+ "_WINDOWS" /Fp"$(INTDIR)\zlib.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c\
+
+CPP_OBJS=.\Release/
+CPP_SBRS=.
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\zlib.bsc"
+BSC32_SBRS= \
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\zlib.lib"
+LIB32_OBJS= \
+ "$(INTDIR)\adler32.obj" \
+ "$(INTDIR)\compress.obj" \
+ "$(INTDIR)\crc32.obj" \
+ "$(INTDIR)\deflate.obj" \
+ "$(INTDIR)\gzio.obj" \
+ "$(INTDIR)\infblock.obj" \
+ "$(INTDIR)\infcodes.obj" \
+ "$(INTDIR)\inffast.obj" \
+ "$(INTDIR)\inflate.obj" \
+ "$(INTDIR)\inftrees.obj" \
+ "$(INTDIR)\infutil.obj" \
+ "$(INTDIR)\trees.obj" \
+ "$(INTDIR)\uncompr.obj" \
+ "$(INTDIR)\zutil.obj"
+
+"..\zlib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+
+!IF "$(RECURSE)" == "0"
+
+ALL : "..\zlib.lib"
+
+!ELSE
+
+ALL : "..\zlib.lib"
+
+!ENDIF
+
+CLEAN :
+ -@erase "$(INTDIR)\adler32.obj"
+ -@erase "$(INTDIR)\compress.obj"
+ -@erase "$(INTDIR)\crc32.obj"
+ -@erase "$(INTDIR)\deflate.obj"
+ -@erase "$(INTDIR)\gzio.obj"
+ -@erase "$(INTDIR)\infblock.obj"
+ -@erase "$(INTDIR)\infcodes.obj"
+ -@erase "$(INTDIR)\inffast.obj"
+ -@erase "$(INTDIR)\inflate.obj"
+ -@erase "$(INTDIR)\inftrees.obj"
+ -@erase "$(INTDIR)\infutil.obj"
+ -@erase "$(INTDIR)\trees.obj"
+ -@erase "$(INTDIR)\uncompr.obj"
+ -@erase "$(INTDIR)\vc50.idb"
+ -@erase "$(INTDIR)\zutil.obj"
+ -@erase "..\zlib.lib"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MDd /W3 /GX /Z7 /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D\
+ "_WINDOWS" /Fp"$(INTDIR)\zlib.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c\
+
+CPP_OBJS=.\Debug/
+CPP_SBRS=.
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\zlib.bsc"
+BSC32_SBRS= \
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\zlib.lib"
+LIB32_OBJS= \
+ "$(INTDIR)\adler32.obj" \
+ "$(INTDIR)\compress.obj" \
+ "$(INTDIR)\crc32.obj" \
+ "$(INTDIR)\deflate.obj" \
+ "$(INTDIR)\gzio.obj" \
+ "$(INTDIR)\infblock.obj" \
+ "$(INTDIR)\infcodes.obj" \
+ "$(INTDIR)\inffast.obj" \
+ "$(INTDIR)\inflate.obj" \
+ "$(INTDIR)\inftrees.obj" \
+ "$(INTDIR)\infutil.obj" \
+ "$(INTDIR)\trees.obj" \
+ "$(INTDIR)\uncompr.obj" \
+ "$(INTDIR)\zutil.obj"
+
+"..\zlib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+
+!IF "$(RECURSE)" == "0"
+
+ALL : "..\zlib.lib"
+
+!ELSE
+
+ALL : "..\zlib.lib"
+
+!ENDIF
+
+CLEAN :
+ -@erase "$(INTDIR)\adler32.obj"
+ -@erase "$(INTDIR)\compress.obj"
+ -@erase "$(INTDIR)\crc32.obj"
+ -@erase "$(INTDIR)\deflate.obj"
+ -@erase "$(INTDIR)\gzio.obj"
+ -@erase "$(INTDIR)\infblock.obj"
+ -@erase "$(INTDIR)\infcodes.obj"
+ -@erase "$(INTDIR)\inffast.obj"
+ -@erase "$(INTDIR)\inflate.obj"
+ -@erase "$(INTDIR)\inftrees.obj"
+ -@erase "$(INTDIR)\infutil.obj"
+ -@erase "$(INTDIR)\trees.obj"
+ -@erase "$(INTDIR)\uncompr.obj"
+ -@erase "$(INTDIR)\vc50.idb"
+ -@erase "$(INTDIR)\zutil.obj"
+ -@erase "..\zlib.lib"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MDd /W3 /GX /Z7 /Od /I "..\include" /D "WIN32" /D "_DEBUG" /D\
+ "_WINDOWS" /Fp"$(INTDIR)\zlib.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c\
+
+CPP_OBJS=.\Debug/
+CPP_SBRS=.
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\zlib.bsc"
+BSC32_SBRS= \
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\zlib.lib"
+LIB32_OBJS= \
+ "$(INTDIR)\adler32.obj" \
+ "$(INTDIR)\compress.obj" \
+ "$(INTDIR)\crc32.obj" \
+ "$(INTDIR)\deflate.obj" \
+ "$(INTDIR)\gzio.obj" \
+ "$(INTDIR)\infblock.obj" \
+ "$(INTDIR)\infcodes.obj" \
+ "$(INTDIR)\inffast.obj" \
+ "$(INTDIR)\inflate.obj" \
+ "$(INTDIR)\inftrees.obj" \
+ "$(INTDIR)\infutil.obj" \
+ "$(INTDIR)\trees.obj" \
+ "$(INTDIR)\uncompr.obj" \
+ "$(INTDIR)\zutil.obj"
+
+"..\zlib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+
+!IF "$(RECURSE)" == "0"
+
+ALL : "..\zlib.lib"
+
+!ELSE
+
+ALL : "..\zlib.lib"
+
+!ENDIF
+
+CLEAN :
+ -@erase "$(INTDIR)\adler32.obj"
+ -@erase "$(INTDIR)\compress.obj"
+ -@erase "$(INTDIR)\crc32.obj"
+ -@erase "$(INTDIR)\deflate.obj"
+ -@erase "$(INTDIR)\gzio.obj"
+ -@erase "$(INTDIR)\infblock.obj"
+ -@erase "$(INTDIR)\infcodes.obj"
+ -@erase "$(INTDIR)\inffast.obj"
+ -@erase "$(INTDIR)\inflate.obj"
+ -@erase "$(INTDIR)\inftrees.obj"
+ -@erase "$(INTDIR)\infutil.obj"
+ -@erase "$(INTDIR)\trees.obj"
+ -@erase "$(INTDIR)\uncompr.obj"
+ -@erase "$(INTDIR)\vc50.idb"
+ -@erase "$(INTDIR)\zutil.obj"
+ -@erase "..\zlib.lib"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MD /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D\
+ "_WINDOWS" /Fp"$(INTDIR)\zlib.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c\
+
+CPP_OBJS=.\Release/
+CPP_SBRS=.
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\zlib.bsc"
+BSC32_SBRS= \
+
+LIB32=link.exe -lib
+LIB32_FLAGS=/nologo /out:"..\zlib.lib"
+LIB32_OBJS= \
+ "$(INTDIR)\adler32.obj" \
+ "$(INTDIR)\compress.obj" \
+ "$(INTDIR)\crc32.obj" \
+ "$(INTDIR)\deflate.obj" \
+ "$(INTDIR)\gzio.obj" \
+ "$(INTDIR)\infblock.obj" \
+ "$(INTDIR)\infcodes.obj" \
+ "$(INTDIR)\inffast.obj" \
+ "$(INTDIR)\inflate.obj" \
+ "$(INTDIR)\inftrees.obj" \
+ "$(INTDIR)\infutil.obj" \
+ "$(INTDIR)\trees.obj" \
+ "$(INTDIR)\uncompr.obj" \
+ "$(INTDIR)\zutil.obj"
+
+"..\zlib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
+ $(LIB32) @<<
+ $(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_OBJS)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(CPP_SBRS)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+
+!IF "$(CFG)" == "zlib - Win32 Release" || "$(CFG)" == "zlib - Win32 Debug" ||\
+ "$(CFG)" == "zlib - Win32 NASM Debug" || "$(CFG)" ==\
+ "zlib - Win32 NASM Release"
+SOURCE=..\src\adler32.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_ADLER=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\adler32.obj" : $(SOURCE) $(DEP_CPP_ADLER) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_ADLER=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+
+
+"$(INTDIR)\adler32.obj" : $(SOURCE) $(DEP_CPP_ADLER) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_ADLER=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+
+
+"$(INTDIR)\adler32.obj" : $(SOURCE) $(DEP_CPP_ADLER) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_ADLER=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\adler32.obj" : $(SOURCE) $(DEP_CPP_ADLER) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\compress.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_COMPR=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\compress.obj" : $(SOURCE) $(DEP_CPP_COMPR) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_COMPR=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+
+
+"$(INTDIR)\compress.obj" : $(SOURCE) $(DEP_CPP_COMPR) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_COMPR=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+
+
+"$(INTDIR)\compress.obj" : $(SOURCE) $(DEP_CPP_COMPR) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_COMPR=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\compress.obj" : $(SOURCE) $(DEP_CPP_COMPR) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\crc32.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_CRC32=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\crc32.obj" : $(SOURCE) $(DEP_CPP_CRC32) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_CRC32=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+
+
+"$(INTDIR)\crc32.obj" : $(SOURCE) $(DEP_CPP_CRC32) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_CRC32=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+
+
+"$(INTDIR)\crc32.obj" : $(SOURCE) $(DEP_CPP_CRC32) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_CRC32=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\crc32.obj" : $(SOURCE) $(DEP_CPP_CRC32) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\deflate.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_DEFLA=\
+ "..\include\deflate.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\deflate.obj" : $(SOURCE) $(DEP_CPP_DEFLA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_DEFLA=\
+ "..\include\deflate.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\deflate.obj" : $(SOURCE) $(DEP_CPP_DEFLA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_DEFLA=\
+ "..\include\deflate.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\deflate.obj" : $(SOURCE) $(DEP_CPP_DEFLA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_DEFLA=\
+ "..\include\deflate.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\deflate.obj" : $(SOURCE) $(DEP_CPP_DEFLA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\gzio.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_GZIO_=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\gzio.obj" : $(SOURCE) $(DEP_CPP_GZIO_) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_GZIO_=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\gzio.obj" : $(SOURCE) $(DEP_CPP_GZIO_) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_GZIO_=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\gzio.obj" : $(SOURCE) $(DEP_CPP_GZIO_) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_GZIO_=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\gzio.obj" : $(SOURCE) $(DEP_CPP_GZIO_) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\infblock.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_INFBL=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\infblock.obj" : $(SOURCE) $(DEP_CPP_INFBL) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_INFBL=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\infblock.obj" : $(SOURCE) $(DEP_CPP_INFBL) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_INFBL=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\infblock.obj" : $(SOURCE) $(DEP_CPP_INFBL) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_INFBL=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\infblock.obj" : $(SOURCE) $(DEP_CPP_INFBL) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\infcodes.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_INFCO=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inffast.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\infcodes.obj" : $(SOURCE) $(DEP_CPP_INFCO) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_INFCO=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inffast.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\infcodes.obj" : $(SOURCE) $(DEP_CPP_INFCO) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_INFCO=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inffast.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\infcodes.obj" : $(SOURCE) $(DEP_CPP_INFCO) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_INFCO=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inffast.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\infcodes.obj" : $(SOURCE) $(DEP_CPP_INFCO) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\inffast.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_INFFA=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inffast.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\inffast.obj" : $(SOURCE) $(DEP_CPP_INFFA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_INFFA=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inffast.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\inffast.obj" : $(SOURCE) $(DEP_CPP_INFFA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_INFFA=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inffast.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\inffast.obj" : $(SOURCE) $(DEP_CPP_INFFA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_INFFA=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inffast.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\inffast.obj" : $(SOURCE) $(DEP_CPP_INFFA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\inflate.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_INFLA=\
+ "..\include\infblock.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\inflate.obj" : $(SOURCE) $(DEP_CPP_INFLA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_INFLA=\
+ "..\include\infblock.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\inflate.obj" : $(SOURCE) $(DEP_CPP_INFLA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_INFLA=\
+ "..\include\infblock.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\inflate.obj" : $(SOURCE) $(DEP_CPP_INFLA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_INFLA=\
+ "..\include\infblock.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\inflate.obj" : $(SOURCE) $(DEP_CPP_INFLA) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\inftrees.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_INFTR=\
+ "..\include\inffixed.h"\
+ "..\include\inftrees.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\inftrees.obj" : $(SOURCE) $(DEP_CPP_INFTR) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_INFTR=\
+ "..\include\inffixed.h"\
+ "..\include\inftrees.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\inftrees.obj" : $(SOURCE) $(DEP_CPP_INFTR) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_INFTR=\
+ "..\include\inffixed.h"\
+ "..\include\inftrees.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\inftrees.obj" : $(SOURCE) $(DEP_CPP_INFTR) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_INFTR=\
+ "..\include\inffixed.h"\
+ "..\include\inftrees.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\inftrees.obj" : $(SOURCE) $(DEP_CPP_INFTR) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\infutil.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_INFUT=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\infutil.obj" : $(SOURCE) $(DEP_CPP_INFUT) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_INFUT=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\infutil.obj" : $(SOURCE) $(DEP_CPP_INFUT) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_INFUT=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\infutil.obj" : $(SOURCE) $(DEP_CPP_INFUT) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_INFUT=\
+ "..\include\infblock.h"\
+ "..\include\infcodes.h"\
+ "..\include\inftrees.h"\
+ "..\include\infutil.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\infutil.obj" : $(SOURCE) $(DEP_CPP_INFUT) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\trees.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_TREES=\
+ "..\include\deflate.h"\
+ "..\include\trees.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\trees.obj" : $(SOURCE) $(DEP_CPP_TREES) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_TREES=\
+ "..\include\deflate.h"\
+ "..\include\trees.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\trees.obj" : $(SOURCE) $(DEP_CPP_TREES) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_TREES=\
+ "..\include\deflate.h"\
+ "..\include\trees.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\trees.obj" : $(SOURCE) $(DEP_CPP_TREES) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_TREES=\
+ "..\include\deflate.h"\
+ "..\include\trees.h"\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\trees.obj" : $(SOURCE) $(DEP_CPP_TREES) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\uncompr.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_UNCOM=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\uncompr.obj" : $(SOURCE) $(DEP_CPP_UNCOM) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_UNCOM=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+
+
+"$(INTDIR)\uncompr.obj" : $(SOURCE) $(DEP_CPP_UNCOM) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_UNCOM=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+
+
+"$(INTDIR)\uncompr.obj" : $(SOURCE) $(DEP_CPP_UNCOM) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_UNCOM=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\uncompr.obj" : $(SOURCE) $(DEP_CPP_UNCOM) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+SOURCE=..\src\zutil.c
+
+!IF "$(CFG)" == "zlib - Win32 Release"
+
+DEP_CPP_ZUTIL=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\zutil.obj" : $(SOURCE) $(DEP_CPP_ZUTIL) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 Debug"
+
+DEP_CPP_ZUTIL=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\zutil.obj" : $(SOURCE) $(DEP_CPP_ZUTIL) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Debug"
+
+DEP_CPP_ZUTIL=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+
+
+"$(INTDIR)\zutil.obj" : $(SOURCE) $(DEP_CPP_ZUTIL) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ELSEIF "$(CFG)" == "zlib - Win32 NASM Release"
+
+DEP_CPP_ZUTIL=\
+ "..\include\zconf.h"\
+ "..\include\zlib.h"\
+ "..\include\zutil.h"\
+ {$(INCLUDE)}"sys\types.h"\
+
+
+"$(INTDIR)\zutil.obj" : $(SOURCE) $(DEP_CPP_ZUTIL) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+!ENDIF
+
+
+!ENDIF
+
--- /dev/null
+++ b/common/id3lib/zlib/src/.cvsignore
@@ -1,0 +1,2 @@
+.deps
+Makefile
--- /dev/null
+++ b/common/id3lib/zlib/src/Makefile.am
@@ -1,0 +1,37 @@
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+zlib_sources = \
+ adler32.c \
+ compress.c \
+ crc32.c \
+ deflate.c \
+ gzio.c \
+ infblock.c \
+ infcodes.c \
+ inffast.c \
+ inflate.c \
+ inftrees.c \
+ infutil.c \
+ trees.c \
+ uncompr.c \
+ zutil.c
+
+if ID3_NEEDZLIB
+LT_VERSION = 1:0:0
+lib_LTLIBRARIES = libz.la
+INCLUDES = -I$(top_srcdir)/zlib/include
+libz_la_SOURCES = $(zlib_sources)
+else
+LT_VERSION = 0:0:0
+endif
+libz_la_LDFLAGS = -version-info $(LT_VERSION)
+
+EXTRA_DIST = $(zlib_sources)
\ No newline at end of file
--- /dev/null
+++ b/common/id3lib/zlib/src/Makefile.in
@@ -1,0 +1,382 @@
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Copyright (C) 1999 Scott Thomas Haug <sth2@cs.wustl.edu>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ../..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DLLTOOL = @DLLTOOL@
+DOX_DIR_HTML = @DOX_DIR_HTML@
+DOX_DIR_LATEX = @DOX_DIR_LATEX@
+DOX_DIR_MAN = @DOX_DIR_MAN@
+DOX_DIR_RTF = @DOX_DIR_RTF@
+ID3LIB_BINARY_AGE = @ID3LIB_BINARY_AGE@
+ID3LIB_DATE = @ID3LIB_DATE@
+ID3LIB_DEBUG_FLAGS = @ID3LIB_DEBUG_FLAGS@
+ID3LIB_FULLNAME = @ID3LIB_FULLNAME@
+ID3LIB_INTERFACE_AGE = @ID3LIB_INTERFACE_AGE@
+ID3LIB_MAJOR_VERSION = @ID3LIB_MAJOR_VERSION@
+ID3LIB_MINOR_VERSION = @ID3LIB_MINOR_VERSION@
+ID3LIB_NAME = @ID3LIB_NAME@
+ID3LIB_PATCH_VERSION = @ID3LIB_PATCH_VERSION@
+ID3LIB_VERSION = @ID3LIB_VERSION@
+LD = @LD@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LT_AGE = @LT_AGE@
+LT_CURRENT = @LT_CURRENT@
+LT_RELEASE = @LT_RELEASE@
+LT_REVISION = @LT_REVISION@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+NM = @NM@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+
+zlib_sources = adler32.c compress.c crc32.c deflate.c gzio.c infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c trees.c uncompr.c zutil.c
+
+@ID3_NEEDZLIB_TRUE@LT_VERSION = 1:0:0
+@ID3_NEEDZLIB_FALSE@LT_VERSION = 0:0:0
+@ID3_NEEDZLIB_TRUE@lib_LTLIBRARIES = libz.la
+@ID3_NEEDZLIB_TRUE@INCLUDES = -I$(top_srcdir)/zlib/include
+@ID3_NEEDZLIB_TRUE@libz_la_SOURCES = $(zlib_sources)
+libz_la_LDFLAGS = -version-info $(LT_VERSION)
+
+EXTRA_DIST = $(zlib_sources)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../../config.h
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(lib_LTLIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I../..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+libz_la_LIBADD =
+@ID3_NEEDZLIB_TRUE@libz_la_OBJECTS = adler32.lo compress.lo crc32.lo \
+@ID3_NEEDZLIB_TRUE@deflate.lo gzio.lo infblock.lo infcodes.lo \
+@ID3_NEEDZLIB_TRUE@inffast.lo inflate.lo inftrees.lo infutil.lo \
+@ID3_NEEDZLIB_TRUE@trees.lo uncompr.lo zutil.lo
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = gtar
+GZIP_ENV = --best
+DEP_FILES = .deps/adler32.P .deps/compress.P .deps/crc32.P \
+.deps/deflate.P .deps/gzio.P .deps/infblock.P .deps/infcodes.P \
+.deps/inffast.P .deps/inflate.P .deps/inftrees.P .deps/infutil.P \
+.deps/trees.P .deps/uncompr.P .deps/zutil.P
+SOURCES = $(libz_la_SOURCES)
+OBJECTS = $(libz_la_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .lo .o .s
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu zlib/src/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-libLTLIBRARIES:
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+
+distclean-libLTLIBRARIES:
+
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+ done
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+libz.la: $(libz_la_OBJECTS) $(libz_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(libz_la_LDFLAGS) $(libz_la_OBJECTS) $(libz_la_LIBADD) $(LIBS)
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = zlib/src
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu zlib/src/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+ @echo '$(COMPILE) -c $<'; \
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.c
+ @echo '$(LTCOMPILE) -c $<'; \
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-libLTLIBRARIES
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-libLTLIBRARIES
+uninstall: uninstall-am
+all-am: Makefile $(LTLIBRARIES)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \
+ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
+ clean-depend clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-libLTLIBRARIES distclean-compile \
+ distclean-libtool distclean-tags distclean-depend \
+ distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-libLTLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+mostlyclean-libtool distclean-libtool clean-libtool \
+maintainer-clean-libtool tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+++ b/common/id3lib/zlib/src/adler32.c
@@ -1,0 +1,48 @@
+/* adler32.c -- compute the Adler-32 checksum of a data stream
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: adler32.c,v 1.1 2002/01/21 08:16:23 menno Exp $ */
+
+#include "zlib.h"
+
+#define BASE 65521L /* largest prime smaller than 65536 */
+#define NMAX 5552
+/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
+
+#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
+#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
+#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
+#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
+#define DO16(buf) DO8(buf,0); DO8(buf,8);
+
+/* ========================================================================= */
+uLong ZEXPORT adler32(adler, buf, len)
+ uLong adler;
+ const Bytef *buf;
+ uInt len;
+{
+ unsigned long s1 = adler & 0xffff;
+ unsigned long s2 = (adler >> 16) & 0xffff;
+ int k;
+
+ if (buf == Z_NULL) return 1L;
+
+ while (len > 0) {
+ k = len < NMAX ? len : NMAX;
+ len -= k;
+ while (k >= 16) {
+ DO16(buf);
+ buf += 16;
+ k -= 16;
+ }
+ if (k != 0) do {
+ s1 += *buf++;
+ s2 += s1;
+ } while (--k);
+ s1 %= BASE;
+ s2 %= BASE;
+ }
+ return (s2 << 16) | s1;
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/compress.c
@@ -1,0 +1,68 @@
+/* compress.c -- compress a memory buffer
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: compress.c,v 1.1 2002/01/21 08:16:23 menno Exp $ */
+
+#include "zlib.h"
+
+/* ===========================================================================
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+ int level;
+{
+ z_stream stream;
+ int err;
+
+ stream.next_in = (Bytef*)source;
+ stream.avail_in = (uInt)sourceLen;
+#ifdef MAXSEG_64K
+ /* Check for source > 64K on 16-bit machine: */
+ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+#endif
+ stream.next_out = dest;
+ stream.avail_out = (uInt)*destLen;
+ if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
+ stream.opaque = (voidpf)0;
+
+ err = deflateInit(&stream, level);
+ if (err != Z_OK) return err;
+
+ err = deflate(&stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ deflateEnd(&stream);
+ return err == Z_OK ? Z_BUF_ERROR : err;
+ }
+ *destLen = stream.total_out;
+
+ err = deflateEnd(&stream);
+ return err;
+}
+
+/* ===========================================================================
+ */
+int ZEXPORT compress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+{
+ return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/crc32.c
@@ -1,0 +1,162 @@
+/* crc32.c -- compute the CRC-32 of a data stream
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: crc32.c,v 1.1 2002/01/21 08:16:23 menno Exp $ */
+
+#include "zlib.h"
+
+#define local static
+
+#ifdef DYNAMIC_CRC_TABLE
+
+local int crc_table_empty = 1;
+local uLongf crc_table[256];
+local void make_crc_table OF((void));
+
+/*
+ Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
+ x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
+
+ Polynomials over GF(2) are represented in binary, one bit per coefficient,
+ with the lowest powers in the most significant bit. Then adding polynomials
+ is just exclusive-or, and multiplying a polynomial by x is a right shift by
+ one. If we call the above polynomial p, and represent a byte as the
+ polynomial q, also with the lowest power in the most significant bit (so the
+ byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
+ where a mod b means the remainder after dividing a by b.
+
+ This calculation is done using the shift-register method of multiplying and
+ taking the remainder. The register is initialized to zero, and for each
+ incoming bit, x^32 is added mod p to the register if the bit is a one (where
+ x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
+ x (which is shifting right by one and adding x^32 mod p if the bit shifted
+ out is a one). We start with the highest power (least significant bit) of
+ q and repeat for all eight bits of q.
+
+ The table is simply the CRC of all possible eight bit values. This is all
+ the information needed to generate CRC's on data a byte at a time for all
+ combinations of CRC register values and incoming bytes.
+*/
+local void make_crc_table()
+{
+ uLong c;
+ int n, k;
+ uLong poly; /* polynomial exclusive-or pattern */
+ /* terms of polynomial defining this crc (except x^32): */
+ static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+
+ /* make exclusive-or pattern from polynomial (0xedb88320L) */
+ poly = 0L;
+ for (n = 0; n < sizeof(p)/sizeof(Byte); n++)
+ poly |= 1L << (31 - p[n]);
+
+ for (n = 0; n < 256; n++)
+ {
+ c = (uLong)n;
+ for (k = 0; k < 8; k++)
+ c = c & 1 ? poly ^ (c >> 1) : c >> 1;
+ crc_table[n] = c;
+ }
+ crc_table_empty = 0;
+}
+#else
+/* ========================================================================
+ * Table of CRC-32's of all single-byte values (made by make_crc_table)
+ */
+local const uLongf crc_table[256] = {
+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+ 0x2d02ef8dL
+};
+#endif
+
+/* =========================================================================
+ * This function can be used by asm versions of crc32()
+ */
+const uLongf * ZEXPORT get_crc_table()
+{
+#ifdef DYNAMIC_CRC_TABLE
+ if (crc_table_empty) make_crc_table();
+#endif
+ return (const uLongf *)crc_table;
+}
+
+/* ========================================================================= */
+#define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
+#define DO2(buf) DO1(buf); DO1(buf);
+#define DO4(buf) DO2(buf); DO2(buf);
+#define DO8(buf) DO4(buf); DO4(buf);
+
+/* ========================================================================= */
+uLong ZEXPORT crc32(crc, buf, len)
+ uLong crc;
+ const Bytef *buf;
+ uInt len;
+{
+ if (buf == Z_NULL) return 0L;
+#ifdef DYNAMIC_CRC_TABLE
+ if (crc_table_empty)
+ make_crc_table();
+#endif
+ crc = crc ^ 0xffffffffL;
+ while (len >= 8)
+ {
+ DO8(buf);
+ len -= 8;
+ }
+ if (len) do {
+ DO1(buf);
+ } while (--len);
+ return crc ^ 0xffffffffL;
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/deflate.c
@@ -1,0 +1,1350 @@
+/* deflate.c -- compress data using the deflation algorithm
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * ALGORITHM
+ *
+ * The "deflation" process depends on being able to identify portions
+ * of the input text which are identical to earlier input (within a
+ * sliding window trailing behind the input currently being processed).
+ *
+ * The most straightforward technique turns out to be the fastest for
+ * most input files: try all possible matches and select the longest.
+ * The key feature of this algorithm is that insertions into the string
+ * dictionary are very simple and thus fast, and deletions are avoided
+ * completely. Insertions are performed at each input character, whereas
+ * string matches are performed only when the previous match ends. So it
+ * is preferable to spend more time in matches to allow very fast string
+ * insertions and avoid deletions. The matching algorithm for small
+ * strings is inspired from that of Rabin & Karp. A brute force approach
+ * is used to find longer strings when a small match has been found.
+ * A similar algorithm is used in comic (by Jan-Mark Wams) and freeze
+ * (by Leonid Broukhis).
+ * A previous version of this file used a more sophisticated algorithm
+ * (by Fiala and Greene) which is guaranteed to run in linear amortized
+ * time, but has a larger average cost, uses more memory and is patented.
+ * However the F&G algorithm may be faster for some highly redundant
+ * files if the parameter max_chain_length (described below) is too large.
+ *
+ * ACKNOWLEDGEMENTS
+ *
+ * The idea of lazy evaluation of matches is due to Jan-Mark Wams, and
+ * I found it in 'freeze' written by Leonid Broukhis.
+ * Thanks to many people for bug reports and testing.
+ *
+ * REFERENCES
+ *
+ * Deutsch, L.P.,"DEFLATE Compressed Data Format Specification".
+ * Available in ftp://ds.internic.net/rfc/rfc1951.txt
+ *
+ * A description of the Rabin and Karp algorithm is given in the book
+ * "Algorithms" by R. Sedgewick, Addison-Wesley, p252.
+ *
+ * Fiala,E.R., and Greene,D.H.
+ * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595
+ *
+ */
+
+/* @(#) $Id: deflate.c,v 1.1 2002/01/21 08:16:23 menno Exp $ */
+
+#include "deflate.h"
+
+const char deflate_copyright[] =
+ " deflate 1.1.3 Copyright 1995-1998 Jean-loup Gailly ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+
+/* ===========================================================================
+ * Function prototypes.
+ */
+typedef enum {
+ need_more, /* block not completed, need more input or more output */
+ block_done, /* block flush performed */
+ finish_started, /* finish started, need only more output at next deflate */
+ finish_done /* finish done, accept no more input or output */
+} block_state;
+
+typedef block_state (*compress_func) OF((deflate_state *s, int flush));
+/* Compression function. Returns the block state after the call. */
+
+local void fill_window OF((deflate_state *s));
+local block_state deflate_stored OF((deflate_state *s, int flush));
+local block_state deflate_fast OF((deflate_state *s, int flush));
+local block_state deflate_slow OF((deflate_state *s, int flush));
+local void lm_init OF((deflate_state *s));
+local void putShortMSB OF((deflate_state *s, uInt b));
+local void flush_pending OF((z_streamp strm));
+local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
+#ifdef ASMV
+ void match_init OF((void)); /* asm code initialization */
+ uInt longest_match OF((deflate_state *s, IPos cur_match));
+#else
+local uInt longest_match OF((deflate_state *s, IPos cur_match));
+#endif
+
+#ifdef DEBUG
+local void check_match OF((deflate_state *s, IPos start, IPos match,
+ int length));
+#endif
+
+/* ===========================================================================
+ * Local data
+ */
+
+#define NIL 0
+/* Tail of hash chains */
+
+#ifndef TOO_FAR
+# define TOO_FAR 4096
+#endif
+/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
+
+#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
+/* Minimum amount of lookahead, except at the end of the input file.
+ * See deflate.c for comments about the MIN_MATCH+1.
+ */
+
+/* Values for max_lazy_match, good_match and max_chain_length, depending on
+ * the desired pack level (0..9). The values given below have been tuned to
+ * exclude worst case performance for pathological files. Better values may be
+ * found for specific files.
+ */
+typedef struct config_s {
+ ush good_length; /* reduce lazy search above this match length */
+ ush max_lazy; /* do not perform lazy search above this match length */
+ ush nice_length; /* quit search above this match length */
+ ush max_chain;
+ compress_func func;
+} config;
+
+local const config configuration_table[10] = {
+/* good lazy nice chain */
+/* 0 */ {0, 0, 0, 0, deflate_stored}, /* store only */
+/* 1 */ {4, 4, 8, 4, deflate_fast}, /* maximum speed, no lazy matches */
+/* 2 */ {4, 5, 16, 8, deflate_fast},
+/* 3 */ {4, 6, 32, 32, deflate_fast},
+
+/* 4 */ {4, 4, 16, 16, deflate_slow}, /* lazy matches */
+/* 5 */ {8, 16, 32, 32, deflate_slow},
+/* 6 */ {8, 16, 128, 128, deflate_slow},
+/* 7 */ {8, 32, 128, 256, deflate_slow},
+/* 8 */ {32, 128, 258, 1024, deflate_slow},
+/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* maximum compression */
+
+/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4
+ * For deflate_fast() (levels <= 3) good is ignored and lazy has a different
+ * meaning.
+ */
+
+#define EQUAL 0
+/* result of memcmp for equal strings */
+
+struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
+
+/* ===========================================================================
+ * Update a hash value with the given input byte
+ * IN assertion: all calls to to UPDATE_HASH are made with consecutive
+ * input characters, so that a running hash key can be computed from the
+ * previous key instead of complete recalculation each time.
+ */
+#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
+
+
+/* ===========================================================================
+ * Insert string str in the dictionary and set match_head to the previous head
+ * of the hash chain (the most recent string with same hash key). Return
+ * the previous length of the hash chain.
+ * If this file is compiled with -DFASTEST, the compression level is forced
+ * to 1, and no hash chains are maintained.
+ * IN assertion: all calls to to INSERT_STRING are made with consecutive
+ * input characters and the first MIN_MATCH bytes of str are valid
+ * (except for the last MIN_MATCH-1 bytes of the input file).
+ */
+#ifdef FASTEST
+#define INSERT_STRING(s, str, match_head) \
+ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+ match_head = s->head[s->ins_h], \
+ s->head[s->ins_h] = (Pos)(str))
+#else
+#define INSERT_STRING(s, str, match_head) \
+ (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
+ s->prev[(str) & s->w_mask] = match_head = s->head[s->ins_h], \
+ s->head[s->ins_h] = (Pos)(str))
+#endif
+
+/* ===========================================================================
+ * Initialize the hash table (avoiding 64K overflow for 16 bit systems).
+ * prev[] will be initialized on the fly.
+ */
+#define CLEAR_HASH(s) \
+ s->head[s->hash_size-1] = NIL; \
+ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+
+/* ========================================================================= */
+int ZEXPORT deflateInit_(strm, level, version, stream_size)
+ z_streamp strm;
+ int level;
+ const char *version;
+ int stream_size;
+{
+ return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
+ Z_DEFAULT_STRATEGY, version, stream_size);
+ /* To do: ignore strm->next_in if we use it as window */
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
+ version, stream_size)
+ z_streamp strm;
+ int level;
+ int method;
+ int windowBits;
+ int memLevel;
+ int strategy;
+ const char *version;
+ int stream_size;
+{
+ deflate_state *s;
+ int noheader = 0;
+ static const char* my_version = ZLIB_VERSION;
+
+ ushf *overlay;
+ /* We overlay pending_buf and d_buf+l_buf. This works since the average
+ * output size for (length,distance) codes is <= 24 bits.
+ */
+
+ if (version == Z_NULL || version[0] != my_version[0] ||
+ stream_size != sizeof(z_stream)) {
+ return Z_VERSION_ERROR;
+ }
+ if (strm == Z_NULL) return Z_STREAM_ERROR;
+
+ strm->msg = Z_NULL;
+ if (strm->zalloc == Z_NULL) {
+ strm->zalloc = zcalloc;
+ strm->opaque = (voidpf)0;
+ }
+ if (strm->zfree == Z_NULL) strm->zfree = zcfree;
+
+ if (level == Z_DEFAULT_COMPRESSION) level = 6;
+#ifdef FASTEST
+ level = 1;
+#endif
+
+ if (windowBits < 0) { /* undocumented feature: suppress zlib header */
+ noheader = 1;
+ windowBits = -windowBits;
+ }
+ if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
+ windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
+ strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
+ return Z_STREAM_ERROR;
+ }
+ s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
+ if (s == Z_NULL) return Z_MEM_ERROR;
+ strm->state = (struct internal_state FAR *)s;
+ s->strm = strm;
+
+ s->noheader = noheader;
+ s->w_bits = windowBits;
+ s->w_size = 1 << s->w_bits;
+ s->w_mask = s->w_size - 1;
+
+ s->hash_bits = memLevel + 7;
+ s->hash_size = 1 << s->hash_bits;
+ s->hash_mask = s->hash_size - 1;
+ s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
+
+ s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
+ s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
+ s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
+
+ s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
+
+ overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
+ s->pending_buf = (uchf *) overlay;
+ s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
+
+ if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
+ s->pending_buf == Z_NULL) {
+ strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
+ deflateEnd (strm);
+ return Z_MEM_ERROR;
+ }
+ s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
+ s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
+
+ s->level = level;
+ s->strategy = strategy;
+ s->method = (Byte)method;
+
+ return deflateReset(strm);
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
+ z_streamp strm;
+ const Bytef *dictionary;
+ uInt dictLength;
+{
+ deflate_state *s;
+ uInt length = dictLength;
+ uInt n;
+ IPos hash_head = 0;
+
+ if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL ||
+ strm->state->status != INIT_STATE) return Z_STREAM_ERROR;
+
+ s = strm->state;
+ strm->adler = adler32(strm->adler, dictionary, dictLength);
+
+ if (length < MIN_MATCH) return Z_OK;
+ if (length > MAX_DIST(s)) {
+ length = MAX_DIST(s);
+#ifndef USE_DICT_HEAD
+ dictionary += dictLength - length; /* use the tail of the dictionary */
+#endif
+ }
+ zmemcpy(s->window, dictionary, length);
+ s->strstart = length;
+ s->block_start = (long)length;
+
+ /* Insert all strings in the hash table (except for the last two bytes).
+ * s->lookahead stays null, so s->ins_h will be recomputed at the next
+ * call of fill_window.
+ */
+ s->ins_h = s->window[0];
+ UPDATE_HASH(s, s->ins_h, s->window[1]);
+ for (n = 0; n <= length - MIN_MATCH; n++) {
+ INSERT_STRING(s, n, hash_head);
+ }
+ if (hash_head) hash_head = 0; /* to make compiler happy */
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateReset (strm)
+ z_streamp strm;
+{
+ deflate_state *s;
+
+ if (strm == Z_NULL || strm->state == Z_NULL ||
+ strm->zalloc == Z_NULL || strm->zfree == Z_NULL) return Z_STREAM_ERROR;
+
+ strm->total_in = strm->total_out = 0;
+ strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
+ strm->data_type = Z_UNKNOWN;
+
+ s = (deflate_state *)strm->state;
+ s->pending = 0;
+ s->pending_out = s->pending_buf;
+
+ if (s->noheader < 0) {
+ s->noheader = 0; /* was set to -1 by deflate(..., Z_FINISH); */
+ }
+ s->status = s->noheader ? BUSY_STATE : INIT_STATE;
+ strm->adler = 1;
+ s->last_flush = Z_NO_FLUSH;
+
+ _tr_init(s);
+ lm_init(s);
+
+ return Z_OK;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateParams(strm, level, strategy)
+ z_streamp strm;
+ int level;
+ int strategy;
+{
+ deflate_state *s;
+ compress_func func;
+ int err = Z_OK;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+ s = strm->state;
+
+ if (level == Z_DEFAULT_COMPRESSION) {
+ level = 6;
+ }
+ if (level < 0 || level > 9 || strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
+ return Z_STREAM_ERROR;
+ }
+ func = configuration_table[s->level].func;
+
+ if (func != configuration_table[level].func && strm->total_in != 0) {
+ /* Flush the last buffer: */
+ err = deflate(strm, Z_PARTIAL_FLUSH);
+ }
+ if (s->level != level) {
+ s->level = level;
+ s->max_lazy_match = configuration_table[level].max_lazy;
+ s->good_match = configuration_table[level].good_length;
+ s->nice_match = configuration_table[level].nice_length;
+ s->max_chain_length = configuration_table[level].max_chain;
+ }
+ s->strategy = strategy;
+ return err;
+}
+
+/* =========================================================================
+ * Put a short in the pending buffer. The 16-bit value is put in MSB order.
+ * IN assertion: the stream state is correct and there is enough room in
+ * pending_buf.
+ */
+local void putShortMSB (s, b)
+ deflate_state *s;
+ uInt b;
+{
+ put_byte(s, (Byte)(b >> 8));
+ put_byte(s, (Byte)(b & 0xff));
+}
+
+/* =========================================================================
+ * Flush as much pending output as possible. All deflate() output goes
+ * through this function so some applications may wish to modify it
+ * to avoid allocating a large strm->next_out buffer and copying into it.
+ * (See also read_buf()).
+ */
+local void flush_pending(strm)
+ z_streamp strm;
+{
+ unsigned len = strm->state->pending;
+
+ if (len > strm->avail_out) len = strm->avail_out;
+ if (len == 0) return;
+
+ zmemcpy(strm->next_out, strm->state->pending_out, len);
+ strm->next_out += len;
+ strm->state->pending_out += len;
+ strm->total_out += len;
+ strm->avail_out -= len;
+ strm->state->pending -= len;
+ if (strm->state->pending == 0) {
+ strm->state->pending_out = strm->state->pending_buf;
+ }
+}
+
+/* ========================================================================= */
+int ZEXPORT deflate (strm, flush)
+ z_streamp strm;
+ int flush;
+{
+ int old_flush; /* value of flush param for previous deflate call */
+ deflate_state *s;
+
+ if (strm == Z_NULL || strm->state == Z_NULL ||
+ flush > Z_FINISH || flush < 0) {
+ return Z_STREAM_ERROR;
+ }
+ s = strm->state;
+
+ if (strm->next_out == Z_NULL ||
+ (strm->next_in == Z_NULL && strm->avail_in != 0) ||
+ (s->status == FINISH_STATE && flush != Z_FINISH)) {
+ ERR_RETURN(strm, Z_STREAM_ERROR);
+ }
+ if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
+
+ s->strm = strm; /* just in case */
+ old_flush = s->last_flush;
+ s->last_flush = flush;
+
+ /* Write the zlib header */
+ if (s->status == INIT_STATE) {
+
+ uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
+ uInt level_flags = (s->level-1) >> 1;
+
+ if (level_flags > 3) level_flags = 3;
+ header |= (level_flags << 6);
+ if (s->strstart != 0) header |= PRESET_DICT;
+ header += 31 - (header % 31);
+
+ s->status = BUSY_STATE;
+ putShortMSB(s, header);
+
+ /* Save the adler32 of the preset dictionary: */
+ if (s->strstart != 0) {
+ putShortMSB(s, (uInt)(strm->adler >> 16));
+ putShortMSB(s, (uInt)(strm->adler & 0xffff));
+ }
+ strm->adler = 1L;
+ }
+
+ /* Flush as much pending output as possible */
+ if (s->pending != 0) {
+ flush_pending(strm);
+ if (strm->avail_out == 0) {
+ /* Since avail_out is 0, deflate will be called again with
+ * more output space, but possibly with both pending and
+ * avail_in equal to zero. There won't be anything to do,
+ * but this is not an error situation so make sure we
+ * return OK instead of BUF_ERROR at next call of deflate:
+ */
+ s->last_flush = -1;
+ return Z_OK;
+ }
+
+ /* Make sure there is something to do and avoid duplicate consecutive
+ * flushes. For repeated and useless calls with Z_FINISH, we keep
+ * returning Z_STREAM_END instead of Z_BUFF_ERROR.
+ */
+ } else if (strm->avail_in == 0 && flush <= old_flush &&
+ flush != Z_FINISH) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
+
+ /* User must not provide more input after the first FINISH: */
+ if (s->status == FINISH_STATE && strm->avail_in != 0) {
+ ERR_RETURN(strm, Z_BUF_ERROR);
+ }
+
+ /* Start a new block or continue the current one.
+ */
+ if (strm->avail_in != 0 || s->lookahead != 0 ||
+ (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
+ block_state bstate;
+
+ bstate = (*(configuration_table[s->level].func))(s, flush);
+
+ if (bstate == finish_started || bstate == finish_done) {
+ s->status = FINISH_STATE;
+ }
+ if (bstate == need_more || bstate == finish_started) {
+ if (strm->avail_out == 0) {
+ s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
+ }
+ return Z_OK;
+ /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
+ * of deflate should use the same flush parameter to make sure
+ * that the flush is complete. So we don't have to output an
+ * empty block here, this will be done at next call. This also
+ * ensures that for a very small output buffer, we emit at most
+ * one empty block.
+ */
+ }
+ if (bstate == block_done) {
+ if (flush == Z_PARTIAL_FLUSH) {
+ _tr_align(s);
+ } else { /* FULL_FLUSH or SYNC_FLUSH */
+ _tr_stored_block(s, (char*)0, 0L, 0);
+ /* For a full flush, this empty block will be recognized
+ * as a special marker by inflate_sync().
+ */
+ if (flush == Z_FULL_FLUSH) {
+ CLEAR_HASH(s); /* forget history */
+ }
+ }
+ flush_pending(strm);
+ if (strm->avail_out == 0) {
+ s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
+ return Z_OK;
+ }
+ }
+ }
+ Assert(strm->avail_out > 0, "bug2");
+
+ if (flush != Z_FINISH) return Z_OK;
+ if (s->noheader) return Z_STREAM_END;
+
+ /* Write the zlib trailer (adler32) */
+ putShortMSB(s, (uInt)(strm->adler >> 16));
+ putShortMSB(s, (uInt)(strm->adler & 0xffff));
+ flush_pending(strm);
+ /* If avail_out is zero, the application will call deflate again
+ * to flush the rest.
+ */
+ s->noheader = -1; /* write the trailer only once! */
+ return s->pending != 0 ? Z_OK : Z_STREAM_END;
+}
+
+/* ========================================================================= */
+int ZEXPORT deflateEnd (strm)
+ z_streamp strm;
+{
+ int status;
+
+ if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+
+ status = strm->state->status;
+ if (status != INIT_STATE && status != BUSY_STATE &&
+ status != FINISH_STATE) {
+ return Z_STREAM_ERROR;
+ }
+
+ /* Deallocate in reverse order of allocations: */
+ TRY_FREE(strm, strm->state->pending_buf);
+ TRY_FREE(strm, strm->state->head);
+ TRY_FREE(strm, strm->state->prev);
+ TRY_FREE(strm, strm->state->window);
+
+ ZFREE(strm, strm->state);
+ strm->state = Z_NULL;
+
+ return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
+}
+
+/* =========================================================================
+ * Copy the source state to the destination state.
+ * To simplify the source, this is not supported for 16-bit MSDOS (which
+ * doesn't have enough memory anyway to duplicate compression states).
+ */
+int ZEXPORT deflateCopy (dest, source)
+ z_streamp dest;
+ z_streamp source;
+{
+#ifdef MAXSEG_64K
+ return Z_STREAM_ERROR;
+#else
+ deflate_state *ds;
+ deflate_state *ss;
+ ushf *overlay;
+
+
+ if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {
+ return Z_STREAM_ERROR;
+ }
+
+ ss = source->state;
+
+ *dest = *source;
+
+ ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));
+ if (ds == Z_NULL) return Z_MEM_ERROR;
+ dest->state = (struct internal_state FAR *) ds;
+ *ds = *ss;
+ ds->strm = dest;
+
+ ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
+ ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
+ ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
+ overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);
+ ds->pending_buf = (uchf *) overlay;
+
+ if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
+ ds->pending_buf == Z_NULL) {
+ deflateEnd (dest);
+ return Z_MEM_ERROR;
+ }
+ /* following zmemcpy do not work for 16-bit MSDOS */
+ zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
+ zmemcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
+ zmemcpy(ds->head, ss->head, ds->hash_size * sizeof(Pos));
+ zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
+
+ ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
+ ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);
+ ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
+
+ ds->l_desc.dyn_tree = ds->dyn_ltree;
+ ds->d_desc.dyn_tree = ds->dyn_dtree;
+ ds->bl_desc.dyn_tree = ds->bl_tree;
+
+ return Z_OK;
+#endif
+}
+
+/* ===========================================================================
+ * Read a new buffer from the current input stream, update the adler32
+ * and total number of bytes read. All deflate() input goes through
+ * this function so some applications may wish to modify it to avoid
+ * allocating a large strm->next_in buffer and copying from it.
+ * (See also flush_pending()).
+ */
+local int read_buf(strm, buf, size)
+ z_streamp strm;
+ Bytef *buf;
+ unsigned size;
+{
+ unsigned len = strm->avail_in;
+
+ if (len > size) len = size;
+ if (len == 0) return 0;
+
+ strm->avail_in -= len;
+
+ if (!strm->state->noheader) {
+ strm->adler = adler32(strm->adler, strm->next_in, len);
+ }
+ zmemcpy(buf, strm->next_in, len);
+ strm->next_in += len;
+ strm->total_in += len;
+
+ return (int)len;
+}
+
+/* ===========================================================================
+ * Initialize the "longest match" routines for a new zlib stream
+ */
+local void lm_init (s)
+ deflate_state *s;
+{
+ s->window_size = (ulg)2L*s->w_size;
+
+ CLEAR_HASH(s);
+
+ /* Set the default configuration parameters:
+ */
+ s->max_lazy_match = configuration_table[s->level].max_lazy;
+ s->good_match = configuration_table[s->level].good_length;
+ s->nice_match = configuration_table[s->level].nice_length;
+ s->max_chain_length = configuration_table[s->level].max_chain;
+
+ s->strstart = 0;
+ s->block_start = 0L;
+ s->lookahead = 0;
+ s->match_length = s->prev_length = MIN_MATCH-1;
+ s->match_available = 0;
+ s->ins_h = 0;
+#ifdef ASMV
+ match_init(); /* initialize the asm code */
+#endif
+}
+
+/* ===========================================================================
+ * Set match_start to the longest match starting at the given string and
+ * return its length. Matches shorter or equal to prev_length are discarded,
+ * in which case the result is equal to prev_length and match_start is
+ * garbage.
+ * IN assertions: cur_match is the head of the hash chain for the current
+ * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
+ * OUT assertion: the match length is not greater than s->lookahead.
+ */
+#ifndef ASMV
+/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
+ * match.S. The code will be functionally equivalent.
+ */
+#ifndef FASTEST
+local uInt longest_match(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ unsigned chain_length = s->max_chain_length;/* max hash chain length */
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ int best_len = s->prev_length; /* best match length so far */
+ int nice_match = s->nice_match; /* stop if match long enough */
+ IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
+ s->strstart - (IPos)MAX_DIST(s) : NIL;
+ /* Stop when cur_match becomes <= limit. To simplify the code,
+ * we prevent matches with the string of window index 0.
+ */
+ Posf *prev = s->prev;
+ uInt wmask = s->w_mask;
+
+#ifdef UNALIGNED_OK
+ /* Compare two bytes at a time. Note: this is not always beneficial.
+ * Try with and without -DUNALIGNED_OK to check.
+ */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
+ register ush scan_start = *(ushf*)scan;
+ register ush scan_end = *(ushf*)(scan+best_len-1);
+#else
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+ register Byte scan_end1 = scan[best_len-1];
+ register Byte scan_end = scan[best_len];
+#endif
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ /* Do not waste too much time if we already have a good match: */
+ if (s->prev_length >= s->good_match) {
+ chain_length >>= 2;
+ }
+ /* Do not look for matches beyond the end of the input. This is necessary
+ * to make deflate deterministic.
+ */
+ if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ do {
+ Assert(cur_match < s->strstart, "no future");
+ match = s->window + cur_match;
+
+ /* Skip to next match if the match length cannot increase
+ * or if the match length is less than 2:
+ */
+#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
+ /* This code assumes sizeof(unsigned short) == 2. Do not use
+ * UNALIGNED_OK if your compiler uses a different size.
+ */
+ if (*(ushf*)(match+best_len-1) != scan_end ||
+ *(ushf*)match != scan_start) continue;
+
+ /* It is not necessary to compare scan[2] and match[2] since they are
+ * always equal when the other bytes match, given that the hash keys
+ * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
+ * strstart+3, +5, ... up to strstart+257. We check for insufficient
+ * lookahead only every 4th comparison; the 128th check will be made
+ * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+ * necessary to put more guard bytes at the end of the window, or
+ * to check more often for insufficient lookahead.
+ */
+ Assert(scan[2] == match[2], "scan[2]?");
+ scan++, match++;
+ do {
+ } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ scan < strend);
+ /* The funny "do {}" generates better code on most compilers */
+
+ /* Here, scan <= window+strstart+257 */
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+ if (*scan == *match) scan++;
+
+ len = (MAX_MATCH - 1) - (int)(strend-scan);
+ scan = strend - (MAX_MATCH-1);
+
+#else /* UNALIGNED_OK */
+
+ if (match[best_len] != scan_end ||
+ match[best_len-1] != scan_end1 ||
+ *match != *scan ||
+ *++match != scan[1]) continue;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match++;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+ scan = strend - MAX_MATCH;
+
+#endif /* UNALIGNED_OK */
+
+ if (len > best_len) {
+ s->match_start = cur_match;
+ best_len = len;
+ if (len >= nice_match) break;
+#ifdef UNALIGNED_OK
+ scan_end = *(ushf*)(scan+best_len-1);
+#else
+ scan_end1 = scan[best_len-1];
+ scan_end = scan[best_len];
+#endif
+ }
+ } while ((cur_match = prev[cur_match & wmask]) > limit
+ && --chain_length != 0);
+
+ if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
+ return s->lookahead;
+}
+
+#else /* FASTEST */
+/* ---------------------------------------------------------------------------
+ * Optimized version for level == 1 only
+ */
+local uInt longest_match(s, cur_match)
+ deflate_state *s;
+ IPos cur_match; /* current match */
+{
+ register Bytef *scan = s->window + s->strstart; /* current string */
+ register Bytef *match; /* matched string */
+ register int len; /* length of current match */
+ register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+
+ /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
+ * It is easy to get rid of this optimization if necessary.
+ */
+ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
+
+ Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+
+ Assert(cur_match < s->strstart, "no future");
+
+ match = s->window + cur_match;
+
+ /* Return failure if the match length is less than 2:
+ */
+ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
+
+ /* The check at best_len-1 can be removed because it will be made
+ * again later. (This heuristic is not always a win.)
+ * It is not necessary to compare scan[2] and match[2] since they
+ * are always equal when the other bytes match, given that
+ * the hash keys are equal and that HASH_BITS >= 8.
+ */
+ scan += 2, match += 2;
+ Assert(*scan == *match, "match[2]?");
+
+ /* We check for insufficient lookahead only every 8th comparison;
+ * the 256th check will be made at strstart+258.
+ */
+ do {
+ } while (*++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ *++scan == *++match && *++scan == *++match &&
+ scan < strend);
+
+ Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+
+ len = MAX_MATCH - (int)(strend - scan);
+
+ if (len < MIN_MATCH) return MIN_MATCH - 1;
+
+ s->match_start = cur_match;
+ return len <= s->lookahead ? len : s->lookahead;
+}
+#endif /* FASTEST */
+#endif /* ASMV */
+
+#ifdef DEBUG
+/* ===========================================================================
+ * Check that the match at match_start is indeed a match.
+ */
+local void check_match(s, start, match, length)
+ deflate_state *s;
+ IPos start, match;
+ int length;
+{
+ /* check that the match is indeed a match */
+ if (zmemcmp(s->window + match,
+ s->window + start, length) != EQUAL) {
+ fprintf(stderr, " start %u, match %u, length %d\n",
+ start, match, length);
+ do {
+ fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
+ } while (--length != 0);
+ z_error("invalid match");
+ }
+ if (z_verbose > 1) {
+ fprintf(stderr,"\\[%d,%d]", start-match, length);
+ do { putc(s->window[start++], stderr); } while (--length != 0);
+ }
+}
+#else
+# define check_match(s, start, match, length)
+#endif
+
+/* ===========================================================================
+ * Fill the window when the lookahead becomes insufficient.
+ * Updates strstart and lookahead.
+ *
+ * IN assertion: lookahead < MIN_LOOKAHEAD
+ * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
+ * At least one byte has been read, or avail_in == 0; reads are
+ * performed for at least two bytes (required for the zip translate_eol
+ * option -- not supported here).
+ */
+local void fill_window(s)
+ deflate_state *s;
+{
+ register unsigned n, m;
+ register Posf *p;
+ unsigned more; /* Amount of free space at the end of the window. */
+ uInt wsize = s->w_size;
+
+ do {
+ more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
+
+ /* Deal with !@#$% 64K limit: */
+ if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
+ more = wsize;
+
+ } else if (more == (unsigned)(-1)) {
+ /* Very unlikely, but possible on 16 bit machine if strstart == 0
+ * and lookahead == 1 (input done one byte at time)
+ */
+ more--;
+
+ /* If the window is almost full and there is insufficient lookahead,
+ * move the upper half to the lower one to make room in the upper half.
+ */
+ } else if (s->strstart >= wsize+MAX_DIST(s)) {
+
+ zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
+ s->match_start -= wsize;
+ s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
+ s->block_start -= (long) wsize;
+
+ /* Slide the hash table (could be avoided with 32 bit values
+ at the expense of memory usage). We slide even when level == 0
+ to keep the hash table consistent if we switch back to level > 0
+ later. (Using level 0 permanently is not an optimal usage of
+ zlib, so we don't care about this pathological case.)
+ */
+ n = s->hash_size;
+ p = &s->head[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ } while (--n);
+
+ n = wsize;
+#ifndef FASTEST
+ p = &s->prev[n];
+ do {
+ m = *--p;
+ *p = (Pos)(m >= wsize ? m-wsize : NIL);
+ /* If n is not on any hash chain, prev[n] is garbage but
+ * its value will never be used.
+ */
+ } while (--n);
+#endif
+ more += wsize;
+ }
+ if (s->strm->avail_in == 0) return;
+
+ /* If there was no sliding:
+ * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
+ * more == window_size - lookahead - strstart
+ * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
+ * => more >= window_size - 2*WSIZE + 2
+ * In the BIG_MEM or MMAP case (not yet supported),
+ * window_size == input_size + MIN_LOOKAHEAD &&
+ * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
+ * Otherwise, window_size == 2*WSIZE so more >= 2.
+ * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
+ */
+ Assert(more >= 2, "more < 2");
+
+ n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
+ s->lookahead += n;
+
+ /* Initialize the hash value now that we have some input: */
+ if (s->lookahead >= MIN_MATCH) {
+ s->ins_h = s->window[s->strstart];
+ UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+#if MIN_MATCH != 3
+ Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+ }
+ /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
+ * but this is not important since only literal bytes will be emitted.
+ */
+
+ } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
+}
+
+/* ===========================================================================
+ * Flush the current block, with given end-of-file flag.
+ * IN assertion: strstart is set to the end of the current match.
+ */
+#define FLUSH_BLOCK_ONLY(s, eof) { \
+ _tr_flush_block(s, (s->block_start >= 0L ? \
+ (charf *)&s->window[(unsigned)s->block_start] : \
+ (charf *)Z_NULL), \
+ (ulg)((long)s->strstart - s->block_start), \
+ (eof)); \
+ s->block_start = s->strstart; \
+ flush_pending(s->strm); \
+ Tracev((stderr,"[FLUSH]")); \
+}
+
+/* Same but force premature exit if necessary. */
+#define FLUSH_BLOCK(s, eof) { \
+ FLUSH_BLOCK_ONLY(s, eof); \
+ if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
+}
+
+/* ===========================================================================
+ * Copy without compression as much as possible from the input stream, return
+ * the current block state.
+ * This function does not insert new strings in the dictionary since
+ * uncompressible data is probably not useful. This function is used
+ * only for the level=0 compression option.
+ * NOTE: this function should be optimized to avoid extra copying from
+ * window to pending_buf.
+ */
+local block_state deflate_stored(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
+ * to pending_buf_size, and each stored block has a 5 byte header:
+ */
+ ulg max_block_size = 0xffff;
+ ulg max_start;
+
+ if (max_block_size > s->pending_buf_size - 5) {
+ max_block_size = s->pending_buf_size - 5;
+ }
+
+ /* Copy as much as possible from input to output: */
+ for (;;) {
+ /* Fill the window as much as possible: */
+ if (s->lookahead <= 1) {
+
+ Assert(s->strstart < s->w_size+MAX_DIST(s) ||
+ s->block_start >= (long)s->w_size, "slide too late");
+
+ fill_window(s);
+ if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
+
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+ Assert(s->block_start >= 0L, "block gone");
+
+ s->strstart += s->lookahead;
+ s->lookahead = 0;
+
+ /* Emit a stored block if pending_buf will be full: */
+ max_start = s->block_start + max_block_size;
+ if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
+ /* strstart == 0 is possible when wraparound on 16-bit machine */
+ s->lookahead = (uInt)(s->strstart - max_start);
+ s->strstart = (uInt)max_start;
+ FLUSH_BLOCK(s, 0);
+ }
+ /* Flush if we may have to slide, otherwise block_start may become
+ * negative and the data will be gone:
+ */
+ if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
+ FLUSH_BLOCK(s, 0);
+ }
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
+
+/* ===========================================================================
+ * Compress as much as possible from the input stream, return the current
+ * block state.
+ * This function does not perform lazy evaluation of matches and inserts
+ * new strings in the dictionary only for unmatched strings or for short
+ * matches. It is used only for the fast compression options.
+ */
+local block_state deflate_fast(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ IPos hash_head = NIL; /* head of the hash chain */
+ int bflush; /* set if current block must be flushed */
+
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s->lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ if (s->lookahead >= MIN_MATCH) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ * At this point we have always match_length < MIN_MATCH
+ */
+ if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ if (s->strategy != Z_HUFFMAN_ONLY) {
+ s->match_length = longest_match (s, hash_head);
+ }
+ /* longest_match() sets match_start */
+ }
+ if (s->match_length >= MIN_MATCH) {
+ check_match(s, s->strstart, s->match_start, s->match_length);
+
+ _tr_tally_dist(s, s->strstart - s->match_start,
+ s->match_length - MIN_MATCH, bflush);
+
+ s->lookahead -= s->match_length;
+
+ /* Insert new strings in the hash table only if the match length
+ * is not too large. This saves time but degrades compression.
+ */
+#ifndef FASTEST
+ if (s->match_length <= s->max_insert_length &&
+ s->lookahead >= MIN_MATCH) {
+ s->match_length--; /* string at strstart already in hash table */
+ do {
+ s->strstart++;
+ INSERT_STRING(s, s->strstart, hash_head);
+ /* strstart never exceeds WSIZE-MAX_MATCH, so there are
+ * always MIN_MATCH bytes ahead.
+ */
+ } while (--s->match_length != 0);
+ s->strstart++;
+ } else
+#endif
+ {
+ s->strstart += s->match_length;
+ s->match_length = 0;
+ s->ins_h = s->window[s->strstart];
+ UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+#if MIN_MATCH != 3
+ Call UPDATE_HASH() MIN_MATCH-3 more times
+#endif
+ /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
+ * matter since it will be recomputed at next deflate call.
+ */
+ }
+ } else {
+ /* No match, output a literal byte */
+ Tracevv((stderr,"%c", s->window[s->strstart]));
+ _tr_tally_lit (s, s->window[s->strstart], bflush);
+ s->lookahead--;
+ s->strstart++;
+ }
+ if (bflush) FLUSH_BLOCK(s, 0);
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
+
+/* ===========================================================================
+ * Same as above, but achieves better compression. We use a lazy
+ * evaluation for matches: a match is finally adopted only if there is
+ * no better match at the next window position.
+ */
+local block_state deflate_slow(s, flush)
+ deflate_state *s;
+ int flush;
+{
+ IPos hash_head = NIL; /* head of hash chain */
+ int bflush; /* set if current block must be flushed */
+
+ /* Process the input block. */
+ for (;;) {
+ /* Make sure that we always have enough lookahead, except
+ * at the end of the input file. We need MAX_MATCH bytes
+ * for the next match, plus MIN_MATCH bytes to insert the
+ * string following the next match.
+ */
+ if (s->lookahead < MIN_LOOKAHEAD) {
+ fill_window(s);
+ if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return need_more;
+ }
+ if (s->lookahead == 0) break; /* flush the current block */
+ }
+
+ /* Insert the string window[strstart .. strstart+2] in the
+ * dictionary, and set hash_head to the head of the hash chain:
+ */
+ if (s->lookahead >= MIN_MATCH) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+
+ /* Find the longest match, discarding those <= prev_length.
+ */
+ s->prev_length = s->match_length, s->prev_match = s->match_start;
+ s->match_length = MIN_MATCH-1;
+
+ if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
+ s->strstart - hash_head <= MAX_DIST(s)) {
+ /* To simplify the code, we prevent matches with the string
+ * of window index 0 (in particular we have to avoid a match
+ * of the string with itself at the start of the input file).
+ */
+ if (s->strategy != Z_HUFFMAN_ONLY) {
+ s->match_length = longest_match (s, hash_head);
+ }
+ /* longest_match() sets match_start */
+
+ if (s->match_length <= 5 && (s->strategy == Z_FILTERED ||
+ (s->match_length == MIN_MATCH &&
+ s->strstart - s->match_start > TOO_FAR))) {
+
+ /* If prev_match is also MIN_MATCH, match_start is garbage
+ * but we will ignore the current match anyway.
+ */
+ s->match_length = MIN_MATCH-1;
+ }
+ }
+ /* If there was a match at the previous step and the current
+ * match is not better, output the previous match:
+ */
+ if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
+ uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
+ /* Do not insert strings in hash table beyond this. */
+
+ check_match(s, s->strstart-1, s->prev_match, s->prev_length);
+
+ _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+ s->prev_length - MIN_MATCH, bflush);
+
+ /* Insert in hash table all strings up to the end of the match.
+ * strstart-1 and strstart are already inserted. If there is not
+ * enough lookahead, the last two strings are not inserted in
+ * the hash table.
+ */
+ s->lookahead -= s->prev_length-1;
+ s->prev_length -= 2;
+ do {
+ if (++s->strstart <= max_insert) {
+ INSERT_STRING(s, s->strstart, hash_head);
+ }
+ } while (--s->prev_length != 0);
+ s->match_available = 0;
+ s->match_length = MIN_MATCH-1;
+ s->strstart++;
+
+ if (bflush) FLUSH_BLOCK(s, 0);
+
+ } else if (s->match_available) {
+ /* If there was no match at the previous position, output a
+ * single literal. If there was a match but the current match
+ * is longer, truncate the previous match to a single literal.
+ */
+ Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ if (bflush) {
+ FLUSH_BLOCK_ONLY(s, 0);
+ }
+ s->strstart++;
+ s->lookahead--;
+ if (s->strm->avail_out == 0) return need_more;
+ } else {
+ /* There is no previous match to compare with, wait for
+ * the next step to decide.
+ */
+ s->match_available = 1;
+ s->strstart++;
+ s->lookahead--;
+ }
+ }
+ Assert (flush != Z_NO_FLUSH, "no flush?");
+ if (s->match_available) {
+ Tracevv((stderr,"%c", s->window[s->strstart-1]));
+ _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+ s->match_available = 0;
+ }
+ FLUSH_BLOCK(s, flush == Z_FINISH);
+ return flush == Z_FINISH ? finish_done : block_done;
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/gzio.c
@@ -1,0 +1,875 @@
+/* gzio.c -- IO on .gz files
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * Compile this file with -DNO_DEFLATE to avoid the compression code.
+ */
+
+/* @(#) $Id: gzio.c,v 1.1 2002/01/21 08:16:23 menno Exp $ */
+
+#include <stdio.h>
+
+#include "zutil.h"
+
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+#ifndef Z_BUFSIZE
+# ifdef MAXSEG_64K
+# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */
+# else
+# define Z_BUFSIZE 16384
+# endif
+#endif
+#ifndef Z_PRINTF_BUFSIZE
+# define Z_PRINTF_BUFSIZE 4096
+#endif
+
+#define ALLOC(size) malloc(size)
+#define TRYFREE(p) {if (p) free(p);}
+
+static int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
+
+/* gzip flag byte */
+#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */
+#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */
+#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
+#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
+#define COMMENT 0x10 /* bit 4 set: file comment present */
+#define RESERVED 0xE0 /* bits 5..7: reserved */
+
+typedef struct gz_stream {
+ z_stream stream;
+ int z_err; /* error code for last stream operation */
+ int z_eof; /* set if end of input file */
+ FILE *file; /* .gz file */
+ Byte *inbuf; /* input buffer */
+ Byte *outbuf; /* output buffer */
+ uLong crc; /* crc32 of uncompressed data */
+ char *msg; /* error message */
+ char *path; /* path name for debugging only */
+ int transparent; /* 1 if input file is not a .gz file */
+ char mode; /* 'w' or 'r' */
+ long startpos; /* start of compressed data in file (header skipped) */
+} gz_stream;
+
+
+local gzFile gz_open OF((const char *path, const char *mode, int fd));
+local int do_flush OF((gzFile file, int flush));
+local int get_byte OF((gz_stream *s));
+local void check_header OF((gz_stream *s));
+local int destroy OF((gz_stream *s));
+local void putLong OF((FILE *file, uLong x));
+local uLong getLong OF((gz_stream *s));
+
+/* ===========================================================================
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb"). The file is given either by file descriptor
+ or path name (if fd == -1).
+ gz_open return NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR).
+*/
+local gzFile gz_open (path, mode, fd)
+ const char *path;
+ const char *mode;
+ int fd;
+{
+ int err;
+ int level = Z_DEFAULT_COMPRESSION; /* compression level */
+ int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */
+ char *p = (char*)mode;
+ gz_stream *s;
+ char fmode[80]; /* copy of mode, without the compression level */
+ char *m = fmode;
+
+ if (!path || !mode) return Z_NULL;
+
+ s = (gz_stream *)ALLOC(sizeof(gz_stream));
+ if (!s) return Z_NULL;
+
+ s->stream.zalloc = (alloc_func)0;
+ s->stream.zfree = (free_func)0;
+ s->stream.opaque = (voidpf)0;
+ s->stream.next_in = s->inbuf = Z_NULL;
+ s->stream.next_out = s->outbuf = Z_NULL;
+ s->stream.avail_in = s->stream.avail_out = 0;
+ s->file = NULL;
+ s->z_err = Z_OK;
+ s->z_eof = 0;
+ s->crc = crc32(0L, Z_NULL, 0);
+ s->msg = NULL;
+ s->transparent = 0;
+
+ s->path = (char*)ALLOC(strlen(path)+1);
+ if (s->path == NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ strcpy(s->path, path); /* do this early for debugging */
+
+ s->mode = '\0';
+ do {
+ if (*p == 'r') s->mode = 'r';
+ if (*p == 'w' || *p == 'a') s->mode = 'w';
+ if (*p >= '0' && *p <= '9') {
+ level = *p - '0';
+ } else if (*p == 'f') {
+ strategy = Z_FILTERED;
+ } else if (*p == 'h') {
+ strategy = Z_HUFFMAN_ONLY;
+ } else {
+ *m++ = *p; /* copy the mode */
+ }
+ } while (*p++ && m != fmode + sizeof(fmode));
+ if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL;
+
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ err = Z_STREAM_ERROR;
+#else
+ err = deflateInit2(&(s->stream), level,
+ Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy);
+ /* windowBits is passed < 0 to suppress zlib header */
+
+ s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
+#endif
+ if (err != Z_OK || s->outbuf == Z_NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ } else {
+ s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
+
+ err = inflateInit2(&(s->stream), -MAX_WBITS);
+ /* windowBits is passed < 0 to tell that there is no zlib header.
+ * Note that in this case inflate *requires* an extra "dummy" byte
+ * after the compressed stream in order to complete decompression and
+ * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
+ * present after the compressed stream.
+ */
+ if (err != Z_OK || s->inbuf == Z_NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ }
+ s->stream.avail_out = Z_BUFSIZE;
+
+ errno = 0;
+ s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
+
+ if (s->file == NULL) {
+ return destroy(s), (gzFile)Z_NULL;
+ }
+ if (s->mode == 'w') {
+ /* Write a very simple .gz header:
+ */
+ fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
+ Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
+ s->startpos = 10L;
+ /* We use 10L instead of ftell(s->file) to because ftell causes an
+ * fflush on some systems. This version of the library doesn't use
+ * startpos anyway in write mode, so this initialization is not
+ * necessary.
+ */
+ } else {
+ check_header(s); /* skip the .gz header */
+ s->startpos = (ftell(s->file) - s->stream.avail_in);
+ }
+
+ return (gzFile)s;
+}
+
+/* ===========================================================================
+ Opens a gzip (.gz) file for reading or writing.
+*/
+gzFile ZEXPORT gzopen (path, mode)
+ const char *path;
+ const char *mode;
+{
+ return gz_open (path, mode, -1);
+}
+
+/* ===========================================================================
+ Associate a gzFile with the file descriptor fd. fd is not dup'ed here
+ to mimic the behavio(u)r of fdopen.
+*/
+gzFile ZEXPORT gzdopen (fd, mode)
+ int fd;
+ const char *mode;
+{
+ char name[20];
+
+ if (fd < 0) return (gzFile)Z_NULL;
+ sprintf(name, "<fd:%d>", fd); /* for debugging */
+
+ return gz_open (name, mode, fd);
+}
+
+/* ===========================================================================
+ * Update the compression level and strategy
+ */
+int ZEXPORT gzsetparams (file, level, strategy)
+ gzFile file;
+ int level;
+ int strategy;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
+
+ /* Make room to allow flushing */
+ if (s->stream.avail_out == 0) {
+
+ s->stream.next_out = s->outbuf;
+ if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
+ s->z_err = Z_ERRNO;
+ }
+ s->stream.avail_out = Z_BUFSIZE;
+ }
+
+ return deflateParams (&(s->stream), level, strategy);
+}
+
+/* ===========================================================================
+ Read a byte from a gz_stream; update next_in and avail_in. Return EOF
+ for end of file.
+ IN assertion: the stream s has been sucessfully opened for reading.
+*/
+local int get_byte(s)
+ gz_stream *s;
+{
+ if (s->z_eof) return EOF;
+ if (s->stream.avail_in == 0) {
+ errno = 0;
+ s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
+ if (s->stream.avail_in == 0) {
+ s->z_eof = 1;
+ if (ferror(s->file)) s->z_err = Z_ERRNO;
+ return EOF;
+ }
+ s->stream.next_in = s->inbuf;
+ }
+ s->stream.avail_in--;
+ return *(s->stream.next_in)++;
+}
+
+/* ===========================================================================
+ Check the gzip header of a gz_stream opened for reading. Set the stream
+ mode to transparent if the gzip magic header is not present; set s->err
+ to Z_DATA_ERROR if the magic header is present but the rest of the header
+ is incorrect.
+ IN assertion: the stream s has already been created sucessfully;
+ s->stream.avail_in is zero for the first time, but may be non-zero
+ for concatenated .gz files.
+*/
+local void check_header(s)
+ gz_stream *s;
+{
+ int method; /* method byte */
+ int flags; /* flags byte */
+ uInt len;
+ int c;
+
+ /* Check the gzip magic header */
+ for (len = 0; len < 2; len++) {
+ c = get_byte(s);
+ if (c != gz_magic[len]) {
+ if (len != 0) s->stream.avail_in++, s->stream.next_in--;
+ if (c != EOF) {
+ s->stream.avail_in++, s->stream.next_in--;
+ s->transparent = 1;
+ }
+ s->z_err = s->stream.avail_in != 0 ? Z_OK : Z_STREAM_END;
+ return;
+ }
+ }
+ method = get_byte(s);
+ flags = get_byte(s);
+ if (method != Z_DEFLATED || (flags & RESERVED) != 0) {
+ s->z_err = Z_DATA_ERROR;
+ return;
+ }
+
+ /* Discard time, xflags and OS code: */
+ for (len = 0; len < 6; len++) (void)get_byte(s);
+
+ if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */
+ len = (uInt)get_byte(s);
+ len += ((uInt)get_byte(s))<<8;
+ /* len is garbage if EOF but the loop below will quit anyway */
+ while (len-- != 0 && get_byte(s) != EOF) ;
+ }
+ if ((flags & ORIG_NAME) != 0) { /* skip the original file name */
+ while ((c = get_byte(s)) != 0 && c != EOF) ;
+ }
+ if ((flags & COMMENT) != 0) { /* skip the .gz file comment */
+ while ((c = get_byte(s)) != 0 && c != EOF) ;
+ }
+ if ((flags & HEAD_CRC) != 0) { /* skip the header crc */
+ for (len = 0; len < 2; len++) (void)get_byte(s);
+ }
+ s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK;
+}
+
+ /* ===========================================================================
+ * Cleanup then free the given gz_stream. Return a zlib error code.
+ Try freeing in the reverse order of allocations.
+ */
+local int destroy (s)
+ gz_stream *s;
+{
+ int err = Z_OK;
+
+ if (!s) return Z_STREAM_ERROR;
+
+ TRYFREE(s->msg);
+
+ if (s->stream.state != NULL) {
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ err = Z_STREAM_ERROR;
+#else
+ err = deflateEnd(&(s->stream));
+#endif
+ } else if (s->mode == 'r') {
+ err = inflateEnd(&(s->stream));
+ }
+ }
+ if (s->file != NULL && fclose(s->file)) {
+#ifdef ESPIPE
+ if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */
+#endif
+ err = Z_ERRNO;
+ }
+ if (s->z_err < 0) err = s->z_err;
+
+ TRYFREE(s->inbuf);
+ TRYFREE(s->outbuf);
+ TRYFREE(s->path);
+ TRYFREE(s);
+ return err;
+}
+
+/* ===========================================================================
+ Reads the given number of uncompressed bytes from the compressed file.
+ gzread returns the number of bytes actually read (0 for end of file).
+*/
+int ZEXPORT gzread (file, buf, len)
+ gzFile file;
+ voidp buf;
+ unsigned len;
+{
+ gz_stream *s = (gz_stream*)file;
+ Bytef *start = (Bytef*)buf; /* starting point for crc computation */
+ Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
+
+ if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
+
+ if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
+ if (s->z_err == Z_STREAM_END) return 0; /* EOF */
+
+ next_out = (Byte*)buf;
+ s->stream.next_out = (Bytef*)buf;
+ s->stream.avail_out = len;
+
+ while (s->stream.avail_out != 0) {
+
+ if (s->transparent) {
+ /* Copy first the lookahead bytes: */
+ uInt n = s->stream.avail_in;
+ if (n > s->stream.avail_out) n = s->stream.avail_out;
+ if (n > 0) {
+ zmemcpy(s->stream.next_out, s->stream.next_in, n);
+ next_out += n;
+ s->stream.next_out = next_out;
+ s->stream.next_in += n;
+ s->stream.avail_out -= n;
+ s->stream.avail_in -= n;
+ }
+ if (s->stream.avail_out > 0) {
+ s->stream.avail_out -= fread(next_out, 1, s->stream.avail_out,
+ s->file);
+ }
+ len -= s->stream.avail_out;
+ s->stream.total_in += (uLong)len;
+ s->stream.total_out += (uLong)len;
+ if (len == 0) s->z_eof = 1;
+ return (int)len;
+ }
+ if (s->stream.avail_in == 0 && !s->z_eof) {
+
+ errno = 0;
+ s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file);
+ if (s->stream.avail_in == 0) {
+ s->z_eof = 1;
+ if (ferror(s->file)) {
+ s->z_err = Z_ERRNO;
+ break;
+ }
+ }
+ s->stream.next_in = s->inbuf;
+ }
+ s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
+
+ if (s->z_err == Z_STREAM_END) {
+ /* Check CRC and original size */
+ s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
+ start = s->stream.next_out;
+
+ if (getLong(s) != s->crc) {
+ s->z_err = Z_DATA_ERROR;
+ } else {
+ (void)getLong(s);
+ /* The uncompressed length returned by above getlong() may
+ * be different from s->stream.total_out) in case of
+ * concatenated .gz files. Check for such files:
+ */
+ check_header(s);
+ if (s->z_err == Z_OK) {
+ uLong total_in = s->stream.total_in;
+ uLong total_out = s->stream.total_out;
+
+ inflateReset(&(s->stream));
+ s->stream.total_in = total_in;
+ s->stream.total_out = total_out;
+ s->crc = crc32(0L, Z_NULL, 0);
+ }
+ }
+ }
+ if (s->z_err != Z_OK || s->z_eof) break;
+ }
+ s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
+
+ return (int)(len - s->stream.avail_out);
+}
+
+
+/* ===========================================================================
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+int ZEXPORT gzgetc(file)
+ gzFile file;
+{
+ unsigned char c;
+
+ return gzread(file, &c, 1) == 1 ? c : -1;
+}
+
+
+/* ===========================================================================
+ Reads bytes from the compressed file until len-1 characters are
+ read, or a newline character is read and transferred to buf, or an
+ end-of-file condition is encountered. The string is then terminated
+ with a null character.
+ gzgets returns buf, or Z_NULL in case of error.
+
+ The current implementation is not optimized at all.
+*/
+char * ZEXPORT gzgets(file, buf, len)
+ gzFile file;
+ char *buf;
+ int len;
+{
+ char *b = buf;
+ if (buf == Z_NULL || len <= 0) return Z_NULL;
+
+ while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
+ *buf = '\0';
+ return b == buf && len > 0 ? Z_NULL : b;
+}
+
+
+#ifndef NO_DEFLATE
+/* ===========================================================================
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of bytes actually written (0 in case of error).
+*/
+int ZEXPORT gzwrite (file, buf, len)
+ gzFile file;
+ const voidp buf;
+ unsigned len;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
+
+ s->stream.next_in = (Bytef*)buf;
+ s->stream.avail_in = len;
+
+ while (s->stream.avail_in != 0) {
+
+ if (s->stream.avail_out == 0) {
+
+ s->stream.next_out = s->outbuf;
+ if (fwrite(s->outbuf, 1, Z_BUFSIZE, s->file) != Z_BUFSIZE) {
+ s->z_err = Z_ERRNO;
+ break;
+ }
+ s->stream.avail_out = Z_BUFSIZE;
+ }
+ s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
+ if (s->z_err != Z_OK) break;
+ }
+ s->crc = crc32(s->crc, (const Bytef *)buf, len);
+
+ return (int)(len - s->stream.avail_in);
+}
+
+/* ===========================================================================
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error).
+*/
+#ifdef STDC
+#include <stdarg.h>
+
+int ZEXPORTVA gzprintf (gzFile file, const char *format, /* args */ ...)
+{
+ char buf[Z_PRINTF_BUFSIZE];
+ va_list va;
+ int len;
+
+ va_start(va, format);
+#ifdef HAS_vsnprintf
+ (void)vsnprintf(buf, sizeof(buf), format, va);
+#else
+ (void)vsprintf(buf, format, va);
+#endif
+ va_end(va);
+ len = strlen(buf); /* some *sprintf don't return the nb of bytes written */
+ if (len <= 0) return 0;
+
+ return gzwrite(file, buf, (unsigned)len);
+}
+#else /* not ANSI C */
+
+int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
+ gzFile file;
+ const char *format;
+ int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+ a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
+{
+ char buf[Z_PRINTF_BUFSIZE];
+ int len;
+
+#ifdef HAS_snprintf
+ snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+#else
+ sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
+ a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);
+#endif
+ len = strlen(buf); /* old sprintf doesn't return the nb of bytes written */
+ if (len <= 0) return 0;
+
+ return gzwrite(file, buf, len);
+}
+#endif
+
+/* ===========================================================================
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+int ZEXPORT gzputc(file, c)
+ gzFile file;
+ int c;
+{
+ unsigned char cc = (unsigned char) c; /* required for big endian systems */
+
+ return gzwrite(file, &cc, 1) == 1 ? (int)cc : -1;
+}
+
+
+/* ===========================================================================
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+int ZEXPORT gzputs(file, s)
+ gzFile file;
+ const char *s;
+{
+ return gzwrite(file, (char*)s, (unsigned)strlen(s));
+}
+
+
+/* ===========================================================================
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function.
+*/
+local int do_flush (file, flush)
+ gzFile file;
+ int flush;
+{
+ uInt len;
+ int done = 0;
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'w') return Z_STREAM_ERROR;
+
+ s->stream.avail_in = 0; /* should be zero already anyway */
+
+ for (;;) {
+ len = Z_BUFSIZE - s->stream.avail_out;
+
+ if (len != 0) {
+ if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
+ s->z_err = Z_ERRNO;
+ return Z_ERRNO;
+ }
+ s->stream.next_out = s->outbuf;
+ s->stream.avail_out = Z_BUFSIZE;
+ }
+ if (done) break;
+ s->z_err = deflate(&(s->stream), flush);
+
+ /* Ignore the second of two consecutive flushes: */
+ if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;
+
+ /* deflate has finished flushing only when it hasn't used up
+ * all the available space in the output buffer:
+ */
+ done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
+
+ if (s->z_err != Z_OK && s->z_err != Z_STREAM_END) break;
+ }
+ return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
+}
+
+int ZEXPORT gzflush (file, flush)
+ gzFile file;
+ int flush;
+{
+ gz_stream *s = (gz_stream*)file;
+ int err = do_flush (file, flush);
+
+ if (err) return err;
+ fflush(s->file);
+ return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
+}
+#endif /* NO_DEFLATE */
+
+/* ===========================================================================
+ Sets the starting position for the next gzread or gzwrite on the given
+ compressed file. The offset represents a number of bytes in the
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error.
+ SEEK_END is not implemented, returns error.
+ In this version of the library, gzseek can be extremely slow.
+*/
+z_off_t ZEXPORT gzseek (file, offset, whence)
+ gzFile file;
+ z_off_t offset;
+ int whence;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || whence == SEEK_END ||
+ s->z_err == Z_ERRNO || s->z_err == Z_DATA_ERROR) {
+ return -1L;
+ }
+
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ return -1L;
+#else
+ if (whence == SEEK_SET) {
+ offset -= s->stream.total_in;
+ }
+ if (offset < 0) return -1L;
+
+ /* At this point, offset is the number of zero bytes to write. */
+ if (s->inbuf == Z_NULL) {
+ s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); /* for seeking */
+ zmemzero(s->inbuf, Z_BUFSIZE);
+ }
+ while (offset > 0) {
+ uInt size = Z_BUFSIZE;
+ if (offset < Z_BUFSIZE) size = (uInt)offset;
+
+ size = gzwrite(file, s->inbuf, size);
+ if (size == 0) return -1L;
+
+ offset -= size;
+ }
+ return (z_off_t)s->stream.total_in;
+#endif
+ }
+ /* Rest of function is for reading only */
+
+ /* compute absolute position */
+ if (whence == SEEK_CUR) {
+ offset += s->stream.total_out;
+ }
+ if (offset < 0) return -1L;
+
+ if (s->transparent) {
+ /* map to fseek */
+ s->stream.avail_in = 0;
+ s->stream.next_in = s->inbuf;
+ if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
+
+ s->stream.total_in = s->stream.total_out = (uLong)offset;
+ return offset;
+ }
+
+ /* For a negative seek, rewind and use positive seek */
+ if ((uLong)offset >= s->stream.total_out) {
+ offset -= s->stream.total_out;
+ } else if (gzrewind(file) < 0) {
+ return -1L;
+ }
+ /* offset is now the number of bytes to skip. */
+
+ if (offset != 0 && s->outbuf == Z_NULL) {
+ s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
+ }
+ while (offset > 0) {
+ int size = Z_BUFSIZE;
+ if (offset < Z_BUFSIZE) size = (int)offset;
+
+ size = gzread(file, s->outbuf, (uInt)size);
+ if (size <= 0) return -1L;
+ offset -= size;
+ }
+ return (z_off_t)s->stream.total_out;
+}
+
+/* ===========================================================================
+ Rewinds input file.
+*/
+int ZEXPORT gzrewind (file)
+ gzFile file;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL || s->mode != 'r') return -1;
+
+ s->z_err = Z_OK;
+ s->z_eof = 0;
+ s->stream.avail_in = 0;
+ s->stream.next_in = s->inbuf;
+ s->crc = crc32(0L, Z_NULL, 0);
+
+ if (s->startpos == 0) { /* not a compressed file */
+ rewind(s->file);
+ return 0;
+ }
+
+ (void) inflateReset(&s->stream);
+ return fseek(s->file, s->startpos, SEEK_SET);
+}
+
+/* ===========================================================================
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+*/
+z_off_t ZEXPORT gztell (file)
+ gzFile file;
+{
+ return gzseek(file, 0L, SEEK_CUR);
+}
+
+/* ===========================================================================
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+int ZEXPORT gzeof (file)
+ gzFile file;
+{
+ gz_stream *s = (gz_stream*)file;
+
+ return (s == NULL || s->mode != 'r') ? 0 : s->z_eof;
+}
+
+/* ===========================================================================
+ Outputs a long in LSB order to the given file
+*/
+local void putLong (file, x)
+ FILE *file;
+ uLong x;
+{
+ int n;
+ for (n = 0; n < 4; n++) {
+ fputc((int)(x & 0xff), file);
+ x >>= 8;
+ }
+}
+
+/* ===========================================================================
+ Reads a long in LSB order from the given gz_stream. Sets z_err in case
+ of error.
+*/
+local uLong getLong (s)
+ gz_stream *s;
+{
+ uLong x = (uLong)get_byte(s);
+ int c;
+
+ x += ((uLong)get_byte(s))<<8;
+ x += ((uLong)get_byte(s))<<16;
+ c = get_byte(s);
+ if (c == EOF) s->z_err = Z_DATA_ERROR;
+ x += ((uLong)c)<<24;
+ return x;
+}
+
+/* ===========================================================================
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state.
+*/
+int ZEXPORT gzclose (file)
+ gzFile file;
+{
+ int err;
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL) return Z_STREAM_ERROR;
+
+ if (s->mode == 'w') {
+#ifdef NO_DEFLATE
+ return Z_STREAM_ERROR;
+#else
+ err = do_flush (file, Z_FINISH);
+ if (err != Z_OK) return destroy((gz_stream*)file);
+
+ putLong (s->file, s->crc);
+ putLong (s->file, s->stream.total_in);
+#endif
+ }
+ return destroy((gz_stream*)file);
+}
+
+/* ===========================================================================
+ Returns the error message for the last error which occured on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occured in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+*/
+const char* ZEXPORT gzerror (file, errnum)
+ gzFile file;
+ int *errnum;
+{
+ char *m;
+ gz_stream *s = (gz_stream*)file;
+
+ if (s == NULL) {
+ *errnum = Z_STREAM_ERROR;
+ return (const char*)ERR_MSG(Z_STREAM_ERROR);
+ }
+ *errnum = s->z_err;
+ if (*errnum == Z_OK) return (const char*)"";
+
+ m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);
+
+ if (m == NULL || *m == '\0') m = (char*)ERR_MSG(s->z_err);
+
+ TRYFREE(s->msg);
+ s->msg = (char*)ALLOC(strlen(s->path) + strlen(m) + 3);
+ strcpy(s->msg, s->path);
+ strcat(s->msg, ": ");
+ strcat(s->msg, m);
+ return (const char*)s->msg;
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/infblock.c
@@ -1,0 +1,398 @@
+/* infblock.c -- interpret and process block types to last block
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* Table for deflate from PKZIP's appnote.txt. */
+local const uInt border[] = { /* Order of the bit length code lengths */
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+/*
+ Notes beyond the 1.93a appnote.txt:
+
+ 1. Distance pointers never point before the beginning of the output
+ stream.
+ 2. Distance pointers can point back across blocks, up to 32k away.
+ 3. There is an implied maximum of 7 bits for the bit length table and
+ 15 bits for the actual data.
+ 4. If only one code exists, then it is encoded using one bit. (Zero
+ would be more efficient, but perhaps a little confusing.) If two
+ codes exist, they are coded using one bit each (0 and 1).
+ 5. There is no way of sending zero distance codes--a dummy must be
+ sent if there are none. (History: a pre 2.0 version of PKZIP would
+ store blocks with no distance codes, but this was discovered to be
+ too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
+ zero distance codes, which is sent as one code of zero bits in
+ length.
+ 6. There are up to 286 literal/length codes. Code 256 represents the
+ end-of-block. Note however that the static length tree defines
+ 288 codes just to fill out the Huffman codes. Codes 286 and 287
+ cannot be used though, since there is no length base or extra bits
+ defined for them. Similarily, there are up to 30 distance codes.
+ However, static trees define 32 codes (all 5 bits) to fill out the
+ Huffman codes, but the last two had better not show up in the data.
+ 7. Unzip can check dynamic Huffman blocks for complete code sets.
+ The exception is that a single code would not be complete (see #4).
+ 8. The five bits following the block type is really the number of
+ literal codes sent minus 257.
+ 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
+ (1+6+6). Therefore, to output three times the length, you output
+ three codes (1+1+1), whereas to output four times the same length,
+ you only need two codes (1+3). Hmm.
+ 10. In the tree reconstruction algorithm, Code = Code + Increment
+ only if BitLength(i) is not zero. (Pretty obvious.)
+ 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
+ 12. Note: length code 284 can represent 227-258, but length code 285
+ really is 258. The last length deserves its own, short code
+ since it gets used a lot in very redundant files. The length
+ 258 is special since 258 - 3 (the min match length) is 255.
+ 13. The literal/length and distance code bit lengths are read as a
+ single stream of lengths. It is possible (and advantageous) for
+ a repeat code (16, 17, or 18) to go across the boundary between
+ the two sets of lengths.
+ */
+
+
+void inflate_blocks_reset(s, z, c)
+inflate_blocks_statef *s;
+z_streamp z;
+uLongf *c;
+{
+ if (c != Z_NULL)
+ *c = s->check;
+ if (s->mode == BTREE || s->mode == DTREE)
+ ZFREE(z, s->sub.trees.blens);
+ if (s->mode == CODES)
+ inflate_codes_free(s->sub.decode.codes, z);
+ s->mode = TYPE;
+ s->bitk = 0;
+ s->bitb = 0;
+ s->read = s->write = s->window;
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
+ Tracev((stderr, "inflate: blocks reset\n"));
+}
+
+
+inflate_blocks_statef *inflate_blocks_new(z, c, w)
+z_streamp z;
+check_func c;
+uInt w;
+{
+ inflate_blocks_statef *s;
+
+ if ((s = (inflate_blocks_statef *)ZALLOC
+ (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
+ return s;
+ if ((s->hufts =
+ (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
+ {
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
+ {
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ return Z_NULL;
+ }
+ s->end = s->window + w;
+ s->checkfn = c;
+ s->mode = TYPE;
+ Tracev((stderr, "inflate: blocks allocated\n"));
+ inflate_blocks_reset(s, z, Z_NULL);
+ return s;
+}
+
+
+int inflate_blocks(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt t; /* temporary storage */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input based on current state */
+ while (1) switch (s->mode)
+ {
+ case TYPE:
+ NEEDBITS(3)
+ t = (uInt)b & 7;
+ s->last = t & 1;
+ switch (t >> 1)
+ {
+ case 0: /* stored */
+ Tracev((stderr, "inflate: stored block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ t = k & 7; /* go to byte boundary */
+ DUMPBITS(t)
+ s->mode = LENS; /* get length of stored block */
+ break;
+ case 1: /* fixed */
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ s->last ? " (last)" : ""));
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+
+ inflate_trees_fixed(&bl, &bd, &tl, &td, z);
+ s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
+ if (s->sub.decode.codes == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ }
+ DUMPBITS(3)
+ s->mode = CODES;
+ break;
+ case 2: /* dynamic */
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ s->last ? " (last)" : ""));
+ DUMPBITS(3)
+ s->mode = TABLE;
+ break;
+ case 3: /* illegal */
+ DUMPBITS(3)
+ s->mode = BAD;
+ z->msg = (char*)"invalid block type";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ break;
+ case LENS:
+ NEEDBITS(32)
+ if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
+ {
+ s->mode = BAD;
+ z->msg = (char*)"invalid stored block lengths";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ s->sub.left = (uInt)b & 0xffff;
+ b = k = 0; /* dump bits */
+ Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
+ s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
+ break;
+ case STORED:
+ if (n == 0)
+ LEAVE
+ NEEDOUT
+ t = s->sub.left;
+ if (t > n) t = n;
+ if (t > m) t = m;
+ zmemcpy(q, p, t);
+ p += t; n -= t;
+ q += t; m -= t;
+ if ((s->sub.left -= t) != 0)
+ break;
+ Tracev((stderr, "inflate: stored end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ s->mode = s->last ? DRY : TYPE;
+ break;
+ case TABLE:
+ NEEDBITS(14)
+ s->sub.trees.table = t = (uInt)b & 0x3fff;
+#ifndef PKZIP_BUG_WORKAROUND
+ if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
+ {
+ s->mode = BAD;
+ z->msg = (char*)"too many length or distance symbols";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+#endif
+ t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
+ if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ DUMPBITS(14)
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: table sizes ok\n"));
+ s->mode = BTREE;
+ case BTREE:
+ while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
+ {
+ NEEDBITS(3)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
+ DUMPBITS(3)
+ }
+ while (s->sub.trees.index < 19)
+ s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
+ s->sub.trees.bb = 7;
+ t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
+ &s->sub.trees.tb, s->hufts, z);
+ if (t != Z_OK)
+ {
+ ZFREE(z, s->sub.trees.blens);
+ r = t;
+ if (r == Z_DATA_ERROR)
+ s->mode = BAD;
+ LEAVE
+ }
+ s->sub.trees.index = 0;
+ Tracev((stderr, "inflate: bits tree ok\n"));
+ s->mode = DTREE;
+ case DTREE:
+ while (t = s->sub.trees.table,
+ s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
+ {
+ inflate_huft *h;
+ uInt i, j, c;
+
+ t = s->sub.trees.bb;
+ NEEDBITS(t)
+ h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
+ t = h->bits;
+ c = h->base;
+ if (c < 16)
+ {
+ DUMPBITS(t)
+ s->sub.trees.blens[s->sub.trees.index++] = c;
+ }
+ else /* c == 16..18 */
+ {
+ i = c == 18 ? 7 : c - 14;
+ j = c == 18 ? 11 : 3;
+ NEEDBITS(t + i)
+ DUMPBITS(t)
+ j += (uInt)b & inflate_mask[i];
+ DUMPBITS(i)
+ i = s->sub.trees.index;
+ t = s->sub.trees.table;
+ if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
+ (c == 16 && i < 1))
+ {
+ ZFREE(z, s->sub.trees.blens);
+ s->mode = BAD;
+ z->msg = (char*)"invalid bit length repeat";
+ r = Z_DATA_ERROR;
+ LEAVE
+ }
+ c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
+ do {
+ s->sub.trees.blens[i++] = c;
+ } while (--j);
+ s->sub.trees.index = i;
+ }
+ }
+ s->sub.trees.tb = Z_NULL;
+ {
+ uInt bl, bd;
+ inflate_huft *tl, *td;
+ inflate_codes_statef *c;
+
+ bl = 9; /* must be <= 9 for lookahead assumptions */
+ bd = 6; /* must be <= 9 for lookahead assumptions */
+ t = s->sub.trees.table;
+ t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
+ s->sub.trees.blens, &bl, &bd, &tl, &td,
+ s->hufts, z);
+ ZFREE(z, s->sub.trees.blens);
+ if (t != Z_OK)
+ {
+ if (t == (uInt)Z_DATA_ERROR)
+ s->mode = BAD;
+ r = t;
+ LEAVE
+ }
+ Tracev((stderr, "inflate: trees ok\n"));
+ if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
+ {
+ r = Z_MEM_ERROR;
+ LEAVE
+ }
+ s->sub.decode.codes = c;
+ }
+ s->mode = CODES;
+ case CODES:
+ UPDATE
+ if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
+ return inflate_flush(s, z, r);
+ r = Z_OK;
+ inflate_codes_free(s->sub.decode.codes, z);
+ LOAD
+ Tracev((stderr, "inflate: codes end, %lu total out\n",
+ z->total_out + (q >= s->read ? q - s->read :
+ (s->end - s->read) + (q - s->window))));
+ if (!s->last)
+ {
+ s->mode = TYPE;
+ break;
+ }
+ s->mode = DRY;
+ case DRY:
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ s->mode = DONE;
+ case DONE:
+ r = Z_STREAM_END;
+ LEAVE
+ case BAD:
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+}
+
+
+int inflate_blocks_free(s, z)
+inflate_blocks_statef *s;
+z_streamp z;
+{
+ inflate_blocks_reset(s, z, Z_NULL);
+ ZFREE(z, s->window);
+ ZFREE(z, s->hufts);
+ ZFREE(z, s);
+ Tracev((stderr, "inflate: blocks freed\n"));
+ return Z_OK;
+}
+
+
+void inflate_set_dictionary(s, d, n)
+inflate_blocks_statef *s;
+const Bytef *d;
+uInt n;
+{
+ zmemcpy(s->window, d, n);
+ s->read = s->write = s->window + n;
+}
+
+
+/* Returns true if inflate is currently at the end of a block generated
+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH.
+ * IN assertion: s != Z_NULL
+ */
+int inflate_blocks_sync_point(s)
+inflate_blocks_statef *s;
+{
+ return s->mode == LENS;
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/infcodes.c
@@ -1,0 +1,257 @@
+/* infcodes.c -- process literals and length/distance pairs
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#include "inffast.h"
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ START, /* x: set up for LEN */
+ LEN, /* i: get length/literal/eob next */
+ LENEXT, /* i: getting length extra (have base) */
+ DIST, /* i: get distance next */
+ DISTEXT, /* i: getting distance extra */
+ COPY, /* o: copying bytes in window, waiting for space */
+ LIT, /* o: got literal, waiting for output space */
+ WASH, /* o: got eob, possibly still output waiting */
+ END, /* x: got eob and all data flushed */
+ BADCODE} /* x: got error */
+inflate_codes_mode;
+
+/* inflate codes private state */
+struct inflate_codes_state {
+
+ /* mode */
+ inflate_codes_mode mode; /* current inflate_codes mode */
+
+ /* mode dependent information */
+ uInt len;
+ union {
+ struct {
+ inflate_huft *tree; /* pointer into tree */
+ uInt need; /* bits needed */
+ } code; /* if LEN or DIST, where in tree */
+ uInt lit; /* if LIT, literal */
+ struct {
+ uInt get; /* bits to get for extra */
+ uInt dist; /* distance back to copy from */
+ } copy; /* if EXT or COPY, where and how much */
+ } sub; /* submode */
+
+ /* mode independent information */
+ Byte lbits; /* ltree bits decoded per branch */
+ Byte dbits; /* dtree bits decoder per branch */
+ inflate_huft *ltree; /* literal/length/eob tree */
+ inflate_huft *dtree; /* distance tree */
+
+};
+
+
+inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z)
+uInt bl, bd;
+inflate_huft *tl;
+inflate_huft *td; /* need separate declaration for Borland C++ */
+z_streamp z;
+{
+ inflate_codes_statef *c;
+
+ if ((c = (inflate_codes_statef *)
+ ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
+ {
+ c->mode = START;
+ c->lbits = (Byte)bl;
+ c->dbits = (Byte)bd;
+ c->ltree = tl;
+ c->dtree = td;
+ Tracev((stderr, "inflate: codes new\n"));
+ }
+ return c;
+}
+
+
+int inflate_codes(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt j; /* temporary storage */
+ inflate_huft *t; /* temporary pointer */
+ uInt e; /* extra bits or operation */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+ Bytef *f; /* pointer to copy strings from */
+ inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
+
+ /* copy input/output information to locals (UPDATE macro restores) */
+ LOAD
+
+ /* process input and output based on current state */
+ while (1) switch (c->mode)
+ { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
+ case START: /* x: set up for LEN */
+#ifndef SLOW
+ if (m >= 258 && n >= 10)
+ {
+ UPDATE
+ r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
+ LOAD
+ if (r != Z_OK)
+ {
+ c->mode = r == Z_STREAM_END ? WASH : BADCODE;
+ break;
+ }
+ }
+#endif /* !SLOW */
+ c->sub.code.need = c->lbits;
+ c->sub.code.tree = c->ltree;
+ c->mode = LEN;
+ case LEN: /* i: get length/literal/eob next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e == 0) /* literal */
+ {
+ c->sub.lit = t->base;
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", t->base));
+ c->mode = LIT;
+ break;
+ }
+ if (e & 16) /* length */
+ {
+ c->sub.copy.get = e & 15;
+ c->len = t->base;
+ c->mode = LENEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ if (e & 32) /* end of block */
+ {
+ Tracevv((stderr, "inflate: end of block\n"));
+ c->mode = WASH;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid literal/length code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case LENEXT: /* i: getting length extra (have base) */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->len += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ c->sub.code.need = c->dbits;
+ c->sub.code.tree = c->dtree;
+ Tracevv((stderr, "inflate: length %u\n", c->len));
+ c->mode = DIST;
+ case DIST: /* i: get distance next */
+ j = c->sub.code.need;
+ NEEDBITS(j)
+ t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
+ DUMPBITS(t->bits)
+ e = (uInt)(t->exop);
+ if (e & 16) /* distance */
+ {
+ c->sub.copy.get = e & 15;
+ c->sub.copy.dist = t->base;
+ c->mode = DISTEXT;
+ break;
+ }
+ if ((e & 64) == 0) /* next table */
+ {
+ c->sub.code.need = e;
+ c->sub.code.tree = t + t->base;
+ break;
+ }
+ c->mode = BADCODE; /* invalid code */
+ z->msg = (char*)"invalid distance code";
+ r = Z_DATA_ERROR;
+ LEAVE
+ case DISTEXT: /* i: getting distance extra */
+ j = c->sub.copy.get;
+ NEEDBITS(j)
+ c->sub.copy.dist += (uInt)b & inflate_mask[j];
+ DUMPBITS(j)
+ Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
+ c->mode = COPY;
+ case COPY: /* o: copying bytes in window, waiting for space */
+#ifndef __TURBOC__ /* Turbo C bug for following expression */
+ f = (uInt)(q - s->window) < c->sub.copy.dist ?
+ s->end - (c->sub.copy.dist - (q - s->window)) :
+ q - c->sub.copy.dist;
+#else
+ f = q - c->sub.copy.dist;
+ if ((uInt)(q - s->window) < c->sub.copy.dist)
+ f = s->end - (c->sub.copy.dist - (uInt)(q - s->window));
+#endif
+ while (c->len)
+ {
+ NEEDOUT
+ OUTBYTE(*f++)
+ if (f == s->end)
+ f = s->window;
+ c->len--;
+ }
+ c->mode = START;
+ break;
+ case LIT: /* o: got literal, waiting for output space */
+ NEEDOUT
+ OUTBYTE(c->sub.lit)
+ c->mode = START;
+ break;
+ case WASH: /* o: got eob, possibly more output */
+ if (k > 7) /* return unused byte, if any */
+ {
+ Assert(k < 16, "inflate_codes grabbed too many bytes")
+ k -= 8;
+ n++;
+ p--; /* can always return one */
+ }
+ FLUSH
+ if (s->read != s->write)
+ LEAVE
+ c->mode = END;
+ case END:
+ r = Z_STREAM_END;
+ LEAVE
+ case BADCODE: /* x: got error */
+ r = Z_DATA_ERROR;
+ LEAVE
+ default:
+ r = Z_STREAM_ERROR;
+ LEAVE
+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
+
+void inflate_codes_free(c, z)
+inflate_codes_statef *c;
+z_streamp z;
+{
+ ZFREE(z, c);
+ Tracev((stderr, "inflate: codes free\n"));
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/inffast.c
@@ -1,0 +1,170 @@
+/* inffast.c -- process literals and length/distance pairs fast
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "infblock.h"
+#include "infcodes.h"
+#include "infutil.h"
+#include "inffast.h"
+
+struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+/* macros for bit input with no checking and for returning unused bytes */
+#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
+#define UNGRAB {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
+
+/* Called with number of bytes left to write in window at least 258
+ (the maximum string length) and number of input bytes available
+ at least ten. The ten bytes are six bytes for the longest length/
+ distance pair plus four bytes for overloading the bit buffer. */
+
+int inflate_fast(bl, bd, tl, td, s, z)
+uInt bl, bd;
+inflate_huft *tl;
+inflate_huft *td; /* need separate declaration for Borland C++ */
+inflate_blocks_statef *s;
+z_streamp z;
+{
+ inflate_huft *t; /* temporary pointer */
+ uInt e; /* extra bits or operation */
+ uLong b; /* bit buffer */
+ uInt k; /* bits in bit buffer */
+ Bytef *p; /* input data pointer */
+ uInt n; /* bytes available there */
+ Bytef *q; /* output window write pointer */
+ uInt m; /* bytes to end of window or read pointer */
+ uInt ml; /* mask for literal/length tree */
+ uInt md; /* mask for distance tree */
+ uInt c; /* bytes to copy */
+ uInt d; /* distance back to copy from */
+ Bytef *r; /* copy source pointer */
+
+ /* load input, output, bit values */
+ LOAD
+
+ /* initialize masks */
+ ml = inflate_mask[bl];
+ md = inflate_mask[bd];
+
+ /* do until not enough input or output space for fast loop */
+ do { /* assume called with m >= 258 && n >= 10 */
+ /* get literal/length code */
+ GRABBITS(20) /* max bits for literal/length code */
+ if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: * literal '%c'\n" :
+ "inflate: * literal 0x%02x\n", t->base));
+ *q++ = (Byte)t->base;
+ m--;
+ continue;
+ }
+ do {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ /* get extra bits for length */
+ e &= 15;
+ c = t->base + ((uInt)b & inflate_mask[e]);
+ DUMPBITS(e)
+ Tracevv((stderr, "inflate: * length %u\n", c));
+
+ /* decode distance base of block to copy */
+ GRABBITS(15); /* max bits for distance code */
+ e = (t = td + ((uInt)b & md))->exop;
+ do {
+ DUMPBITS(t->bits)
+ if (e & 16)
+ {
+ /* get extra bits to add to distance base */
+ e &= 15;
+ GRABBITS(e) /* get extra bits (up to 13) */
+ d = t->base + ((uInt)b & inflate_mask[e]);
+ DUMPBITS(e)
+ Tracevv((stderr, "inflate: * distance %u\n", d));
+
+ /* do the copy */
+ m -= c;
+ if ((uInt)(q - s->window) >= d) /* offset before dest */
+ { /* just copy */
+ r = q - d;
+ *q++ = *r++; c--; /* minimum count is three, */
+ *q++ = *r++; c--; /* so unroll loop a little */
+ }
+ else /* else offset after destination */
+ {
+ e = d - (uInt)(q - s->window); /* bytes from offset to end */
+ r = s->end - e; /* pointer to offset */
+ if (c > e) /* if source crosses, */
+ {
+ c -= e; /* copy to end of window */
+ do {
+ *q++ = *r++;
+ } while (--e);
+ r = s->window; /* copy rest from start of window */
+ }
+ }
+ do { /* copy all or what's left */
+ *q++ = *r++;
+ } while (--c);
+ break;
+ }
+ else if ((e & 64) == 0)
+ {
+ t += t->base;
+ e = (t += ((uInt)b & inflate_mask[e]))->exop;
+ }
+ else
+ {
+ z->msg = (char*)"invalid distance code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ } while (1);
+ break;
+ }
+ if ((e & 64) == 0)
+ {
+ t += t->base;
+ if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0)
+ {
+ DUMPBITS(t->bits)
+ Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
+ "inflate: * literal '%c'\n" :
+ "inflate: * literal 0x%02x\n", t->base));
+ *q++ = (Byte)t->base;
+ m--;
+ break;
+ }
+ }
+ else if (e & 32)
+ {
+ Tracevv((stderr, "inflate: * end of block\n"));
+ UNGRAB
+ UPDATE
+ return Z_STREAM_END;
+ }
+ else
+ {
+ z->msg = (char*)"invalid literal/length code";
+ UNGRAB
+ UPDATE
+ return Z_DATA_ERROR;
+ }
+ } while (1);
+ } while (m >= 258 && n >= 10);
+
+ /* not enough input or output--restore pointers and return */
+ UNGRAB
+ UPDATE
+ return Z_OK;
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/inflate.c
@@ -1,0 +1,366 @@
+/* inflate.c -- zlib interface to inflate modules
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+
+struct inflate_blocks_state {int dummy;}; /* for buggy compilers */
+
+typedef enum {
+ METHOD, /* waiting for method byte */
+ FLAG, /* waiting for flag byte */
+ DICT4, /* four dictionary check bytes to go */
+ DICT3, /* three dictionary check bytes to go */
+ DICT2, /* two dictionary check bytes to go */
+ DICT1, /* one dictionary check byte to go */
+ DICT0, /* waiting for inflateSetDictionary */
+ BLOCKS, /* decompressing blocks */
+ CHECK4, /* four check bytes to go */
+ CHECK3, /* three check bytes to go */
+ CHECK2, /* two check bytes to go */
+ CHECK1, /* one check byte to go */
+ DONE, /* finished check, done */
+ BAD} /* got an error--stay here */
+inflate_mode;
+
+/* inflate private state */
+struct internal_state {
+
+ /* mode */
+ inflate_mode mode; /* current inflate mode */
+
+ /* mode dependent information */
+ union {
+ uInt method; /* if FLAGS, method byte */
+ struct {
+ uLong was; /* computed check value */
+ uLong need; /* stream check value */
+ } check; /* if CHECK, check values to compare */
+ uInt marker; /* if BAD, inflateSync's marker bytes count */
+ } sub; /* submode */
+
+ /* mode independent information */
+ int nowrap; /* flag for no wrapper */
+ uInt wbits; /* log2(window size) (8..15, defaults to 15) */
+ inflate_blocks_statef
+ *blocks; /* current inflate_blocks state */
+
+};
+
+
+int ZEXPORT inflateReset(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->total_in = z->total_out = 0;
+ z->msg = Z_NULL;
+ z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
+ inflate_blocks_reset(z->state->blocks, z, Z_NULL);
+ Tracev((stderr, "inflate: reset\n"));
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateEnd(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->blocks != Z_NULL)
+ inflate_blocks_free(z->state->blocks, z);
+ ZFREE(z, z->state);
+ z->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateInit2_(z, w, version, stream_size)
+z_streamp z;
+int w;
+const char *version;
+int stream_size;
+{
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != sizeof(z_stream))
+ return Z_VERSION_ERROR;
+
+ /* initialize state */
+ if (z == Z_NULL)
+ return Z_STREAM_ERROR;
+ z->msg = Z_NULL;
+ if (z->zalloc == Z_NULL)
+ {
+ z->zalloc = zcalloc;
+ z->opaque = (voidpf)0;
+ }
+ if (z->zfree == Z_NULL) z->zfree = zcfree;
+ if ((z->state = (struct internal_state FAR *)
+ ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
+ return Z_MEM_ERROR;
+ z->state->blocks = Z_NULL;
+
+ /* handle undocumented nowrap option (no zlib header or check) */
+ z->state->nowrap = 0;
+ if (w < 0)
+ {
+ w = - w;
+ z->state->nowrap = 1;
+ }
+
+ /* set window size */
+ if (w < 8 || w > 15)
+ {
+ inflateEnd(z);
+ return Z_STREAM_ERROR;
+ }
+ z->state->wbits = (uInt)w;
+
+ /* create inflate_blocks state */
+ if ((z->state->blocks =
+ inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))
+ == Z_NULL)
+ {
+ inflateEnd(z);
+ return Z_MEM_ERROR;
+ }
+ Tracev((stderr, "inflate: allocated\n"));
+
+ /* reset state */
+ inflateReset(z);
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateInit_(z, version, stream_size)
+z_streamp z;
+const char *version;
+int stream_size;
+{
+ return inflateInit2_(z, DEF_WBITS, version, stream_size);
+}
+
+
+#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
+#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
+
+int ZEXPORT inflate(z, f)
+z_streamp z;
+int f;
+{
+ int r;
+ uInt b;
+
+ if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
+ return Z_STREAM_ERROR;
+ f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
+ r = Z_BUF_ERROR;
+ while (1) switch (z->state->mode)
+ {
+ case METHOD:
+ NEEDBYTE
+ if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"unknown compression method";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"invalid window size";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ z->state->mode = FLAG;
+ case FLAG:
+ NEEDBYTE
+ b = NEXTBYTE;
+ if (((z->state->sub.method << 8) + b) % 31)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"incorrect header check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ Tracev((stderr, "inflate: zlib header ok\n"));
+ if (!(b & PRESET_DICT))
+ {
+ z->state->mode = BLOCKS;
+ break;
+ }
+ z->state->mode = DICT4;
+ case DICT4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = DICT3;
+ case DICT3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = DICT2;
+ case DICT2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = DICT1;
+ case DICT1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+ z->adler = z->state->sub.check.need;
+ z->state->mode = DICT0;
+ return Z_NEED_DICT;
+ case DICT0:
+ z->state->mode = BAD;
+ z->msg = (char*)"need dictionary";
+ z->state->sub.marker = 0; /* can try inflateSync */
+ return Z_STREAM_ERROR;
+ case BLOCKS:
+ r = inflate_blocks(z->state->blocks, z, r);
+ if (r == Z_DATA_ERROR)
+ {
+ z->state->mode = BAD;
+ z->state->sub.marker = 0; /* can try inflateSync */
+ break;
+ }
+ if (r == Z_OK)
+ r = f;
+ if (r != Z_STREAM_END)
+ return r;
+ r = f;
+ inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
+ if (z->state->nowrap)
+ {
+ z->state->mode = DONE;
+ break;
+ }
+ z->state->mode = CHECK4;
+ case CHECK4:
+ NEEDBYTE
+ z->state->sub.check.need = (uLong)NEXTBYTE << 24;
+ z->state->mode = CHECK3;
+ case CHECK3:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 16;
+ z->state->mode = CHECK2;
+ case CHECK2:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE << 8;
+ z->state->mode = CHECK1;
+ case CHECK1:
+ NEEDBYTE
+ z->state->sub.check.need += (uLong)NEXTBYTE;
+
+ if (z->state->sub.check.was != z->state->sub.check.need)
+ {
+ z->state->mode = BAD;
+ z->msg = (char*)"incorrect data check";
+ z->state->sub.marker = 5; /* can't try inflateSync */
+ break;
+ }
+ Tracev((stderr, "inflate: zlib check ok\n"));
+ z->state->mode = DONE;
+ case DONE:
+ return Z_STREAM_END;
+ case BAD:
+ return Z_DATA_ERROR;
+ default:
+ return Z_STREAM_ERROR;
+ }
+#ifdef NEED_DUMMY_RETURN
+ return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+#endif
+}
+
+
+int ZEXPORT inflateSetDictionary(z, dictionary, dictLength)
+z_streamp z;
+const Bytef *dictionary;
+uInt dictLength;
+{
+ uInt length = dictLength;
+
+ if (z == Z_NULL || z->state == Z_NULL || z->state->mode != DICT0)
+ return Z_STREAM_ERROR;
+
+ if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR;
+ z->adler = 1L;
+
+ if (length >= ((uInt)1<<z->state->wbits))
+ {
+ length = (1<<z->state->wbits)-1;
+ dictionary += dictLength - length;
+ }
+ inflate_set_dictionary(z->state->blocks, dictionary, length);
+ z->state->mode = BLOCKS;
+ return Z_OK;
+}
+
+
+int ZEXPORT inflateSync(z)
+z_streamp z;
+{
+ uInt n; /* number of bytes to look at */
+ Bytef *p; /* pointer to bytes */
+ uInt m; /* number of marker bytes found in a row */
+ uLong r, w; /* temporaries to save total_in and total_out */
+
+ /* set up */
+ if (z == Z_NULL || z->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ if (z->state->mode != BAD)
+ {
+ z->state->mode = BAD;
+ z->state->sub.marker = 0;
+ }
+ if ((n = z->avail_in) == 0)
+ return Z_BUF_ERROR;
+ p = z->next_in;
+ m = z->state->sub.marker;
+
+ /* search */
+ while (n && m < 4)
+ {
+ static const Byte mark[4] = {0, 0, 0xff, 0xff};
+ if (*p == mark[m])
+ m++;
+ else if (*p)
+ m = 0;
+ else
+ m = 4 - m;
+ p++, n--;
+ }
+
+ /* restore */
+ z->total_in += p - z->next_in;
+ z->next_in = p;
+ z->avail_in = n;
+ z->state->sub.marker = m;
+
+ /* return no joy or set up to restart on a new block */
+ if (m != 4)
+ return Z_DATA_ERROR;
+ r = z->total_in; w = z->total_out;
+ inflateReset(z);
+ z->total_in = r; z->total_out = w;
+ z->state->mode = BLOCKS;
+ return Z_OK;
+}
+
+
+/* Returns true if inflate is currently at the end of a block generated
+ * by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+ * implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH
+ * but removes the length bytes of the resulting empty stored block. When
+ * decompressing, PPP checks that at the end of input packet, inflate is
+ * waiting for these length bytes.
+ */
+int ZEXPORT inflateSyncPoint(z)
+z_streamp z;
+{
+ if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL)
+ return Z_STREAM_ERROR;
+ return inflate_blocks_sync_point(z->state->blocks);
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/inftrees.c
@@ -1,0 +1,455 @@
+/* inftrees.c -- generate Huffman trees for efficient decoding
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+
+#if !defined(BUILDFIXED) && !defined(STDC)
+# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */
+#endif
+
+const char inflate_copyright[] =
+ " inflate 1.1.3 Copyright 1995-1998 Mark Adler ";
+/*
+ If you use the zlib library in a product, an acknowledgment is welcome
+ in the documentation of your product. If for some reason you cannot
+ include such an acknowledgment, I would appreciate that you keep this
+ copyright string in the executable of your product.
+ */
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+/* simplify the use of the inflate_huft type with some defines */
+#define exop word.what.Exop
+#define bits word.what.Bits
+
+
+local int huft_build OF((
+ uIntf *, /* code lengths in bits */
+ uInt, /* number of codes */
+ uInt, /* number of "simple" codes */
+ const uIntf *, /* list of base values for non-simple codes */
+ const uIntf *, /* list of extra bits for non-simple codes */
+ inflate_huft * FAR*,/* result: starting table */
+ uIntf *, /* maximum lookup bits (returns actual) */
+ inflate_huft *, /* space for trees */
+ uInt *, /* hufts used in space */
+ uIntf * )); /* space for values */
+
+/* Tables for deflate from PKZIP's appnote.txt. */
+local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
+ /* see note #13 above about 258 */
+local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
+ 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
+local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577};
+local const uInt cpdext[30] = { /* Extra bits for distance codes */
+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
+ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
+ 12, 12, 13, 13};
+
+/*
+ Huffman code decoding is performed using a multi-level table lookup.
+ The fastest way to decode is to simply build a lookup table whose
+ size is determined by the longest code. However, the time it takes
+ to build this table can also be a factor if the data being decoded
+ is not very long. The most common codes are necessarily the
+ shortest codes, so those codes dominate the decoding time, and hence
+ the speed. The idea is you can have a shorter table that decodes the
+ shorter, more probable codes, and then point to subsidiary tables for
+ the longer codes. The time it costs to decode the longer codes is
+ then traded against the time it takes to make longer tables.
+
+ This results of this trade are in the variables lbits and dbits
+ below. lbits is the number of bits the first level table for literal/
+ length codes can decode in one step, and dbits is the same thing for
+ the distance codes. Subsequent tables are also less than or equal to
+ those sizes. These values may be adjusted either when all of the
+ codes are shorter than that, in which case the longest code length in
+ bits is used, or when the shortest code is *longer* than the requested
+ table size, in which case the length of the shortest code in bits is
+ used.
+
+ There are two different values for the two tables, since they code a
+ different number of possibilities each. The literal/length table
+ codes 286 possible values, or in a flat code, a little over eight
+ bits. The distance table codes 30 possible values, or a little less
+ than five bits, flat. The optimum values for speed end up being
+ about one bit more than those, so lbits is 8+1 and dbits is 5+1.
+ The optimum values may differ though from machine to machine, and
+ possibly even between compilers. Your mileage may vary.
+ */
+
+
+/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
+#define BMAX 15 /* maximum bit length of any code */
+
+local int huft_build(b, n, s, d, e, t, m, hp, hn, v)
+uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
+uInt n; /* number of codes (assumed <= 288) */
+uInt s; /* number of simple-valued codes (0..s-1) */
+const uIntf *d; /* list of base values for non-simple codes */
+const uIntf *e; /* list of extra bits for non-simple codes */
+inflate_huft * FAR *t; /* result: starting table */
+uIntf *m; /* maximum lookup bits, returns actual */
+inflate_huft *hp; /* space for trees */
+uInt *hn; /* hufts used in space */
+uIntf *v; /* working area: values in order of bit length */
+/* Given a list of code lengths and a maximum table size, make a set of
+ tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
+ if the given code set is incomplete (the tables are still built in this
+ case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of
+ lengths), or Z_MEM_ERROR if not enough memory. */
+{
+
+ uInt a; /* counter for codes of length k */
+ uInt c[BMAX+1]; /* bit length count table */
+ uInt f; /* i repeats in table every f entries */
+ int g; /* maximum code length */
+ int h; /* table level */
+ register uInt i; /* counter, current code */
+ register uInt j; /* counter */
+ register int k; /* number of bits in current code */
+ int l; /* bits per table (returned in m) */
+ uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
+ register uIntf *p; /* pointer into c[], b[], or v[] */
+ inflate_huft *q; /* points to current table */
+ struct inflate_huft_s r; /* table entry for structure assignment */
+ inflate_huft *u[BMAX]; /* table stack */
+ register int w; /* bits before this table == (l * h) */
+ uInt x[BMAX+1]; /* bit offsets, then code stack */
+ uIntf *xp; /* pointer into x */
+ int y; /* number of dummy codes added */
+ uInt z; /* number of entries in current table */
+
+
+ /* Generate counts for each bit length */
+ p = c;
+#define C0 *p++ = 0;
+#define C2 C0 C0 C0 C0
+#define C4 C2 C2 C2 C2
+ C4 /* clear c[]--assume BMAX+1 is 16 */
+ p = b; i = n;
+ do {
+ c[*p++]++; /* assume all entries <= BMAX */
+ } while (--i);
+ if (c[0] == n) /* null input--all zero length codes */
+ {
+ *t = (inflate_huft *)Z_NULL;
+ *m = 0;
+ return Z_OK;
+ }
+
+
+ /* Find minimum and maximum length, bound *m by those */
+ l = *m;
+ for (j = 1; j <= BMAX; j++)
+ if (c[j])
+ break;
+ k = j; /* minimum code length */
+ if ((uInt)l < j)
+ l = j;
+ for (i = BMAX; i; i--)
+ if (c[i])
+ break;
+ g = i; /* maximum code length */
+ if ((uInt)l > i)
+ l = i;
+ *m = l;
+
+
+ /* Adjust last length count to fill out codes, if needed */
+ for (y = 1 << j; j < i; j++, y <<= 1)
+ if ((y -= c[j]) < 0)
+ return Z_DATA_ERROR;
+ if ((y -= c[i]) < 0)
+ return Z_DATA_ERROR;
+ c[i] += y;
+
+
+ /* Generate starting offsets into the value table for each length */
+ x[1] = j = 0;
+ p = c + 1; xp = x + 2;
+ while (--i) { /* note that i == g from above */
+ *xp++ = (j += *p++);
+ }
+
+
+ /* Make a table of values in order of bit lengths */
+ p = b; i = 0;
+ do {
+ if ((j = *p++) != 0)
+ v[x[j]++] = i;
+ } while (++i < n);
+ n = x[g]; /* set n to length of v */
+
+
+ /* Generate the Huffman codes and for each, make the table entries */
+ x[0] = i = 0; /* first Huffman code is zero */
+ p = v; /* grab values in bit order */
+ h = -1; /* no tables yet--level -1 */
+ w = -l; /* bits decoded == (l * h) */
+ u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
+ q = (inflate_huft *)Z_NULL; /* ditto */
+ z = 0; /* ditto */
+
+ /* go through the bit lengths (k already is bits in shortest code) */
+ for (; k <= g; k++)
+ {
+ a = c[k];
+ while (a--)
+ {
+ /* here i is the Huffman code of length k bits for value *p */
+ /* make tables up to required level */
+ while (k > w + l)
+ {
+ h++;
+ w += l; /* previous table always l bits */
+
+ /* compute minimum size table less than or equal to l bits */
+ z = g - w;
+ z = z > (uInt)l ? l : z; /* table size upper limit */
+ if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
+ { /* too few codes for k-w bit table */
+ f -= a + 1; /* deduct codes from patterns left */
+ xp = c + k;
+ if (j < z)
+ while (++j < z) /* try smaller tables up to z bits */
+ {
+ if ((f <<= 1) <= *++xp)
+ break; /* enough codes to use up j bits */
+ f -= *xp; /* else deduct codes from patterns */
+ }
+ }
+ z = 1 << j; /* table entries for j-bit table */
+
+ /* allocate new table */
+ if (*hn + z > MANY) /* (note: doesn't matter for fixed) */
+ return Z_MEM_ERROR; /* not enough memory */
+ u[h] = q = hp + *hn;
+ *hn += z;
+
+ /* connect to last table, if there is one */
+ if (h)
+ {
+ x[h] = i; /* save pattern for backing up */
+ r.bits = (Byte)l; /* bits to dump before this table */
+ r.exop = (Byte)j; /* bits in this table */
+ j = i >> (w - l);
+ r.base = (uInt)(q - u[h-1] - j); /* offset to this table */
+ u[h-1][j] = r; /* connect to last table */
+ }
+ else
+ *t = q; /* first table is returned result */
+ }
+
+ /* set up table entry in r */
+ r.bits = (Byte)(k - w);
+ if (p >= v + n)
+ r.exop = 128 + 64; /* out of values--invalid code */
+ else if (*p < s)
+ {
+ r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
+ r.base = *p++; /* simple code is just the value */
+ }
+ else
+ {
+ r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */
+ r.base = d[*p++ - s];
+ }
+
+ /* fill code-like entries with r */
+ f = 1 << (k - w);
+ for (j = i >> w; j < z; j += f)
+ q[j] = r;
+
+ /* backwards increment the k-bit code i */
+ for (j = 1 << (k - 1); i & j; j >>= 1)
+ i ^= j;
+ i ^= j;
+
+ /* backup over finished tables */
+ mask = (1 << w) - 1; /* needed on HP, cc -O bug */
+ while ((i & mask) != x[h])
+ {
+ h--; /* don't need to update q */
+ w -= l;
+ mask = (1 << w) - 1;
+ }
+ }
+ }
+
+
+ /* Return Z_BUF_ERROR if we were given an incomplete table */
+ return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
+}
+
+
+int inflate_trees_bits(c, bb, tb, hp, z)
+uIntf *c; /* 19 code lengths */
+uIntf *bb; /* bits tree desired/actual depth */
+inflate_huft * FAR *tb; /* bits tree result */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
+ tb, bb, hp, &hn, v);
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed dynamic bit lengths tree";
+ else if (r == Z_BUF_ERROR || *bb == 0)
+ {
+ z->msg = (char*)"incomplete dynamic bit lengths tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+}
+
+
+int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z)
+uInt nl; /* number of literal/length codes */
+uInt nd; /* number of distance codes */
+uIntf *c; /* that many (total) code lengths */
+uIntf *bl; /* literal desired/actual bit depth */
+uIntf *bd; /* distance desired/actual bit depth */
+inflate_huft * FAR *tl; /* literal/length tree result */
+inflate_huft * FAR *td; /* distance tree result */
+inflate_huft *hp; /* space for trees */
+z_streamp z; /* for messages */
+{
+ int r;
+ uInt hn = 0; /* hufts used in space */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate work area */
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+
+ /* build literal/length tree */
+ r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
+ if (r != Z_OK || *bl == 0)
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed literal/length tree";
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"incomplete literal/length tree";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+ }
+
+ /* build distance tree */
+ r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
+ if (r != Z_OK || (*bd == 0 && nl > 257))
+ {
+ if (r == Z_DATA_ERROR)
+ z->msg = (char*)"oversubscribed distance tree";
+ else if (r == Z_BUF_ERROR) {
+#ifdef PKZIP_BUG_WORKAROUND
+ r = Z_OK;
+ }
+#else
+ z->msg = (char*)"incomplete distance tree";
+ r = Z_DATA_ERROR;
+ }
+ else if (r != Z_MEM_ERROR)
+ {
+ z->msg = (char*)"empty distance tree with lengths";
+ r = Z_DATA_ERROR;
+ }
+ ZFREE(z, v);
+ return r;
+#endif
+ }
+
+ /* done */
+ ZFREE(z, v);
+ return Z_OK;
+}
+
+
+/* build fixed tables only once--keep them here */
+#ifdef BUILDFIXED
+local int fixed_built = 0;
+#define FIXEDH 544 /* number of hufts used by fixed tables */
+local inflate_huft fixed_mem[FIXEDH];
+local uInt fixed_bl;
+local uInt fixed_bd;
+local inflate_huft *fixed_tl;
+local inflate_huft *fixed_td;
+#else
+#include "inffixed.h"
+#endif
+
+
+int inflate_trees_fixed(bl, bd, tl, td, z)
+uIntf *bl; /* literal desired/actual bit depth */
+uIntf *bd; /* distance desired/actual bit depth */
+inflate_huft * FAR *tl; /* literal/length tree result */
+inflate_huft * FAR *td; /* distance tree result */
+z_streamp z; /* for memory allocation */
+{
+#ifdef BUILDFIXED
+ /* build fixed tables if not already */
+ if (!fixed_built)
+ {
+ int k; /* temporary variable */
+ uInt f = 0; /* number of hufts used in fixed_mem */
+ uIntf *c; /* length list for huft_build */
+ uIntf *v; /* work area for huft_build */
+
+ /* allocate memory */
+ if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ return Z_MEM_ERROR;
+ if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
+ {
+ ZFREE(z, c);
+ return Z_MEM_ERROR;
+ }
+
+ /* literal table */
+ for (k = 0; k < 144; k++)
+ c[k] = 8;
+ for (; k < 256; k++)
+ c[k] = 9;
+ for (; k < 280; k++)
+ c[k] = 7;
+ for (; k < 288; k++)
+ c[k] = 8;
+ fixed_bl = 9;
+ huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl,
+ fixed_mem, &f, v);
+
+ /* distance table */
+ for (k = 0; k < 30; k++)
+ c[k] = 5;
+ fixed_bd = 5;
+ huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd,
+ fixed_mem, &f, v);
+
+ /* done */
+ ZFREE(z, v);
+ ZFREE(z, c);
+ fixed_built = 1;
+ }
+#endif
+ *bl = fixed_bl;
+ *bd = fixed_bd;
+ *tl = fixed_tl;
+ *td = fixed_td;
+ return Z_OK;
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/infutil.c
@@ -1,0 +1,87 @@
+/* inflate_util.c -- data and routines common to blocks and codes
+ * Copyright (C) 1995-1998 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "infblock.h"
+#include "inftrees.h"
+#include "infcodes.h"
+#include "infutil.h"
+
+struct inflate_codes_state {int dummy;}; /* for buggy compilers */
+
+/* And'ing with mask[n] masks the lower n bits */
+uInt inflate_mask[17] = {
+ 0x0000,
+ 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
+ 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
+};
+
+
+/* copy as much as possible from the sliding window to the output area */
+int inflate_flush(s, z, r)
+inflate_blocks_statef *s;
+z_streamp z;
+int r;
+{
+ uInt n;
+ Bytef *p;
+ Bytef *q;
+
+ /* local copies of source and destination pointers */
+ p = z->next_out;
+ q = s->read;
+
+ /* compute number of bytes to copy as far as end of window */
+ n = (uInt)((q <= s->write ? s->write : s->end) - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy as far as end of window */
+ zmemcpy(p, q, n);
+ p += n;
+ q += n;
+
+ /* see if more to copy at beginning of window */
+ if (q == s->end)
+ {
+ /* wrap pointers */
+ q = s->window;
+ if (s->write == s->end)
+ s->write = s->window;
+
+ /* compute bytes to copy */
+ n = (uInt)(s->write - q);
+ if (n > z->avail_out) n = z->avail_out;
+ if (n && r == Z_BUF_ERROR) r = Z_OK;
+
+ /* update counters */
+ z->avail_out -= n;
+ z->total_out += n;
+
+ /* update check information */
+ if (s->checkfn != Z_NULL)
+ z->adler = s->check = (*s->checkfn)(s->check, q, n);
+
+ /* copy */
+ zmemcpy(p, q, n);
+ p += n;
+ q += n;
+ }
+
+ /* update pointers */
+ z->next_out = p;
+ s->read = q;
+
+ /* done */
+ return r;
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/trees.c
@@ -1,0 +1,1214 @@
+/* trees.c -- output deflated data using Huffman coding
+ * Copyright (C) 1995-1998 Jean-loup Gailly
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ * ALGORITHM
+ *
+ * The "deflation" process uses several Huffman trees. The more
+ * common source values are represented by shorter bit sequences.
+ *
+ * Each code tree is stored in a compressed form which is itself
+ * a Huffman encoding of the lengths of all the code strings (in
+ * ascending order by source values). The actual code strings are
+ * reconstructed from the lengths in the inflate process, as described
+ * in the deflate specification.
+ *
+ * REFERENCES
+ *
+ * Deutsch, L.P.,"'Deflate' Compressed Data Format Specification".
+ * Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc
+ *
+ * Storer, James A.
+ * Data Compression: Methods and Theory, pp. 49-50.
+ * Computer Science Press, 1988. ISBN 0-7167-8156-5.
+ *
+ * Sedgewick, R.
+ * Algorithms, p290.
+ * Addison-Wesley, 1983. ISBN 0-201-06672-6.
+ */
+
+/* @(#) $Id: trees.c,v 1.1 2002/01/21 08:16:23 menno Exp $ */
+
+/* #define GEN_TREES_H */
+
+#include "deflate.h"
+
+#ifdef DEBUG
+# include <ctype.h>
+#endif
+
+/* ===========================================================================
+ * Constants
+ */
+
+#define MAX_BL_BITS 7
+/* Bit length codes must not exceed MAX_BL_BITS bits */
+
+#define END_BLOCK 256
+/* end of block literal code */
+
+#define REP_3_6 16
+/* repeat previous bit length 3-6 times (2 bits of repeat count) */
+
+#define REPZ_3_10 17
+/* repeat a zero length 3-10 times (3 bits of repeat count) */
+
+#define REPZ_11_138 18
+/* repeat a zero length 11-138 times (7 bits of repeat count) */
+
+local const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
+ = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};
+
+local const int extra_dbits[D_CODES] /* extra bits for each distance code */
+ = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
+
+local const int extra_blbits[BL_CODES]/* extra bits for each bit length code */
+ = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};
+
+local const uch bl_order[BL_CODES]
+ = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
+/* The lengths of the bit length codes are sent in order of decreasing
+ * probability, to avoid transmitting the lengths for unused bit length codes.
+ */
+
+#define Buf_size (8 * 2*sizeof(char))
+/* Number of bits used within bi_buf. (bi_buf might be implemented on
+ * more than 16 bits on some systems.)
+ */
+
+/* ===========================================================================
+ * Local data. These are initialized only once.
+ */
+
+#define DIST_CODE_LEN 512 /* see definition of array dist_code below */
+
+#if defined(GEN_TREES_H) || !defined(STDC)
+/* non ANSI compilers may not accept trees.h */
+
+local ct_data static_ltree[L_CODES+2];
+/* The static literal tree. Since the bit lengths are imposed, there is no
+ * need for the L_CODES extra codes used during heap construction. However
+ * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
+ * below).
+ */
+
+local ct_data static_dtree[D_CODES];
+/* The static distance tree. (Actually a trivial tree since all codes use
+ * 5 bits.)
+ */
+
+uch _dist_code[DIST_CODE_LEN];
+/* Distance codes. The first 256 values correspond to the distances
+ * 3 .. 258, the last 256 values correspond to the top 8 bits of
+ * the 15 bit distances.
+ */
+
+uch _length_code[MAX_MATCH-MIN_MATCH+1];
+/* length code for each normalized match length (0 == MIN_MATCH) */
+
+local int base_length[LENGTH_CODES];
+/* First normalized length for each code (0 = MIN_MATCH) */
+
+local int base_dist[D_CODES];
+/* First normalized distance for each code (0 = distance of 1) */
+
+#else
+# include "trees.h"
+#endif /* GEN_TREES_H */
+
+struct static_tree_desc_s {
+ const ct_data *static_tree; /* static tree or NULL */
+ const intf *extra_bits; /* extra bits for each code or NULL */
+ int extra_base; /* base index for extra_bits */
+ int elems; /* max number of elements in the tree */
+ int max_length; /* max bit length for the codes */
+};
+
+local static_tree_desc static_l_desc =
+{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
+
+local static_tree_desc static_d_desc =
+{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
+
+local static_tree_desc static_bl_desc =
+{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
+
+/* ===========================================================================
+ * Local (static) routines in this file.
+ */
+
+local void tr_static_init OF((void));
+local void init_block OF((deflate_state *s));
+local void pqdownheap OF((deflate_state *s, ct_data *tree, int k));
+local void gen_bitlen OF((deflate_state *s, tree_desc *desc));
+local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count));
+local void build_tree OF((deflate_state *s, tree_desc *desc));
+local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));
+local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
+local int build_bl_tree OF((deflate_state *s));
+local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
+ int blcodes));
+local void compress_block OF((deflate_state *s, ct_data *ltree,
+ ct_data *dtree));
+local void set_data_type OF((deflate_state *s));
+local unsigned bi_reverse OF((unsigned value, int length));
+local void bi_windup OF((deflate_state *s));
+local void bi_flush OF((deflate_state *s));
+local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
+ int header));
+
+#ifdef GEN_TREES_H
+local void gen_trees_header OF((void));
+#endif
+
+#ifndef DEBUG
+# define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
+ /* Send a code of the given tree. c and tree must not have side effects */
+
+#else /* DEBUG */
+# define send_code(s, c, tree) \
+ { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \
+ send_bits(s, tree[c].Code, tree[c].Len); }
+#endif
+
+/* ===========================================================================
+ * Output a short LSB first on the stream.
+ * IN assertion: there is enough room in pendingBuf.
+ */
+#define put_short(s, w) { \
+ put_byte(s, (uch)((w) & 0xff)); \
+ put_byte(s, (uch)((ush)(w) >> 8)); \
+}
+
+/* ===========================================================================
+ * Send a value on a given number of bits.
+ * IN assertion: length <= 16 and value fits in length bits.
+ */
+#ifdef DEBUG
+local void send_bits OF((deflate_state *s, int value, int length));
+
+local void send_bits(s, value, length)
+ deflate_state *s;
+ int value; /* value to send */
+ int length; /* number of bits */
+{
+ Tracevv((stderr," l %2d v %4x ", length, value));
+ Assert(length > 0 && length <= 15, "invalid length");
+ s->bits_sent += (ulg)length;
+
+ /* If not enough room in bi_buf, use (valid) bits from bi_buf and
+ * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
+ * unused bits in value.
+ */
+ if (s->bi_valid > (int)Buf_size - length) {
+ s->bi_buf |= (value << s->bi_valid);
+ put_short(s, s->bi_buf);
+ s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);
+ s->bi_valid += length - Buf_size;
+ } else {
+ s->bi_buf |= value << s->bi_valid;
+ s->bi_valid += length;
+ }
+}
+#else /* !DEBUG */
+
+#define send_bits(s, value, length) \
+{ int len = length;\
+ if (s->bi_valid > (int)Buf_size - len) {\
+ int val = value;\
+ s->bi_buf |= (val << s->bi_valid);\
+ put_short(s, s->bi_buf);\
+ s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
+ s->bi_valid += len - Buf_size;\
+ } else {\
+ s->bi_buf |= (value) << s->bi_valid;\
+ s->bi_valid += len;\
+ }\
+}
+#endif /* DEBUG */
+
+
+#define MAX(a,b) (a >= b ? a : b)
+/* the arguments must not have side effects */
+
+/* ===========================================================================
+ * Initialize the various 'constant' tables.
+ */
+local void tr_static_init()
+{
+#if defined(GEN_TREES_H) || !defined(STDC)
+ static int static_init_done = 0;
+ int n; /* iterates over tree elements */
+ int bits; /* bit counter */
+ int length; /* length value */
+ int code; /* code value */
+ int dist; /* distance index */
+ ush bl_count[MAX_BITS+1];
+ /* number of codes at each bit length for an optimal tree */
+
+ if (static_init_done) return;
+
+ /* For some embedded targets, global variables are not initialized: */
+ static_l_desc.static_tree = static_ltree;
+ static_l_desc.extra_bits = extra_lbits;
+ static_d_desc.static_tree = static_dtree;
+ static_d_desc.extra_bits = extra_dbits;
+ static_bl_desc.extra_bits = extra_blbits;
+
+ /* Initialize the mapping length (0..255) -> length code (0..28) */
+ length = 0;
+ for (code = 0; code < LENGTH_CODES-1; code++) {
+ base_length[code] = length;
+ for (n = 0; n < (1<<extra_lbits[code]); n++) {
+ _length_code[length++] = (uch)code;
+ }
+ }
+ Assert (length == 256, "tr_static_init: length != 256");
+ /* Note that the length 255 (match length 258) can be represented
+ * in two different ways: code 284 + 5 bits or code 285, so we
+ * overwrite length_code[255] to use the best encoding:
+ */
+ _length_code[length-1] = (uch)code;
+
+ /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
+ dist = 0;
+ for (code = 0 ; code < 16; code++) {
+ base_dist[code] = dist;
+ for (n = 0; n < (1<<extra_dbits[code]); n++) {
+ _dist_code[dist++] = (uch)code;
+ }
+ }
+ Assert (dist == 256, "tr_static_init: dist != 256");
+ dist >>= 7; /* from now on, all distances are divided by 128 */
+ for ( ; code < D_CODES; code++) {
+ base_dist[code] = dist << 7;
+ for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+ _dist_code[256 + dist++] = (uch)code;
+ }
+ }
+ Assert (dist == 256, "tr_static_init: 256+dist != 512");
+
+ /* Construct the codes of the static literal tree */
+ for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
+ n = 0;
+ while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
+ while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
+ while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
+ while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
+ /* Codes 286 and 287 do not exist, but we must include them in the
+ * tree construction to get a canonical Huffman tree (longest code
+ * all ones)
+ */
+ gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
+
+ /* The static distance tree is trivial: */
+ for (n = 0; n < D_CODES; n++) {
+ static_dtree[n].Len = 5;
+ static_dtree[n].Code = bi_reverse((unsigned)n, 5);
+ }
+ static_init_done = 1;
+
+# ifdef GEN_TREES_H
+ gen_trees_header();
+# endif
+#endif /* defined(GEN_TREES_H) || !defined(STDC) */
+}
+
+/* ===========================================================================
+ * Genererate the file trees.h describing the static trees.
+ */
+#ifdef GEN_TREES_H
+# ifndef DEBUG
+# include <stdio.h>
+# endif
+
+# define SEPARATOR(i, last, width) \
+ ((i) == (last)? "\n};\n\n" : \
+ ((i) % (width) == (width)-1 ? ",\n" : ", "))
+
+void gen_trees_header()
+{
+ FILE *header = fopen("trees.h", "w");
+ int i;
+
+ Assert (header != NULL, "Can't open trees.h");
+ fprintf(header,
+ "/* header created automatically with -DGEN_TREES_H */\n\n");
+
+ fprintf(header, "local const ct_data static_ltree[L_CODES+2] = {\n");
+ for (i = 0; i < L_CODES+2; i++) {
+ fprintf(header, "{{%3u},{%3u}}%s", static_ltree[i].Code,
+ static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));
+ }
+
+ fprintf(header, "local const ct_data static_dtree[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "{{%2u},{%2u}}%s", static_dtree[i].Code,
+ static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));
+ }
+
+ fprintf(header, "const uch _dist_code[DIST_CODE_LEN] = {\n");
+ for (i = 0; i < DIST_CODE_LEN; i++) {
+ fprintf(header, "%2u%s", _dist_code[i],
+ SEPARATOR(i, DIST_CODE_LEN-1, 20));
+ }
+
+ fprintf(header, "const uch _length_code[MAX_MATCH-MIN_MATCH+1]= {\n");
+ for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {
+ fprintf(header, "%2u%s", _length_code[i],
+ SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));
+ }
+
+ fprintf(header, "local const int base_length[LENGTH_CODES] = {\n");
+ for (i = 0; i < LENGTH_CODES; i++) {
+ fprintf(header, "%1u%s", base_length[i],
+ SEPARATOR(i, LENGTH_CODES-1, 20));
+ }
+
+ fprintf(header, "local const int base_dist[D_CODES] = {\n");
+ for (i = 0; i < D_CODES; i++) {
+ fprintf(header, "%5u%s", base_dist[i],
+ SEPARATOR(i, D_CODES-1, 10));
+ }
+
+ fclose(header);
+}
+#endif /* GEN_TREES_H */
+
+/* ===========================================================================
+ * Initialize the tree data structures for a new zlib stream.
+ */
+void _tr_init(s)
+ deflate_state *s;
+{
+ tr_static_init();
+
+ s->l_desc.dyn_tree = s->dyn_ltree;
+ s->l_desc.stat_desc = &static_l_desc;
+
+ s->d_desc.dyn_tree = s->dyn_dtree;
+ s->d_desc.stat_desc = &static_d_desc;
+
+ s->bl_desc.dyn_tree = s->bl_tree;
+ s->bl_desc.stat_desc = &static_bl_desc;
+
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+ s->last_eob_len = 8; /* enough lookahead for inflate */
+#ifdef DEBUG
+ s->compressed_len = 0L;
+ s->bits_sent = 0L;
+#endif
+
+ /* Initialize the first block of the first file: */
+ init_block(s);
+}
+
+/* ===========================================================================
+ * Initialize a new block.
+ */
+local void init_block(s)
+ deflate_state *s;
+{
+ int n; /* iterates over tree elements */
+
+ /* Initialize the trees. */
+ for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
+ for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
+ for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
+
+ s->dyn_ltree[END_BLOCK].Freq = 1;
+ s->opt_len = s->static_len = 0L;
+ s->last_lit = s->matches = 0;
+}
+
+#define SMALLEST 1
+/* Index within the heap array of least frequent node in the Huffman tree */
+
+
+/* ===========================================================================
+ * Remove the smallest element from the heap and recreate the heap with
+ * one less element. Updates heap and heap_len.
+ */
+#define pqremove(s, tree, top) \
+{\
+ top = s->heap[SMALLEST]; \
+ s->heap[SMALLEST] = s->heap[s->heap_len--]; \
+ pqdownheap(s, tree, SMALLEST); \
+}
+
+/* ===========================================================================
+ * Compares to subtrees, using the tree depth as tie breaker when
+ * the subtrees have equal frequency. This minimizes the worst case length.
+ */
+#define smaller(tree, n, m, depth) \
+ (tree[n].Freq < tree[m].Freq || \
+ (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
+
+/* ===========================================================================
+ * Restore the heap property by moving down the tree starting at node k,
+ * exchanging a node with the smallest of its two sons if necessary, stopping
+ * when the heap property is re-established (each father smaller than its
+ * two sons).
+ */
+local void pqdownheap(s, tree, k)
+ deflate_state *s;
+ ct_data *tree; /* the tree to restore */
+ int k; /* node to move down */
+{
+ int v = s->heap[k];
+ int j = k << 1; /* left son of k */
+ while (j <= s->heap_len) {
+ /* Set j to the smallest of the two sons: */
+ if (j < s->heap_len &&
+ smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+ j++;
+ }
+ /* Exit if v is smaller than both sons */
+ if (smaller(tree, v, s->heap[j], s->depth)) break;
+
+ /* Exchange v with the smallest son */
+ s->heap[k] = s->heap[j]; k = j;
+
+ /* And continue down the tree, setting j to the left son of k */
+ j <<= 1;
+ }
+ s->heap[k] = v;
+}
+
+/* ===========================================================================
+ * Compute the optimal bit lengths for a tree and update the total bit length
+ * for the current block.
+ * IN assertion: the fields freq and dad are set, heap[heap_max] and
+ * above are the tree nodes sorted by increasing frequency.
+ * OUT assertions: the field len is set to the optimal bit length, the
+ * array bl_count contains the frequencies for each bit length.
+ * The length opt_len is updated; static_len is also updated if stree is
+ * not null.
+ */
+local void gen_bitlen(s, desc)
+ deflate_state *s;
+ tree_desc *desc; /* the tree descriptor */
+{
+ ct_data *tree = desc->dyn_tree;
+ int max_code = desc->max_code;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ const intf *extra = desc->stat_desc->extra_bits;
+ int base = desc->stat_desc->extra_base;
+ int max_length = desc->stat_desc->max_length;
+ int h; /* heap index */
+ int n, m; /* iterate over the tree elements */
+ int bits; /* bit length */
+ int xbits; /* extra bits */
+ ush f; /* frequency */
+ int overflow = 0; /* number of elements with bit length too large */
+
+ for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
+
+ /* In a first pass, compute the optimal bit lengths (which may
+ * overflow in the case of the bit length tree).
+ */
+ tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
+
+ for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+ n = s->heap[h];
+ bits = tree[tree[n].Dad].Len + 1;
+ if (bits > max_length) bits = max_length, overflow++;
+ tree[n].Len = (ush)bits;
+ /* We overwrite tree[n].Dad which is no longer needed */
+
+ if (n > max_code) continue; /* not a leaf node */
+
+ s->bl_count[bits]++;
+ xbits = 0;
+ if (n >= base) xbits = extra[n-base];
+ f = tree[n].Freq;
+ s->opt_len += (ulg)f * (bits + xbits);
+ if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);
+ }
+ if (overflow == 0) return;
+
+ Trace((stderr,"\nbit length overflow\n"));
+ /* This happens for example on obj2 and pic of the Calgary corpus */
+
+ /* Find the first bit length which could increase: */
+ do {
+ bits = max_length-1;
+ while (s->bl_count[bits] == 0) bits--;
+ s->bl_count[bits]--; /* move one leaf down the tree */
+ s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
+ s->bl_count[max_length]--;
+ /* The brother of the overflow item also moves one step up,
+ * but this does not affect bl_count[max_length]
+ */
+ overflow -= 2;
+ } while (overflow > 0);
+
+ /* Now recompute all bit lengths, scanning in increasing frequency.
+ * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
+ * lengths instead of fixing only the wrong ones. This idea is taken
+ * from 'ar' written by Haruhiko Okumura.)
+ */
+ for (bits = max_length; bits != 0; bits--) {
+ n = s->bl_count[bits];
+ while (n != 0) {
+ m = s->heap[--h];
+ if (m > max_code) continue;
+ if (tree[m].Len != (unsigned) bits) {
+ Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
+ s->opt_len += ((long)bits - (long)tree[m].Len)
+ *(long)tree[m].Freq;
+ tree[m].Len = (ush)bits;
+ }
+ n--;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Generate the codes for a given tree and bit counts (which need not be
+ * optimal).
+ * IN assertion: the array bl_count contains the bit length statistics for
+ * the given tree and the field len is set for all tree elements.
+ * OUT assertion: the field code is set for all tree elements of non
+ * zero code length.
+ */
+local void gen_codes (tree, max_code, bl_count)
+ ct_data *tree; /* the tree to decorate */
+ int max_code; /* largest code with non zero frequency */
+ ushf *bl_count; /* number of codes at each bit length */
+{
+ ush next_code[MAX_BITS+1]; /* next code value for each bit length */
+ ush code = 0; /* running code value */
+ int bits; /* bit index */
+ int n; /* code index */
+
+ /* The distribution counts are first used to generate the code values
+ * without bit reversal.
+ */
+ for (bits = 1; bits <= MAX_BITS; bits++) {
+ next_code[bits] = code = (code + bl_count[bits-1]) << 1;
+ }
+ /* Check that the bit counts in bl_count are consistent. The last code
+ * must be all ones.
+ */
+ Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+ "inconsistent bit counts");
+ Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
+
+ for (n = 0; n <= max_code; n++) {
+ int len = tree[n].Len;
+ if (len == 0) continue;
+ /* Now reverse the bits */
+ tree[n].Code = bi_reverse(next_code[len]++, len);
+
+ Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
+ n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+ }
+}
+
+/* ===========================================================================
+ * Construct one Huffman tree and assigns the code bit strings and lengths.
+ * Update the total bit length for the current block.
+ * IN assertion: the field freq is set for all tree elements.
+ * OUT assertions: the fields len and code are set to the optimal bit length
+ * and corresponding code. The length opt_len is updated; static_len is
+ * also updated if stree is not null. The field max_code is set.
+ */
+local void build_tree(s, desc)
+ deflate_state *s;
+ tree_desc *desc; /* the tree descriptor */
+{
+ ct_data *tree = desc->dyn_tree;
+ const ct_data *stree = desc->stat_desc->static_tree;
+ int elems = desc->stat_desc->elems;
+ int n, m; /* iterate over heap elements */
+ int max_code = -1; /* largest code with non zero frequency */
+ int node; /* new node being created */
+
+ /* Construct the initial heap, with least frequent element in
+ * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+ * heap[0] is not used.
+ */
+ s->heap_len = 0, s->heap_max = HEAP_SIZE;
+
+ for (n = 0; n < elems; n++) {
+ if (tree[n].Freq != 0) {
+ s->heap[++(s->heap_len)] = max_code = n;
+ s->depth[n] = 0;
+ } else {
+ tree[n].Len = 0;
+ }
+ }
+
+ /* The pkzip format requires that at least one distance code exists,
+ * and that at least one bit should be sent even if there is only one
+ * possible code. So to avoid special checks later on we force at least
+ * two codes of non zero frequency.
+ */
+ while (s->heap_len < 2) {
+ node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
+ tree[node].Freq = 1;
+ s->depth[node] = 0;
+ s->opt_len--; if (stree) s->static_len -= stree[node].Len;
+ /* node is 0 or 1 so it does not have extra bits */
+ }
+ desc->max_code = max_code;
+
+ /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+ * establish sub-heaps of increasing lengths:
+ */
+ for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
+
+ /* Construct the Huffman tree by repeatedly combining the least two
+ * frequent nodes.
+ */
+ node = elems; /* next internal node of the tree */
+ do {
+ pqremove(s, tree, n); /* n = node of least frequency */
+ m = s->heap[SMALLEST]; /* m = node of next least frequency */
+
+ s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
+ s->heap[--(s->heap_max)] = m;
+
+ /* Create a new node father of n and m */
+ tree[node].Freq = tree[n].Freq + tree[m].Freq;
+ s->depth[node] = (uch) (MAX(s->depth[n], s->depth[m]) + 1);
+ tree[n].Dad = tree[m].Dad = (ush)node;
+#ifdef DUMP_BL_TREE
+ if (tree == s->bl_tree) {
+ fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
+ node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
+ }
+#endif
+ /* and insert the new node in the heap */
+ s->heap[SMALLEST] = node++;
+ pqdownheap(s, tree, SMALLEST);
+
+ } while (s->heap_len >= 2);
+
+ s->heap[--(s->heap_max)] = s->heap[SMALLEST];
+
+ /* At this point, the fields freq and dad are set. We can now
+ * generate the bit lengths.
+ */
+ gen_bitlen(s, (tree_desc *)desc);
+
+ /* The field len is now set, we can generate the bit codes */
+ gen_codes ((ct_data *)tree, max_code, s->bl_count);
+}
+
+/* ===========================================================================
+ * Scan a literal or distance tree to determine the frequencies of the codes
+ * in the bit length tree.
+ */
+local void scan_tree (s, tree, max_code)
+ deflate_state *s;
+ ct_data *tree; /* the tree to be scanned */
+ int max_code; /* and its largest code of non zero frequency */
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].Len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ if (nextlen == 0) max_count = 138, min_count = 3;
+ tree[max_code+1].Len = (ush)0xffff; /* guard */
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].Len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ s->bl_tree[curlen].Freq += count;
+ } else if (curlen != 0) {
+ if (curlen != prevlen) s->bl_tree[curlen].Freq++;
+ s->bl_tree[REP_3_6].Freq++;
+ } else if (count <= 10) {
+ s->bl_tree[REPZ_3_10].Freq++;
+ } else {
+ s->bl_tree[REPZ_11_138].Freq++;
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Send a literal or distance tree in compressed form, using the codes in
+ * bl_tree.
+ */
+local void send_tree (s, tree, max_code)
+ deflate_state *s;
+ ct_data *tree; /* the tree to be scanned */
+ int max_code; /* and its largest code of non zero frequency */
+{
+ int n; /* iterates over all tree elements */
+ int prevlen = -1; /* last emitted length */
+ int curlen; /* length of current code */
+ int nextlen = tree[0].Len; /* length of next code */
+ int count = 0; /* repeat count of the current code */
+ int max_count = 7; /* max repeat count */
+ int min_count = 4; /* min repeat count */
+
+ /* tree[max_code+1].Len = -1; */ /* guard already set */
+ if (nextlen == 0) max_count = 138, min_count = 3;
+
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen; nextlen = tree[n+1].Len;
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
+
+ } else if (curlen != 0) {
+ if (curlen != prevlen) {
+ send_code(s, curlen, s->bl_tree); count--;
+ }
+ Assert(count >= 3 && count <= 6, " 3_6?");
+ send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+
+ } else if (count <= 10) {
+ send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+
+ } else {
+ send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
+ }
+ count = 0; prevlen = curlen;
+ if (nextlen == 0) {
+ max_count = 138, min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6, min_count = 3;
+ } else {
+ max_count = 7, min_count = 4;
+ }
+ }
+}
+
+/* ===========================================================================
+ * Construct the Huffman tree for the bit lengths and return the index in
+ * bl_order of the last bit length code to send.
+ */
+local int build_bl_tree(s)
+ deflate_state *s;
+{
+ int max_blindex; /* index of last bit length code of non zero freq */
+
+ /* Determine the bit length frequencies for literal and distance trees */
+ scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
+ scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
+
+ /* Build the bit length tree: */
+ build_tree(s, (tree_desc *)(&(s->bl_desc)));
+ /* opt_len now includes the length of the tree representations, except
+ * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+ */
+
+ /* Determine the number of bit length codes to send. The pkzip format
+ * requires that at least 4 bit length codes be sent. (appnote.txt says
+ * 3 but the actual value used is 4.)
+ */
+ for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
+ if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
+ }
+ /* Update opt_len to include the bit length tree and counts */
+ s->opt_len += 3*(max_blindex+1) + 5+5+4;
+ Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
+ s->opt_len, s->static_len));
+
+ return max_blindex;
+}
+
+/* ===========================================================================
+ * Send the header for a block using dynamic Huffman trees: the counts, the
+ * lengths of the bit length codes, the literal tree and the distance tree.
+ * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
+ */
+local void send_all_trees(s, lcodes, dcodes, blcodes)
+ deflate_state *s;
+ int lcodes, dcodes, blcodes; /* number of codes for each tree */
+{
+ int rank; /* index in bl_order */
+
+ Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
+ Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
+ "too many codes");
+ Tracev((stderr, "\nbl counts: "));
+ send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
+ send_bits(s, dcodes-1, 5);
+ send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
+ for (rank = 0; rank < blcodes; rank++) {
+ Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
+ send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
+ }
+ Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
+
+ send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
+ Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
+
+ send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
+ Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
+}
+
+/* ===========================================================================
+ * Send a stored block
+ */
+void _tr_stored_block(s, buf, stored_len, eof)
+ deflate_state *s;
+ charf *buf; /* input block */
+ ulg stored_len; /* length of input block */
+ int eof; /* true if this is the last block for a file */
+{
+ send_bits(s, (STORED_BLOCK<<1)+eof, 3); /* send block type */
+#ifdef DEBUG
+ s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
+ s->compressed_len += (stored_len + 4) << 3;
+#endif
+ copy_block(s, buf, (unsigned)stored_len, 1); /* with header */
+}
+
+/* ===========================================================================
+ * Send one empty static block to give enough lookahead for inflate.
+ * This takes 10 bits, of which 7 may remain in the bit buffer.
+ * The current inflate code requires 9 bits of lookahead. If the
+ * last two codes for the previous block (real code plus EOB) were coded
+ * on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode
+ * the last real code. In this case we send two empty static blocks instead
+ * of one. (There are no problems if the previous block is stored or fixed.)
+ * To simplify the code, we assume the worst case of last real code encoded
+ * on one bit only.
+ */
+void _tr_align(s)
+ deflate_state *s;
+{
+ send_bits(s, STATIC_TREES<<1, 3);
+ send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
+ s->compressed_len += 10L; /* 3 for block type, 7 for EOB */
+#endif
+ bi_flush(s);
+ /* Of the 10 bits for the empty block, we have already sent
+ * (10 - bi_valid) bits. The lookahead for the last real code (before
+ * the EOB of the previous block) was thus at least one plus the length
+ * of the EOB plus what we have just sent of the empty static block.
+ */
+ if (1 + s->last_eob_len + 10 - s->bi_valid < 9) {
+ send_bits(s, STATIC_TREES<<1, 3);
+ send_code(s, END_BLOCK, static_ltree);
+#ifdef DEBUG
+ s->compressed_len += 10L;
+#endif
+ bi_flush(s);
+ }
+ s->last_eob_len = 7;
+}
+
+/* ===========================================================================
+ * Determine the best encoding for the current block: dynamic trees, static
+ * trees or store, and output the encoded block to the zip file.
+ */
+void _tr_flush_block(s, buf, stored_len, eof)
+ deflate_state *s;
+ charf *buf; /* input block, or NULL if too old */
+ ulg stored_len; /* length of input block */
+ int eof; /* true if this is the last block for a file */
+{
+ ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
+ int max_blindex = 0; /* index of last bit length code of non zero freq */
+
+ /* Build the Huffman trees unless a stored block is forced */
+ if (s->level > 0) {
+
+ /* Check if the file is ascii or binary */
+ if (s->data_type == Z_UNKNOWN) set_data_type(s);
+
+ /* Construct the literal and distance trees */
+ build_tree(s, (tree_desc *)(&(s->l_desc)));
+ Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
+ s->static_len));
+
+ build_tree(s, (tree_desc *)(&(s->d_desc)));
+ Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
+ s->static_len));
+ /* At this point, opt_len and static_len are the total bit lengths of
+ * the compressed block data, excluding the tree representations.
+ */
+
+ /* Build the bit length tree for the above two trees, and get the index
+ * in bl_order of the last bit length code to send.
+ */
+ max_blindex = build_bl_tree(s);
+
+ /* Determine the best encoding. Compute first the block length in bytes*/
+ opt_lenb = (s->opt_len+3+7)>>3;
+ static_lenb = (s->static_len+3+7)>>3;
+
+ Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
+ opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
+ s->last_lit));
+
+ if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+
+ } else {
+ Assert(buf != (char*)0, "lost buf");
+ opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
+ }
+
+#ifdef FORCE_STORED
+ if (buf != (char*)0) { /* force stored block */
+#else
+ if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+ /* 4: two words for the lengths */
+#endif
+ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
+ * Otherwise we can't have processed more than WSIZE input bytes since
+ * the last block flush, because compression would have been
+ * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
+ * transform a block into a stored block.
+ */
+ _tr_stored_block(s, buf, stored_len, eof);
+
+#ifdef FORCE_STATIC
+ } else if (static_lenb >= 0) { /* force static trees */
+#else
+ } else if (static_lenb == opt_lenb) {
+#endif
+ send_bits(s, (STATIC_TREES<<1)+eof, 3);
+ compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree);
+#ifdef DEBUG
+ s->compressed_len += 3 + s->static_len;
+#endif
+ } else {
+ send_bits(s, (DYN_TREES<<1)+eof, 3);
+ send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
+ max_blindex+1);
+ compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree);
+#ifdef DEBUG
+ s->compressed_len += 3 + s->opt_len;
+#endif
+ }
+ Assert (s->compressed_len == s->bits_sent, "bad compressed size");
+ /* The above check is made mod 2^32, for files larger than 512 MB
+ * and uLong implemented on 32 bits.
+ */
+ init_block(s);
+
+ if (eof) {
+ bi_windup(s);
+#ifdef DEBUG
+ s->compressed_len += 7; /* align on byte boundary */
+#endif
+ }
+ Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
+ s->compressed_len-7*eof));
+}
+
+/* ===========================================================================
+ * Save the match info and tally the frequency counts. Return true if
+ * the current block must be flushed.
+ */
+int _tr_tally (s, dist, lc)
+ deflate_state *s;
+ unsigned dist; /* distance of matched string */
+ unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
+{
+ s->d_buf[s->last_lit] = (ush)dist;
+ s->l_buf[s->last_lit++] = (uch)lc;
+ if (dist == 0) {
+ /* lc is the unmatched char */
+ s->dyn_ltree[lc].Freq++;
+ } else {
+ s->matches++;
+ /* Here, lc is the match length - MIN_MATCH */
+ dist--; /* dist = match distance - 1 */
+ Assert((ush)dist < (ush)MAX_DIST(s) &&
+ (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
+ (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
+
+ s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
+ s->dyn_dtree[d_code(dist)].Freq++;
+ }
+
+#ifdef TRUNCATE_BLOCK
+ /* Try to guess if it is profitable to stop the current block here */
+ if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
+ /* Compute an upper bound for the compressed length */
+ ulg out_length = (ulg)s->last_lit*8L;
+ ulg in_length = (ulg)((long)s->strstart - s->block_start);
+ int dcode;
+ for (dcode = 0; dcode < D_CODES; dcode++) {
+ out_length += (ulg)s->dyn_dtree[dcode].Freq *
+ (5L+extra_dbits[dcode]);
+ }
+ out_length >>= 3;
+ Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
+ s->last_lit, in_length, out_length,
+ 100L - out_length*100L/in_length));
+ if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
+ }
+#endif
+ return (s->last_lit == s->lit_bufsize-1);
+ /* We avoid equality with lit_bufsize because of wraparound at 64K
+ * on 16 bit machines and because stored blocks are restricted to
+ * 64K-1 bytes.
+ */
+}
+
+/* ===========================================================================
+ * Send the block data compressed using the given Huffman trees
+ */
+local void compress_block(s, ltree, dtree)
+ deflate_state *s;
+ ct_data *ltree; /* literal tree */
+ ct_data *dtree; /* distance tree */
+{
+ unsigned dist; /* distance of matched string */
+ int lc; /* match length or unmatched char (if dist == 0) */
+ unsigned lx = 0; /* running index in l_buf */
+ unsigned code; /* the code to send */
+ int extra; /* number of extra bits to send */
+
+ if (s->last_lit != 0) do {
+ dist = s->d_buf[lx];
+ lc = s->l_buf[lx++];
+ if (dist == 0) {
+ send_code(s, lc, ltree); /* send a literal byte */
+ Tracecv(isgraph(lc), (stderr," '%c' ", lc));
+ } else {
+ /* Here, lc is the match length - MIN_MATCH */
+ code = _length_code[lc];
+ send_code(s, code+LITERALS+1, ltree); /* send the length code */
+ extra = extra_lbits[code];
+ if (extra != 0) {
+ lc -= base_length[code];
+ send_bits(s, lc, extra); /* send the extra length bits */
+ }
+ dist--; /* dist is now the match distance - 1 */
+ code = d_code(dist);
+ Assert (code < D_CODES, "bad d_code");
+
+ send_code(s, code, dtree); /* send the distance code */
+ extra = extra_dbits[code];
+ if (extra != 0) {
+ dist -= base_dist[code];
+ send_bits(s, dist, extra); /* send the extra distance bits */
+ }
+ } /* literal or match pair ? */
+
+ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
+ Assert(s->pending < s->lit_bufsize + 2*lx, "pendingBuf overflow");
+
+ } while (lx < s->last_lit);
+
+ send_code(s, END_BLOCK, ltree);
+ s->last_eob_len = ltree[END_BLOCK].Len;
+}
+
+/* ===========================================================================
+ * Set the data type to ASCII or BINARY, using a crude approximation:
+ * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise.
+ * IN assertion: the fields freq of dyn_ltree are set and the total of all
+ * frequencies does not exceed 64K (to fit in an int on 16 bit machines).
+ */
+local void set_data_type(s)
+ deflate_state *s;
+{
+ int n = 0;
+ unsigned ascii_freq = 0;
+ unsigned bin_freq = 0;
+ while (n < 7) bin_freq += s->dyn_ltree[n++].Freq;
+ while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq;
+ while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq;
+ s->data_type = (Byte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII);
+}
+
+/* ===========================================================================
+ * Reverse the first len bits of a code, using straightforward code (a faster
+ * method would use a table)
+ * IN assertion: 1 <= len <= 15
+ */
+local unsigned bi_reverse(code, len)
+ unsigned code; /* the value to invert */
+ int len; /* its bit length */
+{
+ register unsigned res = 0;
+ do {
+ res |= code & 1;
+ code >>= 1, res <<= 1;
+ } while (--len > 0);
+ return res >> 1;
+}
+
+/* ===========================================================================
+ * Flush the bit buffer, keeping at most 7 bits in it.
+ */
+local void bi_flush(s)
+ deflate_state *s;
+{
+ if (s->bi_valid == 16) {
+ put_short(s, s->bi_buf);
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+ } else if (s->bi_valid >= 8) {
+ put_byte(s, (Byte)s->bi_buf);
+ s->bi_buf >>= 8;
+ s->bi_valid -= 8;
+ }
+}
+
+/* ===========================================================================
+ * Flush the bit buffer and align the output on a byte boundary
+ */
+local void bi_windup(s)
+ deflate_state *s;
+{
+ if (s->bi_valid > 8) {
+ put_short(s, s->bi_buf);
+ } else if (s->bi_valid > 0) {
+ put_byte(s, (Byte)s->bi_buf);
+ }
+ s->bi_buf = 0;
+ s->bi_valid = 0;
+#ifdef DEBUG
+ s->bits_sent = (s->bits_sent+7) & ~7;
+#endif
+}
+
+/* ===========================================================================
+ * Copy a stored block, storing first the length and its
+ * one's complement if requested.
+ */
+local void copy_block(s, buf, len, header)
+ deflate_state *s;
+ charf *buf; /* the input data */
+ unsigned len; /* its length */
+ int header; /* true if block header must be written */
+{
+ bi_windup(s); /* align on byte boundary */
+ s->last_eob_len = 8; /* enough lookahead for inflate */
+
+ if (header) {
+ put_short(s, (ush)len);
+ put_short(s, (ush)~len);
+#ifdef DEBUG
+ s->bits_sent += 2*16;
+#endif
+ }
+#ifdef DEBUG
+ s->bits_sent += (ulg)len<<3;
+#endif
+ while (len--) {
+ put_byte(s, *buf++);
+ }
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/uncompr.c
@@ -1,0 +1,58 @@
+/* uncompr.c -- decompress a memory buffer
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: uncompr.c,v 1.1 2002/01/21 08:16:23 menno Exp $ */
+
+#include "zlib.h"
+
+/* ===========================================================================
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+int ZEXPORT uncompress (dest, destLen, source, sourceLen)
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
+ uLong sourceLen;
+{
+ z_stream stream;
+ int err;
+
+ stream.next_in = (Bytef*)source;
+ stream.avail_in = (uInt)sourceLen;
+ /* Check for source > 64K on 16-bit machine: */
+ if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
+
+ stream.next_out = dest;
+ stream.avail_out = (uInt)*destLen;
+ if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
+
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
+
+ err = inflateInit(&stream);
+ if (err != Z_OK) return err;
+
+ err = inflate(&stream, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ inflateEnd(&stream);
+ return err == Z_OK ? Z_BUF_ERROR : err;
+ }
+ *destLen = stream.total_out;
+
+ err = inflateEnd(&stream);
+ return err;
+}
--- /dev/null
+++ b/common/id3lib/zlib/src/zutil.c
@@ -1,0 +1,225 @@
+/* zutil.c -- target dependent utility functions for the compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zutil.c,v 1.1 2002/01/21 08:16:23 menno Exp $ */
+
+#include "zutil.h"
+
+struct internal_state {int dummy;}; /* for buggy compilers */
+
+#ifndef STDC
+extern void exit OF((int));
+#endif
+
+const char *z_errmsg[10] = {
+"need dictionary", /* Z_NEED_DICT 2 */
+"stream end", /* Z_STREAM_END 1 */
+"", /* Z_OK 0 */
+"file error", /* Z_ERRNO (-1) */
+"stream error", /* Z_STREAM_ERROR (-2) */
+"data error", /* Z_DATA_ERROR (-3) */
+"insufficient memory", /* Z_MEM_ERROR (-4) */
+"buffer error", /* Z_BUF_ERROR (-5) */
+"incompatible version",/* Z_VERSION_ERROR (-6) */
+""};
+
+
+const char * ZEXPORT zlibVersion()
+{
+ return ZLIB_VERSION;
+}
+
+#ifdef DEBUG
+
+# ifndef verbose
+# define verbose 0
+# endif
+int z_verbose = verbose;
+
+void z_error (m)
+ char *m;
+{
+ fprintf(stderr, "%s\n", m);
+ exit(1);
+}
+#endif
+
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(err)
+ int err;
+{
+ return ERR_MSG(err);
+}
+
+
+#ifndef HAVE_MEMCPY
+
+void zmemcpy(dest, source, len)
+ Bytef* dest;
+ const Bytef* source;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = *source++; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+
+int zmemcmp(s1, s2, len)
+ const Bytef* s1;
+ const Bytef* s2;
+ uInt len;
+{
+ uInt j;
+
+ for (j = 0; j < len; j++) {
+ if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
+ }
+ return 0;
+}
+
+void zmemzero(dest, len)
+ Bytef* dest;
+ uInt len;
+{
+ if (len == 0) return;
+ do {
+ *dest++ = 0; /* ??? to be unrolled */
+ } while (--len != 0);
+}
+#endif
+
+#ifdef __TURBOC__
+#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__)
+/* Small and medium model in Turbo C are for now limited to near allocation
+ * with reduced MAX_WBITS and MAX_MEM_LEVEL
+ */
+# define MY_ZCALLOC
+
+/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
+ * and farmalloc(64K) returns a pointer with an offset of 8, so we
+ * must fix the pointer. Warning: the pointer must be put back to its
+ * original form in order to free it, use zcfree().
+ */
+
+#define MAX_PTR 10
+/* 10*64K = 640K */
+
+local int next_ptr = 0;
+
+typedef struct ptr_table_s {
+ voidpf org_ptr;
+ voidpf new_ptr;
+} ptr_table;
+
+local ptr_table table[MAX_PTR];
+/* This table is used to remember the original form of pointers
+ * to large buffers (64K). Such pointers are normalized with a zero offset.
+ * Since MSDOS is not a preemptive multitasking OS, this table is not
+ * protected from concurrent access. This hack doesn't work anyway on
+ * a protected system like OS/2. Use Microsoft C instead.
+ */
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ voidpf buf = opaque; /* just to make some compilers happy */
+ ulg bsize = (ulg)items*size;
+
+ /* If we allocate less than 65520 bytes, we assume that farmalloc
+ * will return a usable pointer which doesn't have to be normalized.
+ */
+ if (bsize < 65520L) {
+ buf = farmalloc(bsize);
+ if (*(ush*)&buf != 0) return buf;
+ } else {
+ buf = farmalloc(bsize + 16L);
+ }
+ if (buf == NULL || next_ptr >= MAX_PTR) return NULL;
+ table[next_ptr].org_ptr = buf;
+
+ /* Normalize the pointer to seg:0 */
+ *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
+ *(ush*)&buf = 0;
+ table[next_ptr++].new_ptr = buf;
+ return buf;
+}
+
+void zcfree (voidpf opaque, voidpf ptr)
+{
+ int n;
+ if (*(ush*)&ptr != 0) { /* object < 64K */
+ farfree(ptr);
+ return;
+ }
+ /* Find the original pointer */
+ for (n = 0; n < next_ptr; n++) {
+ if (ptr != table[n].new_ptr) continue;
+
+ farfree(table[n].org_ptr);
+ while (++n < next_ptr) {
+ table[n-1] = table[n];
+ }
+ next_ptr--;
+ return;
+ }
+ ptr = opaque; /* just to make some compilers happy */
+ Assert(0, "zcfree: ptr not found");
+}
+#endif
+#endif /* __TURBOC__ */
+
+
+#if defined(M_I86) && !defined(__32BIT__)
+/* Microsoft C in 16-bit mode */
+
+# define MY_ZCALLOC
+
+#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
+# define _halloc halloc
+# define _hfree hfree
+#endif
+
+voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ return _halloc((long)items, size);
+}
+
+void zcfree (voidpf opaque, voidpf ptr)
+{
+ if (opaque) opaque = 0; /* to make compiler happy */
+ _hfree(ptr);
+}
+
+#endif /* MSC */
+
+
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef STDC
+extern voidp calloc OF((uInt items, uInt size));
+extern void free OF((voidpf ptr));
+#endif
+
+voidpf zcalloc (opaque, items, size)
+ voidpf opaque;
+ unsigned items;
+ unsigned size;
+{
+ if (opaque) items += size - size; /* make compiler happy */
+ return (voidpf)calloc(items, size);
+}
+
+void zcfree (opaque, ptr)
+ voidpf opaque;
+ voidpf ptr;
+{
+ free(ptr);
+ if (opaque) return; /* make compiler happy */
+}
+
+#endif /* MY_ZCALLOC */