You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(56) |
Jul
(101) |
Aug
(14) |
Sep
|
Oct
(1) |
Nov
|
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(66) |
Feb
(106) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(10) |
Oct
(7) |
Nov
|
Dec
|
2008 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <suc...@us...> - 2006-07-01 23:03:41
|
Revision: 76 Author: sucknblow Date: 2006-07-01 16:03:29 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=76&view=rev Log Message: ----------- * Add ChangeLog entries for 0.12 * Provide better information on licensing. * Add docs on pmplib structure and roadmap. * Add a copy of the LGPL, since this applies to much of pmplib. * svn:ignore build system files in ucs2, since it's going to stay for now. Modified Paths: -------------- trunk/ChangeLog trunk/README Added Paths: ----------- trunk/COPYING.LIB trunk/doc/ trunk/doc/roadmap.txt trunk/doc/structure.txt Property Changed: ---------------- trunk/lib/ucs2/ Added: trunk/COPYING.LIB =================================================================== --- trunk/COPYING.LIB (rev 0) +++ trunk/COPYING.LIB 2006-07-01 23:03:29 UTC (rev 76) @@ -0,0 +1,510 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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 Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + 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 Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +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 other code 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. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + 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, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser 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 combine 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) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) 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. + + d) 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. + + e) 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 materials to be 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 with +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 Lesser 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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! + + Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-06-29 17:39:59 UTC (rev 75) +++ trunk/ChangeLog 2006-07-01 23:03:29 UTC (rev 76) @@ -1,6 +1,13 @@ ChangeLog file for pmplib + Changes in 0.12 +- Command line options for easypmp have changed (now easier to type). +- Easypmp now has a manual page. +- Support for Samsung YH-920 added. +- Fixed crash when reading Ogg Vorbis tags. +- Bug fix for reading playists using iriverplus2 devices. + Changes in 0.11 - POSIX code updated: now works on Linux. - Bug-fix in playlist conversion for iRiver Plus2 Modified: trunk/README =================================================================== --- trunk/README 2006-06-29 17:39:59 UTC (rev 75) +++ trunk/README 2006-07-01 23:03:29 UTC (rev 76) @@ -1,7 +1,55 @@ PMPLib - Version 0.11 + Version 0.12 http://pmplib.sourceforge.net/ - Copyright (c) 2005-2006 by Nyaochi +* STRUCTURE +For a description of each component of PMPLib, please see the +doc/structure.txt file. +* COPYRIGHT AND LICENSING INFORMATION +The programs that comprise PMPLib are released under the GNU General +Public License (GPL). These may be found in the frontend directory. +The library for retrieving tags from music files in the lib/gmi +directory is also licensed under the GNU General Public License. +The following text applies to the programs and the gmi library. + + Copyright (c) 2005-2006 Nyaochi <ny...@ny...> + Copyright (c) 2006 Martin Ellis <mar...@kd...> + + 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 + +The following notice applies to the libraries found in the lib/pmp, +lib/pmp_portalplayer1, lib/pmp_iriverplus2, lib/pmp_irivnavi, +lib/ucs2, lib/filepath, and lib/playlist directories. + + Copyright (c) 2005-2006 Nyaochi <ny...@ny...> + Copyright (c) 2006 Martin Ellis <mar...@kd...> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public License + as published by the Free Software Foundation; either version 2.1 + 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA Added: trunk/doc/roadmap.txt =================================================================== --- trunk/doc/roadmap.txt (rev 0) +++ trunk/doc/roadmap.txt 2006-07-01 23:03:29 UTC (rev 76) @@ -0,0 +1,22 @@ +Roadmap for PMPLib +http://pmplib.sourceforge.net/ + +This file describes the changes planned for each version of pmplib. +Note that all plans listed here are subject to change! + +Version 0.13 +- Add the photo playlist support for iRiver U10/E10. +- Separate the source and destination directories for playlist conversion. + +Version 0.14 +- ? + +Things to be done before 1.0 +- Finalize the programing interfaces in the libraries. +- Write documents (build instruction, usage, programing interface, etc.) + +Long-term plan +- Support tuner preset conversion. +- Replace libid3tag, libogg, libvorbis with taglib. +- Prepare a syncronization plugin for foobar2000 (or Winamp???). +- Prepare SyncPMP, which will be a syncronization software using libpmp. Added: trunk/doc/structure.txt =================================================================== --- trunk/doc/structure.txt (rev 0) +++ trunk/doc/structure.txt 2006-07-01 23:03:29 UTC (rev 76) @@ -0,0 +1,52 @@ +Structure of PMPLib +http://pmplib.sourceforge.net/ + +This file describes the structure of the source code in the PMPLib +distribution. + +* STRUCTURE +frontend/easypmp/cui: + Program for using PMPlib from the command line (GPL). +frontend/easypmp/win32gui: + Windows program for using PMPlib with graphical user interface + (GPL). +frontend/easypmp/common: + Support routines for the above programs (GPL). + +lib/pmp: + Generic media player support library. Dynamically loads plugins + defined in the lib/pmp_* directories (LGPL). + +lib/ucs2: + Library for representing and manipulating text encoded using the + UCS-2 representation. Can convert to and from multi-byte + string (MBS) representations (LGPL). + +lib/gmi: + Library for retrieving tags from music files (GPL). + +lib/filepath: + Library for representing and manipulating paths and file names, + including support for different path separators (LGPL). + +lib/playlist: + Library for reading non-device specific playlist files (for example, + .m3u files) (LGPL). + +lib/pmp_iriverplus2: + Support library for + * iRiver H10Jnr; and + * iRiver U10 devices. + (LGPL) + +lib/pmp_portalplayer1: + Support library for + * MEDION MDJuke220 and MDJuke440; + * Samsung YH-820, YH-920 and YH-925; + * iRiver H10 UMS; and + * iRiver H10 MTP (with emergency connect mode) devices. + (LGPL) + +lib/pmp_irivnavi: + Support library for iRiver H100 and H300 devices. + (LGPL) Property changes on: trunk/lib/ucs2 ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-29 17:40:13
|
Revision: 75 Author: sucknblow Date: 2006-06-29 10:39:59 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=75&view=rev Log Message: ----------- Make compile by applying hdr_template.h change to trunk. Will no doubt conflict when merging branch. No big deal. Reduce number of compile warnings from lack of function prototypes for string.h functions. Modified Paths: -------------- trunk/frontend/easypmp/common/enumerate.c trunk/frontend/easypmp/cui/main.c trunk/frontend/easypmp/cui/util.c trunk/lib/pmp_iriverplus2/dat.c trunk/lib/pmp_iriverplus2/ip2db_idx.c trunk/lib/pmp_portalplayer1/hdr_template.h trunk/lib/pmp_portalplayer1/model_samsung.c trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c Modified: trunk/frontend/easypmp/common/enumerate.c =================================================================== --- trunk/frontend/easypmp/common/enumerate.c 2006-06-29 16:48:46 UTC (rev 74) +++ trunk/frontend/easypmp/common/enumerate.c 2006-06-29 17:39:59 UTC (rev 75) @@ -25,6 +25,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> Modified: trunk/frontend/easypmp/cui/main.c =================================================================== --- trunk/frontend/easypmp/cui/main.c 2006-06-29 16:48:46 UTC (rev 74) +++ trunk/frontend/easypmp/cui/main.c 2006-06-29 17:39:59 UTC (rev 75) @@ -25,6 +25,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> Modified: trunk/frontend/easypmp/cui/util.c =================================================================== --- trunk/frontend/easypmp/cui/util.c 2006-06-29 16:48:46 UTC (rev 74) +++ trunk/frontend/easypmp/cui/util.c 2006-06-29 17:39:59 UTC (rev 75) @@ -25,6 +25,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> Modified: trunk/lib/pmp_iriverplus2/dat.c =================================================================== --- trunk/lib/pmp_iriverplus2/dat.c 2006-06-29 16:48:46 UTC (rev 74) +++ trunk/lib/pmp_iriverplus2/dat.c 2006-06-29 17:39:59 UTC (rev 75) @@ -24,6 +24,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> Modified: trunk/lib/pmp_iriverplus2/ip2db_idx.c =================================================================== --- trunk/lib/pmp_iriverplus2/ip2db_idx.c 2006-06-29 16:48:46 UTC (rev 74) +++ trunk/lib/pmp_iriverplus2/ip2db_idx.c 2006-06-29 17:39:59 UTC (rev 75) @@ -24,6 +24,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> Modified: trunk/lib/pmp_portalplayer1/hdr_template.h =================================================================== --- trunk/lib/pmp_portalplayer1/hdr_template.h 2006-06-29 16:48:46 UTC (rev 74) +++ trunk/lib/pmp_portalplayer1/hdr_template.h 2006-06-29 17:39:59 UTC (rev 75) @@ -67,6 +67,7 @@ int hdr_init_medion_mdjuke220(hdr_t* hdr); int hdr_init_medion_mdjuke440(hdr_t* hdr); int hdr_init_samsung_yh820(hdr_t* hdr); +int hdr_init_samsung_yh920(hdr_t* hdr); int hdr_init_samsung_yh925(hdr_t* hdr); int hdr_init_sirius_s50(hdr_t* hdr); Modified: trunk/lib/pmp_portalplayer1/model_samsung.c =================================================================== --- trunk/lib/pmp_portalplayer1/model_samsung.c 2006-06-29 16:48:46 UTC (rev 74) +++ trunk/lib/pmp_portalplayer1/model_samsung.c 2006-06-29 17:39:59 UTC (rev 75) @@ -24,6 +24,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> Modified: trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-06-29 16:48:46 UTC (rev 74) +++ trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-06-29 17:39:59 UTC (rev 75) @@ -24,6 +24,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-29 16:48:52
|
Revision: 74 Author: sucknblow Date: 2006-06-29 09:48:46 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=74&view=rev Log Message: ----------- Update supported device lists. Modified Paths: -------------- trunk/debian/control trunk/frontend/easypmp/cui/easypmp.1 Modified: trunk/debian/control =================================================================== --- trunk/debian/control 2006-06-28 03:56:06 UTC (rev 73) +++ trunk/debian/control 2006-06-29 16:48:46 UTC (rev 74) @@ -25,9 +25,8 @@ * iRiver H10 MTP (with emergency connect mode) * iRiver H10Jr. UMS * iRiver U10 UMS - * MEDION MDJuke220 - * MEDION MDJuke440 - * Samsung YH-820 + * MEDION MDJuke220 and MDJuke 440 + * Samsung YH-820, YH-920 and YH-925 . A typical usage of easypmp is to connect the media player to the computer; mount it as if it were a normal USB disk; remove some music files from the Modified: trunk/frontend/easypmp/cui/easypmp.1 =================================================================== --- trunk/frontend/easypmp/cui/easypmp.1 2006-06-28 03:56:06 UTC (rev 73) +++ trunk/frontend/easypmp/cui/easypmp.1 2006-06-29 16:48:46 UTC (rev 74) @@ -62,9 +62,8 @@ * iRiver H10 MTP (with emergency connect mode) * iRiver H10Jr. UMS * iRiver U10 UMS - * MEDION MDJuke220 - * MEDION MDJuke440 - * Samsung YH-820 + * MEDION MDJuke220 and MDJuke440 + * Samsung YH-820, YH-920 and YH-925 Note that some of the iRiver devices listed above may not support UMS as shipped. For example, in Europe and the United States, the iRiver This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-28 03:56:18
|
Revision: 73 Author: nyaochi Date: 2006-06-27 20:56:06 -0700 (Tue, 27 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=73&view=rev Log Message: ----------- Supported YH-920. Modified Paths: -------------- branches/branch_0.12/lib/pmp_portalplayer1/hdr_template.h branches/branch_0.12/pmp.sln trunk/lib/pmp_portalplayer1/model_samsung.c trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c Modified: branches/branch_0.12/lib/pmp_portalplayer1/hdr_template.h =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/hdr_template.h 2006-06-25 19:52:44 UTC (rev 72) +++ branches/branch_0.12/lib/pmp_portalplayer1/hdr_template.h 2006-06-28 03:56:06 UTC (rev 73) @@ -67,6 +67,7 @@ int hdr_init_medion_mdjuke220(hdr_t* hdr); int hdr_init_medion_mdjuke440(hdr_t* hdr); int hdr_init_samsung_yh820(hdr_t* hdr); +int hdr_init_samsung_yh920(hdr_t* hdr); int hdr_init_samsung_yh925(hdr_t* hdr); int hdr_init_sirius_s50(hdr_t* hdr); Modified: branches/branch_0.12/pmp.sln =================================================================== --- branches/branch_0.12/pmp.sln 2006-06-25 19:52:44 UTC (rev 72) +++ branches/branch_0.12/pmp.sln 2006-06-28 03:56:06 UTC (rev 73) @@ -11,7 +11,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmi", "lib\gmi\gmi.vcproj", "{3575EFC2-9051-467A-BEB4-E71E2F8664D7}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} - {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection @@ -25,7 +24,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmp_irivnavi", "lib\pmp_irivnavi\pmp_irivnavi.vcproj", "{2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} - {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection @@ -40,13 +38,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "playlist", "lib\playlist\playlist.vcproj", "{3419FA86-F518-4D3B-94C6-B05436439102}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} - {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} + {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "easypmp_cui", "frontend\easypmp\cui\easypmp_cui.vcproj", "{FA1F30D4-6100-4379-8506-6CFE023B0AE7}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} - {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {E393575C-6B10-43BD-B2C0-63C5040A49F7} = {E393575C-6B10-43BD-B2C0-63C5040A49F7} {2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1} = {2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} @@ -83,10 +80,6 @@ {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wstring", "lib\wstring\wstring.vcproj", "{59650257-D8E9-4253-827D-8110C3DAAA3D}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -137,10 +130,6 @@ {E173B48E-95A6-4B16-9A27-57F168C93355}.Debug.Build.0 = Debug|Win32 {E173B48E-95A6-4B16-9A27-57F168C93355}.Release.ActiveCfg = Release|Win32 {E173B48E-95A6-4B16-9A27-57F168C93355}.Release.Build.0 = Release|Win32 - {59650257-D8E9-4253-827D-8110C3DAAA3D}.Debug.ActiveCfg = Debug|Win32 - {59650257-D8E9-4253-827D-8110C3DAAA3D}.Debug.Build.0 = Debug|Win32 - {59650257-D8E9-4253-827D-8110C3DAAA3D}.Release.ActiveCfg = Release|Win32 - {59650257-D8E9-4253-827D-8110C3DAAA3D}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection Modified: trunk/lib/pmp_portalplayer1/model_samsung.c =================================================================== --- trunk/lib/pmp_portalplayer1/model_samsung.c 2006-06-25 19:52:44 UTC (rev 72) +++ trunk/lib/pmp_portalplayer1/model_samsung.c 2006-06-28 03:56:06 UTC (rev 73) @@ -251,6 +251,15 @@ {251956, 18, 6000, 1032, 0, samsung_dat_repr, samsung_dat_set, samsung_dat_get}, }; +/********** Samsung YH-920 firmware 1.61 **********/ +static hdr_template_t hdrtmpl_samsung_yh920 = { + 0, 0, "System\\DATA\\PP5000.DAT", 1, "System\\DATA\\PP5000.HDR", 0x00000428, 0, 0, 18, + hdrtmpl_fd_samsung, + hdrtmpl_max_dat_field_size_samsung, + 0, 0, + {251956, 18, 6000, 1032, 0, samsung_dat_repr, samsung_dat_set, samsung_dat_get}, +}; + /********** Samsung YH-925 firmware 1.61 **********/ static hdr_template_t hdrtmpl_samsung_yh925 = { 0, 0, "System\\DATA\\PP5000.DAT", 1, "System\\DATA\\PP5000.HDR", 0x00000428, 0, 0, 18, @@ -265,6 +274,11 @@ return apply_template(hdr, &hdrtmpl_samsung_yh820); } +int hdr_init_samsung_yh920(hdr_t* hdr) +{ + return apply_template(hdr, &hdrtmpl_samsung_yh920); +} + int hdr_init_samsung_yh925(hdr_t* hdr) { return apply_template(hdr, &hdrtmpl_samsung_yh925); Modified: trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-06-25 19:52:44 UTC (rev 72) +++ trunk/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-06-28 03:56:06 UTC (rev 73) @@ -149,6 +149,14 @@ hdr_init_samsung_yh820, samsung_parse_model }, { + "samsung_yh920", "Samsung YH-920", + 20, "UM", + "5.15", "5.15", + "SYSTEM\\FW_YH920.mi4", "System\\DATA\\PP5000.HDR", "System\\MUSIC\\", "System\\PLAYLIST\\", + ".plp", + hdr_init_samsung_yh920, samsung_parse_model + }, + { "samsung_yh925", "Samsung YH-925", 5, "UM", "1.61", "1.61", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-25 19:52:52
|
Revision: 72 Author: sucknblow Date: 2006-06-25 12:52:44 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=72&view=rev Log Message: ----------- Add man page to debian package. Modified Paths: -------------- trunk/debian/easypmp.install Modified: trunk/debian/easypmp.install =================================================================== --- trunk/debian/easypmp.install 2006-06-25 19:08:24 UTC (rev 71) +++ trunk/debian/easypmp.install 2006-06-25 19:52:44 UTC (rev 72) @@ -3,5 +3,6 @@ debian/tmp/usr/lib/pmplib/*.la debian/tmp/usr/bin/easypmp debian/tmp/usr/share/pmplib/* +debian/tmp/usr/share/man/man1/easypmp.1 debian/tmp/usr/share/doc/easypmp/* debian/lintian/easypmp usr/share/lintian/overrides This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-25 19:08:28
|
Revision: 71 Author: sucknblow Date: 2006-06-25 12:08:24 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=71&view=rev Log Message: ----------- Fix this crash when reading Ogg Vorbis tags: *** glibc detected *** double free or corruption (!prev): 0x0000000000552a50 *** Turns out that ov_clear closes the file for you - no need to do it explicitly. Modified Paths: -------------- trunk/lib/gmi/gmi_vorbis.c Modified: trunk/lib/gmi/gmi_vorbis.c =================================================================== --- trunk/lib/gmi/gmi_vorbis.c 2006-06-25 18:19:48 UTC (rev 70) +++ trunk/lib/gmi/gmi_vorbis.c 2006-06-25 19:08:24 UTC (rev 71) @@ -112,8 +112,10 @@ } info->codec = PMPCODEC_VORBIS; + + // Clear the decoders buffers, also closes fp. ov_clear(&vf); - fclose(fp); + return 0; error_exit: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-25 18:19:53
|
Revision: 70 Author: sucknblow Date: 2006-06-25 11:19:48 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=70&view=rev Log Message: ----------- Install manual page. -D option became -d --- forgot some of the changes required for this. Make -u option do "database mode". Modified Paths: -------------- trunk/frontend/easypmp/cui/Makefile.am trunk/frontend/easypmp/cui/option.c Modified: trunk/frontend/easypmp/cui/Makefile.am =================================================================== --- trunk/frontend/easypmp/cui/Makefile.am 2006-06-25 06:10:55 UTC (rev 69) +++ trunk/frontend/easypmp/cui/Makefile.am 2006-06-25 18:19:48 UTC (rev 70) @@ -1,7 +1,7 @@ # $Id$ bin_PROGRAMS = easypmp -man_MANS = +man_MANS = easypmp.1 EXTRA_DIST = ${man_MANS} getopt.c getopt1.c easypmp_SOURCES = \ Modified: trunk/frontend/easypmp/cui/option.c =================================================================== --- trunk/frontend/easypmp/cui/option.c 2006-06-25 06:10:55 UTC (rev 69) +++ trunk/frontend/easypmp/cui/option.c 2006-06-25 18:19:48 UTC (rev 70) @@ -135,9 +135,9 @@ {NULL, 0, 0, 0} }; #ifndef _WIN32 - int c = getopt_long(argc, argv, "cuzRL:t:pmrfsjlD:e:w:vh", long_options, &option_index); + int c = getopt_long(argc, argv, "cuzRL:t:pmrfsjld:e:w:vh", long_options, &option_index); #else - int c = getopt_long(argc, argv, "cuzRL:t:pmrfsjlD:vh", long_options, &option_index); + int c = getopt_long(argc, argv, "cuzRL:t:pmrfsjld:vh", long_options, &option_index); #endif/*_WIN32*/ if (c == -1) { break; @@ -148,7 +148,7 @@ opt->verb |= MODE_DATABASE; break; case 'u': - opt->verb |= MODE_DATABASE_UPDATE; + opt->verb |= (MODE_DATABASE | MODE_DATABASE_UPDATE); break; case 'z': if (strcmp(optarg, "m") == 0) opt->media_info_source = GMIF_TAG; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-25 06:11:04
|
Revision: 69 Author: nyaochi Date: 2006-06-24 23:10:55 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=69&view=rev Log Message: ----------- Added Makefile.am for libwstring Modified Paths: -------------- branches/branch_0.12/Makefile.am Added Paths: ----------- branches/branch_0.12/lib/wstring/Makefile.am Modified: branches/branch_0.12/Makefile.am =================================================================== --- branches/branch_0.12/Makefile.am 2006-06-25 06:06:43 UTC (rev 68) +++ branches/branch_0.12/Makefile.am 2006-06-25 06:10:55 UTC (rev 69) @@ -1,6 +1,6 @@ # $Id$ -SUBDIRS = m4 libltdl lib/ucs2 lib/filepath lib/gmi lib/playlist lib/pmp lib/pmp_irivnavi lib/pmp_portalplayer1 lib/pmp_iriverplus2 frontend/easypmp/cui +SUBDIRS = m4 libltdl lib/wstring lib/ucs2 lib/filepath lib/gmi lib/playlist lib/pmp lib/pmp_irivnavi lib/pmp_portalplayer1 lib/pmp_iriverplus2 frontend/easypmp/cui docdir = $(prefix)/share/doc/@PACKAGE@ doc_DATA = README INSTALL COPYING AUTHORS ChangeLog Added: branches/branch_0.12/lib/wstring/Makefile.am =================================================================== --- branches/branch_0.12/lib/wstring/Makefile.am (rev 0) +++ branches/branch_0.12/lib/wstring/Makefile.am 2006-06-25 06:10:55 UTC (rev 69) @@ -0,0 +1,13 @@ +# $Id$ + +noinst_LTLIBRARIES = libwstring.la + +libwstring_la_SOURCES = \ + ../../include/wstring.h \ + wstring.c \ + wstring_iconv.c + +libwstring_la_LDFLAGS = @ICONV_LIBS@ -no-undefined + +AM_CFLAGS = @CFLAGS@ +INCLUDES = @INCLUDES@ Property changes on: branches/branch_0.12/lib/wstring/Makefile.am ___________________________________________________________________ Name: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-25 06:06:51
|
Revision: 68 Author: nyaochi Date: 2006-06-24 23:06:43 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=68&view=rev Log Message: ----------- Added wstring_iconv.c Modified Paths: -------------- branches/branch_0.12/lib/wstring/wstring.vcproj branches/branch_0.12/lib/wstring/wstring_win32.c Added Paths: ----------- branches/branch_0.12/lib/wstring/wstring.c branches/branch_0.12/lib/wstring/wstring_iconv.c Added: branches/branch_0.12/lib/wstring/wstring.c =================================================================== --- branches/branch_0.12/lib/wstring/wstring.c (rev 0) +++ branches/branch_0.12/lib/wstring/wstring.c 2006-06-25 06:06:43 UTC (rev 68) @@ -0,0 +1,192 @@ +/* + * wchar_t utility routine. + * + * Copyright (c) 2005-2006 Nyaochi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/* $Id$ */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif/*HAVE_CONFIG_H*/ + +#include <os.h> +#include <ctype.h> +#include <stdlib.h> +#include <wchar.h> +#include <string.h> + +#define COMP(a, b) ((a)>(b))-((a)<(b)) + +char *wcsdupmbs(const wchar_t* src) +{ + size_t dst_size = wcstombs(NULL, src, 0); + char* dst = (char*)malloc((dst_size+1) * sizeof(char)); + if (dst) { + wcstombs(dst, src, dst_size); + dst[dst_size] = 0; + } + return dst; +} + +wchar_t *mbsdupwcs(const char* src) +{ + size_t dst_size = mbstowcs(NULL, src, strlen(src)); + wchar_t* dst = (wchar_t*)malloc(dst_size + sizeof(wchar_t)); + if (dst) { + mbstowcs(dst, src, strlen(src)); + dst[dst_size/sizeof(wchar_t)] = 0; + } + return dst; +} + +char *wcsduputf8(const wchar_t* src) +{ + size_t dst_size = wcstoutf8(NULL, src, 0); + char* dst = (char*)malloc((dst_size+1) * sizeof(char)); + if (dst) { + wcstoutf8(dst, src, dst_size); + dst[dst_size] = 0; + } + return dst; +} + +wchar_t *utf8dupwcs(const char *src) +{ + size_t dst_length = utf8towcs(NULL, src, 0); + wchar_t* dst = (wchar_t*)malloc((dst_length+1) * sizeof(wchar_t)); + if (dst) { + utf8towcs(dst, src, dst_length); + dst[dst_length] = 0; + } + return dst; +} + +wchar_t *wcsstrip(wchar_t* str) +{ + wchar_t *p = str + wcslen(str); + while (str < p) { + if (!*p || *p == L'\n' || *p == L'\r') { + *p = 0; + continue; + } + } + return str; +} + +int has_utf8bom(FILE *fp) +{ + int c[3]; + int ret = 0; + + /* Read three bytes. */ + if ((c[0] = fgetc(fp)) == EOF) { + return ret; + } + if ((c[1] = fgetc(fp)) == EOF) { + ungetc(c[0], fp); + return ret; + } + if ((c[2] = fgetc(fp)) == EOF) { + ungetc(c[1], fp); + ungetc(c[0], fp); + return ret; + } + + if ((char)c[0] == 0xEF && (char)c[1] == 0xBB && (char)c[2] == 0xBF) { + ret = 1; + } + + /* Put back the read characters. */ + ungetc(c[2], fp); + ungetc(c[1], fp); + ungetc(c[0], fp); + + return ret; +} + +wchar_t *wcsfgets(wchar_t* str, size_t n, FILE *fp, int is_utf8) +{ + /* Limit maximum bytes for a line to length. */ + char *line = alloca(n); + if (!fgets(line, (int)n, fp)) { + return NULL; + } + + /* Convert multi-byte characters to wide characters. */ + if (is_utf8) { + /* Make sure we have enough buffer to store the line. */ + size_t actual_length = utf8towcs(NULL, line, 0) / sizeof(wchar_t); + if (actual_length < n) { + /* Convert UTF-8 characters to wide characters. */ + utf8towcs(str, line, actual_length); + str[actual_length] = 0; + return str; + } else { + /* Otherwise return NULL. */ + return NULL; + } + } else { + /* Make sure we have enough buffer to store the line. */ + size_t actual_length = mbstowcs(NULL, line, strlen(line)) / sizeof(wchar_t); + if (actual_length < n) { + /* Convert locale characters to wide characters. */ + mbstowcs(str, line, strlen(line)); + str[actual_length] = 0; + return str; + } else { + /* Otherwise return NULL. */ + return NULL; + } + } +} + +wchar_t* wcsndup(const wchar_t* src, size_t length) +{ + wchar_t* dst = NULL; + size_t src_length = wcslen(src); + if (length < src_length) { + src_length = length; + } + dst = (wchar_t*)malloc((src_length+1) * sizeof(wchar_t)); + if (dst) { + size_t i; + for (i = 0;i < src_length;i++) { + dst[i] = src[i]; + } + dst[i] = 0; + } + return dst; +} + +int wcsincmp(const wchar_t* x, const wchar_t* y, size_t n) +{ + size_t i; + wchar_t a = 0, b = 0; + + for (i = 0;i < n-1;i++) { + a = towupper(*x); + b = towupper(*y); + if (!*x || !*y || a != b) { + break; + } + x++; + y++; + } + return COMP(a, b); +} Property changes on: branches/branch_0.12/lib/wstring/wstring.c ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Modified: branches/branch_0.12/lib/wstring/wstring.vcproj =================================================================== --- branches/branch_0.12/lib/wstring/wstring.vcproj 2006-06-25 05:40:52 UTC (rev 67) +++ branches/branch_0.12/lib/wstring/wstring.vcproj 2006-06-25 06:06:43 UTC (rev 68) @@ -100,6 +100,12 @@ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> <File + RelativePath=".\wstring.c"> + </File> + <File + RelativePath=".\wstring_iconv.c"> + </File> + <File RelativePath=".\wstring_win32.c"> </File> </Filter> Added: branches/branch_0.12/lib/wstring/wstring_iconv.c =================================================================== --- branches/branch_0.12/lib/wstring/wstring_iconv.c (rev 0) +++ branches/branch_0.12/lib/wstring/wstring_iconv.c 2006-06-25 06:06:43 UTC (rev 68) @@ -0,0 +1,56 @@ +/* + * wchar_t utility routine. + * + * Copyright (c) 2005-2006 Nyaochi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/* $Id$ */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif/*HAVE_CONFIG_H*/ + +#include <os.h> +#include <ctype.h> +#include <stdlib.h> +#include <wchar.h> +#include <string.h> + +#include <iconv.h> + +#ifdef USE_LIBICONV_GNU +#define iconv_open libiconv_open +#define iconv_convert libiconv_convert +#define iconv_close libiconv_close +#endif/*USE_LIBICONV_GNU*/ + +size_t utf8towcs(wchar_t* dst, const char *src, size_t dst_length) +{ + iconv_t cd = iconv_open("WCHAR_T", "UTF-8"); + size_t ret = iconv_convert(cd, (char **)&dst, dst_length * sizeof(wchar_t), (char **)&src, strlen(src)); + iconv_close(cd); + return ret; +} + +size_t wcstoutf8(char *dst, const wchar_t *src, size_t dst_size) +{ + iconv_t cd = iconv_open("UTF-8", "WCHAR_T"); + size_t ret = iconv_convert(cd, (char **)&dst, dst_length * sizeof(char), (char **)&src, wcslen(src)); + iconv_close(cd); + return ret; +} Property changes on: branches/branch_0.12/lib/wstring/wstring_iconv.c ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Modified: branches/branch_0.12/lib/wstring/wstring_win32.c =================================================================== --- branches/branch_0.12/lib/wstring/wstring_win32.c 2006-06-25 05:40:52 UTC (rev 67) +++ branches/branch_0.12/lib/wstring/wstring_win32.c 2006-06-25 06:06:43 UTC (rev 68) @@ -31,30 +31,6 @@ #include <wchar.h> #include <string.h> -#define COMP(a, b) ((a)>(b))-((a)<(b)) - -char *wcsdupmbs(const wchar_t* src) -{ - size_t dst_size = wcstombs(NULL, src, 0); - char* dst = (char*)malloc((dst_size+1) * sizeof(char)); - if (dst) { - wcstombs(dst, src, dst_size); - dst[dst_size] = 0; - } - return dst; -} - -wchar_t *mbsdupwcs(const char* src) -{ - size_t dst_size = mbstowcs(NULL, src, strlen(src)); - wchar_t* dst = (wchar_t*)malloc(dst_size + sizeof(wchar_t)); - if (dst) { - mbstowcs(dst, src, strlen(src)); - dst[dst_size/sizeof(wchar_t)] = 0; - } - return dst; -} - size_t utf8towcs(wchar_t* dst, const char *src, size_t dst_length) { size_t length = 0; @@ -134,141 +110,6 @@ } } -char *wcsduputf8(const wchar_t* src) -{ - size_t dst_size = wcstoutf8(NULL, src, 0); - char* dst = (char*)malloc((dst_size+1) * sizeof(char)); - if (dst) { - wcstoutf8(dst, src, dst_size); - dst[dst_size] = 0; - } - return dst; -} -wchar_t *utf8dupwcs(const char *src) -{ - size_t dst_length = utf8towcs(NULL, src, 0); - wchar_t* dst = (wchar_t*)malloc((dst_length+1) * sizeof(wchar_t)); - if (dst) { - utf8towcs(dst, src, dst_length); - dst[dst_length] = 0; - } - return dst; -} -wchar_t *wcsstrip(wchar_t* str) -{ - wchar_t *p = str + wcslen(str); - while (str < p) { - if (!*p || *p == L'\n' || *p == L'\r') { - *p = 0; - continue; - } - } - return str; -} -int has_utf8bom(FILE *fp) -{ - int c[3]; - int ret = 0; - - /* Read three bytes. */ - if ((c[0] = fgetc(fp)) == EOF) { - return ret; - } - if ((c[1] = fgetc(fp)) == EOF) { - ungetc(c[0], fp); - return ret; - } - if ((c[2] = fgetc(fp)) == EOF) { - ungetc(c[1], fp); - ungetc(c[0], fp); - return ret; - } - - if ((char)c[0] == 0xEF && (char)c[1] == 0xBB && (char)c[2] == 0xBF) { - ret = 1; - } - - /* Put back the read characters. */ - ungetc(c[2], fp); - ungetc(c[1], fp); - ungetc(c[0], fp); - - return ret; -} - -wchar_t *wcsfgets(wchar_t* str, size_t n, FILE *fp, int is_utf8) -{ - /* Limit maximum bytes for a line to length. */ - char *line = alloca(n); - if (!fgets(line, (int)n, fp)) { - return NULL; - } - - /* Convert multi-byte characters to wide characters. */ - if (is_utf8) { - /* Make sure we have enough buffer to store the line. */ - size_t actual_length = utf8towcs(NULL, line, 0) / sizeof(wchar_t); - if (actual_length < n) { - /* Convert UTF-8 characters to wide characters. */ - utf8towcs(str, line, actual_length); - str[actual_length] = 0; - return str; - } else { - /* Otherwise return NULL. */ - return NULL; - } - } else { - /* Make sure we have enough buffer to store the line. */ - size_t actual_length = mbstowcs(NULL, line, strlen(line)) / sizeof(wchar_t); - if (actual_length < n) { - /* Convert locale characters to wide characters. */ - mbstowcs(str, line, strlen(line)); - str[actual_length] = 0; - return str; - } else { - /* Otherwise return NULL. */ - return NULL; - } - } -} - -wchar_t* wcsndup(const wchar_t* src, size_t length) -{ - wchar_t* dst = NULL; - size_t src_length = wcslen(src); - if (length < src_length) { - src_length = length; - } - dst = (wchar_t*)malloc((src_length+1) * sizeof(wchar_t)); - if (dst) { - size_t i; - for (i = 0;i < src_length;i++) { - dst[i] = src[i]; - } - dst[i] = 0; - } - return dst; -} - -int wcsincmp(const wchar_t* x, const wchar_t* y, size_t n) -{ - size_t i; - wchar_t a = 0, b = 0; - - for (i = 0;i < n-1;i++) { - a = towupper(*x); - b = towupper(*y); - if (!*x || !*y || a != b) { - break; - } - x++; - y++; - } - return COMP(a, b); -} - - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-25 05:41:25
|
Revision: 67 Author: nyaochi Date: 2006-06-24 22:40:52 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=67&view=rev Log Message: ----------- migration for libpmp_iriverplus2 and the CUI frontend Modified Paths: -------------- branches/branch_0.12/frontend/easypmp/common/database.c branches/branch_0.12/frontend/easypmp/common/easypmp.h branches/branch_0.12/frontend/easypmp/common/enumerate.c branches/branch_0.12/frontend/easypmp/common/playlist.c branches/branch_0.12/frontend/easypmp/cui/device.c branches/branch_0.12/frontend/easypmp/cui/easypmp_cui.vcproj branches/branch_0.12/frontend/easypmp/cui/main.c branches/branch_0.12/frontend/easypmp/cui/option.c branches/branch_0.12/frontend/easypmp/cui/util.c branches/branch_0.12/frontend/easypmp/cui/util.h branches/branch_0.12/include/filepath.h branches/branch_0.12/lib/filepath/filepath_win32.c branches/branch_0.12/lib/pmp_iriverplus2/ip2db.c branches/branch_0.12/lib/pmp_iriverplus2/pmp_iriverplus2.c branches/branch_0.12/pmp.sln Modified: branches/branch_0.12/frontend/easypmp/common/database.c =================================================================== --- branches/branch_0.12/frontend/easypmp/common/database.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/common/database.c 2006-06-25 05:40:52 UTC (rev 67) @@ -30,7 +30,7 @@ #include <stdio.h> #include <stdlib.h> #include <time.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <pmp.h> #include <gmi.h> @@ -39,7 +39,7 @@ #ifdef _WIN32 #define COMP_STR(x, y) lstrcmpiW(x, y) /* FAT32 treats upper/lower letters as identical. */ #else -#define COMP_STR(x, y) ucs2cmp(x, y) +#define COMP_STR(x, y) wcscmp(x, y) #endif static uint32_t get_current_time() @@ -55,7 +55,7 @@ static int find_mediafile( pmp_record_t* records, int num_records, - const ucs2char_t* filename, + const wchar_t* filename, int *begin, int *end ) @@ -154,11 +154,11 @@ int is_skipping = 0; easypmp_filename_t* target = &fl->elements[i]; pmp_record_t* record = &records[i]; - ucs2char_t filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; uint32_t timestamp = 0; filepath_combinepath(filename, MAX_PATH, target->pathname, target->filename); - timestamp = (uint32_t)ucs2stat_mtime(filename); + timestamp = (uint32_t)filepath_mtime(filename); // Report the progress. if (progress(instance, EASYPMPDBP_GMI | EASYPMPSP_PROGRESS, i, 0, filename) != 0) { @@ -381,10 +381,10 @@ -int easypmp_set_strip_words(option_t* opt, const ucs2char_t* str) +int easypmp_set_strip_words(option_t* opt, const wchar_t* str) { size_t i; - const ucs2char_t *p = 0, *q = 0; + const wchar_t *p = 0, *q = 0; /* * This function parses a list of strip words specified by comma separated @@ -394,9 +394,9 @@ /* Free buffers allocated already. */ for (i = 0;i < opt->num_strip_words;++i) { - ucs2free(opt->strip_words[i]); + free(opt->strip_words[i]); } - ucs2free(opt->strip_words); + free(opt->strip_words); if (str && *str) { /* Count the number of strip words in str. */ @@ -408,7 +408,7 @@ } /* Allocate an array to store strip words. */ - opt->strip_words = (ucs2char_t**)ucs2malloc(sizeof(ucs2char_t*) * opt->num_strip_words); + opt->strip_words = (wchar_t**)malloc(sizeof(wchar_t*) * opt->num_strip_words); if (!opt->strip_words) { return -1; } @@ -420,9 +420,9 @@ for (;;) { if (*q == ',' || !*q) { size_t length = (size_t)(q - p); - opt->strip_words[i] = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * (length+1)); - memset(opt->strip_words[i], 0, sizeof(ucs2char_t) * (length+1)); - ucs2ncpy(opt->strip_words[i], p, length); + opt->strip_words[i] = (wchar_t*)malloc(sizeof(wchar_t) * (length+1)); + memset(opt->strip_words[i], 0, sizeof(wchar_t) * (length+1)); + wcsncpy(opt->strip_words[i], p, length); opt->strip_words[i][length] = 0; if (!*q) { break; Modified: branches/branch_0.12/frontend/easypmp/common/easypmp.h =================================================================== --- branches/branch_0.12/frontend/easypmp/common/easypmp.h 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/common/easypmp.h 2006-06-25 05:40:52 UTC (rev 67) @@ -84,18 +84,18 @@ uint32_t verb; uint32_t media_info_source; int repr_level; - ucs2char_t path_to_root[MAX_PATH]; - ucs2char_t path_to_include[MAX_PATH]; + wchar_t path_to_root[MAX_PATH]; + wchar_t path_to_include[MAX_PATH]; char model[128]; char *system_encoding; char *music_encoding; - ucs2char_t** strip_words; + wchar_t** strip_words; int num_strip_words; } option_t; typedef struct { - ucs2char_t pathname[MAX_PATH]; - ucs2char_t filename[MAX_PATH]; + wchar_t pathname[MAX_PATH]; + wchar_t filename[MAX_PATH]; } easypmp_filename_t; typedef struct { @@ -103,14 +103,14 @@ easypmp_filename_t* elements; } easypmp_filelist_t; -typedef int (*easypmp_enumerate_progress_t)(void *instance, const ucs2char_t* path, const ucs2char_t* file, size_t n); +typedef int (*easypmp_enumerate_progress_t)(void *instance, const wchar_t* path, const wchar_t* file, size_t n); typedef int (*easypmp_progress_t)( void *instance, int phase, int param_int, double param_float, - ucs2char_t* param_str + wchar_t* param_str ); int @@ -155,7 +155,7 @@ int easypmp_set_strip_words( option_t* opt, - const ucs2char_t* str + const wchar_t* str ); int Modified: branches/branch_0.12/frontend/easypmp/common/enumerate.c =================================================================== --- branches/branch_0.12/frontend/easypmp/common/enumerate.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/common/enumerate.c 2006-06-25 05:40:52 UTC (rev 67) @@ -29,7 +29,7 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <playlist.h> #include <pmp.h> @@ -44,7 +44,7 @@ void *instance; } enumerate_dat_t; -static int found_music_file(void *instance, const ucs2char_t* found_path, const ucs2char_t* found_file) +static int found_music_file(void *instance, const wchar_t* found_path, const wchar_t* found_file) { enumerate_dat_t* ed = (enumerate_dat_t*)instance; pmp_t* pmp = ed->pmp; @@ -65,8 +65,8 @@ // Set path and file. new_filename = &fl->elements[fl->num_elements++]; - ucs2cpy(new_filename->pathname, found_path); - ucs2cpy(new_filename->filename, found_file); + wcscpy(new_filename->pathname, found_path); + wcscpy(new_filename->filename, found_file); } else { // Exit if the filename does not have a supported extension. return 0; @@ -109,7 +109,7 @@ ); } -static int found_playlist_file(void *instance, const ucs2char_t* found_path, const ucs2char_t* found_file) +static int found_playlist_file(void *instance, const wchar_t* found_path, const wchar_t* found_file) { enumerate_dat_t* ed = (enumerate_dat_t*)instance; pmp_t* pmp = ed->pmp; @@ -131,8 +131,8 @@ // Set path and file. new_filename = &fl->elements[fl->num_elements++]; - ucs2cpy(new_filename->pathname, found_path); - ucs2cpy(new_filename->filename, found_file); + wcscpy(new_filename->pathname, found_path); + wcscpy(new_filename->filename, found_file); } else { // Exit if the filename does not have a supported extension. return 0; Modified: branches/branch_0.12/frontend/easypmp/common/playlist.c =================================================================== --- branches/branch_0.12/frontend/easypmp/common/playlist.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/common/playlist.c 2006-06-25 05:40:52 UTC (rev 67) @@ -29,7 +29,7 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <pmp.h> #include <playlist.h> @@ -41,7 +41,7 @@ easypmp_progress_t progress; } callback_data_t; -static void callback_from_playlist(void *instance, int level, ucs2char_t* message) +static void callback_from_playlist(void *instance, int level, wchar_t* message) { int phase = EASYPMPPLP_CONVERT; callback_data_t* cd = (callback_data_t*)instance; @@ -98,8 +98,8 @@ goto error_exit; } for (i = 0;i < musics->num_elements;++i) { - ucs2cpy(mediafiles[i].path, musics->elements[i].pathname); - ucs2cpy(mediafiles[i].file, musics->elements[i].filename); + wcscpy(mediafiles[i].path, musics->elements[i].pathname); + wcscpy(mediafiles[i].file, musics->elements[i].filename); } // Prepare playlist conversion for finding music files. @@ -114,7 +114,7 @@ // Loop over playlist files. for (i = 0;i < playlists->num_elements;++i) { playlists_t pls; - ucs2char_t src[MAX_PATH]; + wchar_t src[MAX_PATH]; const easypmp_filename_t* plf = &playlists->elements[i]; int k = 0; int n = 0; @@ -146,14 +146,14 @@ } for (k = 0;k < pls.num_playlists;++k) { - ucs2char_t** contents = NULL; + wchar_t** contents = NULL; playlist_t* pl = &pls.playlists[k]; - ucs2char_t dst[MAX_PATH]; + wchar_t dst[MAX_PATH]; // Generate a destination filename. filepath_combinepath(dst, MAX_PATH, pmp->env.path_to_playlist.path, filepath_skippath(pl->name)); filepath_remove_extension(dst); - ucs2cat(dst, pmp->env.playlist_ext); + wcscat(dst, pmp->env.playlist_ext); // Skipping the existing playlist if (!(opt->verb & MODE_PLAYLIST_RECONVERT)) { @@ -211,14 +211,14 @@ } // Allocate a memory block for the contents of the playlist. - contents = (ucs2char_t**)calloc(pl->num_entries, sizeof(ucs2char_t*)); + contents = (wchar_t**)calloc(pl->num_entries, sizeof(wchar_t*)); if (!contents) { result = EASYPMPE_INSUFFICIENT_MEMORY; goto error_exit; } for (j = 0, n = 0;j < pl->num_entries;++j) { if (pl->entries[j].valid && pl->entries[j].filename[0]) { - contents[n] = ucs2dup(pl->entries[j].filename); + contents[n] = wcsdup(pl->entries[j].filename); ++n; } } @@ -229,7 +229,7 @@ // Free the contents of the playlist. for (j = 0;j < n;++j) { - ucs2free(contents[j]); + free(contents[j]); } free(contents); } Modified: branches/branch_0.12/frontend/easypmp/cui/device.c =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/device.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/device.c 2006-06-25 05:40:52 UTC (rev 67) @@ -29,7 +29,7 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <pmp.h> #include <pmphelp.h> @@ -44,10 +44,10 @@ } // Display a path name using the given string format. -void device_show_path(FILE *fp, const char* const format, const ucs2char_t* const path) +void device_show_path(FILE *fp, const char* const format, const wchar_t* const path) { - ucs2char_t decoded_path[MAX_PATH]; - ucs2cpy(decoded_path, path); + wchar_t decoded_path[MAX_PATH]; + wcscpy(decoded_path, path); filepath_decode(decoded_path); fprints(fp, format, decoded_path); @@ -72,9 +72,9 @@ { pmphelp_t *pmphelp = (pmphelp_t*)instance; pmp_t* pmp = NULL; - ucs2char_t ucs2cs_empty[] = {0}; + wchar_t wcscs_empty[] = {0}; - pmphelp_create(pmphelp, &pmp, ucs2cs_empty, devid); + pmphelp_create(pmphelp, &pmp, wcscs_empty, devid); device_show_information(pmp, stderr); fprintf(stderr, "\n"); pmp->release(pmp); Modified: branches/branch_0.12/frontend/easypmp/cui/easypmp_cui.vcproj =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/easypmp_cui.vcproj 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/easypmp_cui.vcproj 2006-06-25 05:40:52 UTC (rev 67) @@ -69,7 +69,7 @@ Name="VCCLCompilerTool" AdditionalIncludeDirectories="$(SolutionDir)include,..\common" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" - RuntimeLibrary="4" + RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" Modified: branches/branch_0.12/frontend/easypmp/cui/main.c =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/main.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/main.c 2006-06-25 05:40:52 UTC (rev 67) @@ -34,7 +34,7 @@ #include <direct.h> /* getcwd() */ #endif/*_MSC_VER*/ -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <gmi.h> #include <pmp.h> @@ -59,8 +59,8 @@ static int easypmp_enumerate_progress( void *instance, - const ucs2char_t* path, - const ucs2char_t* file, + const wchar_t* path, + const wchar_t* file, size_t n ) { @@ -78,7 +78,7 @@ int phase, int param_int, double param_float, - ucs2char_t* param_str + wchar_t* param_str ) { FILE *fpe = stderr; @@ -166,9 +166,9 @@ int set_encoding(const char *encoding) { - ucs2conv_t conv; + wcsconv_t conv; - if (ucs2set_encoding(encoding, &conv) != 0) { + if (wcsset_encoding(encoding, &conv) != 0) { fprintf(stderr, "ERROR: iconv does not support the following conversion\n %s: from %s to %s\n", encoding, conv.from, conv.to); return 1; } @@ -176,9 +176,9 @@ int set_encoding_music(const char *encoding) { - ucs2conv_t conv; + wcsconv_t conv; - if (ucs2set_encoding_music(encoding, &conv) != 0) { + if (wcsset_encoding_music(encoding, &conv) != 0) { fprintf(stderr, "ERROR: iconv does not support the following conversion\n %s: from %s to %s\n", encoding, conv.from, conv.to); return 1; } @@ -225,7 +225,7 @@ if (used_args < argc) { size_t length = strlen(argv[used_args]); if (length > 0) { - mbstoucs2(opt.path_to_root, MAX_PATH, argv[used_args], strlen(argv[used_args])+1); + mbstowcs(opt.path_to_root, argv[used_args], strlen(argv[used_args])+1); } ++used_args; } @@ -258,14 +258,14 @@ // If path_to_root is not set, use the current directory. char pwd[MAX_PATH+1]; getcwd(pwd, MAX_PATH); - mbstoucs2(opt.path_to_root, MAX_PATH, pwd, strlen(pwd)+1); + mbstowcs(opt.path_to_root, pwd, strlen(pwd)+1); } else if (opt.path_to_root[0] == '-' && opt.path_to_root[1] == 0) { #ifdef _WIN32 // (Win32 only) // If path_to_root is "-", assume the root folder of the path where this executable is located. - ucs2char_t* p = NULL; + wchar_t* p = NULL; GetModuleFileNameW(GetModuleHandle(NULL), opt.path_to_root, MAX_PATH); - p = (ucs2char_t*)filepath_skip_one_directory(opt.path_to_root); + p = (wchar_t*)filepath_skip_one_directory(opt.path_to_root); if (p) { *p = 0; } @@ -277,16 +277,16 @@ if (!opt.path_to_include[0]) { #ifdef _WIN32 // "jspl" folder under the location where the executable is installed. - ucs2char_t ucs2cs_jspl[] = {'j','s','p','l',0}; + wchar_t wcscs_jspl[] = {'j','s','p','l',0}; GetModuleFileNameW(GetModuleHandle(NULL), opt.path_to_include, MAX_PATH); filepath_remove_filespec(opt.path_to_include); filepath_addslash(opt.path_to_include); - ucs2cat(opt.path_to_include, ucs2cs_jspl); + wcscat(opt.path_to_include, wcscs_jspl); filepath_addslash(opt.path_to_include); #else // Obtain JavaScript Playlist directory from PMP_JSPLINCL_DIR - mbstoucs2(opt.path_to_include, MAX_PATH, PMP_JSPL_DIR, strlen(PMP_JSPL_DIR)+1); + mbstowcs(opt.path_to_include, MAX_PATH, PMP_JSPL_DIR, strlen(PMP_JSPL_DIR)+1); #endif } Modified: branches/branch_0.12/frontend/easypmp/cui/option.c =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/option.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/option.c 2006-06-25 05:40:52 UTC (rev 67) @@ -33,7 +33,8 @@ #include <direct.h> /* getcwd() */ #endif/*_MSC_VER*/ -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> #include <filepath.h> #include <gmi.h> #include <pmp.h> @@ -94,8 +95,8 @@ static void set_strip_words(option_t* opt, const char *str) { - ucs2char_t* ucs2str = mbsdupucs2(str); - easypmp_set_strip_words(opt, ucs2str); + wchar_t* wcsstr = mbsdupwcs(str); + easypmp_set_strip_words(opt, wcsstr); } int option_parse(option_t* opt, int argc, char *argv[], FILE *fpe) Modified: branches/branch_0.12/frontend/easypmp/cui/util.c =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/util.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/util.c 2006-06-25 05:40:52 UTC (rev 67) @@ -29,7 +29,8 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> #include "util.h" @@ -38,20 +39,20 @@ fprintf(fp, "%-79.79s\r", ""); } -void fprints(FILE *fp, const char *format, const ucs2char_t* value) +void fprints(FILE *fp, const char *format, const wchar_t* value) { - fprints_fixed(fp, format, value, ucs2len(value)); + fprints_fixed(fp, format, value, wcslen(value)); } -void fprints_fixed(FILE *fp, const char *format, const ucs2char_t* value, size_t length) +void fprints_fixed(FILE *fp, const char *format, const wchar_t* value, size_t length) { char *mbs = NULL; - ucs2char_t* tmp = alloca(sizeof(ucs2char_t) * (length+1)); - memset(tmp, 0, sizeof(ucs2char_t) * (length+1)); - ucs2ncpy(tmp, value, length); - mbs = ucs2dupmbs(tmp); + wchar_t* tmp = alloca(sizeof(wchar_t) * (length+1)); + memset(tmp, 0, sizeof(wchar_t) * (length+1)); + wcsncpy(tmp, value, length); + mbs = wcsdupmbs(tmp); if (mbs) { fprintf(fp, format, mbs); - ucs2free(mbs); + free(mbs); } } Modified: branches/branch_0.12/frontend/easypmp/cui/util.h =================================================================== --- branches/branch_0.12/frontend/easypmp/cui/util.h 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/frontend/easypmp/cui/util.h 2006-06-25 05:40:52 UTC (rev 67) @@ -26,7 +26,7 @@ #define __UTIL_H__ void clear_line(FILE *fp); -void fprints(FILE *fp, const char *format, const ucs2char_t* value); -void fprints_fixed(FILE *fp, const char *format, const ucs2char_t* value, size_t length); +void fprints(FILE *fp, const char *format, const wchar_t* value); +void fprints_fixed(FILE *fp, const char *format, const wchar_t* value, size_t length); #endif/*__UTIL_H__*/ Modified: branches/branch_0.12/include/filepath.h =================================================================== --- branches/branch_0.12/include/filepath.h 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/include/filepath.h 2006-06-25 05:40:52 UTC (rev 67) @@ -84,6 +84,7 @@ FILEPATHAPI FILE* filepath_fopen(const wchar_t* name, const wchar_t* mode); FILEPATHAPI unsigned long filepath_filesize(const wchar_t *filename); +FILEPATHAPI time_t filepath_mtime(const wchar_t *filename); #ifdef __cplusplus } Modified: branches/branch_0.12/lib/filepath/filepath_win32.c =================================================================== --- branches/branch_0.12/lib/filepath/filepath_win32.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/lib/filepath/filepath_win32.c 2006-06-25 05:40:52 UTC (rev 67) @@ -249,3 +249,14 @@ } return 0; } + +time_t filepath_mtime(const wchar_t *filename) +{ + int ret = 0; + struct _stat st; + ret = _wstat(filename, &st); + if (ret == 0) { + return st.st_mtime; + } + return 0; +} Modified: branches/branch_0.12/lib/pmp_iriverplus2/ip2db.c =================================================================== --- branches/branch_0.12/lib/pmp_iriverplus2/ip2db.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/lib/pmp_iriverplus2/ip2db.c 2006-06-25 05:40:52 UTC (rev 67) @@ -160,7 +160,7 @@ result_t ret = 0; uint32_t i, j, n = 0; ip2db_record_t* ip2db_records = NULL; - static const ucs2char_t ucs2cs_unknown[] = {'u','n','k','n','o','w','n',0}; + static const wchar_t* wcscs_unknown = L"unknown"; // Count valid entries. for (i = 0;i < num_records;++i) { @@ -193,20 +193,20 @@ } dst->entry_number = j+1; - dst->pathname = ucs2dup(filepath_skipdrive(src->filename, path_to_root)); + dst->pathname = wcsdupucs2(filepath_skipdrive(src->filename, path_to_root)); filepath_remove_filespec(dst->pathname); filepath_encode(dst->pathname); - dst->filename = ucs2dup(filepath_skippath(src->filename)); - dst->title = ucs2dup(src->title ? src->title : dst->filename); - dst->artist = ucs2dup(src->artist ? src->artist : ucs2cs_unknown); - dst->album = ucs2dup(src->album ? src->album : ucs2cs_unknown); - dst->genre = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); + dst->filename = wcsdupucs2(filepath_skippath(src->filename)); + dst->title = wcsdupucs2(src->title ? src->title : dst->filename); + dst->artist = wcsdupucs2(src->artist ? src->artist : wcscs_unknown); + dst->album = wcsdupucs2(src->album ? src->album : wcscs_unknown); + dst->genre = wcsdupucs2(src->genre ? src->genre : wcscs_unknown); dst->rating = src->rating; dst->play_count = src->play_count; dst->recent_play = src->ts_playback; dst->track_number = src->track_number; if (src->date) { - dst->year = ucs2toi(src->date); + dst->year = wtoi(src->date); } dst->filesize = src->filesize; dst->duration = src->duration; @@ -270,17 +270,17 @@ length += ucs2len(src.filename); length += 3; - dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); + dst->filename = (ucs2char_t*)malloc(sizeof(ucs2char_t) * length); filepath_combinepath(dst->filename, length, path_to_root, src.pathname); filepath_addslash(dst->filename); ucs2cat(dst->filename, src.filename); - dst->title = ucs2dup(src.title); - dst->artist = ucs2dup(src.artist); - dst->album = ucs2dup(src.album); - dst->genre = ucs2dup(src.genre); + dst->title = ucs2dupwcs(src.title); + dst->artist = ucs2dupwcs(src.artist); + dst->album = ucs2dupwcs(src.album); + dst->genre = ucs2dupwcs(src.genre); itoucs2(src.year, tmp, 10); - dst->date = ucs2dup(tmp); + dst->date = ucs2dupwcs(tmp); switch (src.format) { case 0: dst->codec = PMPCODEC_MPEGLAYER3; break; Modified: branches/branch_0.12/lib/pmp_iriverplus2/pmp_iriverplus2.c =================================================================== --- branches/branch_0.12/lib/pmp_iriverplus2/pmp_iriverplus2.c 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/lib/pmp_iriverplus2/pmp_iriverplus2.c 2006-06-25 05:40:52 UTC (rev 67) @@ -118,7 +118,7 @@ static result_t pmp_create_instance_db(pmp_t* pmp, pmpdb_t** ptr_pmpdb); static result_t pmp_create_instance_pl(pmp_t* pmp, pmppl_t** ptr_pmppl); static result_t pmp_is_supported_codec(pmp_t* pmp, uint32_t codec); -static result_t pmp_is_supported_ext(pmp_t* pmp, const ucs2char_t* filename); +static result_t pmp_is_supported_ext(pmp_t* pmp, const wchar_t* filename); static uint32_t pmpdb_add_ref(pmpdb_t* pmpdb); static uint32_t pmpdb_release(pmpdb_t* pmpdb); @@ -130,7 +130,7 @@ static uint32_t pmppl_add_ref(pmppl_t* pmppl); static uint32_t pmppl_release(pmppl_t* pmppl); -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t* files[], uint32_t num_files); +static result_t pmppl_write(pmppl_t* pmppl, const wchar_t* filename, const wchar_t* files[], uint32_t num_files); static void set_environment( @@ -290,7 +290,7 @@ return 0; } -PMPIRIVERPLUS2API result_t pmp_create(pmp_t** ptr_pmp, const ucs2char_t* path_to_device, const char *id) +PMPIRIVERPLUS2API result_t pmp_create(pmp_t** ptr_pmp, const wchar_t* path_to_device, const char *id) { result_t ret = 0; pmp_t* pmp = NULL; @@ -539,7 +539,7 @@ return count; } -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t* files[], uint32_t num_files) +static result_t pmppl_write(pmppl_t* pmppl, const wchar_t* filename, const wchar_t* files[], uint32_t num_files) { pmppl_internal_t* pmppli = (pmppl_internal_t*)pmppl->instance; pmp_internal_t* pmpi = (pmp_internal_t*)pmppl->pmp->instance; Modified: branches/branch_0.12/pmp.sln =================================================================== --- branches/branch_0.12/pmp.sln 2006-06-25 05:26:58 UTC (rev 66) +++ branches/branch_0.12/pmp.sln 2006-06-25 05:40:52 UTC (rev 67) @@ -46,6 +46,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "easypmp_cui", "frontend\easypmp\cui\easypmp_cui.vcproj", "{FA1F30D4-6100-4379-8506-6CFE023B0AE7}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} + {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {E393575C-6B10-43BD-B2C0-63C5040A49F7} = {E393575C-6B10-43BD-B2C0-63C5040A49F7} {2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1} = {2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-25 05:27:20
|
Revision: 66 Author: nyaochi Date: 2006-06-24 22:26:58 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=66&view=rev Log Message: ----------- Boring job for libpmp_portalplayer1 Modified Paths: -------------- branches/branch_0.12/lib/pmp_portalplayer1/model_iriver_h10.c branches/branch_0.12/lib/pmp_portalplayer1/model_medion_mdjuke220.c branches/branch_0.12/lib/pmp_portalplayer1/model_medion_mdjuke440.c branches/branch_0.12/lib/pmp_portalplayer1/model_samsung.c branches/branch_0.12/lib/pmp_portalplayer1/model_sirius_s50.c branches/branch_0.12/lib/pmp_portalplayer1/playlist.c branches/branch_0.12/lib/pmp_portalplayer1/pmp_portalplayer1.c branches/branch_0.12/lib/pmp_portalplayer1/pp1db.c branches/branch_0.12/lib/pmp_portalplayer1/pp1db.h Modified: branches/branch_0.12/lib/pmp_portalplayer1/model_iriver_h10.c =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/model_iriver_h10.c 2006-06-25 03:05:48 UTC (rev 65) +++ branches/branch_0.12/lib/pmp_portalplayer1/model_iriver_h10.c 2006-06-25 05:26:58 UTC (rev 66) @@ -91,29 +91,29 @@ int iriver_h10_dat_set(dat_t* dst, const pmp_record_t* src, const ucs2char_t* path_to_root) { - static const ucs2char_t ucs2cs_unknown[] = {0}; + static const wchar_t* wcscs_unknown = L""; static const ucs2char_t ucs2cs_empty[] = {0}; // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = wcsdupucs2(filepath_skiproot(src->filename, path_to_root)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); - dst->fields[PP1DB_DATFIELD_FILENAME].value.str = ucs2dup(filepath_skippath(src->filename)); + dst->fields[PP1DB_DATFIELD_FILENAME].value.str = wcsdupucs2(filepath_skippath(src->filename)); dst->fields[PP1DB_DATFIELD_FORMAT].value.dword = 0; - dst->fields[PP1DB_DATFIELD_TITLE].value.str = ucs2dup(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); - dst->fields[PP1DB_DATFIELD_ARTIST].value.str = ucs2dup(src->artist ? src->artist : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_ALBUM].value.str = ucs2dup(src->album ? src->album : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_GENRE].value.str = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); + dst->fields[PP1DB_DATFIELD_TITLE].value.str = wcsdupucs2(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); + dst->fields[PP1DB_DATFIELD_ARTIST].value.str = wcsdupucs2(src->artist ? src->artist : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_ALBUM].value.str = wcsdupucs2(src->album ? src->album : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_GENRE].value.str = wcsdupucs2(src->genre ? src->genre : wcscs_unknown); dst->fields[PP1DB_DATFIELD_RATING].value.dword = src->rating; dst->fields[PP1DB_DATFIELD_PLAYCOUNT].value.dword = src->play_count; dst->fields[PP1DB_DATFIELD_RECENTPLAY].value.dword = src->ts_playback; dst->fields[PP1DB_DATFIELD_UNKNOWN3].value.dword = 0; dst->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword = src->track_number; if (src->date) { - dst->fields[PP1DB_DATFIELD_YEAR].value.dword = ucs2toi(src->date); + dst->fields[PP1DB_DATFIELD_YEAR].value.dword = wtoi(src->date); } dst->fields[PP1DB_DATFIELD_FILESIZE].value.dword = src->filesize; dst->fields[PP1DB_DATFIELD_DURATION].value.dword = src->duration; @@ -128,9 +128,9 @@ int iriver_h10_dat_get(pmp_record_t* dst, const dat_t* src, const ucs2char_t* path_to_root) { - static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; - static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; - static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + static const wchar_t* wcscs_mp3 = L".mp3"; + static const wchar_t* wcscs_wma = L".wma"; + static const wchar_t* wcscs_wav = L".wav"; ucs2char_t tmp[128]; size_t length = 0; @@ -154,11 +154,11 @@ dst->date = ucs2dup(tmp); // Set codec information according to the file extensions. - if (filepath_hasext(dst->filename, ucs2cs_mp3)) { + if (filepath_hasext(dst->filename, wcscs_mp3)) { dst->codec = PMPCODEC_MPEGLAYER3; - } else if (filepath_hasext(dst->filename, ucs2cs_wma)) { + } else if (filepath_hasext(dst->filename, wcscs_wma)) { dst->codec = PMPCODEC_WMA; - } else if (filepath_hasext(dst->filename, ucs2cs_wav)) { + } else if (filepath_hasext(dst->filename, wcscs_wav)) { dst->codec = PMPCODEC_WAV; } Modified: branches/branch_0.12/lib/pmp_portalplayer1/model_medion_mdjuke220.c =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2006-06-25 03:05:48 UTC (rev 65) +++ branches/branch_0.12/lib/pmp_portalplayer1/model_medion_mdjuke220.c 2006-06-25 05:26:58 UTC (rev 66) @@ -78,16 +78,16 @@ int medion_mdjuke220_dat_set(dat_t* dst, const pmp_record_t* src, const ucs2char_t* path_to_root) { ucs2char_t duration[128]; - static const ucs2char_t ucs2cs_unknown[] = {'0',0}; + static const wchar_t* wcscs_unknown = L"0"; // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dupwcs(filepath_skiproot(src->filename, path_to_root)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); - dst->fields[PP1DB_DATFIELD_FILENAME].value.str = ucs2dup(filepath_skippath(src->filename)); + dst->fields[PP1DB_DATFIELD_FILENAME].value.str = ucs2dupwcs(filepath_skippath(src->filename)); dst->fields[PP1DB_DATFIELD_FORMAT].value.dword = 0; dst->fields[PP1DB_DATFIELD_BITRATE].value.dword = src->bitrate; dst->fields[PP1DB_DATFIELD_SAMPLERATE].value.dword = src->sample_rate; @@ -96,24 +96,24 @@ itoucs2(src->duration, duration, 10); dst->fields[PP1DB_DATFIELD_DURATION].value.str = ucs2dup(duration); - dst->fields[PP1DB_DATFIELD_ARTIST].value.str = ucs2dup(src->artist ? src->artist : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_ALBUM].value.str = ucs2dup(src->album ? src->album : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_GENRE].value.str = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_TITLE].value.str = ucs2dup(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); + dst->fields[PP1DB_DATFIELD_ARTIST].value.str = ucs2dupwcs(src->artist ? src->artist : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_ALBUM].value.str = ucs2dupwcs(src->album ? src->album : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_GENRE].value.str = ucs2dupwcs(src->genre ? src->genre : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_TITLE].value.str = ucs2dupwcs(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); dst->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword = src->track_number; if (src->date) { dst->fields[PP1DB_DATFIELD_YEAR].value.dword = ucs2toi(src->date); } dst->fields[PP1DB_DATFIELD_FILESIZE].value.dword = src->filesize; - dst->fields[PP1DB_DATFIELD_COMPOSER].value.str = ucs2dup(src->composer ? src->composer : ucs2cs_unknown); + dst->fields[PP1DB_DATFIELD_COMPOSER].value.str = ucs2dupwcs(src->composer ? src->composer : wcscs_unknown); return 0; } int medion_mdjuke220_dat_get(pmp_record_t* dst, const dat_t* src, const ucs2char_t* path_to_root) { - static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; - static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; - static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + static const wchar_t* wcscs_mp3 = L".mp3"; + static const wchar_t* wcscs_wma = L".wma"; + static const wchar_t* wcscs_wav = L".wav"; ucs2char_t tmp[128]; size_t length = 0; @@ -133,17 +133,17 @@ dst->sample_rate = src->fields[PP1DB_DATFIELD_SAMPLERATE].value.dword; dst->duration = ucs2toi(src->fields[PP1DB_DATFIELD_DURATION].value.str); - dst->artist = ucs2dup(src->fields[PP1DB_DATFIELD_ARTIST].value.str); - dst->album = ucs2dup(src->fields[PP1DB_DATFIELD_ALBUM].value.str); - dst->genre = ucs2dup(src->fields[PP1DB_DATFIELD_GENRE].value.str); - dst->title = ucs2dup(src->fields[PP1DB_DATFIELD_TITLE].value.str); + dst->artist = ucs2dupwcs(src->fields[PP1DB_DATFIELD_ARTIST].value.str); + dst->album = ucs2dupwcs(src->fields[PP1DB_DATFIELD_ALBUM].value.str); + dst->genre = ucs2dupwcs(src->fields[PP1DB_DATFIELD_GENRE].value.str); + dst->title = ucs2dupwcs(src->fields[PP1DB_DATFIELD_TITLE].value.str); // Set codec information according to the file extensions. - if (filepath_hasext(dst->filename, ucs2cs_mp3)) { + if (filepath_hasext(dst->filename, wcscs_mp3)) { dst->codec = PMPCODEC_MPEGLAYER3; - } else if (filepath_hasext(dst->filename, ucs2cs_wma)) { + } else if (filepath_hasext(dst->filename, wcscs_wma)) { dst->codec = PMPCODEC_WMA; - } else if (filepath_hasext(dst->filename, ucs2cs_wav)) { + } else if (filepath_hasext(dst->filename, wcscs_wav)) { dst->codec = PMPCODEC_WAV; } Modified: branches/branch_0.12/lib/pmp_portalplayer1/model_medion_mdjuke440.c =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/model_medion_mdjuke440.c 2006-06-25 03:05:48 UTC (rev 65) +++ branches/branch_0.12/lib/pmp_portalplayer1/model_medion_mdjuke440.c 2006-06-25 05:26:58 UTC (rev 66) @@ -69,33 +69,33 @@ int medion_mdjuke440_dat_set(dat_t* dst, const pmp_record_t* src, const ucs2char_t* path_to_root) { - static const ucs2char_t ucs2cs_unknown[] = {'0',0}; + static const wchar_t* wcscs_unknown = L"0"; // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = wcsdupucs2(filepath_skiproot(src->filename, path_to_root)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); - dst->fields[PP1DB_DATFIELD_FILENAME].value.str = ucs2dup(filepath_skippath(src->filename)); + dst->fields[PP1DB_DATFIELD_FILENAME].value.str = wcsdupucs2(filepath_skippath(src->filename)); dst->fields[PP1DB_DATFIELD_FORMAT].value.dword = 0; dst->fields[PP1DB_DATFIELD_BITRATE].value.dword = src->bitrate; - dst->fields[PP1DB_DATFIELD_ARTIST].value.str = ucs2dup(src->artist ? src->artist : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_ALBUM].value.str = ucs2dup(src->album ? src->album : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_GENRE].value.str = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_TITLE].value.str = ucs2dup(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); + dst->fields[PP1DB_DATFIELD_ARTIST].value.str = wcsdupucs2(src->artist ? src->artist : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_ALBUM].value.str = wcsdupucs2(src->album ? src->album : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_GENRE].value.str = wcsdupucs2(src->genre ? src->genre : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_TITLE].value.str = wcsdupucs2(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); dst->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword = src->track_number; - dst->fields[PP1DB_DATFIELD_COMPOSER].value.str = ucs2dup(src->composer ? src->composer : ucs2cs_unknown); + dst->fields[PP1DB_DATFIELD_COMPOSER].value.str = wcsdupucs2(src->composer ? src->composer : wcscs_unknown); return 0; } int medion_mdjuke440_dat_get(pmp_record_t* dst, const dat_t* src, const ucs2char_t* path_to_root) { - static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; - static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; - static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + static const wchar_t* wcscs_mp3 = L".mp3"; + static const wchar_t* wcscs_wma = L".wma"; + static const wchar_t* wcscs_wav = L".wav"; size_t length = 0; length = ucs2len(path_to_root); @@ -112,17 +112,17 @@ dst->bitrate = src->fields[PP1DB_DATFIELD_BITRATE].value.dword; - dst->artist = ucs2dup(src->fields[PP1DB_DATFIELD_ARTIST].value.str); - dst->album = ucs2dup(src->fields[PP1DB_DATFIELD_ALBUM].value.str); - dst->genre = ucs2dup(src->fields[PP1DB_DATFIELD_GENRE].value.str); - dst->title = ucs2dup(src->fields[PP1DB_DATFIELD_TITLE].value.str); + dst->artist = ucs2dupwcs(src->fields[PP1DB_DATFIELD_ARTIST].value.str); + dst->album = ucs2dupwcs(src->fields[PP1DB_DATFIELD_ALBUM].value.str); + dst->genre = ucs2dupwcs(src->fields[PP1DB_DATFIELD_GENRE].value.str); + dst->title = ucs2dupwcs(src->fields[PP1DB_DATFIELD_TITLE].value.str); // Set codec information according to the file extensions. - if (filepath_hasext(dst->filename, ucs2cs_mp3)) { + if (filepath_hasext(dst->filename, wcscs_mp3)) { dst->codec = PMPCODEC_MPEGLAYER3; - } else if (filepath_hasext(dst->filename, ucs2cs_wma)) { + } else if (filepath_hasext(dst->filename, wcscs_wma)) { dst->codec = PMPCODEC_WMA; - } else if (filepath_hasext(dst->filename, ucs2cs_wav)) { + } else if (filepath_hasext(dst->filename, wcscs_wav)) { dst->codec = PMPCODEC_WAV; } Modified: branches/branch_0.12/lib/pmp_portalplayer1/model_samsung.c =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/model_samsung.c 2006-06-25 03:05:48 UTC (rev 65) +++ branches/branch_0.12/lib/pmp_portalplayer1/model_samsung.c 2006-06-25 05:26:58 UTC (rev 66) @@ -83,25 +83,25 @@ static int samsung_dat_set(dat_t* dst, const pmp_record_t* src, const ucs2char_t* path_to_root) { - static const ucs2char_t ucs2cs_unknown[] = {0}; + static const wchar_t* wcscs_unknown = L""; static const ucs2char_t ucs2cs_empty[] = {0}; // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = wcsdupucs2(filepath_skiproot(src->filename, path_to_root)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); - dst->fields[PP1DB_DATFIELD_FILENAME].value.str = ucs2dup(filepath_skippath(src->filename)); + dst->fields[PP1DB_DATFIELD_FILENAME].value.str = wcsdupucs2(filepath_skippath(src->filename)); dst->fields[PP1DB_DATFIELD_FORMAT].value.dword = 0; dst->fields[PP1DB_DATFIELD_BITRATE].value.dword = src->bitrate; dst->fields[PP1DB_DATFIELD_SAMPLERATE].value.dword = src->sample_rate; dst->fields[PP1DB_DATFIELD_DURATION].value.dword = src->duration; - dst->fields[PP1DB_DATFIELD_ARTIST].value.str = ucs2dup(src->artist ? src->artist : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_ALBUM].value.str = ucs2dup(src->album ? src->album : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_GENRE].value.str = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_TITLE].value.str = ucs2dup(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); + dst->fields[PP1DB_DATFIELD_ARTIST].value.str = wcsdupucs2(src->artist ? src->artist : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_ALBUM].value.str = wcsdupucs2(src->album ? src->album : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_GENRE].value.str = wcsdupucs2(src->genre ? src->genre : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_TITLE].value.str = wcsdupucs2(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); dst->fields[PP1DB_DATFIELD_TRACKNUMBER].value.dword = src->track_number; if (src->date) { dst->fields[PP1DB_DATFIELD_YEAR].value.dword = ucs2toi(src->date); @@ -138,10 +138,10 @@ dst->sample_rate = src->fields[PP1DB_DATFIELD_SAMPLERATE].value.dword; dst->duration = ucs2toi(src->fields[PP1DB_DATFIELD_DURATION].value.str); - dst->artist = ucs2dup(src->fields[PP1DB_DATFIELD_ARTIST].value.str); - dst->album = ucs2dup(src->fields[PP1DB_DATFIELD_ALBUM].value.str); - dst->genre = ucs2dup(src->fields[PP1DB_DATFIELD_GENRE].value.str); - dst->title = ucs2dup(src->fields[PP1DB_DATFIELD_TITLE].value.str); + dst->artist = ucs2dupwcs(src->fields[PP1DB_DATFIELD_ARTIST].value.str); + dst->album = ucs2dupwcs(src->fields[PP1DB_DATFIELD_ALBUM].value.str); + dst->genre = ucs2dupwcs(src->fields[PP1DB_DATFIELD_GENRE].value.str); + dst->title = ucs2dupwcs(src->fields[PP1DB_DATFIELD_TITLE].value.str); // Set codec information according to the file extensions. if (filepath_hasext(dst->filename, ucs2cs_mp3)) { Modified: branches/branch_0.12/lib/pmp_portalplayer1/model_sirius_s50.c =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/model_sirius_s50.c 2006-06-25 03:05:48 UTC (rev 65) +++ branches/branch_0.12/lib/pmp_portalplayer1/model_sirius_s50.c 2006-06-25 05:26:58 UTC (rev 66) @@ -99,25 +99,25 @@ int sirius_s50_dat_set(dat_t* dst, const pmp_record_t* src, const ucs2char_t* path_to_root) { - static const ucs2char_t ucs2cs_unknown[] = {0}; + static const wchar_t* wcscs_unknown = L""; static const ucs2char_t ucs2cs_empty[] = {0}; // Set fields. dst->status = 0; dst->unknown1 = 0; - dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = ucs2dup(filepath_skiproot(src->filename, path_to_root)); + dst->fields[PP1DB_DATFIELD_PATHNAME].value.str = wcsdupucs2(filepath_skiproot(src->filename, path_to_root)); filepath_remove_filespec(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_addslash(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); filepath_encode(dst->fields[PP1DB_DATFIELD_PATHNAME].value.str); - dst->fields[PP1DB_DATFIELD_FILENAME].value.str = ucs2dup(filepath_skippath(src->filename)); + dst->fields[PP1DB_DATFIELD_FILENAME].value.str = wcsdupucs2(filepath_skippath(src->filename)); dst->fields[PP1DB_DATFIELD_FORMAT].value.dword = 0; dst->fields[PP1DB_DATFIELD_BITRATE].value.dword = src->bitrate; dst->fields[PP1DB_DATFIELD_SAMPLERATE].value.dword = src->sample_rate; dst->fields[PP1DB_DATFIELD_DURATION].value.dword = src->duration; - dst->fields[PP1DB_DATFIELD_ARTIST].value.str = ucs2dup(src->artist ? src->artist : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_ALBUM].value.str = ucs2dup(src->album ? src->album : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_GENRE].value.str = ucs2dup(src->genre ? src->genre : ucs2cs_unknown); - dst->fields[PP1DB_DATFIELD_TITLE].value.str = ucs2dup(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); + dst->fields[PP1DB_DATFIELD_ARTIST].value.str = wcsdupucs2(src->artist ? src->artist : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_ALBUM].value.str = wcsdupucs2(src->album ? src->album : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_GENRE].value.str = wcsdupucs2(src->genre ? src->genre : wcscs_unknown); + dst->fields[PP1DB_DATFIELD_TITLE].value.str = wcsdupucs2(src->title ? src->title : dst->fields[PP1DB_DATFIELD_FILENAME].value.str); dst->fields[PP1DB_DATFIELD_FILESIZE].value.dword = src->filesize; dst->fields[PP1DB_DATFIELD_UNKNOWN3].value.dword = 0; dst->fields[PP1DB_DATFIELD_DATETIME].value.str = ucs2dup(ucs2cs_empty); @@ -148,21 +148,26 @@ length += ucs2len(src->fields[PP1DB_DATFIELD_FILENAME].value.str); length += 3; - dst->filename = (ucs2char_t*)ucs2malloc(sizeof(ucs2char_t) * length); + dst->filename = (ucs2char_t*)malloc(sizeof(ucs2char_t) * length); if (dst->filename) { - filepath_combinepath(dst->filename, length, path_to_root, src->fields[PP1DB_DATFIELD_PATHNAME].value.str); + wchar_t* tmp = NULL; + tmp = ucs2dupwcs(src->fields[PP1DB_DATFIELD_PATHNAME].value.str); + filepath_combinepath(dst->filename, length, path_to_root, tmp); + free(tmp); filepath_addslash(dst->filename); - ucs2cat(dst->filename, src->fields[PP1DB_DATFIELD_FILENAME].value.str); + tmp = ucs2dupwcs(src->fields[PP1DB_DATFIELD_FILENAME].value.str); + ucs2cat(dst->filename, tmp); + free(tmp); } dst->bitrate = src->fields[PP1DB_DATFIELD_BITRATE].value.dword; dst->sample_rate = src->fields[PP1DB_DATFIELD_SAMPLERATE].value.dword; dst->duration = src->fields[PP1DB_DATFIELD_DURATION].value.dword; - dst->artist = ucs2dup(src->fields[PP1DB_DATFIELD_ARTIST].value.str); - dst->album = ucs2dup(src->fields[PP1DB_DATFIELD_ALBUM].value.str); - dst->genre = ucs2dup(src->fields[PP1DB_DATFIELD_GENRE].value.str); - dst->title = ucs2dup(src->fields[PP1DB_DATFIELD_TITLE].value.str); + dst->artist = ucs2dupwcs(src->fields[PP1DB_DATFIELD_ARTIST].value.str); + dst->album = ucs2dupwcs(src->fields[PP1DB_DATFIELD_ALBUM].value.str); + dst->genre = ucs2dupwcs(src->fields[PP1DB_DATFIELD_GENRE].value.str); + dst->title = ucs2dupwcs(src->fields[PP1DB_DATFIELD_TITLE].value.str); // Set codec information according to the file extensions. if (filepath_hasext(dst->filename, ucs2cs_mp3)) { Modified: branches/branch_0.12/lib/pmp_portalplayer1/playlist.c =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/playlist.c 2006-06-25 03:05:48 UTC (rev 65) +++ branches/branch_0.12/lib/pmp_portalplayer1/playlist.c 2006-06-25 05:26:58 UTC (rev 66) @@ -51,10 +51,10 @@ } int playlist_write( - const ucs2char_t *filename, - const ucs2char_t *mediafiles[], + const wchar_t *filename, + const wchar_t *mediafiles[], int num_mediafiles, - const ucs2char_t *path_to_root + const wchar_t *path_to_root ) { static const ucs2char_t header1_str[] = {'P','L','P',' ','P','L','A','Y','L','I','S','T','\r','\n', 0}; @@ -62,7 +62,7 @@ static const ucs2char_t entry_str[] = {'H','D','D',',',' ', 0}; static const ucs2char_t crlf_str[] = {'\r','\n', 0}; - FILE *fp = ucs2fopen(filename, "wb"); + FILE *fp = filepath_fopen(filename, L"wb"); if (!fp) { return -1; } else { @@ -75,7 +75,8 @@ for (i = 0;i < num_mediafiles;i++) { if (mediafiles[i][0]) { ucs2char_t filename[MAX_PATH]; - ucs2cpy(filename, filepath_skiproot(mediafiles[i], path_to_root)); + const wchar_t* wcs_filename = filepath_skiproot(mediafiles[i], path_to_root); + wcstoucs2(filename, MAX_PATH, wcs_filename, wcslen(wcs_filename)); filepath_encode(filename); Modified: branches/branch_0.12/lib/pmp_portalplayer1/pmp_portalplayer1.c =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-06-25 03:05:48 UTC (rev 65) +++ branches/branch_0.12/lib/pmp_portalplayer1/pmp_portalplayer1.c 2006-06-25 05:26:58 UTC (rev 66) @@ -202,7 +202,7 @@ static result_t pmp_create_instance_db(pmp_t* pmp, pmpdb_t** ptr_pmpdb); static result_t pmp_create_instance_pl(pmp_t* pmp, pmppl_t** ptr_pmppl); static result_t pmp_is_supported_codec(pmp_t* pmp, uint32_t codec); -static result_t pmp_is_supported_ext(pmp_t* pmp, const ucs2char_t* filename); +static result_t pmp_is_supported_ext(pmp_t* pmp, const wchar_t* filename); static uint32_t pmpdb_add_ref(pmpdb_t* pmpdb); static uint32_t pmpdb_release(pmpdb_t* pmpdb); @@ -214,7 +214,7 @@ static uint32_t pmppl_add_ref(pmppl_t* pmppl); static uint32_t pmppl_release(pmppl_t* pmppl); -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t* files[], uint32_t num_files); +static result_t pmppl_write(pmppl_t* pmppl, const wchar_t* filename, const wchar_t* files[], uint32_t num_files); @@ -482,7 +482,7 @@ return pp1db_is_supported_codec(codec); } -static int pmp_is_supported_ext(pmp_t* pmp, const ucs2char_t* filename) +static int pmp_is_supported_ext(pmp_t* pmp, const wchar_t* filename) { return pp1db_is_supported_ext(filename); } @@ -559,7 +559,7 @@ return count; } -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t* files[], uint32_t num_files) +static result_t pmppl_write(pmppl_t* pmppl, const wchar_t* filename, const wchar_t* files[], uint32_t num_files) { pmp_internal_t* pmpi = (pmp_internal_t*)pmppl->pmp->instance; if (playlist_write(filename, files, num_files, pmpi->env.path_to_root) != 0) { Modified: branches/branch_0.12/lib/pmp_portalplayer1/pp1db.c =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/pp1db.c 2006-06-25 03:05:48 UTC (rev 65) +++ branches/branch_0.12/lib/pmp_portalplayer1/pp1db.c 2006-06-25 05:26:58 UTC (rev 66) @@ -354,16 +354,16 @@ return 0; } -int pp1db_is_supported_ext(const ucs2char_t* filename) +int pp1db_is_supported_ext(const wchar_t* filename) { - static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; - static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; - static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + static const wchar_t* wcscs_mp3 = L".mp3"; + static const wchar_t* wcscs_wma = L".wma"; + static const wchar_t* wcscs_wav = L".wav"; return ( - filepath_hasext(filename, ucs2cs_mp3) || - filepath_hasext(filename, ucs2cs_wma) || - filepath_hasext(filename, ucs2cs_wav) + filepath_hasext(filename, wcscs_mp3) || + filepath_hasext(filename, wcscs_wma) || + filepath_hasext(filename, wcscs_wav) ) ? 1 : 0; } Modified: branches/branch_0.12/lib/pmp_portalplayer1/pp1db.h =================================================================== --- branches/branch_0.12/lib/pmp_portalplayer1/pp1db.h 2006-06-25 03:05:48 UTC (rev 65) +++ branches/branch_0.12/lib/pmp_portalplayer1/pp1db.h 2006-06-25 05:26:58 UTC (rev 66) @@ -150,10 +150,10 @@ // playlist.c int playlist_write( - const ucs2char_t *filename, - const ucs2char_t *mediafiles[], + const wchar_t *filename, + const wchar_t *mediafiles[], int num_mediafiles, - const ucs2char_t *path_to_root + const wchar_t *path_to_root ); // pp1db.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-25 03:05:58
|
Revision: 65 Author: sucknblow Date: 2006-06-24 20:05:48 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=65&view=rev Log Message: ----------- Ignore auto-generated build system files. Property Changed: ---------------- trunk/lib/filepath/ trunk/lib/gmi/ trunk/lib/playlist/ trunk/lib/pmp/ trunk/lib/pmp_iriverplus2/ trunk/lib/pmp_irivnavi/ trunk/lib/pmp_portalplayer1/ Property changes on: trunk/lib/filepath ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile .libs .deps Property changes on: trunk/lib/gmi ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile .libs .deps Property changes on: trunk/lib/playlist ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile .libs .deps Property changes on: trunk/lib/pmp ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile .libs .deps Property changes on: trunk/lib/pmp_iriverplus2 ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile .libs .deps Property changes on: trunk/lib/pmp_irivnavi ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile .libs .deps Property changes on: trunk/lib/pmp_portalplayer1 ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile .libs .deps This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-25 02:19:57
|
Revision: 64 Author: sucknblow Date: 2006-06-24 19:19:51 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=64&view=rev Log Message: ----------- Changing command line options: -D/--database and -u/--update become -c/--create and -u/--update (so similar to tar). -P and -M are now lower case - often used options should be easier to type. -l becomes -L, so case is consistent with -R, the only option with which it becomes useful. -L becomes -l. Frequently used options are now documented in the man page. Modified Paths: -------------- trunk/frontend/easypmp/cui/easypmp.1 trunk/frontend/easypmp/cui/option.c Property Changed: ---------------- trunk/frontend/easypmp/cui/ Property changes on: trunk/frontend/easypmp/cui ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile .libs .deps easypmp Modified: trunk/frontend/easypmp/cui/easypmp.1 =================================================================== --- trunk/frontend/easypmp/cui/easypmp.1 2006-06-24 17:48:10 UTC (rev 63) +++ trunk/frontend/easypmp/cui/easypmp.1 2006-06-25 02:19:51 UTC (rev 64) @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH EASYPMP 1 "June 2, 2006" +.TH EASYPMP 1 "June 25, 2006" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -16,37 +16,141 @@ easypmp \- create music databases used by portable media players .SH SYNOPSIS .B easypmp -.R [ -.B -D -.R | -.B -u -.RI "] [" mount-point ] +.RB [ -c | -u "] [" -p "] [" -m "] [" -R " [" -L +.IR level "] ]" +.RI [ mount-point ] +.br +.BR "easypmp " [ -h | -v ] + .SH DESCRIPTION -.\" TeX users may be more comfortable with the \fB<whatever>\fP and -.\" \fI<whatever>\fP escape sequences to invode bold face and italics, -.\" respectively. - \fBeasypmp\fP is a command line utility used to create and maintain the -music database on a variety of portable music players. +music database on a variety of portable media players. -Many Portable music players allow the user to browse tracks by artist, -album, genre, pre-defined playlists etc. In order to do this +Many portable music players allow the user to browse tracks by artist, +album, genre, predefined playlists etc. In order to do this efficiently, they require a database of track information. Without this database, the player may require the user to browse tracks using only the directory structure. \fBeasypmp\fP exists to create that database, based on the tracks and playlists that are stored on the player. -.\".SH OPTIONS" -.\"These programs follow the usual GNU command line syntax, with long" -.\"options starting with two dashes (`-')." +Normally, \fBeasypmp\fP is able to detect the type of any supported +media player automatically. It does so by comparing the files and +directories found at the specified mount point with the list of files +it expects to find on each type of device that it supports. If no +mount point is specified, the current working directory is assumed to +be the mount point. + +In order to check that \fBeasypmp\fP can identify the type of media +player, the media player should be mounted as a USB device. The +program should then be run without any command line switches (although +the mount point should be specified if it is not the current +directory). If the device is recognised, \fBeasypmp\fP displays +information about the device, including the directories in which it +expects to find music and playlists on that device. If the device is +not recognised, an error message to this effect is shown. + + +.SH DEVICE SUPPORT +\fBeasypmp\fP currently only works with media players that can be +mounted as \fIUSB Mass Storage\fR (UMS) devices. Specifically, it +has been tested with the following devices: + + * iRiver H100 series + * iRiver H300 series + * iRiver H10 UMS + * iRiver H10 MTP (with emergency connect mode) + * iRiver H10Jr. UMS + * iRiver U10 UMS + * MEDION MDJuke220 + * MEDION MDJuke440 + * Samsung YH-820 + +Note that some of the iRiver devices listed above may not support UMS +as shipped. For example, in Europe and the United States, the iRiver +U10 ships with support for a proprietary file transfer protocol called +\fIMedia Transfer Protocol\fR (MTP). In order to use these devices +with \fBeasypmp\fP, it is necessary to re-program (or `flash') the +firmware on the device to make it support UMS. This can be +accomplished by running the iRiver firmware updater for iRiver +products. At the time of writing this works with T10, T20, T30, U10 +and N12 models, with the exception of 256MB and 2GB models in these +series. The firmware updater can be downloaded from: +.br + http://www.iriver.com/mtp/ + +Note that the iRiver firmware updater is a Windows program. The +program requires that your computer be connected to the Internet when +run, in order to download the latest firmware for the device. Please +note that updating the firmware on a device using this program will +erase any data already stored on the device. + +.SH OPTIONS +\fBeasypmp\fP follows the usual GNU command line syntax, with long +options starting with two dashes (`-'). .\"A summary of options is included below." -.\".TP" -.\".B \-h, \-\-help" -.\"Show summary of options." -.\".TP" -.\".B \-V, \-\-version" -.\"Show version of program." +.TP +.B \-c, \-\-create +Create a new music database from scratch. The music files in the +directory on the device used for storing music files is scanned +recursively for music files. For each file found, the meta-data +stored in that file - including the genre, artist, album and track +name - is read, and used to add a record for that file in the music +database stored on the device. +.TP +.B \-u, \-\-update +Update the music database stored on the device. This is similar to +the \fB-d\fP option, with the exception that, when an entry for a +given music file already exists in the database stored on the device, +the meta-data already stored in the database is not updated. + +Using this option means that \fBeasypmp\fP does not need to re-read +the meta-data in every music file on the device. Rather, it only has +to read the meta-data in music files that were not on the device the +last time the database was updated. Thus this option is a faster way +creating the music database when only a few tracks on the device have +been changed since the database was last created or updated. However, +if the meta-data in existing files has changed, this may not be +reflected in the database when using this option. +.TP +.B \-p, \-\-playlist +Many programs for playing music allow playlists to be created and +saved on disk, ready to be played later. Such playlists frequently +have a \fB.m3u\fP extension. However, the playlists saved by most +programs cannot be used directly on portable media players. Instead, +it is necessary to convert (or `compile') each playlist into a format +that the media player can read. + +When the \fB\-p\fP/\fB\-\-playlist\fP option is specified, +\fBeasypmp\fP will search the playlist directory on the device for +playlists that can be converted into a form that the media player can +read (see the \fBDESCRIPTION\fP section above for information on how +to determine the playlist directory for a particular media player). +.TP +.B \-m, \-\-music +The \fB\-m\fP/\fB\-\-music\fP option is similar to the +\fB\-p\fP/\fB\-\-playlist\fP option. However, instead of searching +the playlist directory on the media player for playlists, it searches +in the music directory on the player instead. +.TP +.B \-R, \-\-repr +Output a textual representation of the music database on standard +output. This option is seldom used: it may be useful for debugging +purposes, or if bored. +.TP +\fB \-L \fIlevel\fP, \-\-repr-level=\fIlevel\fP +Specifies the format of the textual representation of the music +database. This option is only meaningful if the \fB\-R\fP option is +used. The value of \fIlevel\fP should be an natural number: that is, +either 0 or a positive integer. The meaning of the given value +depends on the type of media player in use. Currently, the only +values of \fIlevel\fP that may produce different results are 0 and 1. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-v, \-\-version +Show version of program. .SH EXAMPLES These examples assume a media player has been mounted as a normal USB disk using /media/sda as a mount point. Modified: trunk/frontend/easypmp/cui/option.c =================================================================== --- trunk/frontend/easypmp/cui/option.c 2006-06-24 17:48:10 UTC (rev 63) +++ trunk/frontend/easypmp/cui/option.c 2006-06-25 02:19:51 UTC (rev 64) @@ -63,22 +63,22 @@ fprintf(fp, "\n"); fprintf(fp, "Media database options:\n"); - fprintf(fp, " -D, --database Construct a media database\n"); + fprintf(fp, " -c, --create Construct a media database\n"); fprintf(fp, " -u, --update Update the existing media database incrementally\n"); fprintf(fp, " -R, --repr Output a database structure in plain text\n"); - fprintf(fp, " -l, --repr-level=VAL Specify representation level\n"); + fprintf(fp, " -L, --repr-level=VAL Specify representation level\n"); fprintf(fp, " -t, --strip-words=VAL Specify a list (CSV) of words to strip from artist names\n"); fprintf(fp, "\n"); fprintf(fp, "Playlist options:\n"); - fprintf(fp, " -P, --playlist Convert playlist files in PLAYLIST directory\n"); - fprintf(fp, " -M, --music Convert playlist files in MUSIC directory\n"); + fprintf(fp, " -p, --playlist Convert playlist files in PLAYLIST directory\n"); + fprintf(fp, " -m, --music Convert playlist files in MUSIC directory\n"); fprintf(fp, " -r, --reconvert Discard the existing playlist files and reconvert\n"); fprintf(fp, " -f, --find-missing Correct playlists with corrupt references to media files\n"); fprintf(fp, " -s, --skip-missing Continue a conversion even if a media file is missing\n"); fprintf(fp, " -j, --jspl Enable JavaScript playlist (JSPL)\n"); fprintf(fp, "\n"); fprintf(fp, "Player options:\n"); - fprintf(fp, " -L, --list-device Show the list of supported devices and exit\n"); + fprintf(fp, " -l, --list-device Show the list of supported devices and exit\n"); fprintf(fp, " -d, --device Specify a device identifier for the player\n"); fprintf(fp, "\n"); #ifndef _WIN32 @@ -88,7 +88,7 @@ fprintf(fp, "\n"); #endif/*_WIN32*/ fprintf(fp, "Miscellaneous options:\n"); - fprintf(fp, " -V, --version Show version number and exit\n"); + fprintf(fp, " -v, --version Show version number and exit\n"); fprintf(fp, " -h, --help Show this help message and exit\n"); } @@ -112,39 +112,39 @@ int this_option_optind = optind ? optind : 1; int option_index = 0; static const struct option long_options[] = { - {"database", no_argument, 0, 'D'}, + {"create", no_argument, 0, 'c'}, {"update", no_argument, 0, 'u'}, {"source", required_argument, 0, 'z'}, {"repr", no_argument, 0, 'R'}, - {"repr-level", required_argument, 0, 'l'}, + {"repr-level", required_argument, 0, 'L'}, {"strip-words", required_argument, 0, 't'}, - {"playlist", no_argument, 0, 'P'}, - {"music", no_argument, 0, 'M'}, + {"playlist", no_argument, 0, 'p'}, + {"music", no_argument, 0, 'm'}, {"reconvert", no_argument, 0, 'r'}, {"find-missing", no_argument, 0, 'f'}, {"skip-missing", no_argument, 0, 's'}, {"jspl", no_argument, 0, 'j'}, - {"list-device", no_argument, 0, 'L'}, + {"list-device", no_argument, 0, 'l'}, {"device", required_argument, 0, 'd'}, #ifndef _WIN32 {"encoding", required_argument, 0, 'e'}, {"tagencoding", required_argument, 0, 'w'}, #endif/*_WIN32*/ - {"version", no_argument, 0, 'V'}, + {"version", no_argument, 0, 'v'}, {"help", no_argument, 0, 'h'}, {NULL, 0, 0, 0} }; #ifndef _WIN32 - int c = getopt_long(argc, argv, "DuzRl:t:PMrfsjLd:e:w:Vh", long_options, &option_index); + int c = getopt_long(argc, argv, "cuzRL:t:pmrfsjlD:e:w:vh", long_options, &option_index); #else - int c = getopt_long(argc, argv, "DuzRl:t:PMrfsjLd:Vh", long_options, &option_index); + int c = getopt_long(argc, argv, "cuzRL:t:pmrfsjlD:vh", long_options, &option_index); #endif/*_WIN32*/ if (c == -1) { break; } switch (c) { - case 'D': + case 'c': opt->verb |= MODE_DATABASE; break; case 'u': @@ -168,16 +168,16 @@ case 'R': opt->verb |= MODE_DATABASE_REPR; break; - case 'l': + case 'L': opt->repr_level = atoi(optarg); break; case 't': set_strip_words(opt, optarg); break; - case 'P': + case 'p': opt->verb |= (MODE_PLAYLIST | MODE_PLAYLIST_PLAYLIST); break; - case 'M': + case 'm': opt->verb |= (MODE_PLAYLIST | MODE_PLAYLIST_MUSIC); break; case 'r': @@ -192,7 +192,7 @@ case 'j': opt->verb |= MODE_PLAYLIST_JSPL; break; - case 'L': + case 'l': opt->verb |= MODE_LIST_DEVICES; break; case 'd': @@ -206,7 +206,7 @@ opt->music_encoding = optarg; break; #endif/*_WIN32*/ - case 'V': + case 'v': opt->verb |= MODE_VERSION; break; case 'h': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-24 17:48:28
|
Revision: 63 Author: nyaochi Date: 2006-06-24 10:48:10 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=63&view=rev Log Message: ----------- libpmp_irivnavi: migrated from ucs2char_t to wchar_t. libplaylist: a small fix. Modified Paths: -------------- branches/branch_0.12/lib/gmi/gmi_wav.c branches/branch_0.12/lib/pmp_irivnavi/irivnavi.c branches/branch_0.12/lib/pmp_irivnavi/irivnavi.h branches/branch_0.12/lib/pmp_irivnavi/playlist.c branches/branch_0.12/lib/pmp_irivnavi/pmp_irivnavi.c branches/branch_0.12/lib/pmp_irivnavi/serialize.c branches/branch_0.12/lib/pmp_irivnavi/serialize.h branches/branch_0.12/pmp.sln Modified: branches/branch_0.12/lib/gmi/gmi_wav.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_wav.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/gmi/gmi_wav.c 2006-06-24 17:48:10 UTC (rev 63) @@ -31,6 +31,8 @@ #include <stdio.h> #include <stdlib.h> #include <memory.h> +#include <wchar.h> +#include <wstring.h> #include <ucs2char.h> #include <gmi.h> Modified: branches/branch_0.12/lib/pmp_irivnavi/irivnavi.c =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/irivnavi.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/irivnavi.c 2006-06-24 17:48:10 UTC (rev 63) @@ -28,7 +28,7 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <pmp.h> #include "serialize.h" @@ -41,11 +41,11 @@ void record_finish(record_t* record) { - ucs2free(record->filename); - ucs2free(record->title); - ucs2free(record->artist); - ucs2free(record->album); - ucs2free(record->genre); + free(record->filename); + free(record->title); + free(record->artist); + free(record->album); + free(record->genre); record_init(record); } @@ -93,11 +93,11 @@ if (!is_storing) { record_finish(record); - record->filename = ucs2malloc(filename_size); - record->title = ucs2malloc(title_size); - record->artist = ucs2malloc(artist_size); - record->album = ucs2malloc(album_size); - record->genre = ucs2malloc(genre_size); + record->filename = (char*)malloc(filename_size); + record->title = (char*)malloc(title_size); + record->artist = (char*)malloc(artist_size); + record->album = (char*)malloc(album_size); + record->genre = (char*)malloc(genre_size); } p += serialize_uint8_array(p, (uint8_t*)record->filename, filename_size, is_storing); Modified: branches/branch_0.12/lib/pmp_irivnavi/irivnavi.h =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/irivnavi.h 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/irivnavi.h 2006-06-24 17:48:10 UTC (rev 63) @@ -69,10 +69,10 @@ void irivnavi_repr(irivnavi_t* db, FILE *fp, int level); int playlist_write( - const ucs2char_t *filename, - const ucs2char_t *mediafiles[], + const wchar_t *filename, + const wchar_t *mediafiles[], int num_mediafiles, - const ucs2char_t *path_to_root + const wchar_t *path_to_root ); #endif/*__IRIVNAVI_H__*/ Modified: branches/branch_0.12/lib/pmp_irivnavi/playlist.c =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/playlist.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/playlist.c 2006-06-24 17:48:10 UTC (rev 63) @@ -37,23 +37,23 @@ #include <os.h> #include <stdio.h> #include <stdlib.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include "irivnavi.h" int playlist_write( - const ucs2char_t *filename, - const ucs2char_t *mediafiles[], + const wchar_t *filename, + const wchar_t *mediafiles[], int num_mediafiles, - const ucs2char_t *path_to_root + const wchar_t *path_to_root ) { int i; FILE *fp = NULL; // Open a playlist for writing. - fp = ucs2fopen(filename, "w"); + fp = filepath_fopen(filename, L"w"); if (!fp) { return -1; } @@ -62,12 +62,12 @@ // Skip empty entry just in case. if (mediafiles[i][0]) { char *mbs = NULL; - ucs2char_t filename[MAX_PATH]; - ucs2cpy(filename, filepath_skipdrive(mediafiles[i], path_to_root)); + wchar_t filename[MAX_PATH]; + wcscpy(filename, filepath_skipdrive(mediafiles[i], path_to_root)); filepath_encode(filename); - mbs = ucs2dupmbs(filename); + mbs = wcsdupmbs(filename); fputs(mbs, fp); fputc('\n', fp); } Modified: branches/branch_0.12/lib/pmp_irivnavi/pmp_irivnavi.c =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/pmp_irivnavi.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/pmp_irivnavi.c 2006-06-24 17:48:10 UTC (rev 63) @@ -27,7 +27,8 @@ #include <os.h> #include <stddef.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> #include <filepath.h> #include <pmp.h> #include <pmphelp.h> @@ -46,32 +47,32 @@ MODEL_IRIVER_H300, }; -static const ucs2char_t ucs2cs_music_path[] = +static const wchar_t wcscs_music_path[] = {'M','u','s','i','c',PATHCHAR,0}; -static const ucs2char_t ucs2cs_playlist_path[] = +static const wchar_t wcscs_playlist_path[] = {'P','l','a','y','l','i','s','t','s',PATHCHAR,0}; -static const ucs2char_t ucs2cs_playlist_ext[] = +static const wchar_t wcscs_playlist_ext[] = {'.','m','3','u',0}; -static const ucs2char_t ucs2cs_irivnavi_idb[] = +static const wchar_t wcscs_irivnavi_idb[] = {'i','R','i','v','N','a','v','i','.','i','D','B',0}; -static const ucs2char_t ucs2cs_h100_sys[] = +static const wchar_t wcscs_h100_sys[] = {'H','1','0','0','.','s','y','s',0}; -static const ucs2char_t ucs2cs_h300_sys[] = +static const wchar_t wcscs_h300_sys[] = {'H','3','0','0','.','s','y','s',0}; -static const ucs2char_t ucs2cs_system_h100_sys[] = +static const wchar_t wcscs_system_h100_sys[] = {'S','y','s','t','e','m',PATHCHAR,'H','1','0','0','.','s','y','s',0}; -static const ucs2char_t ucs2cs_system_h300_sys[] = +static const wchar_t wcscs_system_h300_sys[] = {'S','y','s','t','e','m',PATHCHAR,'H','3','0','0','.','s','y','s',0}; #define MODELID_H100 "iriver_h100" #define MODELID_H300 "iriver_h300" typedef struct { - ucs2char_t path_to_root[MAX_PATH]; - ucs2char_t path_to_music[MAX_PATH]; - ucs2char_t path_to_playlist[MAX_PATH]; - ucs2char_t db_filename[MAX_PATH]; - ucs2char_t playlist_ext[MAX_PATH]; + wchar_t path_to_root[MAX_PATH]; + wchar_t path_to_music[MAX_PATH]; + wchar_t path_to_playlist[MAX_PATH]; + wchar_t db_filename[MAX_PATH]; + wchar_t playlist_ext[MAX_PATH]; } irivnavi_environment_t; typedef struct { @@ -84,7 +85,7 @@ static result_t pmp_create_instance_db(pmp_t* pmp, pmpdb_t** ptr_pmpdb); static result_t pmp_create_instance_pl(pmp_t* pmp, pmppl_t** ptr_pmppl); static result_t pmp_is_supported_codec(pmp_t* pmp, uint32_t codec); -static result_t pmp_is_supported_ext(pmp_t* pmp, const ucs2char_t* filename); +static result_t pmp_is_supported_ext(pmp_t* pmp, const wchar_t* filename); static uint32_t pmpdb_add_ref(pmpdb_t* pmpdb); static uint32_t pmpdb_release(pmpdb_t* pmpdb); @@ -96,15 +97,15 @@ static uint32_t pmppl_add_ref(pmppl_t* pmppl); static uint32_t pmppl_release(pmppl_t* pmppl); -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t* files[], uint32_t num_files); +static result_t pmppl_write(pmppl_t* pmppl, const wchar_t* filename, const wchar_t* files[], uint32_t num_files); -int exists_sysfile(const ucs2char_t* path_to_device, const ucs2char_t* sysfilename) +int exists_sysfile(const wchar_t* path_to_device, const wchar_t* sysfilename) { - ucs2char_t filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; - ucs2cpy(filename, path_to_device); + wcscpy(filename, path_to_device); filepath_addslash(filename); - ucs2cat(filename, sysfilename); + wcscat(filename, sysfilename); return filepath_file_exists(filename); } @@ -115,7 +116,7 @@ return 0; } -PMPIRIVNAVIAPI result_t pmp_create(pmp_t** ptr_pmp, const ucs2char_t* path_to_device, const char *id) +PMPIRIVNAVIAPI result_t pmp_create(pmp_t** ptr_pmp, const wchar_t* path_to_device, const char *id) { int model = MODEL_NONE; result_t ret = 0; @@ -134,16 +135,16 @@ model = MODEL_IRIVER_H300; } } else { - if (exists_sysfile(path_to_device, ucs2cs_h100_sys)) { + if (exists_sysfile(path_to_device, wcscs_h100_sys)) { model = MODEL_IRIVER_H100; } - if (exists_sysfile(path_to_device, ucs2cs_system_h100_sys)) { + if (exists_sysfile(path_to_device, wcscs_system_h100_sys)) { model = MODEL_IRIVER_H100; } - if (exists_sysfile(path_to_device, ucs2cs_h300_sys)) { + if (exists_sysfile(path_to_device, wcscs_h300_sys)) { model = MODEL_IRIVER_H300; } - if (exists_sysfile(path_to_device, ucs2cs_system_h300_sys)) { + if (exists_sysfile(path_to_device, wcscs_system_h300_sys)) { model = MODEL_IRIVER_H300; } } @@ -176,14 +177,14 @@ pmp->instance = pmpi; // Initialize the internal variables. - ucs2cpy(pmpi->env.path_to_root, path_to_device); - ucs2cpy(pmpi->env.path_to_music, path_to_device); // Force "\Music" directory for now. + wcscpy(pmpi->env.path_to_root, path_to_device); + wcscpy(pmpi->env.path_to_music, path_to_device); // Force "\Music" directory for now. filepath_addslash(pmpi->env.path_to_music); - ucs2cat(pmpi->env.path_to_music, ucs2cs_music_path); - ucs2cpy(pmpi->env.path_to_playlist, path_to_device); // Force "\Playlist" directory for now. + wcscat(pmpi->env.path_to_music, wcscs_music_path); + wcscpy(pmpi->env.path_to_playlist, path_to_device); // Force "\Playlist" directory for now. filepath_addslash(pmpi->env.path_to_playlist); - ucs2cat(pmpi->env.path_to_playlist, ucs2cs_playlist_path); - ucs2cpy(pmpi->env.playlist_ext, ucs2cs_playlist_ext); + wcscat(pmpi->env.path_to_playlist, wcscs_playlist_path); + wcscpy(pmpi->env.playlist_ext, wcscs_playlist_ext); // Set model information. switch (model) { @@ -203,12 +204,12 @@ // Set enviroments. pmpenv = &pmp->env; pmpenv->path_to_root.flag = PMPPEF_SUPPORT | PMPPEF_CONSTANT; - ucs2cpy(pmpenv->path_to_root.path, pmpi->env.path_to_root); + wcscpy(pmpenv->path_to_root.path, pmpi->env.path_to_root); pmpenv->path_to_music.flag = PMPPEF_SUPPORT | PMPPEF_RECURSIVE; - ucs2cpy(pmpenv->path_to_music.path, pmpi->env.path_to_music); + wcscpy(pmpenv->path_to_music.path, pmpi->env.path_to_music); pmpenv->path_to_playlist.flag = PMPPEF_SUPPORT | PMPPEF_RECURSIVE; - ucs2cpy(pmpenv->path_to_playlist.path, pmpi->env.path_to_playlist); - ucs2cpy(pmpenv->playlist_ext, pmpi->env.playlist_ext); + wcscpy(pmpenv->path_to_playlist.path, pmpi->env.path_to_playlist); + wcscpy(pmpenv->playlist_ext, pmpi->env.playlist_ext); pmp->add_ref(pmp); *ptr_pmp = pmp; @@ -239,18 +240,18 @@ ) ? 1 : 0; } -static int pmp_is_supported_ext(pmp_t* pmp, const ucs2char_t* filename) +static int pmp_is_supported_ext(pmp_t* pmp, const wchar_t* filename) { - static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; - static const ucs2char_t ucs2cs_ogg[] = {'.','o','g','g',0}; - static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; - static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + static const wchar_t wcscs_mp3[] = {'.','m','p','3',0}; + static const wchar_t wcscs_ogg[] = {'.','o','g','g',0}; + static const wchar_t wcscs_wma[] = {'.','w','m','a',0}; + static const wchar_t wcscs_wav[] = {'.','w','a','v',0}; return ( - filepath_hasext(filename, ucs2cs_mp3) || - filepath_hasext(filename, ucs2cs_ogg) || - filepath_hasext(filename, ucs2cs_wma) || - filepath_hasext(filename, ucs2cs_wav) + filepath_hasext(filename, wcscs_mp3) || + filepath_hasext(filename, wcscs_ogg) || + filepath_hasext(filename, wcscs_wma) || + filepath_hasext(filename, wcscs_wav) ) ? 1 : 0; } @@ -340,15 +341,15 @@ irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; FILE *fp = NULL; - ucs2char_t filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; long size = 0; uint8_t *buffer = NULL; // Open a database file in the root directory. - ucs2cpy(filename, pmpdb->pmp->env.path_to_root.path); + wcscpy(filename, pmpdb->pmp->env.path_to_root.path); filepath_addslash(filename); - ucs2cat(filename, ucs2cs_irivnavi_idb); - fp = ucs2fopen(filename, "rb"); + wcscat(filename, wcscs_irivnavi_idb); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return PMPDBE_OPENFORREAD; } @@ -395,15 +396,15 @@ irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; FILE *fp = NULL; - ucs2char_t filename[MAX_PATH]; + wchar_t filename[MAX_PATH]; uint8_t *buffer = NULL; // Open a database file in the root directory. - ucs2cpy(filename, pmpdb->pmp->env.path_to_root.path); + wcscpy(filename, pmpdb->pmp->env.path_to_root.path); filepath_addslash(filename); - ucs2cat(filename, ucs2cs_irivnavi_idb); + wcscat(filename, wcscs_irivnavi_idb); filepath_removefile(filename); - fp = ucs2fopen(filename, "wb"); + fp = filepath_fopen(filename, L"wb"); if (!fp) { return PMPDBE_OPENFORREAD; } @@ -441,8 +442,8 @@ irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; uint32_t i, j, n = 0; - static const ucs2char_t ucs2cs_unknown[] = {'u','n','k','n','o','w','n',0}; - const ucs2char_t* path_to_root = pmpdb->pmp->env.path_to_root.path; + static const wchar_t wcscs_unknown[] = {'u','n','k','n','o','w','n',0}; + const wchar_t* path_to_root = pmpdb->pmp->env.path_to_root.path; // Clear the database. irivnavi_finish(db); @@ -473,11 +474,11 @@ // Set record fields. record_init(dst); - dst->filename = ucs2dupmbs(filepath_skipdrive(src->filename, path_to_root)); - dst->title = src->title ? ucs2dupmbs(src->title) : ucs2dupmbs(filepath_skippath(src->filename));; - dst->artist = ucs2dupmbs(src->artist ? src->artist : ucs2cs_unknown); - dst->album = ucs2dupmbs(src->album ? src->album : ucs2cs_unknown); - dst->genre = ucs2dupmbs(src->genre ? src->genre : ucs2cs_unknown); + dst->filename = wcsdupmbs(filepath_skipdrive(src->filename, path_to_root)); + dst->title = src->title ? wcsdupmbs(src->title) : wcsdupmbs(filepath_skippath(src->filename));; + dst->artist = wcsdupmbs(src->artist ? src->artist : wcscs_unknown); + dst->album = wcsdupmbs(src->album ? src->album : wcscs_unknown); + dst->genre = wcsdupmbs(src->genre ? src->genre : wcscs_unknown); dst->timestamp = src->ts_update; ++j; @@ -493,11 +494,11 @@ irivnavi_t* db = (irivnavi_t*)pmpdb->instance; result_t ret = 0; uint32_t i, j, n = db->num_records; - const ucs2char_t* path_to_root = pmpdb->pmp->env.path_to_root.path; - static const ucs2char_t ucs2cs_mp3[] = {'.','m','p','3',0}; - static const ucs2char_t ucs2cs_ogg[] = {'.','o','g','g',0}; - static const ucs2char_t ucs2cs_wma[] = {'.','w','m','a',0}; - static const ucs2char_t ucs2cs_wav[] = {'.','w','a','v',0}; + const wchar_t* path_to_root = pmpdb->pmp->env.path_to_root.path; + static const wchar_t wcscs_mp3[] = {'.','m','p','3',0}; + static const wchar_t wcscs_ogg[] = {'.','o','g','g',0}; + static const wchar_t wcscs_wma[] = {'.','w','m','a',0}; + static const wchar_t wcscs_wav[] = {'.','w','a','v',0}; if (!records) { *num_records = n; @@ -511,38 +512,38 @@ for (i = 0, j = 0;i < n;++i) { size_t length = 0; - ucs2char_t* tmp = NULL; + wchar_t* tmp = NULL; const record_t* src = &db->records[i]; pmp_record_t* dst = &records[j]; pmp_record_init(dst); - tmp = mbsdupucs2(src->filename); - length = ucs2len(path_to_root); - length += ucs2len(tmp); + tmp = mbsdupwcs(src->filename); + length = wcslen(path_to_root); + length += wcslen(tmp); length += 3; - dst->filename = ucs2malloc(sizeof(ucs2char_t) * length); + dst->filename = malloc(sizeof(wchar_t) * length); filepath_combinepath(dst->filename, length, path_to_root, tmp); - dst->title = mbsdupucs2(src->title); - dst->artist = mbsdupucs2(src->artist); - dst->album = mbsdupucs2(src->album); - dst->genre = mbsdupucs2(src->genre); + dst->title = mbsdupwcs(src->title); + dst->artist = mbsdupwcs(src->artist); + dst->album = mbsdupwcs(src->album); + dst->genre = mbsdupwcs(src->genre); // Set codec information according to the file extensions. - if (filepath_hasext(dst->filename, ucs2cs_mp3)) { + if (filepath_hasext(dst->filename, wcscs_mp3)) { dst->codec = PMPCODEC_MPEGLAYER3; - } else if (filepath_hasext(dst->filename, ucs2cs_ogg)) { + } else if (filepath_hasext(dst->filename, wcscs_ogg)) { dst->codec = PMPCODEC_VORBIS; - } else if (filepath_hasext(dst->filename, ucs2cs_wma)) { + } else if (filepath_hasext(dst->filename, wcscs_wma)) { dst->codec = PMPCODEC_WMA; - } else if (filepath_hasext(dst->filename, ucs2cs_wav)) { + } else if (filepath_hasext(dst->filename, wcscs_wav)) { dst->codec = PMPCODEC_WAV; } dst->ts_update = src->timestamp; - ucs2free(tmp); + free(tmp); ++j; } @@ -576,7 +577,7 @@ return count; } -static result_t pmppl_write(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t* files[], uint32_t num_files) +static result_t pmppl_write(pmppl_t* pmppl, const wchar_t* filename, const wchar_t* files[], uint32_t num_files) { pmp_internal_t* pmpi = (pmp_internal_t*)pmppl->pmp->instance; if (playlist_write(filename, files, num_files, pmpi->env.path_to_root) != 0) { Modified: branches/branch_0.12/lib/pmp_irivnavi/serialize.c =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/serialize.c 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/serialize.c 2006-06-24 17:48:10 UTC (rev 63) @@ -27,7 +27,7 @@ #include <os.h> #include <stddef.h> -#include <ucs2char.h> +#include <wchar.h> #include "serialize.h" @@ -101,54 +101,3 @@ } return sizeof(uint32_t); } - -size_t serialize_ucs2be(uint8_t* buffer, ucs2char_t* value, int is_storing) -{ - serialize_uint16be(buffer, (uint16_t*)value, is_storing); - return sizeof(ucs2char_t); -} - -size_t serialize_ucs2be_string_fixed(uint8_t* buffer, ucs2char_t* str, size_t length, int is_storing) -{ - size_t i; - for (i = 0;i < length;i++) { - serialize_ucs2be(buffer, str, is_storing); - buffer += sizeof(ucs2char_t); - ++str; - } - return length; -} - -size_t serialize_ucs2be_string_var(uint8_t* buffer, ucs2char_t* str, int is_storing) -{ - size_t length = 0; - while (serialize_ucs2be(buffer, str, is_storing), *str) { - ++length; - ++str; - buffer += sizeof(ucs2char_t); - } - return length; -} - -size_t serialize_ucs2be_string_var_alloc(uint8_t* buffer, ucs2char_t** str) -{ - ucs2char_t c; - size_t length = 0; - uint8_t* p = buffer; - - /* Measure the length of the string. */ - while (serialize_ucs2be(p, &c, 0), c) { - ++length; - p += sizeof(ucs2char_t); - } - - /* Allocate a string buffer. */ - ucs2free(*str); - *str = ucs2malloc(sizeof(ucs2char_t) * (length+1)); - memset(*str, 0, sizeof(ucs2char_t) * (length+1)); - - /* Read the string. */ - serialize_ucs2be_string_fixed(buffer, *str, length, 0); - - return length; -} Modified: branches/branch_0.12/lib/pmp_irivnavi/serialize.h =================================================================== --- branches/branch_0.12/lib/pmp_irivnavi/serialize.h 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/lib/pmp_irivnavi/serialize.h 2006-06-24 17:48:10 UTC (rev 63) @@ -30,9 +30,5 @@ size_t serialize_uint32le(uint8_t* buffer, uint32_t* value, int is_storing); size_t serialize_uint16be(uint8_t* buffer, uint16_t* value, int is_storing); size_t serialize_uint32be(uint8_t* buffer, uint32_t* value, int is_storing); -size_t serialize_ucs2be(uint8_t* buffer, ucs2char_t* value, int is_storing); -size_t serialize_ucs2be_string_fixed(uint8_t* buffer, ucs2char_t* str, size_t length, int is_storing); -size_t serialize_ucs2be_string_var(uint8_t* buffer, ucs2char_t* str, int is_storing); -size_t serialize_ucs2be_string_var_alloc(uint8_t* buffer, ucs2char_t** str); #endif/*__IP2DB_SERIALIZE_H__*/ Modified: branches/branch_0.12/pmp.sln =================================================================== --- branches/branch_0.12/pmp.sln 2006-06-24 17:30:18 UTC (rev 62) +++ branches/branch_0.12/pmp.sln 2006-06-24 17:48:10 UTC (rev 63) @@ -25,6 +25,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmp_irivnavi", "lib\pmp_irivnavi\pmp_irivnavi.vcproj", "{2548F270-FFCF-43B4-BB9D-D5AAD5B5FEF1}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} + {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-24 17:30:40
|
Revision: 62 Author: nyaochi Date: 2006-06-24 10:30:18 -0700 (Sat, 24 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=62&view=rev Log Message: ----------- libgmi: migrated from ucs2char_t to wchar_t. Note that libgmi still depends on libucs2 in order to parse WMA and WAV files. Modified Paths: -------------- branches/branch_0.12/include/gmi.h branches/branch_0.12/include/os.h branches/branch_0.12/include/wstring.h branches/branch_0.12/lib/gmi/gmi.c branches/branch_0.12/lib/gmi/gmi_mp3.c branches/branch_0.12/lib/gmi/gmi_vorbis.c branches/branch_0.12/lib/gmi/gmi_wav.c branches/branch_0.12/lib/gmi/gmi_wma.c branches/branch_0.12/lib/wstring/wstring_win32.c branches/branch_0.12/pmp.sln Modified: branches/branch_0.12/include/gmi.h =================================================================== --- branches/branch_0.12/include/gmi.h 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/include/gmi.h 2006-06-24 17:30:18 UTC (rev 62) @@ -54,10 +54,10 @@ GMIAPI int gmi_get( media_info_t* info, - const ucs2char_t *filename, - const ucs2char_t* path_to_music, + const wchar_t *filename, + const wchar_t* path_to_music, int flag, - const ucs2char_t** strip_words, + const wchar_t** strip_words, int num_strip_words ); Modified: branches/branch_0.12/include/os.h =================================================================== --- branches/branch_0.12/include/os.h 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/include/os.h 2006-06-24 17:30:18 UTC (rev 62) @@ -49,6 +49,7 @@ #define getcwd _getcwd #define alloca _alloca #define strnicmp _strnicmp +#define wtoi _wtoi #define PATHCHAR '\\' #define PATHSTR "\\" Modified: branches/branch_0.12/include/wstring.h =================================================================== --- branches/branch_0.12/include/wstring.h 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/include/wstring.h 2006-06-24 17:30:18 UTC (rev 62) @@ -35,6 +35,8 @@ wchar_t *wcsstrip(wchar_t* str); wchar_t *wcsfgets(wchar_t* str, size_t max_bytes, FILE *fp, int is_utf8); +wchar_t* wcsndup(const wchar_t* src, size_t length); +int wcsincmp(const wchar_t* x, const wchar_t* y, size_t n); int has_utf8bom(FILE *fp); Modified: branches/branch_0.12/lib/gmi/gmi.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi.c 2006-06-24 17:30:18 UTC (rev 62) @@ -27,69 +27,70 @@ #endif/*HAVE_CONFIG_H*/ #include <os.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> #include <filepath.h> #include <gmi.h> -int gmi_mp3(media_info_t* info, const ucs2char_t *filename); -static const ucs2char_t ucs2cs_ext_mp3[] = {'.','m','p','3',0}; +int gmi_mp3(media_info_t* info, const wchar_t *filename); +static const wchar_t* wcscs_ext_mp3 = L".mp3"; -int gmi_wma(media_info_t* info, const ucs2char_t *filename); -static const ucs2char_t ucs2cs_ext_wma[] = {'.','w','m','a',0}; +int gmi_wma(media_info_t* info, const wchar_t *filename); +static const wchar_t* wcscs_ext_wma = L".wma"; -int gmi_vorbis(media_info_t* info, const ucs2char_t *filename); -static const ucs2char_t ucs2cs_ext_ogg[] = {'.','o','g','g',0}; +int gmi_vorbis(media_info_t* info, const wchar_t *filename); +static const wchar_t* wcscs_ext_ogg = L".ogg"; -int gmi_wav(media_info_t* info, const ucs2char_t *filename); -static const ucs2char_t ucs2cs_ext_wav[] = {'.','w','a','v',0}; +int gmi_wav(media_info_t* info, const wchar_t *filename); +static const wchar_t* wcscs_ext_wav = L".wav"; typedef struct { - int (*func)(media_info_t* info, const ucs2char_t *filename); - const ucs2char_t* ext; + int (*func)(media_info_t* info, const wchar_t *filename); + const wchar_t* ext; } gmi_exports_t; static gmi_exports_t gmi_exports[] = { - {gmi_mp3, ucs2cs_ext_mp3}, - {gmi_wma, ucs2cs_ext_wma}, - {gmi_vorbis, ucs2cs_ext_ogg}, - {gmi_wav, ucs2cs_ext_wav}, + {gmi_mp3, L".mp3"}, + {gmi_wma, L".wma"}, + {gmi_vorbis, L".ogg"}, + {gmi_wav, L".wav"}, {NULL, NULL}, }; static int gmi_get_from_pathname( media_info_t* info, - const ucs2char_t *filename, - const ucs2char_t* path_to_music, + const wchar_t *filename, + const wchar_t* path_to_music, int flag ) { - const ucs2char_t *p = NULL, *q = NULL; - ucs2char_t file[MAX_PATH], path[MAX_PATH]; + const wchar_t *p = NULL, *q = NULL; + wchar_t file[MAX_PATH], path[MAX_PATH]; - ucs2cpy(file, filepath_skippath(filename)); - ucs2cpy(path, filename); + wcscpy(file, filepath_skippath(filename)); + wcscpy(path, filename); filepath_remove_filespec(path); if (flag & GMIF_PARSEMASK) { /* Clear fields according to the type. */ if (flag & GMIF_TITLE) { - ucs2free(info->title); info->title = NULL; + free(info->title); info->title = NULL; } if (flag & GMIF_ALBUM) { - ucs2free(info->album); info->album = NULL; + free(info->album); info->album = NULL; } if (flag & GMIF_GENRE) { - ucs2free(info->genre); info->genre = NULL; + free(info->genre); info->genre = NULL; } if (flag & GMIF_ARTIST) { - ucs2free(info->artist); info->artist = NULL; + free(info->artist); info->artist = NULL; } /* Obtain path name to the music. */ - p = ucs2str(path, path_to_music); + p = wcsstr(path, path_to_music); if (p) { - p += ucs2len(path_to_music); + p += wcslen(path_to_music); } else { p = path; } @@ -98,26 +99,26 @@ if (flag & GMIF_GENRE) { q = filepath_skip_one_directory(p); if (q) { - info->genre = ucs2ndup(p, (q-p) - 1); + info->genre = wcsndup(p, (q-p) - 1); p = q; q = filepath_skip_one_directory(p); if (q) { - info->artist = ucs2ndup(p, (q-p) - 1); + info->artist = wcsndup(p, (q-p) - 1); if (flag & GMIF_ALBUM) { - info->album = ucs2dup(q); + info->album = wcsdup(q); filepath_removeslash(info->album); - filepath_replace_slash(info->album, (ucs2char_t)' '); + filepath_replace_slash(info->album, (wchar_t)' '); } } } } else { q = filepath_skip_one_directory(p); if (q) { - info->artist = ucs2ndup(p, (q-p) - 1); + info->artist = wcsndup(p, (q-p) - 1); if (flag & GMIF_ALBUM) { - info->album = ucs2dup(q); + info->album = wcsdup(q); filepath_removeslash(info->album); - filepath_replace_slash(info->album, (ucs2char_t)' '); + filepath_replace_slash(info->album, (wchar_t)' '); } } } @@ -133,7 +134,7 @@ p++; /* Obtain track number. */ - info->track_number = (uint32_t)ucs2toi(file); + info->track_number = (uint32_t)wtoi(file); if (flag & GMIF_TITLE) { /* Skip space and '_' letters. */ @@ -142,33 +143,33 @@ } /* Obtain track title. */ - info->title = ucs2dup(p); + info->title = wcsdup(p); filepath_remove_extension(info->title); if (!info->title[0]) { /* If track title becomes empty (e.g., 01.mp3), set the filename. */ - ucs2free(info->title); - info->title = ucs2dup(file); + free(info->title); + info->title = wcsdup(file); filepath_remove_extension(info->title); } } } else { /* The filename begins with one numerical letter. */ if (flag & GMIF_TITLE) { - info->title = ucs2dup(file); + info->title = wcsdup(file); filepath_remove_extension(info->title); } } } else { /* The filename does not begin with a numerical letter. */ if (flag & GMIF_TITLE) { - info->title = ucs2dup(file); + info->title = wcsdup(file); filepath_remove_extension(info->title); } } } else { if (flag & GMIF_TITLE) { /* Use filename as a title. */ - info->title = ucs2dup(file); + info->title = wcsdup(file); filepath_remove_extension(info->title); } } @@ -177,10 +178,10 @@ return 0; } -static void strip_head_letters(ucs2char_t* str, size_t offset) +static void strip_head_letters(wchar_t* str, size_t offset) { - if (offset <= ucs2len(str)) { - size_t i, n = ucs2len(str) + 1 - offset; + if (offset <= wcslen(str)) { + size_t i, n = wcslen(str) + 1 - offset; for (i = 0;i < n;++i) { str[i] = str[i+offset]; } @@ -189,10 +190,10 @@ int gmi_get( media_info_t* info, - const ucs2char_t *filename, - const ucs2char_t* path_to_music, + const wchar_t *filename, + const wchar_t* path_to_music, int flag, - const ucs2char_t* strip_words[], + const wchar_t* strip_words[], int num_strip_words ) { @@ -200,8 +201,8 @@ gmi_exports_t* exp = gmi_exports; /* Set the pathname and filename. */ - info->filename = ucs2dup(filename); - info->filesize = ucs2stat_size(filename); + info->filename = wcsdup(filename); + info->filesize = filepath_filesize(filename); if (flag & GMIF_TAG) { while (exp->func) { @@ -223,8 +224,8 @@ if ((flag & GMIF_STRIP_ARTIST) && strip_words) { int i; for (i = 0;i < num_strip_words;++i) { - if (ucs2incmp(info->artist, strip_words[i], ucs2len(strip_words[i])) == 0) { - strip_head_letters(info->artist, ucs2len(strip_words[i])); + if (wcsincmp(info->artist, strip_words[i], wcslen(strip_words[i])) == 0) { + strip_head_letters(info->artist, wcslen(strip_words[i])); break; } } Modified: branches/branch_0.12/lib/gmi/gmi_mp3.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_mp3.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi_mp3.c 2006-06-24 17:30:18 UTC (rev 62) @@ -33,7 +33,9 @@ #include <string.h> #include <sys/types.h> #include <sys/stat.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> +#include <filepath.h> #include <gmi.h> #include <id3tag.h> @@ -201,11 +203,11 @@ return 0; } -static int get_mp3stream_info(mp3header_t* header, const ucs2char_t *filename, uint32_t filesize) +static int get_mp3stream_info(mp3header_t* header, const wchar_t *filename, uint32_t filesize) { int channels = 0; uint8_t buffer[4]; - FILE *fp = ucs2fopen(filename, "rb"); + FILE *fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } @@ -268,9 +270,9 @@ } -static ucs2char_t* get_frame_value(struct id3_tag *id3tag, const char *name) +static wchar_t* get_frame_value(struct id3_tag *id3tag, const char *name) { - ucs2char_t* ret = NULL; + wchar_t* ret = NULL; const id3_ucs4_t *value = NULL; struct id3_frame *frame = NULL; union id3_field *field = NULL; @@ -308,30 +310,30 @@ if (encoding == ID3_FIELD_TEXTENCODING_ISO_8859_1) { char *mbs = id3_ucs4_latin1duplicate(value); - ret = mbsdupucs2_music(mbs); /* MBS for music files. */ + ret = mbsdupwcs(mbs); /* MBS for music files. */ free(mbs); return ret; } else { - ucs2char_t* ucs2 = id3_ucs4_utf16duplicate(value); - ret = ucs2dup(ucs2); - free(ucs2); + wchar_t* wcs = id3_ucs4_utf16duplicate(value); + ret = wcsdup(wcs); + free(wcs); return ret; } } -int gmi_mp3(media_info_t* info, const ucs2char_t *filename) +int gmi_mp3(media_info_t* info, const wchar_t *filename) { int i, num_tags = 0; FILE *fp = NULL; mp3header_t mp3header; uint32_t tn = 0; - static const ucs2char_t ucs2_empty[1] = {0}; - ucs2char_t* ucs2 = NULL; + static const wchar_t wcs_empty[1] = {0}; + wchar_t* wcs = NULL; struct id3_file *id3file = NULL; struct id3_tag *id3tag = NULL; /* Open the file with UNICODE filename. This is for better compatibility. */ - fp = ucs2fopen(filename, "rb"); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } @@ -371,106 +373,106 @@ } /* Obtain track number first. */ - ucs2 = get_frame_value(id3tag, "TRCK"); - if (ucs2 && *ucs2) { - info->track_number = ucs2toi(ucs2); + wcs = get_frame_value(id3tag, "TRCK"); + if (wcs && *wcs) { + info->track_number = wtoi(wcs); } else { info->track_number = 0; } - ucs2free(ucs2); + free(wcs); /* Obtain track title. */ - ucs2 = get_frame_value(id3tag, "TIT2"); - if (ucs2 && *ucs2) { - ucs2free(info->title); - info->title = ucs2dup(ucs2); + wcs = get_frame_value(id3tag, "TIT2"); + if (wcs && *wcs) { + free(info->title); + info->title = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* Set artist field. */ - if (1) ucs2 = get_frame_value(id3tag, "TPE1"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TPE2"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TPE3"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TPE4"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TCOM"); - if (ucs2 && *ucs2) { - ucs2free(info->artist); - info->artist = ucs2dup(ucs2); + if (1) wcs = get_frame_value(id3tag, "TPE1"); + if (!wcs) wcs = get_frame_value(id3tag, "TPE2"); + if (!wcs) wcs = get_frame_value(id3tag, "TPE3"); + if (!wcs) wcs = get_frame_value(id3tag, "TPE4"); + if (!wcs) wcs = get_frame_value(id3tag, "TCOM"); + if (wcs && *wcs) { + free(info->artist); + info->artist = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* Set composer field. */ - ucs2 = get_frame_value(id3tag, "TCOM"); - if (ucs2 && *ucs2) { - ucs2free(info->composer); - info->composer = ucs2dup(ucs2); + wcs = get_frame_value(id3tag, "TCOM"); + if (wcs && *wcs) { + free(info->composer); + info->composer = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* Set album field. */ - ucs2 = get_frame_value(id3tag, "TALB"); - if (ucs2 && *ucs2) { - ucs2free(info->album); - info->album = ucs2dup(ucs2); + wcs = get_frame_value(id3tag, "TALB"); + if (wcs && *wcs) { + free(info->album); + info->album = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* * TCMP (compilation flag) handling for omnibus albums. * This patch was originally submitted by Espen Matheussen. */ - ucs2 = get_frame_value(id3tag, "TCMP"); - if (ucs2 && *ucs2) { + wcs = get_frame_value(id3tag, "TCMP"); + if (wcs && *wcs) { size_t length = 0; - ucs2char_t* title = NULL; - static ucs2char_t separator[] = {' ','-',' ',0}; + wchar_t* title = NULL; + static wchar_t separator[] = {' ','-',' ',0}; /* Calculate the length of the new title. */ if (info->artist) { - length += ucs2len(info->artist); + length += wcslen(info->artist); } - length += ucs2len(separator); + length += wcslen(separator); if (info->title) { - length += ucs2len(info->title); + length += wcslen(info->title); } /* Construct the new title. */ - title = ucs2malloc(sizeof(ucs2char_t) * (length+1)); + title = (wchar_t*)malloc(sizeof(wchar_t) * (length+1)); if (info->artist) { - ucs2cpy(title, info->artist); + wcscpy(title, info->artist); } - ucs2cat(title, separator); + wcscat(title, separator); if (info->title) { - ucs2cat(title, info->title); + wcscat(title, info->title); } /* Free the previous title and artist. */ - ucs2free(info->title); - ucs2free(info->artist); + free(info->title); + free(info->artist); /* Set the new title and artist. */ info->title = title; - info->artist = mbsdupucs2("Various artists"); + info->artist = mbsdupwcs("Various artists"); } /* Set genre field. */ - ucs2 = get_frame_value(id3tag, "TCON"); - if (ucs2 && *ucs2) { - ucs2free(info->genre); - info->genre = ucs2dup(ucs2); + wcs = get_frame_value(id3tag, "TCON"); + if (wcs && *wcs) { + free(info->genre); + info->genre = wcsdup(wcs); } - ucs2free(ucs2); + free(wcs); /* Set year field. */ - if (1) ucs2 = get_frame_value(id3tag, "TYER"); - if (!ucs2) ucs2 = get_frame_value(id3tag, "TDRC"); - if (ucs2 && *ucs2) { - ucs2free(info->date); - info->date = ucs2dup(ucs2); + if (1) wcs = get_frame_value(id3tag, "TYER"); + if (!wcs) wcs = get_frame_value(id3tag, "TDRC"); + if (wcs && *wcs) { + free(info->date); + info->date = wcsdup(wcs); } else { info->date = 0; } - ucs2free(ucs2); + free(wcs); } /* Parse MPEG audio header. */ Modified: branches/branch_0.12/lib/gmi/gmi_vorbis.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_vorbis.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi_vorbis.c 2006-06-24 17:30:18 UTC (rev 62) @@ -31,7 +31,9 @@ #include <stdio.h> #include <stdlib.h> #include <memory.h> -#include <ucs2char.h> +#include <wchar.h> +#include <wstring.h> +#include <filepath.h> #include <gmi.h> #include <vorbis/codec.h> @@ -41,7 +43,7 @@ #define strncasecmp strnicmp #endif -int gmi_vorbis(media_info_t* info, const ucs2char_t *filename) +int gmi_vorbis(media_info_t* info, const wchar_t *filename) { int i, ret = 0; long lval = 0; @@ -53,12 +55,12 @@ /* Set the pathname and filename. */ /* - info->filename = ucs2dup(filename); - info->filesize = ucs2stat_size(filename); + info->filename = wcsdup(filename); + info->filesize = wcsstat_size(filename); */ /* Open the target file. */ - fp = ucs2fopen(filename, "rb"); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } @@ -97,17 +99,17 @@ for (i = 0;i < vc->comments;++i) { const char *fieldvalue = vc->user_comments[i]; if (strncasecmp(fieldvalue, "TITLE=", 6) == 0) { - info->title = utf8dupucs2(fieldvalue+6); + info->title = utf8dupwcs(fieldvalue+6); } else if (strncasecmp(fieldvalue, "ARTIST=", 7) == 0) { - info->artist = utf8dupucs2(fieldvalue+7); + info->artist = utf8dupwcs(fieldvalue+7); } else if (strncasecmp(fieldvalue, "ALBUM=", 6) == 0) { - info->album = utf8dupucs2(fieldvalue+6); + info->album = utf8dupwcs(fieldvalue+6); } else if (strncasecmp(fieldvalue, "GENRE=", 6) == 0) { - info->genre = utf8dupucs2(fieldvalue+6); + info->genre = utf8dupwcs(fieldvalue+6); } else if (strncasecmp(fieldvalue, "TRACKNUMBER=", 12) == 0) { info->track_number = atoi(fieldvalue+12); } else if (strncasecmp(fieldvalue, "DATE=", 5) == 0) { - info->date = utf8dupucs2(fieldvalue+5); + info->date = utf8dupwcs(fieldvalue+5); } } Modified: branches/branch_0.12/lib/gmi/gmi_wav.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_wav.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi_wav.c 2006-06-24 17:30:18 UTC (rev 62) @@ -102,24 +102,24 @@ switch (ch.id) { case 0x44525049: /* "IPRD" */ - ucs2free(info->album); - info->album = mbsdupucs2_music(buffer); + free(info->album); + info->album = mbsdupwcs(buffer); break; case 0x4D414E49: /* "INAM" */ - ucs2free(info->title); - info->title = mbsdupucs2_music(buffer); + free(info->title); + info->title = mbsdupwcs(buffer); break; case 0x54524149: /* "IART" */ - ucs2free(info->artist); - info->artist = mbsdupucs2_music(buffer); + free(info->artist); + info->artist = mbsdupwcs(buffer); break; case 0x524E4749: /* "IGNR" */ - ucs2free(info->genre); - info->genre = mbsdupucs2_music(buffer); + free(info->genre); + info->genre = mbsdupwcs(buffer); break; case 0x44524349: /* "ICRD" */ - ucs2free(info->date); - info->date = mbsdupucs2_music(buffer); + free(info->date); + info->date = mbsdupwcs(buffer); break; case 0x6974726B: /* "itrk" */ info->track_number = atoi(buffer); @@ -151,7 +151,7 @@ uint16_t channels, sample_bits; /* Open the audio file. */ - fp = ucs2fopen(filename, "rb"); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } Modified: branches/branch_0.12/lib/gmi/gmi_wma.c =================================================================== --- branches/branch_0.12/lib/gmi/gmi_wma.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/gmi/gmi_wma.c 2006-06-24 17:30:18 UTC (rev 62) @@ -31,6 +31,9 @@ #include <stdio.h> #include <stdlib.h> #include <memory.h> +#include <wchar.h> +#include <wstring.h> +#include <filepath.h> #include <ucs2char.h> #include <gmi.h> @@ -157,7 +160,7 @@ FILE *fp = NULL; /* Open the audio file. */ - fp = ucs2fopen(filename, "rb"); + fp = filepath_fopen(filename, L"rb"); if (!fp) { return -1; } @@ -378,6 +381,7 @@ } else if (guid_equals(guid, g_guid_content_description)) { /* Content Description Object (title, artist) */ uint16_t title_bytes, author_bytes; + ucs2char_t* ucs2 = NULL; if (!read_uint16le(&title_bytes, fp)) { goto get_asf_audio_info_error; @@ -391,18 +395,23 @@ /* Release the buffer first to overwrite the information without memory leak. */ free(info->title); - info->title = (ucs2char_t*)malloc(title_bytes+sizeof(ucs2char_t)); - if (!info->title || !read_ucs2le_fixed(info->title, title_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)malloc(title_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, title_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->title = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; free(info->artist); - info->artist = (ucs2char_t*)malloc(author_bytes+sizeof(ucs2char_t)); - if (!info->artist || !read_ucs2le_fixed(info->artist, author_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)malloc(author_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, author_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->artist = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; - } else if (guid_equals(guid, g_guid_extended_content_description)) { /* Extended Content Description Object (album, genre, etc.) */ uint16_t j, num_descriptions; @@ -412,6 +421,7 @@ } for (j = 0;j < num_descriptions;j++) { + ucs2char_t* ucs2 = NULL; static const ucs2char_t ucs2cs_wm_albumartist[] = {'w','m','/','a','l','b','u','m','a','r','t','i','s','t',0}; static const ucs2char_t ucs2cs_artist[] = {'a','r','t','i','s','t',0}; static const ucs2char_t ucs2cs_wm_albumtitle[] = {'w','m','/','a','l','b','u','m','t','i','t','l','e',0}; @@ -448,38 +458,53 @@ /* If an artist name was extracted from Content Description, we don't parse wm/albumartist. */ if ((!info->artist || !info->artist[0]) && (ucs2icmp(name, ucs2cs_wm_albumartist) == 0 || ucs2icmp(name, ucs2cs_artist) == 0)) { free(info->artist); - info->artist = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->artist || !read_ucs2le_fixed(info->artist, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; - } + } + info->artist = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else if (ucs2icmp(name, ucs2cs_wm_albumtitle) == 0 || ucs2icmp(name, ucs2cs_album) == 0) { free(info->album); - info->album = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->album || !read_ucs2le_fixed(info->album, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; - } + } + info->album = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else if (ucs2icmp(name, ucs2cs_wm_genre) == 0 || ucs2icmp(name, ucs2cs_genre) == 0) { free(info->genre); - info->genre = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->genre || !read_ucs2le_fixed(info->genre, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->genre = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else if (ucs2icmp(name, ucs2cs_wm_composer) == 0 || ucs2icmp(name, ucs2cs_composer) == 0) { free(info->composer); - info->composer = (ucs2char_t*)malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->composer || !read_ucs2le_fixed(info->composer, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->composer = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else if (ucs2icmp(name, ucs2cs_wm_tracknumber) == 0 || ucs2icmp(name, ucs2cs_tracknumber) == 0) { info->track_number = read_field_as_uint32(value_type, value_bytes, fp); } else if (ucs2icmp(name, ucs2cs_wm_track) == 0) { info->track_number = read_field_as_uint32(value_type, value_bytes, fp) + 1; } else if (ucs2icmp(name, ucs2cs_wm_year) == 0 || ucs2icmp(name, ucs2cs_year) == 0 || ucs2icmp(name, ucs2cs_date) == 0) { free(info->date); - info->date = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); - if (!info->date || !read_ucs2le_fixed(info->date, value_bytes/sizeof(ucs2char_t), fp)) { + ucs2 = (ucs2char_t*)ucs2malloc(value_bytes+sizeof(ucs2char_t)); + if (!ucs2 || !read_ucs2le_fixed(ucs2, value_bytes/sizeof(ucs2char_t), fp)) { goto get_asf_audio_info_error; } + info->date = ucs2dupwcs(ucs2); + free(ucs2); + ucs2 = NULL; } else { if (fseek(fp, value_bytes, SEEK_CUR) != 0) { goto get_asf_audio_info_error; Modified: branches/branch_0.12/lib/wstring/wstring_win32.c =================================================================== --- branches/branch_0.12/lib/wstring/wstring_win32.c 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/lib/wstring/wstring_win32.c 2006-06-24 17:30:18 UTC (rev 62) @@ -31,6 +31,8 @@ #include <wchar.h> #include <string.h> +#define COMP(a, b) ((a)>(b))-((a)<(b)) + char *wcsdupmbs(const wchar_t* src) { size_t dst_size = wcstombs(NULL, src, 0); @@ -232,3 +234,41 @@ } } } + +wchar_t* wcsndup(const wchar_t* src, size_t length) +{ + wchar_t* dst = NULL; + size_t src_length = wcslen(src); + if (length < src_length) { + src_length = length; + } + dst = (wchar_t*)malloc((src_length+1) * sizeof(wchar_t)); + if (dst) { + size_t i; + for (i = 0;i < src_length;i++) { + dst[i] = src[i]; + } + dst[i] = 0; + } + return dst; +} + +int wcsincmp(const wchar_t* x, const wchar_t* y, size_t n) +{ + size_t i; + wchar_t a = 0, b = 0; + + for (i = 0;i < n-1;i++) { + a = towupper(*x); + b = towupper(*y); + if (!*x || !*y || a != b) { + break; + } + x++; + y++; + } + return COMP(a, b); +} + + + Modified: branches/branch_0.12/pmp.sln =================================================================== --- branches/branch_0.12/pmp.sln 2006-06-24 16:49:51 UTC (rev 61) +++ branches/branch_0.12/pmp.sln 2006-06-24 17:30:18 UTC (rev 62) @@ -11,6 +11,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmi", "lib\gmi\gmi.vcproj", "{3575EFC2-9051-467A-BEB4-E71E2F8664D7}" ProjectSection(ProjectDependencies) = postProject {AA8DA82B-C209-4ABE-ABA1-22352962426D} = {AA8DA82B-C209-4ABE-ABA1-22352962426D} + {59650257-D8E9-4253-827D-8110C3DAAA3D} = {59650257-D8E9-4253-827D-8110C3DAAA3D} {FA6E7B73-7CF8-47DD-A016-77382A1FD904} = {FA6E7B73-7CF8-47DD-A016-77382A1FD904} {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} = {8BFE7DD6-F825-42BA-A7D7-EFCDCC9D686A} EndProjectSection This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-23 15:30:32
|
Revision: 60 Author: nyaochi Date: 2006-06-23 08:30:22 -0700 (Fri, 23 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=60&view=rev Log Message: ----------- [Win32 only] added wchar_t <--> ucs2char_t conversion routines in libucs2. Modified Paths: -------------- branches/branch_0.12/include/ucs2char.h branches/branch_0.12/lib/ucs2/ucs2char_win32.c Modified: branches/branch_0.12/include/ucs2char.h =================================================================== --- branches/branch_0.12/include/ucs2char.h 2006-06-23 15:17:37 UTC (rev 59) +++ branches/branch_0.12/include/ucs2char.h 2006-06-23 15:30:22 UTC (rev 60) @@ -103,15 +103,19 @@ UCS2API ucs2char_t* itoucs2(int value, ucs2char_t *string, int radix); -UCS2API size_t ucs2tombs(char *mbstr, size_t mbs_size, const ucs2char_t *ucs2str, size_t ucs_size); +UCS2API size_t ucs2tombs(char *mbstr, size_t mbs_size, const ucs2char_t *ucs2str, size_t ucs_len); +UCS2API size_t ucs2towcs(wchar_t *wcstr, size_t wcs_len, const ucs2char_t *ucs2str, size_t ucs_len); UCS2API size_t mbstoucs2(ucs2char_t *ucs2str, size_t ucs_size, const char *mbstr, size_t mbs_size); UCS2API size_t mbstoucs2_music(ucs2char_t *ucs2str, size_t ucs_size, const char *mbstr, size_t mbs_size); +UCS2API size_t wcstoucs2(ucs2char_t *ucs2str, size_t ucs_len, const wchar_t *wcstr, size_t wcs_len); UCS2API size_t utf8toucs2(ucs2char_t *ucs2str, size_t ucs_size, const char *mbstr, size_t mbs_size); UCS2API ucs2char_t* mbsdupucs2(const char *mbstr); +UCS2API ucs2char_t* wcsdupucs2(const wchar_t *wcstr); UCS2API ucs2char_t* utf8dupucs2(const char *utf8str); UCS2API ucs2char_t* mbsdupucs2_music(const char *mbstr); UCS2API char *ucs2dupmbs(const ucs2char_t *ucs2str); +UCS2API wchar_t *ucs2dupwcs(const ucs2char_t *ucs2str); UCS2API time_t ucs2stat_mtime(const ucs2char_t *filename); UCS2API uint32_t ucs2stat_size(const ucs2char_t *filename); Modified: branches/branch_0.12/lib/ucs2/ucs2char_win32.c =================================================================== --- branches/branch_0.12/lib/ucs2/ucs2char_win32.c 2006-06-23 15:17:37 UTC (rev 59) +++ branches/branch_0.12/lib/ucs2/ucs2char_win32.c 2006-06-23 15:30:22 UTC (rev 60) @@ -68,11 +68,32 @@ return WideCharToMultiByte(g_codepage, 0, ucs2str, (int)ucs_len, mbstr, (int)mbs_len, NULL, NULL); } +size_t ucs2towcs(wchar_t *wcstr, size_t wcs_len, const ucs2char_t *ucs2str, size_t ucs_len) +{ + if (!wcstr || !wcs_len) { + return ucs_len; + } else { + wcsncpy(wcstr, ucs2str, wcs_len); + return wcs_len; + } +} + size_t mbstoucs2(ucs2char_t *ucs2str, size_t ucs_len, const char *mbstr, size_t mbs_len) { return MultiByteToWideChar(g_codepage, 0, mbstr, (int)mbs_len, ucs2str, (int)ucs_len); } +size_t wcstoucs2(ucs2char_t *ucs2str, size_t ucs_len, const wchar_t *wcstr, size_t wcs_len) +{ + if (!ucs2str || !ucs2str) { + return wcs_len; + } else { + wcsncpy(ucs2str, wcstr, ucs_len); + return ucs_len; + } +} + + size_t mbstoucs2_music(ucs2char_t *ucs2str, size_t ucs_len, const char *mbstr, size_t mbs_len) { return MultiByteToWideChar(g_codepage, 0, mbstr, (int)mbs_len, ucs2str, (int)ucs_len); @@ -91,17 +112,14 @@ return mbsdupucs2(mbstr); } - -ucs2char_t* wcsdupucs2(const wchar_t *wstr) +ucs2char_t* wcsdupucs2(const wchar_t *wcstr) { - /* Just call ucs2dup. */ - return ucs2dup(wstr); + return ucs2dup((const ucs2char_t*)wcstr); } -wchar_t* ucs2dupwcs(const ucs2char_t *ucs2str) +wchar_t *ucs2dupwcs(const ucs2char_t *ucs2str) { - /* Just call ucs2dup. */ - return ucs2dup(ucs2str); + return wcsdup((const wchar_t*)ucs2str); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-23 15:18:19
|
Revision: 58 Author: nyaochi Date: 2006-06-23 08:06:49 -0700 (Fri, 23 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=58&view=rev Log Message: ----------- Branch for 0.12 (this branch is mainly for changing ucs2char_t to wchar_t) Added Paths: ----------- branches/branch_0.12/ Copied: branches/branch_0.12 (from rev 57, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-23 15:17:55
|
Revision: 59 Author: nyaochi Date: 2006-06-23 08:17:37 -0700 (Fri, 23 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=59&view=rev Log Message: ----------- Changed ucs2char_t to wchar_t in libpmp. (This branch will be broken for the time being) Modified Paths: -------------- branches/branch_0.12/include/pmp.h branches/branch_0.12/include/pmphelp.h branches/branch_0.12/lib/pmp/pmp.c branches/branch_0.12/lib/pmp/pmp_posix.c branches/branch_0.12/lib/pmp/pmp_win32.c Modified: branches/branch_0.12/include/pmp.h =================================================================== --- branches/branch_0.12/include/pmp.h 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/include/pmp.h 2006-06-23 15:17:37 UTC (rev 59) @@ -78,7 +78,7 @@ typedef struct { int flag; - ucs2char_t path[MAX_PATH]; + wchar_t path[MAX_PATH]; } pmp_pathenv_t; typedef struct { @@ -92,31 +92,31 @@ pmp_pathenv_t path_to_music; /**< Path to the music files */ pmp_pathenv_t path_to_playlist; /**< Path to the playlist files */ pmp_pathenv_t path_to_photo; /**< Path to the photo files */ - ucs2char_t playlist_ext[MAX_PATH]; + wchar_t playlist_ext[MAX_PATH]; } pmp_environment_t; /** * Structure of media record. */ struct tag_pmp_record_t { - ucs2char_t *filename; /**< Filename. */ - ucs2char_t *title; /**< Track title. */ - ucs2char_t *artist; /**< Artist name. */ - ucs2char_t *composer; /**< Composer name. */ - ucs2char_t *album; /**< Album name. */ - ucs2char_t *genre; /**< Genre name. */ - ucs2char_t *date; /**< Date. */ - uint32_t codec; /**< Codec FourCC. */ - uint32_t track_number; /**< Track number. */ - uint32_t sample_rate; /**< Sample rate in kHz. */ - uint32_t bitrate; /**< Bitrate in bps. */ - uint32_t duration; /**< Duration in seconds. */ - uint32_t filesize; /**< File size in bytes. */ - uint32_t ts_update; /**< Last update. */ - uint32_t rating; /**< Rating of the track. */ - uint32_t play_count; /**< The number of playback of the track. */ - uint32_t ts_playback; /**< Date/time of recent playback of the track. */ - uint32_t ts_import; /**< Date/time when the track was imported. */ + wchar_t* filename; /**< Filename. */ + wchar_t* title; /**< Track title. */ + wchar_t* artist; /**< Artist name. */ + wchar_t* composer; /**< Composer name. */ + wchar_t* album; /**< Album name. */ + wchar_t* genre; /**< Genre name. */ + wchar_t* date; /**< Date. */ + uint32_t codec; /**< Codec FourCC. */ + uint32_t track_number; /**< Track number. */ + uint32_t sample_rate; /**< Sample rate in kHz. */ + uint32_t bitrate; /**< Bitrate in bps. */ + uint32_t duration; /**< Duration in seconds. */ + uint32_t filesize; /**< File size in bytes. */ + uint32_t ts_update; /**< Last update. */ + uint32_t rating; /**< Rating of the track. */ + uint32_t play_count; /**< The number of playback of the track. */ + uint32_t ts_playback; /**< Date/time of recent playback of the track. */ + uint32_t ts_import; /**< Date/time when the track was imported. */ }; typedef struct tag_pmp_record_t pmp_record_t; @@ -132,7 +132,7 @@ result_t (*create_instance_pl)(pmp_t* pmp, pmppl_t** pmppl); int (*is_supported_codec)(pmp_t* pmp, uint32_t codec); - int (*is_supported_ext)(pmp_t* pmp, const ucs2char_t* filename); + int (*is_supported_ext)(pmp_t* pmp, const wchar_t* filename); }; typedef void pmpdb_readwrite_progress_t(void *instance, uint32_t size, uint32_t total); @@ -162,10 +162,10 @@ uint32_t (*add_ref)(pmppl_t* pmppl); uint32_t (*release)(pmppl_t* pmppl); - result_t (*write)(pmppl_t* pmppl, const ucs2char_t* filename, const ucs2char_t** files, uint32_t num_files); + result_t (*write)(pmppl_t* pmppl, const wchar_t* filename, const wchar_t** files, uint32_t num_files); }; -typedef result_t (*pmp_create_t)(pmp_t** pmp, const ucs2char_t* path_to_device, const char *devid); +typedef result_t (*pmp_create_t)(pmp_t** pmp, const wchar_t* path_to_device, const char *devid); typedef void (*pmp_enumerate_devid_callback_t)(void *instance, const char *devid); typedef result_t (*pmp_enumerate_devid_t)(pmp_enumerate_devid_callback_t callback, void *instance); Modified: branches/branch_0.12/include/pmphelp.h =================================================================== --- branches/branch_0.12/include/pmphelp.h 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/include/pmphelp.h 2006-06-23 15:17:37 UTC (rev 59) @@ -34,7 +34,7 @@ pmphelp_create( pmphelp_t* pmphelp, pmp_t** pmp, - const ucs2char_t* path_to_device, + const wchar_t* path_to_device, const char *id ); Modified: branches/branch_0.12/lib/pmp/pmp.c =================================================================== --- branches/branch_0.12/lib/pmp/pmp.c 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/lib/pmp/pmp.c 2006-06-23 15:17:37 UTC (rev 59) @@ -31,7 +31,7 @@ #include <string.h> #endif/*HAVE_STRING_H*/ -#include <ucs2char.h> +#include <wchar.h> #include <pmp.h> void pmp_record_init(pmp_record_t* record) @@ -42,24 +42,24 @@ void pmp_record_finish(pmp_record_t* record) { - ucs2free(record->filename); - ucs2free(record->title); - ucs2free(record->artist); - ucs2free(record->album); - ucs2free(record->genre); - ucs2free(record->date); + free(record->filename); + free(record->title); + free(record->artist); + free(record->album); + free(record->genre); + free(record->date); pmp_record_init(record); } result_t pmp_record_copy(pmp_record_t* dst, const pmp_record_t* src) { memcpy(dst, src, sizeof(*src)); - dst->filename = src->filename ? ucs2dup(src->filename) : NULL; - dst->title = src->title ? ucs2dup(src->title) : NULL; - dst->artist = src->artist ? ucs2dup(src->artist) : NULL; - dst->album = src->album ? ucs2dup(src->album) : NULL; - dst->genre = src->genre ? ucs2dup(src->genre) : NULL; - dst->date = src->date ? ucs2dup(src->date) : NULL; + dst->filename = src->filename ? wcsdup(src->filename) : NULL; + dst->title = src->title ? wcsdup(src->title) : NULL; + dst->artist = src->artist ? wcsdup(src->artist) : NULL; + dst->album = src->album ? wcsdup(src->album) : NULL; + dst->genre = src->genre ? wcsdup(src->genre) : NULL; + dst->date = src->date ? wcsdup(src->date) : NULL; return 0; } Modified: branches/branch_0.12/lib/pmp/pmp_posix.c =================================================================== --- branches/branch_0.12/lib/pmp/pmp_posix.c 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/lib/pmp/pmp_posix.c 2006-06-23 15:17:37 UTC (rev 59) @@ -29,7 +29,7 @@ #include <ltdl.h> #include <os.h> -#include <ucs2char.h> +#include <wchar.h> #include <filepath.h> #include <pmp.h> @@ -119,7 +119,7 @@ return 0; } -result_t pmphelp_create(pmphelp_t* pmphelp, pmp_t** pmp, const ucs2char_t* path_to_device, const char *id) +result_t pmphelp_create(pmphelp_t* pmphelp, pmp_t** pmp, const wchar_t* path_to_device, const char *id) { pmphelp_posix_t* pmphelpposix = (pmphelp_posix_t*)pmphelp; result_t ret = PMP_DEVICENOTFOUND; Modified: branches/branch_0.12/lib/pmp/pmp_win32.c =================================================================== --- branches/branch_0.12/lib/pmp/pmp_win32.c 2006-06-23 15:06:49 UTC (rev 58) +++ branches/branch_0.12/lib/pmp/pmp_win32.c 2006-06-23 15:17:37 UTC (rev 59) @@ -27,7 +27,7 @@ #endif/*HAVE_CONFIG_H*/ #include <os.h> -#include <ucs2char.h> +#include <wchar.h> #include <windows.h> @@ -56,9 +56,9 @@ pmphelp_win32_t* pmphelp = NULL; HANDLE hFile = INVALID_HANDLE_VALUE; WIN32_FIND_DATAW data; - ucs2char_t szPath[MAX_PATH]; - ucs2char_t szPattern[MAX_PATH]; - static const ucs2char_t ucs2cs_pattern[] = {'p','m','p','_','*','.','d','l','l',0}; + wchar_t szPath[MAX_PATH]; + wchar_t szPattern[MAX_PATH]; + static const wchar_t wcscs_pattern[] = {'p','m','p','_','*','.','d','l','l',0}; pmphelp = calloc(1, sizeof(pmphelp_win32_t)); pmphelp->num_plugins = 0; @@ -68,16 +68,16 @@ filepath_remove_filespec(szPath); filepath_addslash(szPath); - ucs2cpy(szPattern, szPath); - ucs2cat(szPattern, ucs2cs_pattern); + wcscpy(szPattern, szPath); + wcscat(szPattern, wcscs_pattern); hFile = FindFirstFileW(szPattern, &data); if (hFile != INVALID_HANDLE_VALUE) { do { if (!(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { - ucs2char_t szFilename[MAX_PATH]; - ucs2cpy(szFilename, szPath); - ucs2cat(szFilename, data.cFileName); + wchar_t szFilename[MAX_PATH]; + wcscpy(szFilename, szPath); + wcscat(szFilename, data.cFileName); pmphelp->plugins = realloc(pmphelp->plugins, sizeof(HMODULE) * (pmphelp->num_plugins+1)); pmphelp->plugins[pmphelp->num_plugins] = LoadLibraryW(szFilename); @@ -116,7 +116,7 @@ return 0; } -result_t pmphelp_create(pmphelp_t* pmphelp, pmp_t** pmp, const ucs2char_t* path_to_device, const char *id) +result_t pmphelp_create(pmphelp_t* pmphelp, pmp_t** pmp, const wchar_t* path_to_device, const char *id) { pmphelp_win32_t* pmphelpw32 = (pmphelp_win32_t*)pmphelp; uint32_t i; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-20 02:07:36
|
Revision: 57 Author: sucknblow Date: 2006-06-19 19:07:31 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=57&view=rev Log Message: ----------- Playlists now work on U10 using POSIX. Modified Paths: -------------- trunk/lib/pmp_iriverplus2/playlist.c Modified: trunk/lib/pmp_iriverplus2/playlist.c =================================================================== --- trunk/lib/pmp_iriverplus2/playlist.c 2006-06-07 17:17:28 UTC (rev 56) +++ trunk/lib/pmp_iriverplus2/playlist.c 2006-06-20 02:07:31 UTC (rev 57) @@ -34,18 +34,39 @@ #include "serialize.h" #include "ip2db.h" +// ip2db_findfile: check that a file with path 'filename' can be found in the music database +// returns 0 if not found. +// db - the music database +// filename - the path given in the playlist file +// path_to_root - encoded mount point prefix static uint32_t ip2db_findfile(ip2db_t* db, const ucs2char_t *filename, const ucs2char_t *path_to_root) { uint8_t *block = NULL; idx_key_t key; - ucs2char_t pathname[MAX_PATH], filepart[MAX_PATH]; + ucs2char_t pathname[MAX_PATH]; + ucs2char_t filepart[MAX_PATH]; + ucs2char_t decoded_filename[MAX_PATH]; + ucs2char_t decoded_filepathname[MAX_PATH]; + ucs2char_t decoded_pathname[MAX_PATH]; uint32_t leafid; - ucs2cpy(pathname, filepath_skipdrive(filename, path_to_root)); - filepath_remove_filespec(pathname); + // 1. Decode the file path listed in the playlist, including mount point prefix. + ucs2cpy(decoded_filename, filename); + filepath_decode(decoded_filename); + + // 2. As above, with mount point prefix stripped. + ucs2cpy(decoded_filepathname, filepath_skipdrive(decoded_filename, path_to_root)); + + // 3. As above, but with filename stripped. + ucs2cpy(decoded_pathname, decoded_filepathname); + filepath_remove_filespec(decoded_pathname); + // The path stored in the database is encoded, need do comparisons against that. + ucs2cpy(pathname, decoded_pathname); filepath_encode(pathname); - ucs2cpy(filepart, filepath_skippath(filename)); + // 4. As 2, but with directory path stripped. + ucs2cpy(filepart, filepath_skippath(decoded_filepathname)); + memset(&key, 0, sizeof(key)); key.type = IP2DBIDX_PAGE_NODE_FILENAME; key.dup = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-08 02:57:49
|
Revision: 56 Author: sucknblow Date: 2006-06-07 10:17:28 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=56&view=rev Log Message: ----------- Lintian override for library names Modified Paths: -------------- trunk/debian/easypmp.install Added Paths: ----------- trunk/debian/lintian/ trunk/debian/lintian/easypmp Modified: trunk/debian/easypmp.install =================================================================== --- trunk/debian/easypmp.install 2006-06-06 20:15:18 UTC (rev 55) +++ trunk/debian/easypmp.install 2006-06-07 17:17:28 UTC (rev 56) @@ -4,3 +4,4 @@ debian/tmp/usr/bin/easypmp debian/tmp/usr/share/pmplib/* debian/tmp/usr/share/doc/easypmp/* +debian/lintian/easypmp usr/share/lintian/overrides Added: trunk/debian/lintian/easypmp =================================================================== --- trunk/debian/lintian/easypmp (rev 0) +++ trunk/debian/lintian/easypmp 2006-06-07 17:17:28 UTC (rev 56) @@ -0,0 +1,7 @@ +# The project name is pmplib, but we avoid using the library +# name 'libpmplib...', in favour of the less redundant 'libpmp...'. +# +# While we're not shipping a separate library packages, it makes +# more sense for the package to be named after the binary, rather +# than the libraries, anyway. +easypmp binary: package-name-doesnt-match-sonames This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-06 20:15:24
|
Revision: 55 Author: nyaochi Date: 2006-06-06 13:15:18 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=55&view=rev Log Message: ----------- 0.11 release Added Paths: ----------- tags/release_0.11/ Copied: tags/release_0.11 (from rev 54, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-06 20:13:40
|
Revision: 54 Author: nyaochi Date: 2006-06-06 13:13:35 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=54&view=rev Log Message: ----------- Bumped the version number in README Modified Paths: -------------- trunk/README Modified: trunk/README =================================================================== --- trunk/README 2006-06-06 20:05:51 UTC (rev 53) +++ trunk/README 2006-06-06 20:13:35 UTC (rev 54) @@ -1,5 +1,5 @@ PMPLib - Version 0.10 + Version 0.11 http://pmplib.sourceforge.net/ Copyright (c) 2005-2006 by Nyaochi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ny...@us...> - 2006-06-06 20:06:03
|
Revision: 53 Author: nyaochi Date: 2006-06-06 13:05:51 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=53&view=rev Log Message: ----------- Fixed warning C4114 in MSVC. "const char const*" seems to be a wrong usage of 'const'. Modified Paths: -------------- trunk/frontend/easypmp/cui/device.c Modified: trunk/frontend/easypmp/cui/device.c =================================================================== --- trunk/frontend/easypmp/cui/device.c 2006-06-06 17:43:27 UTC (rev 52) +++ trunk/frontend/easypmp/cui/device.c 2006-06-06 20:05:51 UTC (rev 53) @@ -44,7 +44,7 @@ } // Display a path name using the given string format. -void device_show_path(FILE *fp, const char const* format, const ucs2char_t const* path) +void device_show_path(FILE *fp, const char* const format, const ucs2char_t* const path) { ucs2char_t decoded_path[MAX_PATH]; ucs2cpy(decoded_path, path); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-06 19:36:56
|
Revision: 52 Author: sucknblow Date: 2006-06-06 10:43:27 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=52&view=rev Log Message: ----------- Add 'pmp' prefix to shared libraries that install to /usr/lib (except to libpmp.so itself) - reducing chances of conflicts with other packages. Modified Paths: -------------- trunk/debian/easypmp.install trunk/frontend/easypmp/cui/Makefile.am trunk/lib/filepath/Makefile.am trunk/lib/gmi/Makefile.am trunk/lib/playlist/Makefile.am trunk/lib/pmp/Makefile.am trunk/lib/pmp_iriverplus2/Makefile.am trunk/lib/pmp_irivnavi/Makefile.am trunk/lib/pmp_portalplayer1/Makefile.am trunk/lib/ucs2/Makefile.am Modified: trunk/debian/easypmp.install =================================================================== --- trunk/debian/easypmp.install 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/debian/easypmp.install 2006-06-06 17:43:27 UTC (rev 52) @@ -1,8 +1,4 @@ -debian/tmp/usr/lib/libucs2.so.* -debian/tmp/usr/lib/libfilepath.so.* -debian/tmp/usr/lib/libgmi.so.* -debian/tmp/usr/lib/libplaylist.so.* -debian/tmp/usr/lib/libpmp.so.* +debian/tmp/usr/lib/libpmp*.so.* debian/tmp/usr/lib/pmplib/*.so debian/tmp/usr/lib/pmplib/*.la debian/tmp/usr/bin/easypmp Modified: trunk/frontend/easypmp/cui/Makefile.am =================================================================== --- trunk/frontend/easypmp/cui/Makefile.am 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/frontend/easypmp/cui/Makefile.am 2006-06-06 17:43:27 UTC (rev 52) @@ -26,8 +26,8 @@ easypmp_CFLAGS = -DPMP_JSPL_DIR="\"$(prefix)/share/@PACKAGE@/jspl\"" easypmp_LDADD = \ - $(top_builddir)/lib/ucs2/libucs2.la \ - $(top_builddir)/lib/filepath/libfilepath.la \ - $(top_builddir)/lib/gmi/libgmi.la \ - $(top_builddir)/lib/playlist/libplaylist.la \ + $(top_builddir)/lib/ucs2/libpmpucs2.la \ + $(top_builddir)/lib/filepath/libpmpfilepath.la \ + $(top_builddir)/lib/gmi/libpmpgmi.la \ + $(top_builddir)/lib/playlist/libpmpplaylist.la \ $(top_builddir)/lib/pmp/libpmp.la Modified: trunk/lib/filepath/Makefile.am =================================================================== --- trunk/lib/filepath/Makefile.am 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/lib/filepath/Makefile.am 2006-06-06 17:43:27 UTC (rev 52) @@ -1,14 +1,14 @@ # $Id$ -lib_LTLIBRARIES = libfilepath.la +lib_LTLIBRARIES = libpmpfilepath.la -libfilepath_la_SOURCES = \ +libpmpfilepath_la_SOURCES = \ ../../include/filepath.h \ filepath_posix.c \ rel2abs.c -libfilepath_la_LDFLAGS = \ - $(top_builddir)/lib/ucs2/libucs2.la \ +libpmpfilepath_la_LDFLAGS = \ + $(top_builddir)/lib/ucs2/libpmpucs2.la \ -no-undefined AM_CFLAGS = @CFLAGS@ Modified: trunk/lib/gmi/Makefile.am =================================================================== --- trunk/lib/gmi/Makefile.am 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/lib/gmi/Makefile.am 2006-06-06 17:43:27 UTC (rev 52) @@ -1,8 +1,8 @@ # $Id$ -lib_LTLIBRARIES = libgmi.la +lib_LTLIBRARIES = libpmpgmi.la -libgmi_la_SOURCES = \ +libpmpgmi_la_SOURCES = \ ../../include/gmi.h \ gmi_mp3.c \ gmi_wma.c \ @@ -10,10 +10,10 @@ gmi_vorbis.c \ gmi.c -libgmi_la_LDFLAGS = \ +libpmpgmi_la_LDFLAGS = \ @ID3TAG_LIBS@ @OGG_LIBS@ @VORBIS_LIBS@ @VORBISFILE_LIBS@ \ - $(top_builddir)/lib/ucs2/libucs2.la \ - $(top_builddir)/lib/filepath/libfilepath.la \ + $(top_builddir)/lib/ucs2/libpmpucs2.la \ + $(top_builddir)/lib/filepath/libpmpfilepath.la \ -no-undefined AM_CFLAGS = @CFLAGS@ Modified: trunk/lib/playlist/Makefile.am =================================================================== --- trunk/lib/playlist/Makefile.am 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/lib/playlist/Makefile.am 2006-06-06 17:43:27 UTC (rev 52) @@ -7,23 +7,23 @@ jspl/artists.jspl \ jspl/top_ranking.jspl -lib_LTLIBRARIES = libplaylist.la +lib_LTLIBRARIES = libpmpplaylist.la -libplaylist_la_SOURCES = \ +libpmpplaylist_la_SOURCES = \ ../../include/playlist.h \ rw_m3u.c \ rw_pls.c \ playlist.c \ jspl.c -libplaylist_la_CPPFLAGS = $(JS_CFLAGS) +libpmpplaylist_la_CPPFLAGS = $(JS_CFLAGS) -libplaylist_la_LDFLAGS = \ +libpmpplaylist_la_LDFLAGS = \ -no-undefined -libplaylist_la_LIBADD = \ - $(top_builddir)/lib/ucs2/libucs2.la \ - $(top_builddir)/lib/filepath/libfilepath.la \ +libpmpplaylist_la_LIBADD = \ + $(top_builddir)/lib/ucs2/libpmpucs2.la \ + $(top_builddir)/lib/filepath/libpmpfilepath.la \ $(JS_LIBS) EXTRA_DIST = \ Modified: trunk/lib/pmp/Makefile.am =================================================================== --- trunk/lib/pmp/Makefile.am 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/lib/pmp/Makefile.am 2006-06-06 17:43:27 UTC (rev 52) @@ -14,8 +14,8 @@ -no-undefined libpmp_la_LIBADD = \ - $(top_builddir)/lib/ucs2/libucs2.la \ - $(top_builddir)/lib/filepath/libfilepath.la \ + $(top_builddir)/lib/ucs2/libpmpucs2.la \ + $(top_builddir)/lib/filepath/libpmpfilepath.la \ $(LIBLTDL) EXTRA_DIST = pmp_plugin.sym Modified: trunk/lib/pmp_iriverplus2/Makefile.am =================================================================== --- trunk/lib/pmp_iriverplus2/Makefile.am 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/lib/pmp_iriverplus2/Makefile.am 2006-06-06 17:43:27 UTC (rev 52) @@ -28,8 +28,8 @@ -export-symbols $(top_srcdir)/lib/pmp/pmp_plugin.sym iriverplus2_la_LIBADD = \ - $(top_builddir)/lib/ucs2/libucs2.la \ - $(top_builddir)/lib/filepath/libfilepath.la \ + $(top_builddir)/lib/ucs2/libpmpucs2.la \ + $(top_builddir)/lib/filepath/libpmpfilepath.la \ $(top_builddir)/lib/pmp/libpmp.la AM_CFLAGS = @CFLAGS@ Modified: trunk/lib/pmp_irivnavi/Makefile.am =================================================================== --- trunk/lib/pmp_irivnavi/Makefile.am 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/lib/pmp_irivnavi/Makefile.am 2006-06-06 17:43:27 UTC (rev 52) @@ -18,8 +18,8 @@ -export-symbols $(top_srcdir)/lib/pmp/pmp_plugin.sym irivnavi_la_LIBADD = \ - $(top_builddir)/lib/ucs2/libucs2.la \ - $(top_builddir)/lib/filepath/libfilepath.la \ + $(top_builddir)/lib/ucs2/libpmpucs2.la \ + $(top_builddir)/lib/filepath/libpmpfilepath.la \ $(top_builddir)/lib/pmp/libpmp.la AM_CFLAGS = @CFLAGS@ Modified: trunk/lib/pmp_portalplayer1/Makefile.am =================================================================== --- trunk/lib/pmp_portalplayer1/Makefile.am 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/lib/pmp_portalplayer1/Makefile.am 2006-06-06 17:43:27 UTC (rev 52) @@ -32,8 +32,8 @@ -export-symbols $(top_srcdir)/lib/pmp/pmp_plugin.sym portalplayer1_la_LIBADD = \ - $(top_builddir)/lib/ucs2/libucs2.la \ - $(top_builddir)/lib/filepath/libfilepath.la \ + $(top_builddir)/lib/ucs2/libpmpucs2.la \ + $(top_builddir)/lib/filepath/libpmpfilepath.la \ $(top_builddir)/lib/pmp/libpmp.la AM_CFLAGS = @CFLAGS@ Modified: trunk/lib/ucs2/Makefile.am =================================================================== --- trunk/lib/ucs2/Makefile.am 2006-06-06 00:35:56 UTC (rev 51) +++ trunk/lib/ucs2/Makefile.am 2006-06-06 17:43:27 UTC (rev 52) @@ -1,13 +1,13 @@ # $Id$ -lib_LTLIBRARIES = libucs2.la +lib_LTLIBRARIES = libpmpucs2.la -libucs2_la_SOURCES = \ +libpmpucs2_la_SOURCES = \ ../../include/ucs2char.h \ ucs2char.c \ ucs2char_iconv.c -libucs2_la_LDFLAGS = @ICONV_LIBS@ -no-undefined +libpmpucs2_la_LDFLAGS = @ICONV_LIBS@ -no-undefined AM_CFLAGS = @CFLAGS@ INCLUDES = @INCLUDES@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <suc...@us...> - 2006-06-06 01:57:36
|
Revision: 40 Author: sucknblow Date: 2006-06-03 20:54:19 -0700 (Sat, 03 Jun 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=40&view=rev Log Message: ----------- Remove unnecessary packaging files. Don't include the Win32 libraries in the "make dist-bzip2" target, since we're not worrying about the Cygwin build. Modified Paths: -------------- trunk/debian/control trunk/debian/rules trunk/frontend/easypmp/cui/Makefile.am trunk/lib/gmi/Makefile.am trunk/lib/playlist/Makefile.am trunk/lib/pmp_iriverplus2/Makefile.am trunk/lib/pmp_iriverplus2/pmp_iriverplus2.c trunk/lib/pmp_irivnavi/Makefile.am trunk/lib/pmp_portalplayer1/Makefile.am Removed Paths: ------------- trunk/debian/postinst trunk/debian/postrm trunk/debian/preinst trunk/debian/prerm Modified: trunk/debian/control =================================================================== --- trunk/debian/control 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/debian/control 2006-06-04 03:54:19 UTC (rev 40) @@ -1,6 +1,6 @@ Source: pmplib Section: sound -Priority: optional +Priority: extra Maintainer: Martin Ellis <mar...@kd...> Build-Depends: debhelper (>= 4.0.0), libvorbis-dev, libid3tag0-dev, libmozjs-dev Standards-Version: 3.6.2 Deleted: trunk/debian/postinst =================================================================== --- trunk/debian/postinst 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/debian/postinst 2006-06-04 03:54:19 UTC (rev 40) @@ -1,42 +0,0 @@ -#! /bin/sh -# postinst script for easypmp -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * <postinst> `configure' <most-recently-configured-version> -# * <old-postinst> `abort-upgrade' <new version> -# * <conflictor's-postinst> `abort-remove' `in-favour' <package> -# <new-version> -# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' -# <failed-install-package> <version> `removing' -# <conflicting-package> <version> -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package -# - -case "$1" in - configure) - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - Deleted: trunk/debian/postrm =================================================================== --- trunk/debian/postrm 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/debian/postrm 2006-06-04 03:54:19 UTC (rev 40) @@ -1,38 +0,0 @@ -#! /bin/sh -# postrm script for easypmp -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * <postrm> `remove' -# * <postrm> `purge' -# * <old-postrm> `upgrade' <new-version> -# * <new-postrm> `failed-upgrade' <old-version> -# * <new-postrm> `abort-install' -# * <new-postrm> `abort-install' <old-version> -# * <new-postrm> `abort-upgrade' <old-version> -# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version> -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - - - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 Deleted: trunk/debian/preinst =================================================================== --- trunk/debian/preinst 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/debian/preinst 2006-06-04 03:54:19 UTC (rev 40) @@ -1,38 +0,0 @@ -#! /bin/sh -# preinst script for easypmp -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * <new-preinst> `install' -# * <new-preinst> `install' <old-version> -# * <new-preinst> `upgrade' <old-version> -# * <old-preinst> `abort-upgrade' <new-version> -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - install|upgrade) - ;; - - abort-upgrade) - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - Deleted: trunk/debian/prerm =================================================================== --- trunk/debian/prerm 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/debian/prerm 2006-06-04 03:54:19 UTC (rev 40) @@ -1,38 +0,0 @@ -#! /bin/sh -# prerm script for easypmp -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * <prerm> `remove' -# * <old-prerm> `upgrade' <new-version> -# * <new-prerm> `failed-upgrade' <old-version> -# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version> -# * <deconfigured's-prerm> `deconfigure' `in-favour' -# <package-being-installed> <version> `removing' -# <conflicting-package> <version> -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - remove|upgrade|deconfigure) - ;; - failed-upgrade) - ;; - *) - echo "prerm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - -#DEBHELPER# - -exit 0 - - Modified: trunk/debian/rules =================================================================== --- trunk/debian/rules 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/debian/rules 2006-06-04 03:54:19 UTC (rev 40) @@ -20,7 +20,7 @@ config.status: configure dh_testdir - LDFLAGS="$(LDFLAGS) -Wl,-z,defs" ./configure \ + CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" ./configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ Modified: trunk/frontend/easypmp/cui/Makefile.am =================================================================== --- trunk/frontend/easypmp/cui/Makefile.am 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/frontend/easypmp/cui/Makefile.am 2006-06-04 03:54:19 UTC (rev 40) @@ -17,9 +17,10 @@ util.h \ main.c +easypmp_CPPFLAGS = -I$(srcdir)/../common AM_CFLAGS = @CFLAGS@ -INCLUDES = @INCLUDES@ -I../common +INCLUDES = @INCLUDES@ AM_LDFLAGS = @LDFLAGS@ easypmp_CFLAGS = -DPMP_JSPL_DIR="\"$(prefix)/share/pmp/jspl\"" Modified: trunk/lib/gmi/Makefile.am =================================================================== --- trunk/lib/gmi/Makefile.am 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/lib/gmi/Makefile.am 2006-06-04 03:54:19 UTC (rev 40) @@ -16,7 +16,5 @@ $(top_builddir)/lib/filepath/libfilepath.la \ -no-undefined -EXTRA_DIST = contrib - AM_CFLAGS = @CFLAGS@ INCLUDES = @INCLUDES@ Modified: trunk/lib/playlist/Makefile.am =================================================================== --- trunk/lib/playlist/Makefile.am 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/lib/playlist/Makefile.am 2006-06-04 03:54:19 UTC (rev 40) @@ -27,10 +27,10 @@ $(JS_LIBS) EXTRA_DIST = \ - sample/artist.jspl \ - sample/artists.jspl \ - sample/top_ranking.jspl \ - contrib + jspl/artist.jspl \ + jspl/artists.jspl \ + jspl/playlist.js \ + jspl/top_ranking.jspl AM_CFLAGS = @CFLAGS@ INCLUDES = @INCLUDES@ Modified: trunk/lib/pmp_iriverplus2/Makefile.am =================================================================== --- trunk/lib/pmp_iriverplus2/Makefile.am 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/lib/pmp_iriverplus2/Makefile.am 2006-06-04 03:54:19 UTC (rev 40) @@ -25,7 +25,7 @@ iriverplus2_la_LDFLAGS = \ -no-undefined -module -avoid-version \ - -export-symbols ../pmp/pmp_plugin.sym + -export-symbols $(top_srcdir)/lib/pmp/pmp_plugin.sym iriverplus2_la_LIBADD = \ $(top_builddir)/lib/ucs2/libucs2.la \ Modified: trunk/lib/pmp_iriverplus2/pmp_iriverplus2.c =================================================================== --- trunk/lib/pmp_iriverplus2/pmp_iriverplus2.c 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/lib/pmp_iriverplus2/pmp_iriverplus2.c 2006-06-04 03:54:19 UTC (rev 40) @@ -24,6 +24,9 @@ #ifdef HAVE_CONFIG_H #include <config.h> #endif/*HAVE_CONFIG_H*/ +#ifdef HAVE_STRING_H +#include <string.h> +#endif/*HAVE_STRING_H*/ #include <os.h> #include <stdio.h> Modified: trunk/lib/pmp_irivnavi/Makefile.am =================================================================== --- trunk/lib/pmp_irivnavi/Makefile.am 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/lib/pmp_irivnavi/Makefile.am 2006-06-04 03:54:19 UTC (rev 40) @@ -15,7 +15,7 @@ irivnavi_la_LDFLAGS = \ -no-undefined -module -avoid-version \ - -export-symbols ../pmp/pmp_plugin.sym + -export-symbols $(top_srcdir)/lib/pmp/pmp_plugin.sym irivnavi_la_LIBADD = \ $(top_builddir)/lib/ucs2/libucs2.la \ Modified: trunk/lib/pmp_portalplayer1/Makefile.am =================================================================== --- trunk/lib/pmp_portalplayer1/Makefile.am 2006-06-04 02:27:26 UTC (rev 39) +++ trunk/lib/pmp_portalplayer1/Makefile.am 2006-06-04 03:54:19 UTC (rev 40) @@ -29,7 +29,7 @@ portalplayer1_la_LDFLAGS = \ -no-undefined -module -avoid-version \ - -export-symbols ../pmp/pmp_plugin.sym + -export-symbols $(top_srcdir)/lib/pmp/pmp_plugin.sym portalplayer1_la_LIBADD = \ $(top_builddir)/lib/ucs2/libucs2.la \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |