From 4436cd5b58d2b1c9010bfa0956e2a0990d7f5140 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 21 May 2021 14:46:44 +1000 Subject: [PATCH] dep: Remove libcue --- dep/CMakeLists.txt | 1 - dep/libcue/CMakeLists.txt | 20 - dep/libcue/ChangeLog | 202 -- dep/libcue/LICENSE | 693 ------- dep/libcue/README.md | 30 - dep/libcue/include/libcue/cd.h | 64 - dep/libcue/include/libcue/cdtext.h | 44 - dep/libcue/include/libcue/cuetime.h | 15 - dep/libcue/include/libcue/libcue.h | 156 -- dep/libcue/include/libcue/rem.h | 63 - dep/libcue/libcue.vcxproj | 579 ------ dep/libcue/libcue.vcxproj.filters | 23 - dep/libcue/src/cd.c | 414 ----- dep/libcue/src/cdtext.c | 167 -- dep/libcue/src/cue_parser.c | 1861 ------------------- dep/libcue/src/cue_parser.h | 133 -- dep/libcue/src/cue_parser.y | 375 ---- dep/libcue/src/cue_scanner.c | 2672 --------------------------- dep/libcue/src/cue_scanner.l | 140 -- dep/libcue/src/generate_parser.sh | 5 - dep/libcue/src/rem.c | 140 -- dep/libcue/src/time.c | 36 - duckstation.sln | 27 - 23 files changed, 7860 deletions(-) delete mode 100644 dep/libcue/CMakeLists.txt delete mode 100644 dep/libcue/ChangeLog delete mode 100644 dep/libcue/LICENSE delete mode 100644 dep/libcue/README.md delete mode 100644 dep/libcue/include/libcue/cd.h delete mode 100644 dep/libcue/include/libcue/cdtext.h delete mode 100644 dep/libcue/include/libcue/cuetime.h delete mode 100644 dep/libcue/include/libcue/libcue.h delete mode 100644 dep/libcue/include/libcue/rem.h delete mode 100644 dep/libcue/libcue.vcxproj delete mode 100644 dep/libcue/libcue.vcxproj.filters delete mode 100644 dep/libcue/src/cd.c delete mode 100644 dep/libcue/src/cdtext.c delete mode 100644 dep/libcue/src/cue_parser.c delete mode 100644 dep/libcue/src/cue_parser.h delete mode 100644 dep/libcue/src/cue_parser.y delete mode 100644 dep/libcue/src/cue_scanner.c delete mode 100644 dep/libcue/src/cue_scanner.l delete mode 100644 dep/libcue/src/generate_parser.sh delete mode 100644 dep/libcue/src/rem.c delete mode 100644 dep/libcue/src/time.c diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index 6897b189f..7da47d532 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -1,5 +1,4 @@ add_subdirectory(glad) -add_subdirectory(libcue) add_subdirectory(stb) add_subdirectory(zlib) add_subdirectory(minizip) diff --git a/dep/libcue/CMakeLists.txt b/dep/libcue/CMakeLists.txt deleted file mode 100644 index c40f487f4..000000000 --- a/dep/libcue/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -set(SRCS - include/libcue/cd.h - include/libcue/cdtext.h - include/libcue/libcue.h - include/libcue/rem.h - include/libcue/cuetime.h - src/cd.c - src/cdtext.c - src/cue_parser.c - src/cue_parser.h - src/cue_scanner.c - src/rem.c - src/time.c -) - -add_library(libcue ${SRCS}) -target_include_directories(libcue PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include/libcue" "${CMAKE_CURRENT_SOURCE_DIR}/src") -target_include_directories(libcue INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") -set_target_properties(libcue PROPERTIES LINKER_LANGUAGE C) - diff --git a/dep/libcue/ChangeLog b/dep/libcue/ChangeLog deleted file mode 100644 index bc0724297..000000000 --- a/dep/libcue/ChangeLog +++ /dev/null @@ -1,202 +0,0 @@ -libcue (2.2.1) - [Ilya Lipnitskiy] - * cmake: Check for __attribute__ format - - [Fabrice Fontaine] - * cmake: Don't check for C++ presence as libcue is C-only - - [Thomas Petazzoni] - * cmake: Don't force SHARED when building the library - -libcue (2.2.0) - [Tom M] - * cmake: Use GNUInstallDirs and don't hard-code install paths (PR #12) - - [John Lindgren] - * cmake: Set RUNTIME to CMAKE_INSTALL_BINDIR (issue #13) - - [Wolfgang Hotwagner] - * Fix memory corruption in cue_scanner.l (PR #15) - - [John Fitzgerald] - * Use MAXINDEX instead of MAXTRACK when indexing INDEX entries - * Allow for 100 INDEX entries - * Replace fprintf(3) to stdout with printf(3) - - [Ilya Lipnitskiy] - * pkgconfig: Use dynamic directories from GNUInstallDirs - * Port 99 track fix from cuetools and add a test case - -libcue (2.1.0) - [Ilya Lipnitskiy] - * Add FLAC token support (issue #9) - * Clean up static vars in the parser to prevent double frees (issue #10) - -libcue (2.0.1) - [Peter Lemenkov] - * Rename buffer to yy_buffer - - [Ilya Lipnitskiy] - * Create the libcue/libcue.h symlink for compatibility - -libcue (2.0.0) - - [John Lindgren] - * Parse REM GENRE lines - - [Svyatoslav Mishyn] - * Clean up time conversion functions - - [Ilya Lipnitskiy] - * Add Travis-CI support - - * Move exported function declarations to libcue.h. Change default - symbol visibility to hidden. Only export parsing and accessor - functions. Make functions more const-correct - - * Add support for noncompliant CUEs produced by EAC - - * Return -1 instead of 0 for unknown values - - * Refactor CUE INDEX parsing to set pregap and previous track length - correctly - - * Add tests for various CUE formats - - * Move the project from automake to cmake - - * Clean up the changelog - -libcue (1.4.0) - - [Avuton Olrich] - * He helped a lot to make compilation on win32 work (it still would break - without him). Finding the parallel build bug is also accredited to him. - Thanks! - - [Jochen Keil] - * force make to *not* build things in parallel since this tends to mess things up - - * update changelog - - * set version number to 1.4.0 (libtool) - - * update copyright - - * fix compiler warning: input() defined but not used - - * new flex behaviour: explicitly enable yylineno usage - - * new automake macro name - - * possible fix for compilation problems on win32 - - * update COPYING and corrected copyright notices in several source code files - - * Update general COPYRIGHT notice as well as several file specific notifications - - * update ChangeLog and NEWS - -libcue (1.3.0) - - [Jochen Keil] - * set version number to 1.3.0 (libtool) - - * fix for invalid pointer - -libcue (1.2.0) - - [Jochen Keil] - * set version number to 1.2.0 (libtool) - - * update comment on libtool versioning - - * update copyright notifications - - * switch copyright licence to 2-clause BSD - - * update AUTHORS to reflect recent changes - - * dump old README - - * simple test program (not yet supported by autotools, needs flac lib - - * autoheader/config.h support for parser buffer size - - * update autotool build system - - * update main interface/api file - - * support for custom cue values hidden as rem comments - - * add buffer size to config.h - - * prevent the parser from memory leaking/replace strdup() with - fixed-size array and strncpy/implement yacc|bison macros for buffer - creation/deletion - - * prevent the lexer from memory leaking/replace strdup() with - fixed-size array and strncpy - - * cd_delete() and track_delete() methods - - * support for cdtext filename - - * major code clean up - - * initial clean up for libcue - -cuetools (1.3.1) - - [Svend Sorensen] - * Applied most of Branden Robinson's Debian patch - (cuetools_1.3-2.diff.gz). This included many fixes and enhancements - to tools and manual pages. cuebreakpoints and cueconvert will exit if - they fail on any of the input files. cuebreakpoints, cueconvert, and - cuetools will exit with a nonzero return value if there was a failure - on an input file. - - * Added version option to all tools. - - * Single quoted string support has been removed. This was broken, and I am not - sure of any software that supports single quoted strings in cue or toc files. - -cuetools (1.3) - - [Svend Sorensen] - * Build system has been rewritten using automake/autoconf. - - * Added append, prepend, and split pregap modes to cuebreakpoints. - - * Fixed possible compilation error with Bison. - - * All tools accept long options. - - * Programs exit if --input-format or --output-format is an illegal value. - -cuetools (1.2) - - [Svend Sorensen] - * cuebreakpoints was not printing the last track breakpoint. This has been - fixed. - - * cueprint now prints a zero-length string for undefined values. Flags, width, - and precision are applied to conversion characters which have no conversion. - - * Added a tagging script, cuetag.sh, which uses cueprint, vorbiscomment, and - mp3info to tag Ogg Vorbis and MP3 files. This needs more testing and - documentation. - - * Added a track selection flag to cueprint. - -cuetools (1.1) - - [Svend Sorensen] - * File formats documentation has been readded and updated (docs/formats.txt). - - * ``CDTEXTFILE`` is now a recognized (but ignored) keyword. - - * If only a disc or track template is specified on the command line, then only - the disc or track information is printed, respectively. - - * cueprint now supports flags and width and precision values for template diff --git a/dep/libcue/LICENSE b/dep/libcue/LICENSE deleted file mode 100644 index 60874f76a..000000000 --- a/dep/libcue/LICENSE +++ /dev/null @@ -1,693 +0,0 @@ -== IMPORTANT == - -There are two licences involved in this software. - -The whole libcue project is released under GPLv2 due to its heritage -from cuetools. Some code was added independently from cuetools. These -files have a copyright notice and licensing information on their own. - -All files that contain this note: -'Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen' -are taken from cuetools and are therefore under licence of GPLv2. - -== IMPORTANT == - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -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 give any other recipients of the Program a copy of this License -along with the Program. - -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 Program or any portion -of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -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 Program, 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 Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) 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; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, 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 executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or 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 counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program 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. - - 5. 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 Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. 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 Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program 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 Program. - -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. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program 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. - - 9. The Free Software Foundation may publish revised and/or new versions -of the 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 Program -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 Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, 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 - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), 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 Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. 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. - - - Copyright (C) - - 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -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 give any other recipients of the Program a copy of this License -along with the Program. - -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 Program or any portion -of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -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 Program, 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 Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) 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; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, 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 executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or 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 counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program 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. - - 5. 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 Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. 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 Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program 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 Program. - -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. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program 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. - - 9. The Free Software Foundation may publish revised and/or new versions -of the 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 Program -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 Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, 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 - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), 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 Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. 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. - - - Copyright (C) - - 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/dep/libcue/README.md b/dep/libcue/README.md deleted file mode 100644 index 1b530d864..000000000 --- a/dep/libcue/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Overview [![Build Status](https://travis-ci.org/lipnitsk/libcue.svg)](https://travis-ci.org/lipnitsk/libcue) - -libcue provides an API for parsing and extracting data from [CUE sheets](https://en.wikipedia.org/wiki/Cue_sheet_%28computing%29). - -libcue was originally forked from [cuetools](https://github.com/svend/cuetools) and then enhanced to add additional features. - -Please refer to [libcue.h](https://github.com/lipnitsk/libcue/blob/master/libcue.h) for the API. - -Some usage examples are also available in the test cases under [t/](https://github.com/lipnitsk/libcue/tree/master/t). - -# Compiling - -NOTE: Use `-DBUILD_SHARED_LIBS=ON` to build as a shared library. - -``` -mkdir bin -cd bin -cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release ../ -make -make test -make install -``` - -# Contributing - -One should note that while the CUE format is supported by various tools, such as media players or CD ripping tools, there is no single standard that strictly describes the CUE syntax. - -libcue attempts to parse the most commonly known CUE layouts, but it does not claim to support every possible combination. - -Therefore, if you would like to contribute to the library, please include a test case with your pull request to ensure that the functionality does not break in the future. diff --git a/dep/libcue/include/libcue/cd.h b/dep/libcue/include/libcue/cd.h deleted file mode 100644 index 2408b48f2..000000000 --- a/dep/libcue/include/libcue/cd.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen - * Copyright (c) 2009, 2010 Jochen Keil - * For license terms, see the file COPYING in this distribution. - */ - -/* references: MMC-3 draft revsion - 10g */ - -#ifndef CD_H -#define CD_H - -#include "libcue.h" -#include "cdtext.h" -#include "rem.h" - -#define MAXTRACK 99 /* Red Book track limit (from 01 to 99) */ -#define MAXINDEX 99 /* Red Book index limit (from 00 to 99) */ -#define PARSER_BUFFER 1024 /* Parser buffer size */ - - -/* return pointer to CD structure */ -Cd *cd_init(void); -Track *track_init(void); -void track_delete(struct Track* track); -void cd_dump(Cd *cd); - -/* - * Cd functions - */ - -void cd_set_mode(Cd *cd, int mode); -void cd_set_catalog(Cd *cd, char *catalog); -void cd_set_cdtextfile(Cd *cd, char *cdtextfile); - -/* - * add a new track to cd, increment number of tracks - * and return pointer to new track - */ -Track *cd_add_track(Cd *cd); - -/* - * Track functions - */ - -/* filename of data file */ -void track_set_filename(Track *track, char *filename); -/* track start is starting position in data file */ -void track_set_start(Track *track, long start); -/* track length is length of data file to use */ -void track_set_length(Track *track, long length); -/* see enum TrackMode */ -void track_set_mode(Track *track, int mode); -/* see enum TrackSubMode */ -void track_set_sub_mode(Track *track, int sub_mode); -/* see enum TrackFlag */ -void track_set_flag(Track *track, int flag); -void track_clear_flag(Track *track, int flag); - -void track_set_zero_pre(Track *track, long length); -void track_set_zero_post(Track *track, long length); -void track_set_isrc(Track *track, char *isrc); -void track_set_index(Track *track, int i, long index); - -#endif diff --git a/dep/libcue/include/libcue/cdtext.h b/dep/libcue/include/libcue/cdtext.h deleted file mode 100644 index 049589ff9..000000000 --- a/dep/libcue/include/libcue/cdtext.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen - * Copyright (c) 2009, 2010 Jochen Keil - * For license terms, see the file COPYING in this distribution. - */ - -/* references: MMC-3 draft revsion - 10g */ - -#ifndef CDTEXT_H -#define CDTEXT_H - -#include "libcue.h" - -enum PtiFormat { - FORMAT_CHAR, /* single or double byte character string */ - FORMAT_BINARY /* binary data */ -}; - -/* return a pointer to a new Cdtext */ -Cdtext *cdtext_init(void); - -/* release a Cdtext */ -void cdtext_delete(Cdtext *cdtext); - -/* returns non-zero if there are no CD-TEXT fields set, zero otherwise */ -int cdtext_is_empty(Cdtext *cdtext); - -/* set CD-TEXT field to value for PTI pti */ -void cdtext_set(int pti, char *value, Cdtext *cdtext); - -/* - * returns appropriate string for PTI pti - * if istrack is zero, UPC/EAN string will be returned for PTI_UPC_ISRC - * othwise ISRC string will be returned - */ -const char *cdtext_get_key(int pti, int istrack); - -/* - * dump all cdtext info - * in human readable format (for debugging) - */ -void cdtext_dump(Cdtext *cdtext, int istrack); - -#endif diff --git a/dep/libcue/include/libcue/cuetime.h b/dep/libcue/include/libcue/cuetime.h deleted file mode 100644 index 78b019fac..000000000 --- a/dep/libcue/include/libcue/cuetime.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * time.h -- time declarations - * - * Copyright (C) 2004, 2005, 2006, 2007 Svend Sorensen - * For license terms, see the file COPYING in this distribution. - */ - -#ifndef CUETIME_H -#define CUETIME_H - -long time_msf_to_frame(int m, int s, int f); -void time_frame_to_msf(long frame, int *m, int *s, int *f); -char *time_frame_to_mmssff(long f); - -#endif diff --git a/dep/libcue/include/libcue/libcue.h b/dep/libcue/include/libcue/libcue.h deleted file mode 100644 index ad1eec8b2..000000000 --- a/dep/libcue/include/libcue/libcue.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2009, 2010 Jochen Keil - * For license terms, see the file COPYING in this distribution. - */ - -#ifndef LIBCUE_H -#define LIBCUE_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// #define CUE_EXPORT __attribute__((visibility("default"))) -#define CUE_EXPORT - -/* - * disc modes - * DATA FORM OF MAIN DATA (5.29.2.8) - */ -enum DiscMode { - MODE_CD_DA, /* CD-DA */ - MODE_CD_ROM, /* CD-ROM mode 1 */ - MODE_CD_ROM_XA /* CD-ROM XA and CD-I */ -}; - -/* - * track modes - * 5.29.2.8 DATA FORM OF MAIN DATA - * Table 350 - Data Block Type Codes - */ -enum TrackMode { - MODE_AUDIO, /* 2352 byte block length */ - MODE_MODE1, /* 2048 byte block length */ - MODE_MODE1_RAW, /* 2352 byte block length */ - MODE_MODE2, /* 2336 byte block length */ - MODE_MODE2_FORM1, /* 2048 byte block length */ - MODE_MODE2_FORM2, /* 2324 byte block length */ - MODE_MODE2_FORM_MIX, /* 2332 byte block length */ - MODE_MODE2_RAW /* 2352 byte block length */ -}; - -/* - * sub-channel mode - * 5.29.2.13 Data Form of Sub-channel - * NOTE: not sure if this applies to cue files - */ -enum TrackSubMode { - SUB_MODE_RW, /* RAW Data */ - SUB_MODE_RW_RAW /* PACK DATA (written R-W */ -}; - -/* - * track flags - * Q Sub-channel Control Field (4.2.3.3, 5.29.2.2) - */ -enum TrackFlag { - FLAG_NONE = 0x00, /* no flags set */ - FLAG_PRE_EMPHASIS = 0x01, /* audio recorded with pre-emphasis */ - FLAG_COPY_PERMITTED = 0x02, /* digital copy permitted */ - FLAG_DATA = 0x04, /* data track */ - FLAG_FOUR_CHANNEL = 0x08, /* 4 audio channels */ - FLAG_SCMS = 0x10, /* SCMS (not Q Sub-ch.) (5.29.2.7) */ - FLAG_ANY = 0xff /* any flags set */ -}; - -enum DataType { - DATA_AUDIO, - DATA_DATA, - DATA_FIFO, - DATA_ZERO -}; - -/* cdtext pack type indicators */ -enum Pti { - PTI_TITLE, /* title of album or track titles */ - PTI_PERFORMER, /* name(s) of the performer(s) */ - PTI_SONGWRITER, /* name(s) of the songwriter(s) */ - PTI_COMPOSER, /* name(s) of the composer(s) */ - PTI_ARRANGER, /* name(s) of the arranger(s) */ - PTI_MESSAGE, /* message(s) from the content provider and/or artist */ - PTI_DISC_ID, /* (binary) disc identification information */ - PTI_GENRE, /* (binary) genre identification and genre information */ - PTI_TOC_INFO1, /* (binary) table of contents information */ - PTI_TOC_INFO2, /* (binary) second table of contents information */ - PTI_RESERVED1, /* reserved */ - PTI_RESERVED2, /* reserved */ - PTI_RESERVED3, /* reserved */ - PTI_RESERVED4, /* reserved for content provider only */ - PTI_UPC_ISRC, /* UPC/EAN code of the album and ISRC code of each track */ - PTI_SIZE_INFO, /* (binary) size information of the block */ - PTI_END /* terminating PTI (for stepping through PTIs) */ -}; - -enum RemType { - REM_DATE, /* date of cd/track */ - REM_REPLAYGAIN_ALBUM_GAIN, - REM_REPLAYGAIN_ALBUM_PEAK, - REM_REPLAYGAIN_TRACK_GAIN, - REM_REPLAYGAIN_TRACK_PEAK, - REM_END /* terminating REM (for stepping through REMs) */ -}; - -/* ADTs */ -typedef struct Cd Cd; -typedef struct Track Track; -typedef struct Cdtext Cdtext; -typedef struct Rem Rem; -typedef enum Pti Pti; -typedef enum TrackFlag TrackFlag; -typedef enum RemType RemType; - -CUE_EXPORT Cd* cue_parse_file(FILE*); -CUE_EXPORT Cd* cue_parse_string(const char*); -CUE_EXPORT void cd_delete(Cd* cd); - -/* CD functions */ -CUE_EXPORT enum DiscMode cd_get_mode(const Cd *cd); -CUE_EXPORT const char *cd_get_cdtextfile(const Cd *cd); -/* - * return number of tracks in cd - */ -CUE_EXPORT int cd_get_ntrack(const Cd *cd); - -/* CDTEXT functions */ -CUE_EXPORT Cdtext *cd_get_cdtext(const Cd *cd); -CUE_EXPORT Cdtext *track_get_cdtext(const Track *track); -CUE_EXPORT const char *cdtext_get(enum Pti pti, const Cdtext *cdtext); - -CUE_EXPORT Rem* cd_get_rem(const Cd* cd); -CUE_EXPORT Rem* track_get_rem(const Track* track); -/** - * return pointer to value for rem comment - * @param unsigned int: enum of rem comment - */ -CUE_EXPORT const char* rem_get(unsigned int, Rem*); - -/* Track functions */ -CUE_EXPORT Track *cd_get_track(const Cd *cd, int i); -CUE_EXPORT const char *track_get_filename(const Track *track); -CUE_EXPORT long track_get_start(const Track *track); -CUE_EXPORT long track_get_length(const Track *track); -CUE_EXPORT enum TrackMode track_get_mode(const Track *track); -CUE_EXPORT enum TrackSubMode track_get_sub_mode(const Track *track); -CUE_EXPORT int track_is_set_flag(const Track *track, enum TrackFlag flag); -CUE_EXPORT long track_get_zero_pre(const Track *track); -CUE_EXPORT long track_get_zero_post(const Track *track); -CUE_EXPORT const char *track_get_isrc(const Track *track); -CUE_EXPORT long track_get_index(const Track *track, int i); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/dep/libcue/include/libcue/rem.h b/dep/libcue/include/libcue/rem.h deleted file mode 100644 index a69f2da6d..000000000 --- a/dep/libcue/include/libcue/rem.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2009, 2010 Jochen Keil - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Jochen Keil ''AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Jochen Keil BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef REM_H -#define REM_H - -#include "libcue.h" - -/** - * return new allocated rem struct - */ -Rem* -rem_new( void); - -/** - * free rem struct - */ -void -rem_free( Rem*); - -/** - * return true if allocated rem struct is empty - */ -int -rem_is_emtpy( Rem*); - -/** - * set value of rem comment - * @param unsigned int: enum of rem comment - */ -void -rem_set( unsigned int, - char*, - Rem*); - -/** - * dump all rem comments in human readable form - * @param bool: if track: true; else false - */ -void -rem_dump( Rem*); - -#endif diff --git a/dep/libcue/libcue.vcxproj b/dep/libcue/libcue.vcxproj deleted file mode 100644 index 31e6ad9b0..000000000 --- a/dep/libcue/libcue.vcxproj +++ /dev/null @@ -1,579 +0,0 @@ - - - - - DebugFast - ARM64 - - - DebugFast - Win32 - - - DebugFast - x64 - - - Debug - ARM64 - - - Debug - Win32 - - - Debug - x64 - - - ReleaseLTCG - ARM64 - - - ReleaseLTCG - Win32 - - - ReleaseLTCG - x64 - - - Release - ARM64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - {6A4208ED-E3DC-41E1-81CD-F61025FC285A} - Win32Proj - libcue - 10.0 - - - - StaticLibrary - true - v142 - NotSet - - - StaticLibrary - true - v142 - NotSet - - - StaticLibrary - true - v142 - NotSet - - - StaticLibrary - true - v142 - NotSet - - - StaticLibrary - true - v142 - NotSet - - - StaticLibrary - true - v142 - NotSet - - - StaticLibrary - false - v142 - true - NotSet - false - - - StaticLibrary - false - v142 - true - NotSet - false - - - StaticLibrary - false - v142 - true - NotSet - false - - - StaticLibrary - false - v142 - true - NotSet - false - - - StaticLibrary - false - v142 - true - NotSet - false - - - StaticLibrary - false - v142 - true - NotSet - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - - - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - true - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - - - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - true - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - - - true - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - - - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - true - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - - - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - true - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - - - false - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - - - false - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - - - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - false - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - - - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - false - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - - - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - false - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - - - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - $(ProjectName)-$(Platform)-$(Configuration) - false - $(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\ - - - - - - Level4 - Disabled - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - false - ProgramDatabase - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - true - false - stdcpp17 - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib32-debug;%(AdditionalLibraryDirectories) - - - - - - - Level4 - Disabled - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - false - ProgramDatabase - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - true - false - stdcpp17 - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib64-debug;%(AdditionalLibraryDirectories) - - - - - - - Level4 - Disabled - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - false - ProgramDatabase - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - true - false - stdcpp17 - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib64-debug;%(AdditionalLibraryDirectories) - - - - - - - Level4 - Disabled - _ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - false - ProgramDatabase - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - Default - true - false - stdcpp17 - false - OnlyExplicitInline - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib32-debug;%(AdditionalLibraryDirectories) - - - - - - - Level4 - Disabled - _ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - false - ProgramDatabase - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - Default - true - false - stdcpp17 - false - OnlyExplicitInline - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib64-debug;%(AdditionalLibraryDirectories) - - - - - - - Level4 - Disabled - _ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - false - ProgramDatabase - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - Default - true - false - stdcpp17 - false - OnlyExplicitInline - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib64-debug;%(AdditionalLibraryDirectories) - - - - - Level4 - - - MaxSpeed - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - true - false - stdcpp17 - false - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - true - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib32;%(AdditionalLibraryDirectories) - - - - - Level4 - - - MaxSpeed - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - true - false - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - true - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib32;%(AdditionalLibraryDirectories) - - - - - Level4 - - - MaxSpeed - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - true - false - stdcpp17 - false - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - true - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib64;%(AdditionalLibraryDirectories) - - - - - Level4 - - - MaxSpeed - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - true - false - stdcpp17 - false - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - true - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib64;%(AdditionalLibraryDirectories) - - - - - Level4 - - - MaxSpeed - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - true - false - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - true - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib64;%(AdditionalLibraryDirectories) - - - - - Level4 - - - MaxSpeed - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories) - true - true - stdcpp17 - true - false - true - /Zo /utf-8 %(AdditionalOptions) - - - Windows - true - true - true - SDL2.lib;SDL2main.lib;%(AdditionalDependencies) - $(SolutionDir)dep\lib64;%(AdditionalLibraryDirectories) - - - - - - \ No newline at end of file diff --git a/dep/libcue/libcue.vcxproj.filters b/dep/libcue/libcue.vcxproj.filters deleted file mode 100644 index a4d197159..000000000 --- a/dep/libcue/libcue.vcxproj.filters +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dep/libcue/src/cd.c b/dep/libcue/src/cd.c deleted file mode 100644 index cf77a181c..000000000 --- a/dep/libcue/src/cd.c +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen - * Copyright (c) 2009, 2010 Jochen Keil - * For license terms, see the file COPYING in this distribution. - */ - -#include -#include -#include -#include "cd.h" - -typedef struct Data Data; -struct Data { - int type; /* DataType */ - char *name; /* data source name */ - long start; /* start time for data */ - long length; /* length of data */ -}; - -struct Track { - Data zero_pre; /* pre-gap generated with zero data */ - Data file; /* track data file */ - Data zero_post; /* post-gap generated with zero data */ - int mode; /* track mode */ - int sub_mode; /* sub-channel mode */ - int flags; /* flags */ - char *isrc; /* IRSC Code (5.22.4) 12 bytes */ - Cdtext *cdtext; /* CD-TEXT */ - Rem* rem; - long index[MAXINDEX+1]; /* indexes (in frames) (5.29.2.5) - * relative to start of file */ -}; - -struct Cd { - int mode; /* disc mode */ - char *catalog; /* Media Catalog Number (5.22.3) */ - char *cdtextfile; /* Filename of CDText File */ - Cdtext *cdtext; /* CD-TEXT */ - Rem* rem; - int ntrack; /* number of tracks in album */ - Track *track[MAXTRACK]; /* array of tracks */ -}; - -Cd *cd_init(void) -{ - Cd *cd = NULL; - cd = malloc(sizeof(Cd)); - - if(NULL == cd) { - fprintf(stderr, "unable to create cd\n"); - } else { - cd->mode = MODE_CD_DA; - cd->catalog = NULL; - cd->cdtextfile = NULL; - cd->cdtext = cdtext_init(); - cd->rem = rem_new(); - cd->ntrack = 0; - } - - return cd; -} - -void track_delete(struct Track* track) -{ - if (track != NULL) - { - cdtext_delete(track_get_cdtext(track)); - - rem_free(track_get_rem(track)); - - free(track->isrc); - - free(track->zero_pre.name); - - free(track->zero_post.name); - - free(track->file.name); - - free(track); - } -} - -void cd_delete(struct Cd* cd) -{ - int i = 0; - - if (cd != NULL) - { - free(cd->catalog); - - free(cd->cdtextfile); - - for (i = 0; i < cd->ntrack; i++) - track_delete(cd->track[i]); - - cdtext_delete(cd_get_cdtext(cd)); - - rem_free(cd_get_rem(cd)); - - free(cd); - } -} - -Track *track_init(void) -{ - Track *track = NULL; - track = malloc(sizeof(Track)); - - if (NULL == track) { - fprintf(stderr, "unable to create track\n"); - } else { - track->zero_pre.type = DATA_ZERO; - track->zero_pre.name = NULL; - track->zero_pre.start = -1; - track->zero_pre.length = -1; - - track->file.type = DATA_AUDIO; - track->file.name = NULL; - track->file.start = -1; - track->file.length = -1; - - track->zero_post.type = DATA_ZERO; - track->zero_post.name = NULL; - track->zero_post.start = -1; - track->zero_post.length = -1; - - track->mode = MODE_AUDIO; - track->sub_mode = SUB_MODE_RW; - track->flags = FLAG_NONE; - track->isrc = NULL; - track->cdtext = cdtext_init(); - track->rem = rem_new(); - - int i; - for (i=0; i<=MAXINDEX; i++) - track->index[i] = -1; - } - - return track; -} - -/* - * cd structure functions - */ -void cd_set_mode(Cd *cd, int mode) -{ - cd->mode = mode; -} - -enum DiscMode cd_get_mode(const Cd *cd) -{ - return cd->mode; -} - -void cd_set_catalog(Cd *cd, char *catalog) -{ - if (cd->catalog) - free(cd->catalog); - - cd->catalog = strdup(catalog); -} - -void cd_set_cdtextfile(Cd *cd, char *cdtextfile) -{ - if (cd->cdtextfile) - free(cd->cdtextfile); - - cd->cdtextfile = strdup(cdtextfile); -} - -const char *cd_get_cdtextfile(const Cd *cd) -{ - return cd->cdtextfile; -} - -Cdtext *cd_get_cdtext(const Cd *cd) -{ - if (cd != NULL) - return cd->cdtext; - else - return NULL; -} - -Rem* -cd_get_rem(const Cd* cd) -{ - if (cd != NULL) - return cd->rem; - else - return NULL; -} - -Track *cd_add_track(Cd *cd) -{ - if (MAXTRACK > cd->ntrack) - cd->ntrack++; - else - fprintf(stderr, "too many tracks\n"); - - /* this will reinit last track if there were too many */ - cd->track[cd->ntrack - 1] = track_init(); - - return cd->track[cd->ntrack - 1]; -} - -int cd_get_ntrack(const Cd *cd) -{ - return cd->ntrack; -} - -Track *cd_get_track(const Cd *cd, int i) -{ - if ((0 < i) && (i <= cd->ntrack) && (cd != NULL)) - return cd->track[i - 1]; - else - return NULL; -} - -/* - * track structure functions - */ - -void track_set_filename(Track *track, char *filename) -{ - if (track->file.name) - free(track->file.name); - - track->file.name = strdup(filename); -} - -const char *track_get_filename(const Track *track) -{ - return track->file.name; -} - -void track_set_start(Track *track, long start) -{ - track->file.start = start; -} - -long track_get_start(const Track *track) -{ - return track->file.start; -} - -void track_set_length(Track *track, long length) -{ - track->file.length = length; -} - -long track_get_length(const Track *track) -{ - return track->file.length; -} - -void track_set_mode(Track *track, int mode) -{ - track->mode = mode; -} - -enum TrackMode track_get_mode(const Track *track) -{ - return track->mode; -} - -void track_set_sub_mode(Track *track, int sub_mode) -{ - track->sub_mode = sub_mode; -} - -enum TrackSubMode track_get_sub_mode(const Track *track) -{ - return track->sub_mode; -} - -void track_set_flag(Track *track, int flag) -{ - track->flags |= flag; -} - -void track_clear_flag(Track *track, int flag) -{ - track->flags &= ~flag; -} - -int track_is_set_flag(const Track *track, enum TrackFlag flag) -{ - return track->flags & flag; -} - -void track_set_zero_pre(Track *track, long length) -{ - track->zero_pre.length = length; -} - -long track_get_zero_pre(const Track *track) -{ - return track->zero_pre.length; -} - -void track_set_zero_post(Track *track, long length) -{ - track->zero_post.length = length; -} - -long track_get_zero_post(const Track *track) -{ - return track->zero_post.length; -} -void track_set_isrc(Track *track, char *isrc) -{ - if (track->isrc) - free(track->isrc); - - track->isrc = strdup(isrc); -} - -const char *track_get_isrc(const Track *track) -{ - return track->isrc; -} - -Cdtext *track_get_cdtext(const Track *track) -{ - if (track != NULL) - return track->cdtext; - else - return NULL; -} - -Rem* -track_get_rem(const Track* track) -{ - if (track != NULL) - return track->rem; - else - return NULL; -} - -void track_set_index(Track *track, int i, long ind) -{ - if (i > MAXINDEX) { - fprintf(stderr, "too many indexes\n"); - return; - } - - track->index[i] = ind; -} - -long track_get_index(const Track *track, int i) -{ - if ((0 <= i) && (i <= MAXINDEX)) - return track->index[i]; - - return -1; -} - -/* - * dump cd information - */ -static void cd_track_dump(Track *track) -{ - int i; - - printf("zero_pre: %ld\n", track->zero_pre.length); - printf("filename: %s\n", track->file.name); - printf("start: %ld\n", track->file.start); - printf("length: %ld\n", track->file.length); - printf("zero_post: %ld\n", track->zero_post.length); - printf("mode: %d\n", track->mode); - printf("sub_mode: %d\n", track->sub_mode); - printf("flags: 0x%x\n", track->flags); - printf("isrc: %s\n", track->isrc); - - for (i = 0; i <= MAXINDEX; ++i) - if (track->index[i] != -1) - printf("index %d: %ld\n", i, track->index[i]); - - if (NULL != track->cdtext) { - printf("cdtext:\n"); - cdtext_dump(track->cdtext, 1); - } - - if (track->rem != NULL) - { - printf("rem:\n"); - rem_dump(track->rem); - } -} - -void cd_dump(Cd *cd) -{ - int i; - - printf("Disc Info\n"); - printf("mode: %d\n", cd->mode); - printf("catalog: %s\n", cd->catalog); - printf("cdtextfile: %s\n", cd->cdtextfile); - if (NULL != cd->cdtext) { - printf("cdtext:\n"); - cdtext_dump(cd->cdtext, 0); - } - - if (cd->rem != NULL) - { - printf("rem:\n"); - rem_dump(cd->rem); - } - - for (i = 0; i < cd->ntrack; ++i) { - printf("Track %d Info\n", i + 1); - cd_track_dump(cd->track[i]); - } -} diff --git a/dep/libcue/src/cdtext.c b/dep/libcue/src/cdtext.c deleted file mode 100644 index 1f8459921..000000000 --- a/dep/libcue/src/cdtext.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen - * Copyright (c) 2009, 2010 Jochen Keil - * For license terms, see the file COPYING in this distribution. - */ - -#include -#include -#include -#include "cdtext.h" - -struct Cdtext { - int pti; - int format; - char *value; -}; - -Cdtext *cdtext_init(void) -{ - Cdtext *new_cdtext = NULL; - - Cdtext cdtext[] = { - {PTI_TITLE, FORMAT_CHAR, NULL}, - {PTI_PERFORMER, FORMAT_CHAR, NULL}, - {PTI_SONGWRITER, FORMAT_CHAR, NULL}, - {PTI_COMPOSER, FORMAT_CHAR, NULL}, - {PTI_ARRANGER, FORMAT_CHAR, NULL}, - {PTI_MESSAGE, FORMAT_CHAR, NULL}, - {PTI_DISC_ID, FORMAT_BINARY, NULL}, - {PTI_GENRE, FORMAT_BINARY, NULL}, - {PTI_TOC_INFO1, FORMAT_BINARY, NULL}, - {PTI_TOC_INFO2, FORMAT_BINARY, NULL}, - {PTI_RESERVED1, FORMAT_CHAR, NULL}, - {PTI_RESERVED2, FORMAT_CHAR, NULL}, - {PTI_RESERVED3, FORMAT_CHAR, NULL}, - {PTI_RESERVED4, FORMAT_CHAR, NULL}, - {PTI_UPC_ISRC, FORMAT_CHAR, NULL}, - {PTI_SIZE_INFO, FORMAT_BINARY, NULL}, - {PTI_END, FORMAT_CHAR, NULL} - }; - - new_cdtext = (Cdtext *) calloc (sizeof (cdtext) / sizeof (Cdtext), sizeof (Cdtext)); - if (NULL == new_cdtext) - fprintf (stderr, "problem allocating memory\n"); - else - memcpy (new_cdtext, cdtext, sizeof(cdtext)); - - return new_cdtext; -} - -void cdtext_delete(Cdtext *cdtext) -{ - int i; - - if (NULL != cdtext) { - for (i = 0; PTI_END != cdtext[i].pti; i++) - { - free (cdtext[i].value); - } - free (cdtext); - } -} - -/* return 0 if there is no cdtext, returns non-zero otherwise */ -int cdtext_is_empty(Cdtext *cdtext) -{ - for (; PTI_END != cdtext->pti; cdtext++) - if (NULL != cdtext->value) - return -1; - - return 0; -} - -/* sets cdtext's pti entry to field */ -void cdtext_set(int pti, char *value, Cdtext *cdtext) -{ - if (NULL != value) /* don't pass NULL to strdup */ - for (; PTI_END != cdtext->pti; cdtext++) - if (pti == cdtext->pti) { - free (cdtext->value); - cdtext->value = strdup (value); - } -} - -/* returns value for pti, NULL if pti is not found */ -const char *cdtext_get(enum Pti pti, const Cdtext *cdtext) -{ - for (; PTI_END != cdtext->pti; cdtext++) - if (pti == cdtext->pti) - return cdtext->value; - - return NULL; -} - -const char *cdtext_get_key(int pti, int istrack) -{ - const char *key = NULL; - - switch (pti) { - case PTI_TITLE: - key = "TITLE"; - break; - case PTI_PERFORMER: - key = "PERFORMER"; - break; - case PTI_SONGWRITER: - key = "SONGWRITER"; - break; - case PTI_COMPOSER: - key = "COMPOSER"; - break; - case PTI_ARRANGER: - key = "ARRANGER"; - break; - case PTI_MESSAGE: - key = "MESSAGE"; - break; - case PTI_DISC_ID: - key = "DISC_ID"; - break; - case PTI_GENRE: - key = "GENRE"; - break; - case PTI_TOC_INFO1: - key = "TOC_INFO1"; - break; - case PTI_TOC_INFO2: - key = "TOC_INFO1"; - break; - case PTI_RESERVED1: - /* reserved */ - break; - case PTI_RESERVED2: - /* reserved */ - break; - case PTI_RESERVED3: - /* reserved */ - break; - case PTI_RESERVED4: - /* reserved */ - break; - case PTI_UPC_ISRC: - if (0 == istrack) - key = "UPC_EAN"; - else - key = "ISRC"; - break; - case PTI_SIZE_INFO: - key = "SIZE_INFO"; - break; - } - - return key; -} - -void cdtext_dump(Cdtext *cdtext, int istrack) -{ - int pti; - const char *value = NULL; - - for (pti = 0; PTI_END != pti; pti++) { - if (NULL != (value = cdtext_get(pti, cdtext))) { - printf("%s: ", cdtext_get_key(pti, istrack)); - printf("%s\n", value); - } - } -} diff --git a/dep/libcue/src/cue_parser.c b/dep/libcue/src/cue_parser.c deleted file mode 100644 index 8cc9b462f..000000000 --- a/dep/libcue/src/cue_parser.c +++ /dev/null @@ -1,1861 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - 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 3 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, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Substitute the type names. */ -#define YYSTYPE CUEPARSERSTYPE -/* Substitute the variable and function names. */ -#define yyparse cueparserparse -#define yylex cueparserlex -#define yyerror cueparsererror -#define yydebug cueparserdebug -#define yynerrs cueparsernerrs - -#define yylval cueparserlval -#define yychar cueparserchar - -/* First part of user prologue. */ -#line 1 "cue_parser.y" - -/* - * Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen - * Copyright (c) 2009, 2010 Jochen Keil - * For license terms, see the file COPYING in this distribution. - */ - -#include -#include -#include - -#include "cd.h" -#include "cuetime.h" - -#ifdef CUEPARSER_BUF_SIZE -#undef CUEPARSER_BUF_SIZE -#endif -#define CUEPARSER_BUF_SIZE 16384 - -#define CUEPARSERDEBUG 1 - -char fnamebuf[PARSER_BUFFER]; - -/* debugging */ -//int cueparserdebug = 1; - -extern int cueparserlineno; -extern FILE* cueparserin; - -static Cd *cd = NULL; -static Track *track = NULL; -static Track *prev_track = NULL; -static Cdtext *cdtext = NULL; -static Rem *rem = NULL; -static char *prev_filename = NULL; /* last file in or before last track */ -static char *cur_filename = NULL; /* last file in the last track */ -static char *new_filename = NULL; /* last file in this track */ - -/* lexer interface */ -typedef struct cueparser_buffer_state* CUEPARSER_BUFFER_STATE; - -int cueparserlex(void); -void cueparsererror(const char*); -CUEPARSER_BUFFER_STATE cueparser_scan_string(const char*); -CUEPARSER_BUFFER_STATE cueparser_create_buffer(FILE*, int); -void cueparser_switch_to_buffer(CUEPARSER_BUFFER_STATE); -void cueparser_delete_buffer(CUEPARSER_BUFFER_STATE); - -/* parser interface */ -int cueparserparse(void); -Cd *cue_parse_file(FILE *fp); -Cd *cue_parse_string(const char*); - -#line 133 "cue_parser.c" - -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_CUEPARSER_CUE_PARSER_H_INCLUDED -# define YY_CUEPARSER_CUE_PARSER_H_INCLUDED -/* Debug traces. */ -#ifndef CUEPARSERDEBUG -# if defined YYDEBUG -#if YYDEBUG -# define CUEPARSERDEBUG 1 -# else -# define CUEPARSERDEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define CUEPARSERDEBUG 0 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined CUEPARSERDEBUG */ -#if CUEPARSERDEBUG -extern int cueparserdebug; -#endif - -/* Token type. */ -#ifndef CUEPARSERTOKENTYPE -# define CUEPARSERTOKENTYPE - enum cueparsertokentype - { - NUMBER = 258, - STRING = 259, - CATALOG = 260, - CDTEXTFILE = 261, - FFILE = 262, - BINARY = 263, - MOTOROLA = 264, - AIFF = 265, - WAVE = 266, - MP3 = 267, - FLAC = 268, - TRACK = 269, - AUDIO = 270, - MODE1_2048 = 271, - MODE1_2352 = 272, - MODE2_2336 = 273, - MODE2_2048 = 274, - MODE2_2342 = 275, - MODE2_2332 = 276, - MODE2_2352 = 277, - TRACK_ISRC = 278, - FLAGS = 279, - PRE = 280, - DCP = 281, - FOUR_CH = 282, - SCMS = 283, - PREGAP = 284, - INDEX = 285, - POSTGAP = 286, - TITLE = 287, - PERFORMER = 288, - SONGWRITER = 289, - COMPOSER = 290, - ARRANGER = 291, - MESSAGE = 292, - DISC_ID = 293, - GENRE = 294, - TOC_INFO1 = 295, - TOC_INFO2 = 296, - UPC_EAN = 297, - ISRC = 298, - SIZE_INFO = 299, - DATE = 300, - XXX_GENRE = 301, - REPLAYGAIN_ALBUM_GAIN = 302, - REPLAYGAIN_ALBUM_PEAK = 303, - REPLAYGAIN_TRACK_GAIN = 304, - REPLAYGAIN_TRACK_PEAK = 305 - }; -#endif - -/* Value type. */ -#if ! defined CUEPARSERSTYPE && ! defined CUEPARSERSTYPE_IS_DECLARED -union CUEPARSERSTYPE -{ -#line 58 "cue_parser.y" - - long ival; - char *sval; - -#line 240 "cue_parser.c" - -}; -typedef union CUEPARSERSTYPE CUEPARSERSTYPE; -# define CUEPARSERSTYPE_IS_TRIVIAL 1 -# define CUEPARSERSTYPE_IS_DECLARED 1 -#endif - - -extern CUEPARSERSTYPE cueparserlval; - -int cueparserparse (void); - -#endif /* !YY_CUEPARSER_CUE_PARSER_H_INCLUDED */ - - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined CUEPARSERSTYPE_IS_TRIVIAL && CUEPARSERSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 150 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 53 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 21 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 71 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 105 - -#define YYUNDEFTOK 2 -#define YYMAXUTOK 305 - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 51, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 52, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50 -}; - -#if CUEPARSERDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 134, 134, 138, 146, 147, 151, 152, 153, 154, - 155, 156, 160, 174, 175, 179, 183, 184, 185, 186, - 187, 188, 192, 214, 220, 221, 222, 223, 224, 225, - 226, 227, 231, 232, 236, 237, 238, 239, 240, 241, - 264, 265, 266, 270, 271, 275, 276, 277, 278, 282, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 302, 303, 307, 308, 312, 313, 314, - 315, 316 -}; -#endif - -#if CUEPARSERDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "NUMBER", "STRING", "CATALOG", - "CDTEXTFILE", "FFILE", "BINARY", "MOTOROLA", "AIFF", "WAVE", "MP3", - "FLAC", "TRACK", "AUDIO", "MODE1_2048", "MODE1_2352", "MODE2_2336", - "MODE2_2048", "MODE2_2342", "MODE2_2332", "MODE2_2352", "TRACK_ISRC", - "FLAGS", "PRE", "DCP", "FOUR_CH", "SCMS", "PREGAP", "INDEX", "POSTGAP", - "TITLE", "PERFORMER", "SONGWRITER", "COMPOSER", "ARRANGER", "MESSAGE", - "DISC_ID", "GENRE", "TOC_INFO1", "TOC_INFO2", "UPC_EAN", "ISRC", - "SIZE_INFO", "DATE", "XXX_GENRE", "REPLAYGAIN_ALBUM_GAIN", - "REPLAYGAIN_ALBUM_PEAK", "REPLAYGAIN_TRACK_GAIN", - "REPLAYGAIN_TRACK_PEAK", "'\\n'", "':'", "$accept", "cuefile", "new_cd", - "global_statements", "global_statement", "track_data", "track_list", - "track", "file_format", "new_track", "track_def", "track_mode", - "track_statements", "track_statement", "track_flags", "track_flag", - "cdtext", "cdtext_item", "time", "rem", "rem_item", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 10, 58 -}; -# endif - -#define YYPACT_NINF -44 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-44))) - -#define YYTABLE_NINF -23 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int8 yypact[] = -{ - -44, 6, -44, -44, 100, -43, 5, 8, 9, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - -44, -44, -44, 17, -44, -44, -44, -44, -44, -44, - -4, -44, -3, -44, 18, -44, 21, -44, -25, -24, - 7, 2, -44, 51, 50, 4, 15, -44, -44, -44, - -44, -44, -44, -44, -44, 16, -44, 43, 19, 52, - -44, 65, 66, 65, -44, 0, -44, -44, -44, -44, - -44, -44, -44, -44, -44, -44, -44, -44, -44, -44, - 20, -44, 25, -23, 26, 53, 65, 57, -44, -44, - -44, -44, -44, -44, -44, -44, -44, 69, -44, 58, - -44, 59, -44, 74, -44 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 3, 0, 4, 1, 0, 0, 0, 0, 0, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 67, 0, 68, 69, 70, 71, 5, 10, - 2, 13, 0, 8, 0, 9, 0, 11, 0, 0, - 0, 0, 14, 0, 0, 0, 0, 6, 7, 16, - 17, 18, 19, 20, 21, 0, 66, 0, 0, 0, - 43, 0, 0, 0, 41, 0, 32, 34, 35, 49, - 65, 12, 24, 25, 26, 27, 28, 29, 30, 31, - 0, 42, 0, 0, 63, 0, 0, 0, 33, 23, - 37, 45, 46, 47, 48, 36, 44, 0, 38, 0, - 40, 0, 39, 0, 64 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -44, -44, -44, -44, -44, 98, -44, 73, -44, -44, - -44, -44, -44, 45, -44, -44, 108, -44, -11, 109, - -44 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 1, 2, 4, 28, 64, 30, 31, 55, 32, - 44, 80, 65, 66, 83, 96, 67, 34, 85, 68, - 36 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int8 yytable[] = -{ - -15, 58, 91, 92, 93, 94, 3, 8, 37, 38, - -22, 43, 39, 40, -15, 49, 50, 51, 52, 53, - 54, 41, 45, 59, 60, 46, 47, 48, 95, 61, - 62, 63, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 58, 87, 56, 57, 69, 82, 8, 72, 73, - 74, 75, 76, 77, 78, 79, 70, 71, 84, 86, - 81, 89, 101, 59, 60, 99, 90, 104, 97, 61, - 62, 63, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 5, 29, 42, 98, 6, 7, 8, 100, 102, - 88, 103, 33, 35, -22, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27 -}; - -static const yytype_int8 yycheck[] = -{ - 0, 1, 25, 26, 27, 28, 0, 7, 51, 4, - 14, 14, 4, 4, 14, 8, 9, 10, 11, 12, - 13, 4, 4, 23, 24, 4, 51, 51, 51, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 1, 63, 51, 3, 51, 4, 7, 15, 16, - 17, 18, 19, 20, 21, 22, 51, 51, 3, 3, - 51, 51, 3, 23, 24, 86, 51, 3, 52, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 1, 4, 30, 51, 5, 6, 7, 51, 51, - 65, 52, 4, 4, 14, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 54, 55, 0, 56, 1, 5, 6, 7, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 57, 58, - 59, 60, 62, 69, 70, 72, 73, 51, 4, 4, - 4, 4, 60, 14, 63, 4, 4, 51, 51, 8, - 9, 10, 11, 12, 13, 61, 51, 3, 1, 23, - 24, 29, 30, 31, 58, 65, 66, 69, 72, 51, - 51, 51, 15, 16, 17, 18, 19, 20, 21, 22, - 64, 51, 4, 67, 3, 71, 3, 71, 66, 51, - 51, 25, 26, 27, 28, 51, 68, 52, 51, 71, - 51, 3, 51, 52, 3 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 53, 54, 55, 56, 56, 57, 57, 57, 57, - 57, 57, 58, 59, 59, 60, 61, 61, 61, 61, - 61, 61, 62, 63, 64, 64, 64, 64, 64, 64, - 64, 64, 65, 65, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 67, 67, 68, 68, 68, 68, 69, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 71, 71, 72, 72, 73, 73, 73, - 73, 73 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 3, 0, 0, 2, 3, 3, 1, 1, - 1, 2, 4, 1, 2, 3, 1, 1, 1, 1, - 1, 1, 0, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 1, 3, 3, 3, 4, - 3, 1, 2, 0, 2, 1, 1, 1, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 5, 3, 3, 1, 1, 1, - 1, 1 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if CUEPARSERDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) -{ - FILE *yyoutput = yyo; - YYUSE (yyoutput); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) -{ - YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyo, yytype, yyvaluep); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) -{ - unsigned long yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !CUEPARSERDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !CUEPARSERDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -{ - YYUSE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void) -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - *yyssp = (yytype_int16) yystate; - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 3: -#line 138 "cue_parser.y" - { - cd = cd_init(); - cdtext = cd_get_cdtext(cd); - rem = cd_get_rem(cd); - } -#line 1432 "cue_parser.c" - break; - - case 6: -#line 151 "cue_parser.y" - { cd_set_catalog(cd, (yyvsp[-1].sval)); } -#line 1438 "cue_parser.c" - break; - - case 7: -#line 152 "cue_parser.y" - { cd_set_cdtextfile(cd, (yyvsp[-1].sval)); } -#line 1444 "cue_parser.c" - break; - - case 12: -#line 160 "cue_parser.y" - { - if (NULL != new_filename) { - cueparsererror("too many files specified\n"); - } - if (track && track_get_index(track, 1) == -1) { - track_set_filename (track, (yyvsp[-2].sval)); - } else { - new_filename = strncpy(fnamebuf, (yyvsp[-2].sval), sizeof(fnamebuf)); - new_filename[sizeof(fnamebuf) - 1] = '\0'; - } - } -#line 1460 "cue_parser.c" - break; - - case 22: -#line 192 "cue_parser.y" - { - /* save previous track, to later set length */ - prev_track = track; - - track = cd_add_track(cd); - cdtext = track_get_cdtext(track); - rem = track_get_rem(track); - - cur_filename = new_filename; - if (NULL != cur_filename) - prev_filename = cur_filename; - - if (NULL == prev_filename) - cueparsererror("no file specified for track"); - else - track_set_filename(track, prev_filename); - - new_filename = NULL; - } -#line 1484 "cue_parser.c" - break; - - case 23: -#line 214 "cue_parser.y" - { - track_set_mode(track, (yyvsp[-1].ival)); - } -#line 1492 "cue_parser.c" - break; - - case 37: -#line 239 "cue_parser.y" - { track_set_isrc(track, (yyvsp[-1].sval)); } -#line 1498 "cue_parser.c" - break; - - case 38: -#line 240 "cue_parser.y" - { track_set_zero_pre(track, (yyvsp[-1].ival)); } -#line 1504 "cue_parser.c" - break; - - case 39: -#line 241 "cue_parser.y" - { - long prev_length; - - /* Set previous track length if it has not been set */ - if (NULL != prev_track && NULL == cur_filename - && track_get_length (prev_track) == -1) { - /* track shares file with previous track */ - prev_length = (yyvsp[-1].ival) - track_get_start(prev_track); - track_set_length(prev_track, prev_length); - } - - if (1 == (yyvsp[-2].ival)) { - /* INDEX 01 */ - track_set_start(track, (yyvsp[-1].ival)); - - long idx00 = track_get_index (track, 0); - - if (idx00 != -1 && (yyvsp[-1].ival) != 0) - track_set_zero_pre (track, (yyvsp[-1].ival) - idx00); - } - - track_set_index (track, (yyvsp[-2].ival), (yyvsp[-1].ival)); - } -#line 1532 "cue_parser.c" - break; - - case 40: -#line 264 "cue_parser.y" - { track_set_zero_post(track, (yyvsp[-1].ival)); } -#line 1538 "cue_parser.c" - break; - - case 44: -#line 271 "cue_parser.y" - { track_set_flag(track, (yyvsp[0].ival)); } -#line 1544 "cue_parser.c" - break; - - case 49: -#line 282 "cue_parser.y" - { cdtext_set ((yyvsp[-2].ival), (yyvsp[-1].sval), cdtext); } -#line 1550 "cue_parser.c" - break; - - case 64: -#line 303 "cue_parser.y" - { (yyval.ival) = time_msf_to_frame((yyvsp[-4].ival), (yyvsp[-2].ival), (yyvsp[0].ival)); } -#line 1556 "cue_parser.c" - break; - - case 65: -#line 307 "cue_parser.y" - { rem_set((yyvsp[-2].ival), (yyvsp[-1].sval), rem); } -#line 1562 "cue_parser.c" - break; - - case 66: -#line 308 "cue_parser.y" - { cdtext_set((yyvsp[-2].ival), (yyvsp[-1].sval), cdtext); } -#line 1568 "cue_parser.c" - break; - - -#line 1572 "cue_parser.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - - -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 318 "cue_parser.y" - - -/* lexer interface */ - -void cueparsererror (const char *s) -{ - fprintf(stderr, "%d: %s\n", cueparserlineno, s); -} - -static void reset_static_vars() -{ - cd = NULL; - track = NULL; - prev_track = NULL; - cdtext = NULL; - rem = NULL; - prev_filename = NULL; - cur_filename = NULL; - new_filename = NULL; -} - -Cd *cue_parse_file(FILE *fp) -{ - CUEPARSER_BUFFER_STATE buffer = NULL; - - cueparserin = fp; - - buffer = cueparser_create_buffer(cueparserin, CUEPARSER_BUF_SIZE); - - cueparser_switch_to_buffer(buffer); - - Cd *ret_cd = NULL; - - if (0 == cueparserparse()) ret_cd = cd; - else ret_cd = NULL; - - cueparser_delete_buffer(buffer); - reset_static_vars(); - - return ret_cd; -} - -Cd *cue_parse_string(const char* string) -{ - CUEPARSER_BUFFER_STATE buffer = NULL; - - buffer = cueparser_scan_string(string); - - Cd *ret_cd = NULL; - - if (0 == cueparserparse()) ret_cd = cd; - else ret_cd = NULL; - - cueparser_delete_buffer(buffer); - reset_static_vars(); - - return ret_cd; -} diff --git a/dep/libcue/src/cue_parser.h b/dep/libcue/src/cue_parser.h deleted file mode 100644 index 7dacd1f88..000000000 --- a/dep/libcue/src/cue_parser.h +++ /dev/null @@ -1,133 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - 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 3 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, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -#ifndef YY_CUEPARSER_CUE_PARSER_H_INCLUDED -# define YY_CUEPARSER_CUE_PARSER_H_INCLUDED -/* Debug traces. */ -#ifndef CUEPARSERDEBUG -# if defined YYDEBUG -#if YYDEBUG -# define CUEPARSERDEBUG 1 -# else -# define CUEPARSERDEBUG 0 -# endif -# else /* ! defined YYDEBUG */ -# define CUEPARSERDEBUG 0 -# endif /* ! defined YYDEBUG */ -#endif /* ! defined CUEPARSERDEBUG */ -#if CUEPARSERDEBUG -extern int cueparserdebug; -#endif - -/* Token type. */ -#ifndef CUEPARSERTOKENTYPE -# define CUEPARSERTOKENTYPE - enum cueparsertokentype - { - NUMBER = 258, - STRING = 259, - CATALOG = 260, - CDTEXTFILE = 261, - FFILE = 262, - BINARY = 263, - MOTOROLA = 264, - AIFF = 265, - WAVE = 266, - MP3 = 267, - FLAC = 268, - TRACK = 269, - AUDIO = 270, - MODE1_2048 = 271, - MODE1_2352 = 272, - MODE2_2336 = 273, - MODE2_2048 = 274, - MODE2_2342 = 275, - MODE2_2332 = 276, - MODE2_2352 = 277, - TRACK_ISRC = 278, - FLAGS = 279, - PRE = 280, - DCP = 281, - FOUR_CH = 282, - SCMS = 283, - PREGAP = 284, - INDEX = 285, - POSTGAP = 286, - TITLE = 287, - PERFORMER = 288, - SONGWRITER = 289, - COMPOSER = 290, - ARRANGER = 291, - MESSAGE = 292, - DISC_ID = 293, - GENRE = 294, - TOC_INFO1 = 295, - TOC_INFO2 = 296, - UPC_EAN = 297, - ISRC = 298, - SIZE_INFO = 299, - DATE = 300, - XXX_GENRE = 301, - REPLAYGAIN_ALBUM_GAIN = 302, - REPLAYGAIN_ALBUM_PEAK = 303, - REPLAYGAIN_TRACK_GAIN = 304, - REPLAYGAIN_TRACK_PEAK = 305 - }; -#endif - -/* Value type. */ -#if ! defined CUEPARSERSTYPE && ! defined CUEPARSERSTYPE_IS_DECLARED -union CUEPARSERSTYPE -{ -#line 58 "cue_parser.y" - - long ival; - char *sval; - -#line 121 "cue_parser.h" - -}; -typedef union CUEPARSERSTYPE CUEPARSERSTYPE; -# define CUEPARSERSTYPE_IS_TRIVIAL 1 -# define CUEPARSERSTYPE_IS_DECLARED 1 -#endif - - -extern CUEPARSERSTYPE cueparserlval; - -int cueparserparse (void); - -#endif /* !YY_CUEPARSER_CUE_PARSER_H_INCLUDED */ diff --git a/dep/libcue/src/cue_parser.y b/dep/libcue/src/cue_parser.y deleted file mode 100644 index 45de094f2..000000000 --- a/dep/libcue/src/cue_parser.y +++ /dev/null @@ -1,375 +0,0 @@ -%{ -/* - * Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen - * Copyright (c) 2009, 2010 Jochen Keil - * For license terms, see the file COPYING in this distribution. - */ - -#include -#include -#include - -#include "cd.h" -#include "cuetime.h" - -#ifdef CUEPARSER_BUF_SIZE -#undef CUEPARSER_BUF_SIZE -#endif -#define CUEPARSER_BUF_SIZE 16384 - -#define CUEPARSERDEBUG 1 - -char fnamebuf[PARSER_BUFFER]; - -/* debugging */ -//int cueparserdebug = 1; - -extern int cueparserlineno; -extern FILE* cueparserin; - -static Cd *cd = NULL; -static Track *track = NULL; -static Track *prev_track = NULL; -static Cdtext *cdtext = NULL; -static Rem *rem = NULL; -static char *prev_filename = NULL; /* last file in or before last track */ -static char *cur_filename = NULL; /* last file in the last track */ -static char *new_filename = NULL; /* last file in this track */ - -/* lexer interface */ -typedef struct cueparser_buffer_state* CUEPARSER_BUFFER_STATE; - -int cueparserlex(void); -void cueparsererror(const char*); -CUEPARSER_BUFFER_STATE cueparser_scan_string(const char*); -CUEPARSER_BUFFER_STATE cueparser_create_buffer(FILE*, int); -void cueparser_switch_to_buffer(CUEPARSER_BUFFER_STATE); -void cueparser_delete_buffer(CUEPARSER_BUFFER_STATE); - -/* parser interface */ -int cueparserparse(void); -Cd *cue_parse_file(FILE *fp); -Cd *cue_parse_string(const char*); -%} - -%start cuefile -%define api.prefix {cueparser} - -%union { - long ival; - char *sval; -} - -%token NUMBER -%token STRING - -/* global (header) */ -%token CATALOG -%token CDTEXTFILE - -%token FFILE -%token BINARY -%token MOTOROLA -%token AIFF -%token WAVE -%token MP3 -%token FLAC - -/* track */ -%token TRACK - -%token AUDIO -%token MODE1_2048 -%token MODE1_2352 -%token MODE2_2336 -%token MODE2_2048 -%token MODE2_2342 -%token MODE2_2332 -%token MODE2_2352 - -/* ISRC is with CD_TEXT */ -%token TRACK_ISRC - -%token FLAGS -%token PRE -%token DCP -%token FOUR_CH -%token SCMS - -%token PREGAP -%token INDEX -%token POSTGAP - -/* CD-TEXT */ -%token TITLE -%token PERFORMER -%token SONGWRITER -%token COMPOSER -%token ARRANGER -%token MESSAGE -%token DISC_ID -%token GENRE -%token TOC_INFO1 -%token TOC_INFO2 -%token UPC_EAN -%token ISRC -%token SIZE_INFO - -%type track_mode -%type track_flag -%type time -%type cdtext_item - -/* REM */ -%type rem_item -%token DATE -%token XXX_GENRE /* parsed in REM but stored in CD-TEXT */ -%token REPLAYGAIN_ALBUM_GAIN -%token REPLAYGAIN_ALBUM_PEAK -%token REPLAYGAIN_TRACK_GAIN -%token REPLAYGAIN_TRACK_PEAK -%% - -cuefile - : new_cd global_statements track_list - ; - -new_cd - : /* empty */ { - cd = cd_init(); - cdtext = cd_get_cdtext(cd); - rem = cd_get_rem(cd); - } - ; - -global_statements - : /* empty */ - | global_statements global_statement - ; - -global_statement - : CATALOG STRING '\n' { cd_set_catalog(cd, $2); } - | CDTEXTFILE STRING '\n' { cd_set_cdtextfile(cd, $2); } - | cdtext - | rem - | track_data - | error '\n' - ; - -track_data - : FFILE STRING file_format '\n' { - if (NULL != new_filename) { - cueparsererror("too many files specified\n"); - } - if (track && track_get_index(track, 1) == -1) { - track_set_filename (track, $2); - } else { - new_filename = strncpy(fnamebuf, $2, sizeof(fnamebuf)); - new_filename[sizeof(fnamebuf) - 1] = '\0'; - } - } - ; - -track_list - : track - | track_list track - ; - -track - : new_track track_def track_statements - ; - -file_format - : BINARY - | MOTOROLA - | AIFF - | WAVE - | MP3 - | FLAC - ; - -new_track - : /*empty */ { - /* save previous track, to later set length */ - prev_track = track; - - track = cd_add_track(cd); - cdtext = track_get_cdtext(track); - rem = track_get_rem(track); - - cur_filename = new_filename; - if (NULL != cur_filename) - prev_filename = cur_filename; - - if (NULL == prev_filename) - cueparsererror("no file specified for track"); - else - track_set_filename(track, prev_filename); - - new_filename = NULL; - } - ; - -track_def - : TRACK NUMBER track_mode '\n' { - track_set_mode(track, $3); - } - ; - -track_mode - : AUDIO - | MODE1_2048 - | MODE1_2352 - | MODE2_2336 - | MODE2_2048 - | MODE2_2342 - | MODE2_2332 - | MODE2_2352 - ; - -track_statements - : track_statement - | track_statements track_statement - ; - -track_statement - : cdtext - | rem - | FLAGS track_flags '\n' - | TRACK_ISRC STRING '\n' { track_set_isrc(track, $2); } - | PREGAP time '\n' { track_set_zero_pre(track, $2); } - | INDEX NUMBER time '\n' { - long prev_length; - - /* Set previous track length if it has not been set */ - if (NULL != prev_track && NULL == cur_filename - && track_get_length (prev_track) == -1) { - /* track shares file with previous track */ - prev_length = $3 - track_get_start(prev_track); - track_set_length(prev_track, prev_length); - } - - if (1 == $2) { - /* INDEX 01 */ - track_set_start(track, $3); - - long idx00 = track_get_index (track, 0); - - if (idx00 != -1 && $3 != 0) - track_set_zero_pre (track, $3 - idx00); - } - - track_set_index (track, $2, $3); - } - | POSTGAP time '\n' { track_set_zero_post(track, $2); } - | track_data - | error '\n' - ; - -track_flags - : /* empty */ - | track_flags track_flag { track_set_flag(track, $2); } - ; - -track_flag - : PRE - | DCP - | FOUR_CH - | SCMS - ; - -cdtext - : cdtext_item STRING '\n' { cdtext_set ($1, $2, cdtext); } - ; - -cdtext_item - : TITLE - | PERFORMER - | SONGWRITER - | COMPOSER - | ARRANGER - | MESSAGE - | DISC_ID - | GENRE - | TOC_INFO1 - | TOC_INFO2 - | UPC_EAN - | ISRC - | SIZE_INFO - ; - -time - : NUMBER - | NUMBER ':' NUMBER ':' NUMBER { $$ = time_msf_to_frame($1, $3, $5); } - ; - -rem - : rem_item STRING '\n' { rem_set($1, $2, rem); } - | XXX_GENRE STRING '\n' { cdtext_set($1, $2, cdtext); } - ; - -rem_item - : DATE - | REPLAYGAIN_ALBUM_GAIN - | REPLAYGAIN_ALBUM_PEAK - | REPLAYGAIN_TRACK_GAIN - | REPLAYGAIN_TRACK_PEAK - ; -%% - -/* lexer interface */ - -void cueparsererror (const char *s) -{ - fprintf(stderr, "%d: %s\n", cueparserlineno, s); -} - -static void reset_static_vars() -{ - cd = NULL; - track = NULL; - prev_track = NULL; - cdtext = NULL; - rem = NULL; - prev_filename = NULL; - cur_filename = NULL; - new_filename = NULL; -} - -Cd *cue_parse_file(FILE *fp) -{ - CUEPARSER_BUFFER_STATE buffer = NULL; - - cueparserin = fp; - - buffer = cueparser_create_buffer(cueparserin, CUEPARSER_BUF_SIZE); - - cueparser_switch_to_buffer(buffer); - - Cd *ret_cd = NULL; - - if (0 == cueparserparse()) ret_cd = cd; - else ret_cd = NULL; - - cueparser_delete_buffer(buffer); - reset_static_vars(); - - return ret_cd; -} - -Cd *cue_parse_string(const char* string) -{ - CUEPARSER_BUFFER_STATE buffer = NULL; - - buffer = cueparser_scan_string(string); - - Cd *ret_cd = NULL; - - if (0 == cueparserparse()) ret_cd = cd; - else ret_cd = NULL; - - cueparser_delete_buffer(buffer); - reset_static_vars(); - - return ret_cd; -} diff --git a/dep/libcue/src/cue_scanner.c b/dep/libcue/src/cue_scanner.c deleted file mode 100644 index d54080059..000000000 --- a/dep/libcue/src/cue_scanner.c +++ /dev/null @@ -1,2672 +0,0 @@ -#line 2 "cue_scanner.c" - -#line 4 "cue_scanner.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define yy_create_buffer cueparser_create_buffer -#define yy_delete_buffer cueparser_delete_buffer -#define yy_scan_buffer cueparser_scan_buffer -#define yy_scan_string cueparser_scan_string -#define yy_scan_bytes cueparser_scan_bytes -#define yy_init_buffer cueparser_init_buffer -#define yy_flush_buffer cueparser_flush_buffer -#define yy_load_buffer_state cueparser_load_buffer_state -#define yy_switch_to_buffer cueparser_switch_to_buffer -#define yypush_buffer_state cueparserpush_buffer_state -#define yypop_buffer_state cueparserpop_buffer_state -#define yyensure_buffer_stack cueparserensure_buffer_stack -#define yy_flex_debug cueparser_flex_debug -#define yyin cueparserin -#define yyleng cueparserleng -#define yylex cueparserlex -#define yylineno cueparserlineno -#define yyout cueparserout -#define yyrestart cueparserrestart -#define yytext cueparsertext -#define yywrap cueparserwrap -#define yyalloc cueparseralloc -#define yyrealloc cueparserrealloc -#define yyfree cueparserfree - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yy_create_buffer -#define cueparser_create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer cueparser_create_buffer -#endif - -#ifdef yy_delete_buffer -#define cueparser_delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer cueparser_delete_buffer -#endif - -#ifdef yy_scan_buffer -#define cueparser_scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer cueparser_scan_buffer -#endif - -#ifdef yy_scan_string -#define cueparser_scan_string_ALREADY_DEFINED -#else -#define yy_scan_string cueparser_scan_string -#endif - -#ifdef yy_scan_bytes -#define cueparser_scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes cueparser_scan_bytes -#endif - -#ifdef yy_init_buffer -#define cueparser_init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer cueparser_init_buffer -#endif - -#ifdef yy_flush_buffer -#define cueparser_flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer cueparser_flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define cueparser_load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state cueparser_load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define cueparser_switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer cueparser_switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define cueparserpush_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state cueparserpush_buffer_state -#endif - -#ifdef yypop_buffer_state -#define cueparserpop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state cueparserpop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define cueparserensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack cueparserensure_buffer_stack -#endif - -#ifdef yylex -#define cueparserlex_ALREADY_DEFINED -#else -#define yylex cueparserlex -#endif - -#ifdef yyrestart -#define cueparserrestart_ALREADY_DEFINED -#else -#define yyrestart cueparserrestart -#endif - -#ifdef yylex_init -#define cueparserlex_init_ALREADY_DEFINED -#else -#define yylex_init cueparserlex_init -#endif - -#ifdef yylex_init_extra -#define cueparserlex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra cueparserlex_init_extra -#endif - -#ifdef yylex_destroy -#define cueparserlex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy cueparserlex_destroy -#endif - -#ifdef yyget_debug -#define cueparserget_debug_ALREADY_DEFINED -#else -#define yyget_debug cueparserget_debug -#endif - -#ifdef yyset_debug -#define cueparserset_debug_ALREADY_DEFINED -#else -#define yyset_debug cueparserset_debug -#endif - -#ifdef yyget_extra -#define cueparserget_extra_ALREADY_DEFINED -#else -#define yyget_extra cueparserget_extra -#endif - -#ifdef yyset_extra -#define cueparserset_extra_ALREADY_DEFINED -#else -#define yyset_extra cueparserset_extra -#endif - -#ifdef yyget_in -#define cueparserget_in_ALREADY_DEFINED -#else -#define yyget_in cueparserget_in -#endif - -#ifdef yyset_in -#define cueparserset_in_ALREADY_DEFINED -#else -#define yyset_in cueparserset_in -#endif - -#ifdef yyget_out -#define cueparserget_out_ALREADY_DEFINED -#else -#define yyget_out cueparserget_out -#endif - -#ifdef yyset_out -#define cueparserset_out_ALREADY_DEFINED -#else -#define yyset_out cueparserset_out -#endif - -#ifdef yyget_leng -#define cueparserget_leng_ALREADY_DEFINED -#else -#define yyget_leng cueparserget_leng -#endif - -#ifdef yyget_text -#define cueparserget_text_ALREADY_DEFINED -#else -#define yyget_text cueparserget_text -#endif - -#ifdef yyget_lineno -#define cueparserget_lineno_ALREADY_DEFINED -#else -#define yyget_lineno cueparserget_lineno -#endif - -#ifdef yyset_lineno -#define cueparserset_lineno_ALREADY_DEFINED -#else -#define yyset_lineno cueparserset_lineno -#endif - -#ifdef yywrap -#define cueparserwrap_ALREADY_DEFINED -#else -#define yywrap cueparserwrap -#endif - -#ifdef yyalloc -#define cueparseralloc_ALREADY_DEFINED -#else -#define yyalloc cueparseralloc -#endif - -#ifdef yyrealloc -#define cueparserrealloc_ALREADY_DEFINED -#else -#define yyrealloc cueparserrealloc -#endif - -#ifdef yyfree -#define cueparserfree_ALREADY_DEFINED -#else -#define yyfree cueparserfree -#endif - -#ifdef yytext -#define cueparsertext_ALREADY_DEFINED -#else -#define yytext cueparsertext -#endif - -#ifdef yyleng -#define cueparserleng_ALREADY_DEFINED -#else -#define yyleng cueparserleng -#endif - -#ifdef yyin -#define cueparserin_ALREADY_DEFINED -#else -#define yyin cueparserin -#endif - -#ifdef yyout -#define cueparserout_ALREADY_DEFINED -#else -#define yyout cueparserout -#endif - -#ifdef yy_flex_debug -#define cueparser_flex_debug_ALREADY_DEFINED -#else -#define yy_flex_debug cueparser_flex_debug -#endif - -#ifdef yylineno -#define cueparserlineno_ALREADY_DEFINED -#else -#define yylineno cueparserlineno -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. - */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytext[yyl] == '\n' )\ - --yylineno;\ - }while(0) - #define YY_LINENO_REWIND_TO(dst) \ - do {\ - const char *p;\ - for ( p = yy_cp-1; p >= (dst); --p)\ - if ( *p == '\n' )\ - --yylineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -static void yyensure_buffer_stack ( void ); -static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -#define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define cueparserwrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP -typedef flex_uint8_t YY_CHAR; - -FILE *yyin = NULL, *yyout = NULL; - -typedef int yy_state_type; - -extern int yylineno; -int yylineno = 1; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state ( void ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); -static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 63 -#define YY_END_OF_BUFFER 64 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[496] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 62, 57, 61, 62, 62, 58, 58, 59, 62, - 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 57, 60, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 52, 51, 53, 52, 52, - 52, 54, 55, 63, 63, 56, 57, 0, 2, 0, - 0, 1, 0, 58, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 57, 60, 3, 3, 2, 3, - 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 51, 0, 0, 0, 54, 55, - 0, 56, 2, 1, 25, 0, 0, 0, 0, 0, - 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 11, 0, 0, 23, 44, 0, 0, 0, - 0, 0, 0, 0, 0, 2, 1, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, - 0, 9, 0, 0, 0, 0, 0, 0, 0, 6, - 12, 0, 0, 0, 43, 0, 0, 0, 0, 0, - 0, 26, 0, 0, 0, 0, 0, 0, 10, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 45, 0, 0, - 0, 14, 0, 0, 0, 0, 0, 22, 37, 28, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 30, 0, 13, 0, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 46, 0, 0, - 7, 0, 0, 0, 0, 41, 0, 0, 0, 0, - 0, 0, 27, 0, 0, 0, 0, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 0, 0, 4, 0, 0, 36, - 35, 0, 0, 0, 0, 29, 0, 0, 0, 40, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 0, 34, 0, 33, 0, - - 0, 0, 0, 8, 0, 0, 0, 0, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 0, 0, 0, 0, 0, 0, 0, 0, 31, 42, - 0, 38, 39, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 0, 5, 15, 16, 18, - 20, 17, 19, 21, 32, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 47, 48, 49, 50, 0 - - } ; - -static const YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 4, 1, 1, 1, 1, 5, 1, - 1, 1, 1, 1, 1, 1, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 14, 16, 1, 1, - 1, 1, 1, 1, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 1, 26, 27, 28, 29, 30, 31, - 1, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 1, 41, 1, 1, 42, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static const YY_CHAR yy_meta[43] = - { 0, - 1, 2, 2, 1, 1, 1, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1 - } ; - -static const flex_int16_t yy_base[507] = - { 0, - 0, 41, 44, 85, 87, 89, 91, 93, 603, 602, - 604, 607, 601, 607, 93, 94, 0, 583, 607, 73, - 576, 83, 92, 77, 579, 85, 85, 99, 578, 103, - 100, 567, 580, 121, 607, 0, 134, 137, 172, 577, - 0, 116, 570, 126, 125, 120, 573, 120, 131, 133, - 572, 139, 141, 561, 574, 607, 588, 607, 572, 567, - 566, 0, 584, 607, 582, 607, 582, 151, 607, 153, - 154, 607, 155, 0, 559, 560, 549, 560, 550, 544, - 543, 548, 544, 541, 546, 555, 542, 550, 537, 535, - 154, 557, 534, 532, 543, 535, 534, 521, 531, 525, - - 539, 540, 537, 519, 124, 607, 0, 187, 0, 195, - 165, 0, 198, 0, 530, 531, 520, 531, 521, 515, - 514, 519, 515, 512, 517, 526, 513, 521, 508, 506, - 173, 528, 505, 503, 514, 506, 505, 492, 502, 496, - 510, 511, 508, 490, 523, 490, 494, 491, 0, 519, - 517, 607, 168, 171, 607, 497, 501, 492, 499, 498, - 493, 482, 607, 493, 490, 185, 478, 488, 489, 474, - 485, 475, 607, 482, 469, 479, 607, 468, 479, 476, - 471, 455, 477, 453, 473, 211, 214, 0, 471, 475, - 466, 473, 472, 467, 456, 0, 467, 464, 199, 452, - - 462, 463, 448, 459, 449, 0, 456, 443, 453, 0, - 442, 453, 450, 445, 429, 451, 427, 447, 446, 434, - 438, 607, 435, 433, 430, 434, 422, 429, 416, 607, - 607, 424, 435, 417, 452, 436, 202, 420, 421, 427, - 432, 607, 406, 410, 425, 420, 418, 422, 607, 0, - 413, 411, 408, 412, 400, 407, 394, 0, 0, 402, - 413, 395, 430, 414, 212, 398, 399, 405, 410, 0, - 384, 388, 403, 398, 396, 400, 0, 607, 399, 402, - 395, 607, 378, 386, 381, 381, 388, 607, 607, 607, - 221, 389, 405, 404, 379, 376, 390, 375, 380, 372, - - 607, 374, 607, 385, 378, 0, 361, 369, 364, 364, - 371, 0, 0, 0, 372, 388, 387, 362, 359, 373, - 358, 363, 355, 0, 357, 0, 368, 607, 345, 362, - 607, 359, 359, 359, 359, 607, 357, 368, 367, 348, - 346, 342, 607, 343, 346, 348, 340, 347, 0, 344, - 344, 344, 344, 342, 353, 352, 333, 331, 327, 0, - 328, 331, 333, 325, 330, 320, 607, 326, 318, 607, - 607, 195, 217, 332, 327, 607, 325, 312, 315, 607, - 312, 0, 318, 310, 0, 0, 219, 223, 324, 319, - 0, 317, 304, 307, 0, 319, 607, 308, 607, 323, - - 321, 321, 230, 607, 299, 300, 308, 223, 0, 301, - 0, 316, 314, 314, 233, 0, 292, 293, 301, 226, - 296, 299, 304, 309, 302, 237, 307, 306, 607, 607, - 282, 607, 607, 292, 297, 302, 295, 238, 300, 299, - 0, 0, 275, 0, 0, 277, 607, 607, 607, 607, - 607, 607, 607, 607, 607, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 263, 220, 277, 271, 284, 284, - 265, 280, 270, 271, 254, 253, 225, 226, 277, 272, - 275, 270, 265, 272, 263, 266, 245, 227, 209, 151, - 607, 607, 607, 607, 607, 257, 260, 263, 266, 269, - - 98, 272, 275, 278, 281, 284 - } ; - -static const flex_int16_t yy_def[507] = - { 0, - 495, 1, 495, 3, 496, 496, 497, 497, 498, 498, - 495, 495, 495, 495, 499, 500, 501, 501, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 502, 503, 504, 502, 39, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 495, 495, 495, 495, 495, - 495, 505, 495, 495, 506, 495, 495, 499, 495, 499, - 500, 495, 500, 501, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - - 495, 495, 495, 495, 495, 495, 502, 503, 502, 503, - 504, 502, 504, 39, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 495, 495, 495, 495, 505, 495, - 506, 495, 499, 500, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 503, 504, 502, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 502, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 502, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - - 495, 495, 495, 495, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 502, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 495, 495, 495, 495, 495, - - 495, 495, 495, 495, 495, 495, 495, 495, 502, 502, - 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 502, 502, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 502, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 502, 502, 502, 502, 502, - 502, 502, 502, 502, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 0, 495, 495, 495, 495, 495, - - 495, 495, 495, 495, 495, 495 - } ; - -static const flex_int16_t yy_nxt[650] = - { 0, - 12, 13, 14, 15, 16, 12, 17, 17, 17, 17, - 18, 17, 17, 17, 17, 19, 20, 21, 22, 23, - 12, 24, 25, 12, 26, 12, 12, 27, 12, 12, - 28, 29, 30, 31, 32, 12, 33, 12, 12, 12, - 12, 12, 34, 35, 36, 13, 14, 37, 38, 36, - 39, 39, 39, 39, 40, 39, 39, 39, 39, 41, - 42, 43, 44, 45, 36, 46, 47, 36, 48, 36, - 36, 49, 36, 36, 50, 51, 52, 53, 54, 36, - 55, 36, 36, 36, 36, 36, 34, 35, 57, 58, - 57, 58, 63, 64, 63, 64, 69, 76, 72, 80, - - 74, 85, 81, 86, 77, 90, 59, 78, 59, 60, - 83, 60, 82, 88, 91, 92, 84, 89, 61, 93, - 61, 97, 105, 106, 100, 105, 106, 98, 94, 101, - 95, 102, 99, 70, 73, 68, 68, 109, 71, 71, - 116, 112, 120, 123, 125, 121, 126, 117, 128, 124, - 118, 130, 129, 133, 69, 122, 153, 137, 72, 154, - 131, 132, 134, 138, 135, 140, 71, 71, 139, 112, - 141, 69, 142, 171, 110, 72, 494, 113, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 172, 68, 68, - 109, 70, 204, 70, 73, 73, 68, 68, 186, 71, - - 71, 400, 187, 231, 401, 113, 205, 232, 70, 293, - 294, 73, 68, 68, 109, 71, 71, 259, 112, 316, - 317, 260, 291, 402, 336, 412, 403, 110, 413, 414, - 432, 433, 415, 444, 445, 110, 467, 493, 113, 426, - 427, 428, 438, 439, 440, 451, 460, 479, 481, 452, - 461, 110, 492, 468, 113, 480, 482, 56, 56, 56, - 62, 62, 62, 65, 65, 65, 68, 68, 68, 71, - 71, 71, 107, 491, 107, 108, 108, 108, 111, 111, - 111, 149, 490, 149, 151, 151, 151, 489, 488, 487, - 486, 485, 484, 483, 478, 477, 476, 475, 474, 473, - - 472, 471, 470, 469, 466, 465, 464, 463, 462, 459, - 458, 457, 456, 455, 454, 453, 450, 449, 448, 447, - 446, 443, 442, 441, 437, 436, 435, 434, 431, 430, - 429, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 411, 410, 409, 408, 407, 406, 405, 404, 399, - 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, - 388, 387, 386, 385, 384, 383, 382, 381, 380, 379, - 378, 377, 376, 375, 374, 373, 372, 371, 370, 369, - 368, 367, 366, 365, 364, 363, 362, 361, 360, 359, - 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, - - 348, 347, 346, 345, 344, 343, 342, 341, 340, 339, - 338, 337, 335, 334, 333, 332, 331, 330, 329, 328, - 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, - 315, 291, 314, 313, 312, 311, 310, 309, 308, 307, - 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, - 296, 295, 292, 291, 290, 289, 288, 287, 286, 285, - 284, 283, 282, 281, 280, 279, 278, 277, 276, 275, - 274, 273, 272, 271, 270, 269, 268, 267, 266, 265, - 264, 263, 262, 261, 258, 257, 256, 255, 254, 253, - 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, - - 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, - 230, 229, 228, 227, 226, 225, 224, 223, 222, 152, - 150, 221, 220, 219, 145, 218, 217, 216, 215, 214, - 213, 212, 211, 210, 209, 208, 207, 206, 203, 202, - 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, - 191, 190, 189, 188, 185, 184, 183, 182, 181, 180, - 179, 178, 177, 176, 175, 174, 173, 170, 169, 168, - 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, - 157, 156, 155, 67, 152, 150, 148, 147, 146, 145, - 144, 143, 136, 127, 119, 115, 104, 103, 96, 87, - - 79, 75, 67, 495, 66, 66, 11, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495 - } ; - -static const flex_int16_t yy_chk[650] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, - 6, 6, 7, 7, 8, 8, 15, 20, 16, 22, - - 501, 24, 22, 24, 20, 27, 5, 20, 6, 5, - 23, 6, 22, 26, 27, 27, 23, 26, 5, 28, - 6, 30, 34, 34, 31, 105, 105, 30, 28, 31, - 28, 31, 30, 15, 16, 37, 37, 37, 38, 38, - 42, 38, 44, 45, 46, 44, 46, 42, 48, 45, - 42, 49, 48, 50, 68, 44, 70, 52, 71, 73, - 49, 49, 50, 52, 50, 53, 111, 111, 52, 111, - 53, 153, 53, 91, 37, 154, 490, 38, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 91, 108, 108, - 108, 68, 131, 70, 71, 73, 110, 110, 110, 113, - - 113, 372, 113, 166, 372, 111, 131, 166, 153, 237, - 237, 154, 186, 186, 186, 187, 187, 199, 187, 265, - 265, 199, 291, 373, 291, 387, 373, 108, 387, 388, - 408, 408, 388, 420, 420, 110, 466, 489, 113, 403, - 403, 403, 415, 415, 415, 426, 438, 477, 478, 426, - 438, 186, 488, 466, 187, 477, 478, 496, 496, 496, - 497, 497, 497, 498, 498, 498, 499, 499, 499, 500, - 500, 500, 502, 487, 502, 503, 503, 503, 504, 504, - 504, 505, 486, 505, 506, 506, 506, 485, 484, 483, - 482, 481, 480, 479, 476, 475, 474, 473, 472, 471, - - 470, 469, 468, 467, 465, 446, 443, 440, 439, 437, - 436, 435, 434, 431, 428, 427, 425, 424, 423, 422, - 421, 419, 418, 417, 414, 413, 412, 410, 407, 406, - 405, 402, 401, 400, 398, 396, 394, 393, 392, 390, - 389, 384, 383, 381, 379, 378, 377, 375, 374, 369, - 368, 366, 365, 364, 363, 362, 361, 359, 358, 357, - 356, 355, 354, 353, 352, 351, 350, 348, 347, 346, - 345, 344, 342, 341, 340, 339, 338, 337, 335, 334, - 333, 332, 330, 329, 327, 325, 323, 322, 321, 320, - 319, 318, 317, 316, 315, 311, 310, 309, 308, 307, - - 305, 304, 302, 300, 299, 298, 297, 296, 295, 294, - 293, 292, 287, 286, 285, 284, 283, 281, 280, 279, - 276, 275, 274, 273, 272, 271, 269, 268, 267, 266, - 264, 263, 262, 261, 260, 257, 256, 255, 254, 253, - 252, 251, 248, 247, 246, 245, 244, 243, 241, 240, - 239, 238, 236, 235, 234, 233, 232, 229, 228, 227, - 226, 225, 224, 223, 221, 220, 219, 218, 217, 216, - 215, 214, 213, 212, 211, 209, 208, 207, 205, 204, - 203, 202, 201, 200, 198, 197, 195, 194, 193, 192, - 191, 190, 189, 185, 184, 183, 182, 181, 180, 179, - - 178, 176, 175, 174, 172, 171, 170, 169, 168, 167, - 165, 164, 162, 161, 160, 159, 158, 157, 156, 151, - 150, 148, 147, 146, 145, 144, 143, 142, 141, 140, - 139, 138, 137, 136, 135, 134, 133, 132, 130, 129, - 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, - 118, 117, 116, 115, 104, 103, 102, 101, 100, 99, - 98, 97, 96, 95, 94, 93, 92, 90, 89, 88, - 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, - 77, 76, 75, 67, 65, 63, 61, 60, 59, 57, - 55, 54, 51, 47, 43, 40, 33, 32, 29, 25, - - 21, 18, 13, 11, 10, 9, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, - 495, 495, 495, 495, 495, 495, 495, 495, 495 - } ; - -/* Table of booleans, true if rule could match eol. */ -static const flex_int32_t yy_rule_can_match_eol[64] = - { 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, - 1, 1, 0, 0, }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "cue_scanner.l" -#line 2 "cue_scanner.l" -/* - * Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen - * Copyright (c) 2009, 2010 Jochen Keil - * For license terms, see the file COPYING in this distribution. - */ - -#include -#include - -#include "cd.h" -#include "cue_parser.h" - -char cueparser_buffer[PARSER_BUFFER]; - -int cueparserlex(void); -#line 1055 "cue_scanner.c" -#define YY_NO_INPUT 1 - -#line 1058 "cue_scanner.c" - -#define INITIAL 0 -#define NAME 1 -#define REM 2 -#define RPG 3 -#define SKIP 4 - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals ( void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput ( void ); -#else -static int input ( void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - { -#line 33 "cue_scanner.l" - - -#line 1275 "cue_scanner.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 496 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 607 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - - yylineno++; -; - } - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -/* rule 1 can match eol */ -#line 36 "cue_scanner.l" -case 2: -/* rule 2 can match eol */ -YY_RULE_SETUP -#line 36 "cue_scanner.l" -{ - cueparserlval.sval = strncpy( cueparser_buffer, - ++yytext, - (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)); - cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng) - 2] = '\0'; - BEGIN(INITIAL); - return STRING; - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 45 "cue_scanner.l" -{ - cueparserlval.sval = strncpy( cueparser_buffer, - yytext, - (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)); - cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)] = '\0'; - BEGIN(INITIAL); - return STRING; - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 54 "cue_scanner.l" -{ BEGIN(NAME); return CATALOG; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 55 "cue_scanner.l" -{ BEGIN(NAME); return CDTEXTFILE; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 57 "cue_scanner.l" -{ BEGIN(NAME); return FFILE; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 58 "cue_scanner.l" -{ return BINARY; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 59 "cue_scanner.l" -{ return MOTOROLA; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 60 "cue_scanner.l" -{ return AIFF; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 61 "cue_scanner.l" -{ return WAVE; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 62 "cue_scanner.l" -{ return MP3; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 63 "cue_scanner.l" -{ return FLAC; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 65 "cue_scanner.l" -{ return TRACK; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 66 "cue_scanner.l" -{ cueparserlval.ival = MODE_AUDIO; return AUDIO; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 67 "cue_scanner.l" -{ cueparserlval.ival = MODE_MODE1; return MODE1_2048; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 68 "cue_scanner.l" -{ cueparserlval.ival = MODE_MODE1_RAW; return MODE1_2352; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 69 "cue_scanner.l" -{ cueparserlval.ival = MODE_MODE2; return MODE2_2336; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 70 "cue_scanner.l" -{ cueparserlval.ival = MODE_MODE2_FORM1; return MODE2_2048; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 71 "cue_scanner.l" -{ cueparserlval.ival = MODE_MODE2_FORM2; return MODE2_2342; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 72 "cue_scanner.l" -{ cueparserlval.ival = MODE_MODE2_FORM_MIX; return MODE2_2332; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 73 "cue_scanner.l" -{ cueparserlval.ival = MODE_MODE2_RAW; return MODE2_2352; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 75 "cue_scanner.l" -{ return FLAGS; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 76 "cue_scanner.l" -{ cueparserlval.ival = FLAG_PRE_EMPHASIS; return PRE; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 77 "cue_scanner.l" -{ cueparserlval.ival = FLAG_COPY_PERMITTED; return DCP; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 78 "cue_scanner.l" -{ cueparserlval.ival = FLAG_FOUR_CHANNEL; return FOUR_CH; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 79 "cue_scanner.l" -{ cueparserlval.ival = FLAG_SCMS; return SCMS; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 81 "cue_scanner.l" -{ return PREGAP; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 82 "cue_scanner.l" -{ return INDEX; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 83 "cue_scanner.l" -{ return POSTGAP; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 85 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_TITLE; return TITLE; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 86 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_PERFORMER; return PERFORMER; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 87 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_SONGWRITER; return SONGWRITER; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 88 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_COMPOSER; return COMPOSER; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 89 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_ARRANGER; return ARRANGER; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 90 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_MESSAGE; return MESSAGE; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 91 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_DISC_ID; return DISC_ID; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 92 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_GENRE; return GENRE; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 93 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_TOC_INFO1; return TOC_INFO1; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 94 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_TOC_INFO2; return TOC_INFO2; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 95 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_UPC_ISRC; return UPC_EAN; } - YY_BREAK -case 41: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp = yy_bp + 4; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 96 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_UPC_ISRC; return ISRC; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 97 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_SIZE_INFO; return SIZE_INFO; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 99 "cue_scanner.l" -{ BEGIN(NAME); return TRACK_ISRC; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 101 "cue_scanner.l" -{ BEGIN(REM); /* exclusive rules for special exceptions */ } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 103 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = REM_DATE; return DATE; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 104 "cue_scanner.l" -{ BEGIN(NAME); cueparserlval.ival = PTI_GENRE; return XXX_GENRE; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 105 "cue_scanner.l" -{ BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_ALBUM_GAIN; - return REPLAYGAIN_ALBUM_GAIN; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 107 "cue_scanner.l" -{ BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_ALBUM_PEAK; - return REPLAYGAIN_ALBUM_PEAK; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 109 "cue_scanner.l" -{ BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_TRACK_GAIN; - return REPLAYGAIN_TRACK_GAIN; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 111 "cue_scanner.l" -{ BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_TRACK_PEAK; - return REPLAYGAIN_TRACK_PEAK; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 114 "cue_scanner.l" -{ BEGIN(REM); } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 115 "cue_scanner.l" -{ BEGIN(REM); } - YY_BREAK -case 53: -/* rule 53 can match eol */ -YY_RULE_SETUP -#line 116 "cue_scanner.l" -{ BEGIN(INITIAL); } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 118 "cue_scanner.l" -{ - cueparserlval.sval = strncpy( cueparser_buffer, - yytext, - (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)); - cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)] = '\0'; - BEGIN(SKIP); - return STRING; - } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 127 "cue_scanner.l" -{ BEGIN(RPG); } - YY_BREAK -case 56: -/* rule 56 can match eol */ -YY_RULE_SETUP -#line 129 "cue_scanner.l" -{ BEGIN(INITIAL); yylineno++; return '\n'; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 131 "cue_scanner.l" -{ /* ignore whitespace */ } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 133 "cue_scanner.l" -{ cueparserlval.ival = atoi(yytext); return NUMBER; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 134 "cue_scanner.l" -{ return yytext[0]; } - YY_BREAK -case 60: -/* rule 60 can match eol */ -YY_RULE_SETUP -#line 136 "cue_scanner.l" -{ yylineno++; /* blank line */ } - YY_BREAK -case 61: -/* rule 61 can match eol */ -YY_RULE_SETUP -#line 137 "cue_scanner.l" -{ yylineno++; return '\n'; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 138 "cue_scanner.l" -{ fprintf(stderr, "bad character '%c'\n", yytext[0]); } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 140 "cue_scanner.l" -ECHO; - YY_BREAK -#line 1689 "cue_scanner.c" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(NAME): -case YY_STATE_EOF(REM): -case YY_STATE_EOF(RPG): -case YY_STATE_EOF(SKIP): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 496 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 496 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 495); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) - - yylineno++; -; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); - - yyfree( (void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) -{ - - return yy_scan_bytes( yystr, (int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (const char* msg ) -{ - fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; -} - -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - /* We do not touch yylineno unless the option is enabled. */ - yylineno = 1; - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = NULL; - yyout = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return malloc(size); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 140 "cue_scanner.l" - - diff --git a/dep/libcue/src/cue_scanner.l b/dep/libcue/src/cue_scanner.l deleted file mode 100644 index c052a21f4..000000000 --- a/dep/libcue/src/cue_scanner.l +++ /dev/null @@ -1,140 +0,0 @@ -%{ -/* - * Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen - * Copyright (c) 2009, 2010 Jochen Keil - * For license terms, see the file COPYING in this distribution. - */ - -#include -#include - -#include "cd.h" -#include "cue_parser.h" - -char cueparser_buffer[PARSER_BUFFER]; - -int cueparserlex(void); -%} - -ws [ \t\r] -nonws [^ \t\r\n] - -%option yylineno -%option noyywrap -%option noinput -%option nounput -%option prefix="cueparser" - -%s NAME -%x REM -%x RPG -%x SKIP - -%% - -\'([^\']|\\\')*\' | -\"([^\"]|\\\")*\" { - cueparserlval.sval = strncpy( cueparser_buffer, - ++yytext, - (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)); - cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng) - 2] = '\0'; - BEGIN(INITIAL); - return STRING; - } - -{nonws}+ { - cueparserlval.sval = strncpy( cueparser_buffer, - yytext, - (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)); - cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)] = '\0'; - BEGIN(INITIAL); - return STRING; - } - -CATALOG { BEGIN(NAME); return CATALOG; } -CDTEXTFILE { BEGIN(NAME); return CDTEXTFILE; } - -FILE { BEGIN(NAME); return FFILE; } -BINARY { return BINARY; } -MOTOROLA { return MOTOROLA; } -AIFF { return AIFF; } -WAVE { return WAVE; } -MP3 { return MP3; } -FLAC { return FLAC; } - -TRACK { return TRACK; } -AUDIO { cueparserlval.ival = MODE_AUDIO; return AUDIO; } -MODE1\/2048 { cueparserlval.ival = MODE_MODE1; return MODE1_2048; } -MODE1\/2352 { cueparserlval.ival = MODE_MODE1_RAW; return MODE1_2352; } -MODE2\/2336 { cueparserlval.ival = MODE_MODE2; return MODE2_2336; } -MODE2\/2048 { cueparserlval.ival = MODE_MODE2_FORM1; return MODE2_2048; } -MODE2\/2342 { cueparserlval.ival = MODE_MODE2_FORM2; return MODE2_2342; } -MODE2\/2332 { cueparserlval.ival = MODE_MODE2_FORM_MIX; return MODE2_2332; } -MODE2\/2352 { cueparserlval.ival = MODE_MODE2_RAW; return MODE2_2352; } - -FLAGS { return FLAGS; } -PRE { cueparserlval.ival = FLAG_PRE_EMPHASIS; return PRE; } -DCP { cueparserlval.ival = FLAG_COPY_PERMITTED; return DCP; } -4CH { cueparserlval.ival = FLAG_FOUR_CHANNEL; return FOUR_CH; } -SCMS { cueparserlval.ival = FLAG_SCMS; return SCMS; } - -PREGAP { return PREGAP; } -INDEX { return INDEX; } -POSTGAP { return POSTGAP; } - -TITLE { BEGIN(NAME); cueparserlval.ival = PTI_TITLE; return TITLE; } -PERFORMER { BEGIN(NAME); cueparserlval.ival = PTI_PERFORMER; return PERFORMER; } -SONGWRITER { BEGIN(NAME); cueparserlval.ival = PTI_SONGWRITER; return SONGWRITER; } -COMPOSER { BEGIN(NAME); cueparserlval.ival = PTI_COMPOSER; return COMPOSER; } -ARRANGER { BEGIN(NAME); cueparserlval.ival = PTI_ARRANGER; return ARRANGER; } -MESSAGE { BEGIN(NAME); cueparserlval.ival = PTI_MESSAGE; return MESSAGE; } -DISC_ID { BEGIN(NAME); cueparserlval.ival = PTI_DISC_ID; return DISC_ID; } -GENRE { BEGIN(NAME); cueparserlval.ival = PTI_GENRE; return GENRE; } -TOC_INFO1 { BEGIN(NAME); cueparserlval.ival = PTI_TOC_INFO1; return TOC_INFO1; } -TOC_INFO2 { BEGIN(NAME); cueparserlval.ival = PTI_TOC_INFO2; return TOC_INFO2; } -UPC_EAN { BEGIN(NAME); cueparserlval.ival = PTI_UPC_ISRC; return UPC_EAN; } -ISRC/{ws}+\" { BEGIN(NAME); cueparserlval.ival = PTI_UPC_ISRC; return ISRC; } -SIZE_INFO { BEGIN(NAME); cueparserlval.ival = PTI_SIZE_INFO; return SIZE_INFO; } - -ISRC { BEGIN(NAME); return TRACK_ISRC; } - -REM { BEGIN(REM); /* exclusive rules for special exceptions */ } - -DATE { BEGIN(NAME); cueparserlval.ival = REM_DATE; return DATE; } -GENRE { BEGIN(NAME); cueparserlval.ival = PTI_GENRE; return XXX_GENRE; } -REPLAYGAIN_ALBUM_GAIN { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_ALBUM_GAIN; - return REPLAYGAIN_ALBUM_GAIN; } -REPLAYGAIN_ALBUM_PEAK { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_ALBUM_PEAK; - return REPLAYGAIN_ALBUM_PEAK; } -REPLAYGAIN_TRACK_GAIN { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_TRACK_GAIN; - return REPLAYGAIN_TRACK_GAIN; } -REPLAYGAIN_TRACK_PEAK { BEGIN(RPG); cueparserlval.ival = REM_REPLAYGAIN_TRACK_PEAK; - return REPLAYGAIN_TRACK_PEAK; } - -{ws}+ { BEGIN(REM); } -. { BEGIN(REM); } -\n { BEGIN(INITIAL); } - -{nonws}+ { - cueparserlval.sval = strncpy( cueparser_buffer, - yytext, - (yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)); - cueparserlval.sval[(yyleng > sizeof(cueparser_buffer) ? sizeof(cueparser_buffer) : yyleng)] = '\0'; - BEGIN(SKIP); - return STRING; - } - -{ws}+ { BEGIN(RPG); } - -.*\n { BEGIN(INITIAL); yylineno++; return '\n'; } - -{ws}+ { /* ignore whitespace */ } - -[[:digit:]]+ { cueparserlval.ival = atoi(yytext); return NUMBER; } -: { return yytext[0]; } - -^{ws}*\n { yylineno++; /* blank line */ } -\n { yylineno++; return '\n'; } -. { fprintf(stderr, "bad character '%c'\n", yytext[0]); } - -%% diff --git a/dep/libcue/src/generate_parser.sh b/dep/libcue/src/generate_parser.sh deleted file mode 100644 index 9838bbb71..000000000 --- a/dep/libcue/src/generate_parser.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -flex --nounistd -o cue_scanner.c cue_scanner.l -bison --defines=cue_parser.h -o cue_parser.c cue_parser.y - diff --git a/dep/libcue/src/rem.c b/dep/libcue/src/rem.c deleted file mode 100644 index b5327fc66..000000000 --- a/dep/libcue/src/rem.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2009, 2010 Jochen Keil - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY Jochen Keil ''AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Jochen Keil BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include "rem.h" - -struct Rem { - unsigned int cmt; - char *value; -}; - -Rem* -rem_new( void) -{ - Rem* new_rem = NULL; - - Rem rem[] = { - {REM_DATE, NULL}, - {REM_REPLAYGAIN_ALBUM_GAIN, NULL}, - {REM_REPLAYGAIN_ALBUM_PEAK, NULL}, - {REM_REPLAYGAIN_TRACK_GAIN, NULL}, - {REM_REPLAYGAIN_TRACK_PEAK, NULL}, - {REM_END, NULL} - }; - - /* sizeof(rem) = number of elements in rem[] * sizeof(Rem) */ - new_rem = (Rem*)calloc(sizeof(rem) / sizeof(Rem), sizeof(Rem)); - if (new_rem == NULL) - fprintf(stderr, "rem_new(): problem allocating memory\n"); - else - memcpy(new_rem, rem, sizeof(rem)); - - return new_rem; -} - -void -rem_free( Rem* rem) -{ - if (rem == NULL) - return; - - Rem* ptr = rem; - - do - { - free(ptr->value); - } - while ((++ptr)->cmt != REM_END); - - free(rem); -} - -int -rem_is_emtpy( Rem* rem) -{ - if (rem == NULL) - return 1; - - do - { - if (rem->value != NULL) - return 0; - } while ((++rem)->cmt != REM_END); - - return 1; -} - -void -rem_set( unsigned int cmt, - char* value, - Rem* rem) -{ - if (rem == NULL || value == NULL) - return; - - do - { - if (rem->cmt == cmt) - { - free(rem->value); - rem->value = strdup(value); - return; - } - } while ((++rem)->cmt != REM_END); -} - -const char* -rem_get( RemType cmt, - Rem* rem) -{ - if (rem == NULL) - return NULL; - - do - { - if (rem->cmt == cmt) - { - if (rem->value != NULL) - return rem->value; - else - return NULL; - } - } while ((++rem)->cmt != REM_END); - - return NULL; -} - -void -rem_dump( Rem* rem) -{ - if (rem == NULL) - return; - - do - { - printf("REM %u: %s\n", rem->cmt, rem->value); - } while ((++rem)->cmt != REM_END); -} diff --git a/dep/libcue/src/time.c b/dep/libcue/src/time.c deleted file mode 100644 index 9ea2be0f2..000000000 --- a/dep/libcue/src/time.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * time.c -- time functions - * - * Copyright (C) 2004, 2005, 2006, 2007 Svend Sorensen - * For license terms, see the file COPYING in this distribution. - */ - -#include "cuetime.h" -#include -#include - -long time_msf_to_frame(int m, int s, int f) -{ - return (m * 60 + s) * 75 + f; -} - -void time_frame_to_msf(long frame, int *m, int *s, int *f) -{ - *f = frame % 75; /* 0 <= frames <= 74 */ - frame /= 75; - *s = frame % 60; /* 0 <= seconds <= 59 */ - frame /= 60; - *m = frame; /* 0 <= minutes */ -} - -/* print frame in mm:ss:ff format */ -char *time_frame_to_mmssff(long f) -{ - static char msf[9]; - int minutes, seconds, frames; - - time_frame_to_msf(f, &minutes, &seconds, &frames); - sprintf(msf, "%02d:%02d:%02d", minutes, seconds, frames); - - return msf; -} diff --git a/duckstation.sln b/duckstation.sln index 19d63eb61..8e8c0ae01 100644 --- a/duckstation.sln +++ b/duckstation.sln @@ -15,8 +15,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "src\core\core.vcxpr EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stb", "dep\stb\stb.vcxproj", "{ED601289-AC1A-46B8-A8ED-17DB9EB73423}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcue", "dep\libcue\libcue.vcxproj", "{6A4208ED-E3DC-41E1-81CD-F61025FC285A}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simpleini", "dep\simpleini\simpleini.vcxproj", "{3773F4CC-614E-4028-8595-22E08CA649E3}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyxml2", "dep\tinyxml2\tinyxml2.vcxproj", "{933118A9-68C5-47B4-B151-B03C93961623}" @@ -197,30 +195,6 @@ Global {ED601289-AC1A-46B8-A8ED-17DB9EB73423}.ReleaseLTCG|x64.Build.0 = ReleaseLTCG|x64 {ED601289-AC1A-46B8-A8ED-17DB9EB73423}.ReleaseLTCG|x86.ActiveCfg = ReleaseLTCG|Win32 {ED601289-AC1A-46B8-A8ED-17DB9EB73423}.ReleaseLTCG|x86.Build.0 = ReleaseLTCG|Win32 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|ARM64.Build.0 = Debug|ARM64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|x64.ActiveCfg = Debug|x64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|x64.Build.0 = Debug|x64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|x86.ActiveCfg = Debug|Win32 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|x86.Build.0 = Debug|Win32 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|ARM64.ActiveCfg = DebugFast|ARM64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|ARM64.Build.0 = DebugFast|ARM64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|x64.ActiveCfg = DebugFast|x64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|x64.Build.0 = DebugFast|x64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|x86.ActiveCfg = DebugFast|Win32 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|x86.Build.0 = DebugFast|Win32 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|ARM64.ActiveCfg = Release|ARM64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|ARM64.Build.0 = Release|ARM64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|x64.ActiveCfg = Release|x64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|x64.Build.0 = Release|x64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|x86.ActiveCfg = Release|Win32 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|x86.Build.0 = Release|Win32 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|ARM64.ActiveCfg = ReleaseLTCG|ARM64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|ARM64.Build.0 = ReleaseLTCG|ARM64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|x64.ActiveCfg = ReleaseLTCG|x64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|x64.Build.0 = ReleaseLTCG|x64 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|x86.ActiveCfg = ReleaseLTCG|Win32 - {6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|x86.Build.0 = ReleaseLTCG|Win32 {3773F4CC-614E-4028-8595-22E08CA649E3}.Debug|ARM64.ActiveCfg = Debug|ARM64 {3773F4CC-614E-4028-8595-22E08CA649E3}.Debug|ARM64.Build.0 = Debug|ARM64 {3773F4CC-614E-4028-8595-22E08CA649E3}.Debug|x64.ActiveCfg = Debug|x64 @@ -749,7 +723,6 @@ Global {43540154-9E1E-409C-834F-B84BE5621388} = {BA490C0E-497D-4634-A21E-E65012006385} {BB08260F-6FBC-46AF-8924-090EE71360C6} = {BA490C0E-497D-4634-A21E-E65012006385} {ED601289-AC1A-46B8-A8ED-17DB9EB73423} = {BA490C0E-497D-4634-A21E-E65012006385} - {6A4208ED-E3DC-41E1-81CD-F61025FC285A} = {BA490C0E-497D-4634-A21E-E65012006385} {3773F4CC-614E-4028-8595-22E08CA649E3} = {BA490C0E-497D-4634-A21E-E65012006385} {933118A9-68C5-47B4-B151-B03C93961623} = {BA490C0E-497D-4634-A21E-E65012006385} {72F9423C-91EE-4487-AAC6-555ED6F61AA1} = {BA490C0E-497D-4634-A21E-E65012006385}