uni2ascii-4.20/0000755000175000017500000000000014300550110010313 500000000000000uni2ascii-4.20/enttbl.h0000644000175000017500000000026213755677100011722 00000000000000extern UTF32 LookupCodeForEntity(char *); extern UTF32 LookupHDMLCodeForEntity(char *); extern char * LookupEntityForCode(UTF32); extern char *LookupHDMLEntityForCode (UTF32); uni2ascii-4.20/COPYING0000644000175000017500000010451313755677100011320 00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. 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. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. 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 state 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 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program 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, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU 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 Lesser General Public License instead of this License. But first, please read . uni2ascii-4.20/uni2ascii.c0000644000175000017500000020774314300544262012315 00000000000000/* Time-stamp: <2022-08-21 17:07:14 poser> * * Converts UTF-8 Unicode to pure 7-bit ASCII using any of a number * of different representations. * * Copyright (C) 2004-2022 William J. Poser (billposer@alum.mit.edu) * * This program is free software; you can redistribute it and/or modify * it under the terms of version 3 of the GNU General Public License as published by * the Free Software Foundation. * * 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 * Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * or go to the web page: http://www.gnu.org/licenses/gpl.txt. */ #include "config.h" #include #include #include #include #include #include #include #include #ifdef HAVE_LOCALE_H #include #endif #ifdef HAVE_LIBINTL_H #include #define _(String) gettext(String) #else #define _(x) (x) #endif #include "unicode.h" #include "enttbl.h" #include "u2a_endian.h" #include "utf8error.h" #include "exitcode.h" #include "formats.h" #if defined(__DATE__) && defined(__TIME__) #define HAVE_DATE_TIME char compdate[]= __DATE__ " " __TIME__ ; #else char compdate[]= ""; #endif #define MSGSIZE 128 char version[]=PACKAGE_VERSION; char pgname[]="uni2ascii"; #ifndef LOCALEDIR #define LOCALEDIR "/usr/local/share/locale" #endif char msg [MSGSIZE]; #include #ifdef HAVE_GNU_LIBC_VERSION_H #include #endif void ShowVersion(FILE *fp) { extern char version[]; char *vp; char vnum[11+1]; struct utsname utsbuf; fprintf(fp,"%s %s\n",pgname,version); #ifdef HAVE_GNU_LIBC_VERSION_H fprintf(fp,_(" glibc %s\n"),gnu_get_libc_version()); #endif if (uname(&utsbuf) >= 0) { fprintf(fp,_("Compiled %s on %s\nunder %s %s %s\n"), compdate, utsbuf.machine, utsbuf.sysname, utsbuf.release, utsbuf.version); } else fprintf(fp,_("Compiled %s\n"),compdate); } void Copyright (void) { fprintf(stderr,"Copyright (C) 2004-2022 William J. Poser\n"); fprintf(stderr,"This program is free software; you can redistribute\n\ it and/or modify it under the terms of version 3 of\n\ the GNU General Public License as published by the\n\ Free Software Foundation.\n"); fprintf(stderr,"Report bugs to: billposer@alum.mit.edu.\n"); } void ShowUsage(void){ fprintf(stderr,_("This program is a filter which converts UTF-8 Unicode\n\ to any of a variety 7-bit ASCII textual representations.\n")); fprintf(stderr,_("By default all characters above 0x7F are converted to the specified\n\ format except for newline and the space characters (space, tab\n\ ideographic space, ethiopic word space and ogham space mark).\n\ Options allow conversion of the ASCII characters as well\n\ and for conversion even of newline and space characters.\n")); fprintf(stderr,_("Usage: %s [flags] ()\n"),pgname); fprintf(stderr,_(" -h Print this usage message.\n")); fprintf(stderr,_(" -v Print version information.\n")); fprintf(stderr,_(" -L List format specifications.\n")); fprintf(stderr,_(" -A List the conversions performed by the -e option.\n")); fprintf(stderr,_(" -E List the expansions performed by the -x option.\n")); fprintf(stderr,_(" -q Quiet. Do not chat unnecessarily while working.\n")); fprintf(stderr,_(" -a .\n")); fprintf(stderr,_(" -c Convert circled and parenthesized characters.\n")); fprintf(stderr,_(" -e Convert to approximate ASCII equivalents.\n")); fprintf(stderr,_(" -f Convert formal equivalents to ASCII.\n")); fprintf(stderr,_(" -x Expand certain single characters to equivalent sequences.\n")); fprintf(stderr,_(" -y Convert certain characters to approximate single-characters.\n")); fprintf(stderr,_(" -d Strip diacritics.\n")); fprintf(stderr,_(" -S define a custom substitution\n")); fprintf(stderr,_(" -n Convert newlines.\n")); fprintf(stderr,_(" -s Convert space characters.\n")); fprintf(stderr,_(" -P Pass through Unicode if not transformed - do not ascify\n")); fprintf(stderr,_(" -p Convert codepoints below 0x80 except for 0x0A and 0x20 too.\n")); fprintf(stderr,_(" -l Use lower-case a-f when generating hex.\n")); fprintf(stderr,_(" -w Add a space after each converted item.\n")); fprintf(stderr,_(" -B Best ASCII. Transform to ASCII if possible. Combines cdefx.\n")); fprintf(stderr, _(" -Z Use the specified format\n")); fprintf(stderr,_("Report bugs to: billposer@alum.mit.edu\n")); } void ListExpansions(void){ fprintf(stderr,_("The expansions performed by the -x flag are:\n")); fprintf(stderr,_(" U+00A2 CENT SIGN -> cent\n")); fprintf(stderr,_(" U+00A3 POUND SIGN -> pound\n")); fprintf(stderr,_(" U+00A5 YEN SIGN -> yen\n")); fprintf(stderr,_(" U+00A9 COPYRIGHT SYMBOL -> (c)\n")); fprintf(stderr,_(" U+00AE REGISTERED SYMBOL -> (R)\n")); fprintf(stderr,_(" U+00BC ONE QUARTER -> 1/4\n")); fprintf(stderr,_(" U+00BD ONE HALF -> 1/2\n")); fprintf(stderr,_(" U+00BE THREE QUARTERS -> 3/4\n")); fprintf(stderr,_(" U+00C6 CAPITAL LETTER ASH -> AE\n")); fprintf(stderr,_(" U+00DF SMALL LETTER SHARP S -> ss\n")); fprintf(stderr,_(" U+00E6 SMALL LETTER ASH -> ae\n")); fprintf(stderr,_(" U+0132 LIGATURE IJ -> IJ\n")); fprintf(stderr,_(" U+0133 LIGATURE ij -> ij\n")); fprintf(stderr,_(" U+0152 LIGATURE OE -> OE\n")); fprintf(stderr,_(" U+0153 LIGATURE oe -> oe\n")); fprintf(stderr,_(" U+01F1 CAPITAL LETTER DZ -> DZ\n")); fprintf(stderr,_(" U+01F2 MIXED LETTER Dz -> Dz\n")); fprintf(stderr,_(" U+01F3 SMALL LETTER dz -> dz\n")); fprintf(stderr,_(" U+02A6 SMALL LETTER TS DIGRAPH -> ts\n")); fprintf(stderr,_(" U+2026 HORIZONTAL ELLIPSIS -> ...\n")); fprintf(stderr,_(" U+20AC EURO SIGN -> euro\n")); fprintf(stderr,_(" U+2122 TRADEMARK -> (tm)\n")); fprintf(stderr,_(" U+2190 LEFTWARDS ARROW -> <-\n")); fprintf(stderr,_(" U+2192 RIGHTWARDS ARROW -> ->\n")); fprintf(stderr,_(" U+21D0 LEFTWARDS DOUBLE ARROW -> <=\n")); fprintf(stderr,_(" U+21D2 RIGHTWARDS DOUBLE ARROW -> =>\n")); fprintf(stderr,_(" U+22EF MIDLINE HORIZONTAL ELLIPSIS -> ...\n")); fprintf(stderr,_(" U+FB00 LATIN SMALL LIGATURE FF -> ff\n")); fprintf(stderr,_(" U+FB01 LATIN SMALL LIGATURE FI -> fi\n")); fprintf(stderr,_(" U+FB02 LATIN SMALL LIGATURE FL -> fl\n")); fprintf(stderr,_(" U+FB03 LATIN SMALL LIGATURE FFI -> ffi\n")); fprintf(stderr,_(" U+FB04 LATIN SMALL LIGATURE FFL -> ffl\n")); fprintf(stderr,_(" U+FB06 LATIN SMALL LIGATURE ST -> st\n")); } void ListSingleApproximations(void){ fprintf(stderr,_("The approximations produced by the -y flag are:\n")); fprintf(stderr,_(" U+0085 NEXT LINE -> newline\n")); fprintf(stderr,_(" U+00A2 CENT SIGN -> C\n")); fprintf(stderr,_(" U+00A3 POUND SIGN -> #\n")); fprintf(stderr,_(" U+00A5 YEN SIGN -> Y\n")); fprintf(stderr,_(" U+00A9 COPYRIGHT SYMBOL -> C\n")); fprintf(stderr,_(" U+00AE REGISTERED SYMBOL -> R\n")); fprintf(stderr,_(" U+00AF MACRON -> -\n")); fprintf(stderr,_(" U+00BC ONE QUARTER -> -\n")); fprintf(stderr,_(" U+00BD ONE HALF -> -\n")); fprintf(stderr,_(" U+00BE THREE QUARTERS -> -\n")); fprintf(stderr,_(" U+00B7 MIDDLE DOT -> .\n")); fprintf(stderr,_(" U+00C6 CAPITAL LETTER ASH -> A\n")); fprintf(stderr,_(" U+00DF SMALL LETTER SHARP S -> s\n")); fprintf(stderr,_(" U+00E6 SMALL LETTER ASH -> a\n")); fprintf(stderr,_(" U+0132 LIGATURE IJ -> I\n")); fprintf(stderr,_(" U+0133 LIGATURE ij -> i\n")); fprintf(stderr,_(" U+0152 LIGATURE OE -> O\n")); fprintf(stderr,_(" U+0153 LIGATURE oe -> o\n")); fprintf(stderr,_(" U+01F1 CAPITAL LETTER DZ -> D\n")); fprintf(stderr,_(" U+01F2 MIXED LETTER Dz -> D\n")); fprintf(stderr,_(" U+01F3 SMALL LETTER dz -> d\n")); fprintf(stderr,_(" U+02A6 SMALL LETTER TS DIGRAPH -> t\n")); fprintf(stderr,_(" U+2028 LINE SEPARATOR -> newline\n")); fprintf(stderr,_(" U+2026 HORIZONTAL ELLIPSIS -> .\n")); fprintf(stderr,_(" U+2032 PRIME -> \'\n")); fprintf(stderr,_(" U+20AC EURO SIGN -> E\n")); fprintf(stderr,_(" U+2190 LEFTWARDS ARROW -> <\n")); fprintf(stderr,_(" U+2192 RIGHTWARDS ARROW -> >\n")); fprintf(stderr,_(" U+21D0 LEFTWARDS DOUBLE ARROW -> <\n")); fprintf(stderr,_(" U+21D2 RIGHTWARDS DOUBLE ARROW -> >\n")); fprintf(stderr,_(" U+2216 SET MINUS -> \\\n")); fprintf(stderr,_(" U+2217 ASTERISK OPERATOR -> *\n")); fprintf(stderr,_(" U+2223 DIVIDES -> |\n")); fprintf(stderr,_(" U+22EF MIDLINE HORIZONTAL ELLIPSIS -> .\n")); } /* Swap the byte order of a 4 byte integer */ void lswab(unsigned long *val) { union{ long l; char c[4]; } u; unsigned char tmp; u.l = *val; /* Swap peripheral bytes */ tmp = u.c[0]; u.c[0] = u.c[3]; u.c[3] = tmp; /* Swap medial bytes */ tmp = u.c[1]; u.c[1] = u.c[2]; u.c[2] = tmp; *val = u.l; } static char *Formats [] = { "&#x%04x;", /* HTMLX */ "&#x%04X;", "&#%04d;", /* HTMLD */ "&#%04d;", "\\#x%04x;", /* SGMLX */ "\\#x%04X;", "\\#%04d;", /* SGMLD */ "\\#%04d;", "\\u%04x", /* BSLU */ "\\u%04X", "\\x%04x", /* BSLX */ "\\x%04X", "0x%04x", /* STDX */ "0x%04X", "#x%04x", /* CLSX */ "#x%04X", "%04x", /* RAWX */ "%04X", "\\x{%04x}", /* BSLXB */ "\\x{%04X}", "", /* ABUX */ "", "U%04x", /* JUUX */ "U%04X", "u%04x", /* JuUX */ "u%04X", "U+%04x", /* UPLX */ "U+%04X", "X\'%04x\'", /* XQ */ "X\'%04X\'", "\\u%05d", /* BSLUD */ "\\u%05d", "v%05d", /* PERLV */ "v%05d", "$%04x", /* DOLLAR */ "$%04X", "16#%04x", /* PSPT */ "16#%04X", "#16r%04x", /* CLR */ "#16r%04X", "16#%04x#", /* ADA */ "16#%04X#", "&#%02x;", /* HDML */ "&#%02X;", "\\%03hho\\%03hho\\%03hho", /* BYTEO */ "\\%03hho\\%03hho\\%03hho", "\\d%03hhd\\d%03hhd\\d%03hhd", /* BYTED */ "\\d%03hhd\\d%03hhd\\d%03hhd", "\\x%02hhx\\x%02hhx\\x%02hhx",/* BYTEH */ "\\x%02hhX\\x%02hhX\\x%02hhX", "_x%04x_", /* OOXML */ "_x%04X_", "%%u%04x", /* PCTUX */ "%%u%04X" }; /* Returns 1 if it handled the character, 0 if not. */ /* Done for letters, probably should add numbers */ int AscifyEnclosed(UTF32 c) { switch (c) { /* Parenthesized letters */ case 0x249C: case 0x24D0: putchar(0x61); break; case 0x249D: case 0x24D1: putchar(0x62); break; case 0x249E: case 0x24D2: putchar(0x63); break; case 0x249F: case 0x24D3: putchar(0x64); break; case 0x24A0: case 0x24D4: putchar(0x65); break; case 0x24A1: case 0x24D5: putchar(0x66); break; case 0x24A2: case 0x24D6: putchar(0x67); break; case 0x24A3: case 0x24D7: putchar(0x68); break; case 0x24A4: case 0x24D8: putchar(0x69); break; case 0x24A5: case 0x24D9: putchar(0x6A); break; case 0x24A6: case 0x24DA: putchar(0x6B); break; case 0x24A7: case 0x24DB: putchar(0x6C); break; case 0x24A8: case 0x24DC: putchar(0x6D); break; case 0x24A9: case 0x24DD: putchar(0x6E); break; case 0x24AA: case 0x24DE: putchar(0x6F); break; case 0x24AB: case 0x24DF: putchar(0x70); break; case 0x24AC: case 0x24E0: putchar(0x71); break; case 0x24AD: case 0x24E1: putchar(0x72); break; case 0x24AE: case 0x24E2: putchar(0x73); break; case 0x24AF: case 0x24E3: putchar(0x74); break; case 0x24B0: case 0x24E4: putchar(0x75); break; case 0x24B1: case 0x24E5: putchar(0x76); break; case 0x24B2: case 0x24E6: putchar(0x77); break; case 0x24B3: case 0x24E7: putchar(0x78); break; case 0x24B4: case 0x24E8: putchar(0x79); break; case 0x24B5: case 0x24E9: putchar(0x7A); break; /* Circled capital letters */ case 0x24B6: putchar(0x41); break; case 0x24B7: putchar(0x42); break; case 0x24B8: putchar(0x43); break; case 0x24B9: putchar(0x44); break; case 0x24BA: putchar(0x45); break; case 0x24BB: putchar(0x46); break; case 0x24BC: putchar(0x47); break; case 0x24BD: putchar(0x48); break; case 0x24BE: putchar(0x49); break; case 0x24BF: putchar(0x4A); break; case 0x24C0: putchar(0x4B); break; case 0x24C1: putchar(0x4C); break; case 0x24C2: putchar(0x4D); break; case 0x24C3: putchar(0x4E); break; case 0x24C4: putchar(0x4F); break; case 0x24C5: putchar(0x50); break; case 0x24C6: putchar(0x51); break; case 0x24C7: putchar(0x52); break; case 0x24C8: putchar(0x53); break; case 0x24C9: putchar(0x54); break; case 0x24CA: putchar(0x55); break; case 0x24CB: putchar(0x56); break; case 0x24CC: putchar(0x57); break; case 0x24CD: putchar(0x58); break; case 0x24CE: putchar(0x59); break; case 0x24CF: putchar(0x5A); break; default: return 0; } return 1; } /* Returns 1 if it replaced the character, 0 if not. */ int AscifyEquiv(UTF32 c) { int retval = 1; switch (c) { case 0x0085: /* next line */ case 0x2028: /* line separator */ putchar('\n'); break; case 0x00AF: putchar('-'); /* macron */ break; case 0x00B7: /* middle dot */ putchar('.'); break; case 0xFE60: putchar(0x26); /* ampersand */ break; case 0x204E: case 0x2217: case 0x2731: case 0xFE61: putchar(0x2A); /* asterisk */ break; case 0xFE62: /* plus sign */ putchar(0x2B); break; case 0x00AD: case 0x2010: case 0x2011: case 0x2012: case 0x2013: case 0x2014: case 0x2212: case 0x2500: case 0x2501: putchar(0x2D); /* Hyphen */ break; case 0x2502: case 0x2503: putchar(0x7C); /* Vertical line */ break; case 0x00AB: case 0x00BB: case 0x201C: case 0x201D: case 0x201E: case 0x201F: case 0x2033: case 0x275D: case 0x275E: putchar(0x22); /* Double quote */ break; case 0x2018: case 0x201A: case 0x201B: case 0x2039: putchar(0x60); /* left single quote */ break; case 0x2022: /* Bullet */ putchar('o'); break; case 0x2019: case 0x2032: /* prime */ case 0x203A: putchar(0x27); /* right or neutral single quote */ break; case 0x222A: /* Union */ putchar('U'); break; case 0x00A0: /* no break space */ case 0x1361: /* ethiopic word space */ case 0x1680: /* ogham space */ case 0x2000: /* en quad */ case 0x2001: /* em quad */ case 0x2002: /* en space */ case 0x2003: /* em space */ case 0x2004: /* three-per-em space */ case 0x2005: /* four-per-em space */ case 0x2006: /* six-per-em space */ case 0x2007: /* figure space */ case 0x2008: /* punctuation space */ case 0x2009: /* thin space */ case 0x200A: /* hair space */ case 0x200B: /* zero-width space */ case 0x3000: /* ideographic space */ putchar(0x20); /* Space */ break; case 0x2215: /* division slash */ putchar(0x2F); break; case 0x2216: /* set minus */ putchar(0x5C); break; case 0x2223: /* divides */ putchar('|'); break; default: retval = 0; } return retval; } /* Returns 1 if it handled the character, 0 if not. */ int AscifyDiacritics(UTF32 c) { switch (c) { case 0x226E: putchar(0x3C); break; case 0x226F: putchar(0x3E); break; case 0x00C0: case 0x00C1: case 0x00C2: case 0x00C3: case 0x00C4: case 0x00C5: case 0x0100: case 0x0102: case 0x0104: case 0x01CD: case 0x01DE: case 0x01E0: case 0x01E2: case 0x01FA: case 0x0200: case 0x0202: case 0x0226: case 0x1D00: case 0x1E00: case 0x1EA0: case 0x1EA2: case 0x1EA4: case 0x1EA6: case 0x1EA8: case 0x1EAA: case 0x1EAC: case 0x1EAE: case 0x1EB0: case 0x1EB2: case 0x1EB4: case 0x1EB6: putchar(0x41); /* A */ break; case 0x0181: case 0x0182: case 0x0299: case 0x1D03: case 0x1E02: case 0x1E04: case 0x1E06: putchar(0x42); /* B */ break; case 0x00C7: case 0x0106: case 0x0108: case 0x010A: case 0x010C: case 0x0187: case 0x023B: case 0x1E08: putchar(0x43); /* C */ break; case 0x010E: case 0x0110: case 0x018A: case 0x018B: case 0x1E0A: case 0x1E0C: case 0x1E0E: case 0x1E10: case 0x1E12: putchar(0x44); /* D */ break; case 0x00C8: case 0x00C9: case 0x00CA: case 0x00CB: case 0x0112: case 0x0114: case 0x0116: case 0x0118: case 0x011A: case 0x0204: case 0x0206: case 0x0228: case 0x1D07: case 0x1E14: case 0x1E16: case 0x1E18: case 0x1E1A: case 0x1E1C: case 0x1EB8: case 0x1EBA: case 0x1EBC: case 0x1EBE: case 0x1EC0: case 0x1EC2: case 0x1EC4: case 0x1EC6: putchar(0x45); /* E */ break; case 0x0191: case 0x1E1E: putchar(0x46); /* F */ break; case 0x011C: case 0x011E: case 0x0120: case 0x0122: case 0x0193: case 0x01E4: case 0x01E6: case 0x01F4: case 0x1E20: putchar(0x47); /* G */ break; case 0x0124: case 0x0126: case 0x021E: case 0x1E22: case 0x1E24: case 0x1E26: case 0x1E28: case 0x1E2A: putchar(0x48); /* H */ break; case 0x00CC: case 0x00CD: case 0x00CE: case 0x00CF: case 0x0128: case 0x012A: case 0x012C: case 0x012E: case 0x0130: case 0x0197: case 0x01CF: case 0x0208: case 0x020A: case 0x026A: case 0x1D7B: case 0x1E2C: case 0x1E2E: case 0x1EC8: case 0x1ECA: putchar(0x49); /* I */ break; case 0x0134: putchar(0x4A); /* J */ break; case 0x0136: case 0x0198: case 0x01E8: case 0x1E30: case 0x1E32: case 0x1E34: putchar(0x4B); /* K */ break; case 0x0139: case 0x013B: case 0x013D: case 0x023D: case 0x1E36: case 0x1E38: case 0x1E3A: case 0x1E3C: putchar(0x4C); /* L */ break; case 0x1E3E: case 0x1E40: case 0x1E42: putchar(0x4D); /* M */ break; case 0x00D1: case 0x0143: case 0x0145: case 0x0147: case 0x019D: case 0x01F8: case 0x0220: case 0x1E44: case 0x1E46: case 0x1E48: case 0x1E4A: putchar(0x4E); /* N */ break; case 0x00D2: case 0x00D3: case 0x00D4: case 0x00D5: case 0x00D6: case 0x00D8: case 0x014C: case 0x014E: case 0x0150: case 0x019F: case 0x01A0: case 0x01D1: case 0x01EA: case 0x01EC: case 0x01FE: case 0x020C: case 0x020E: case 0x022A: case 0x022C: case 0x022E: case 0x0230: case 0x1D0F: case 0x1E4C: case 0x1E4E: case 0x1E50: case 0x1E52: case 0x1ECC: case 0x1ECE: case 0x1ED0: case 0x1ED2: case 0x1ED4: case 0x1ED6: case 0x1ED8: case 0x1EDA: case 0x1EDC: case 0x1EDE: case 0x1EE0: case 0x1EE2: putchar(0x4F); /* O */ break; case 0x01A4: case 0x1E54: case 0x1E56: putchar(0x50); /* P */ break; case 0x0154: case 0x0156: case 0x0158: case 0x0210: case 0x0212: case 0x1E58: case 0x1E5A: case 0x1E5C: case 0x1E5E: putchar(0x52); /* R */ break; case 0x015A: case 0x015C: case 0x015E: case 0x0160: case 0x0218: case 0x1E60: case 0x1E62: case 0x1E64: case 0x1E66: case 0x1E68: putchar(0x53); /* S */ break; case 0x0162: case 0x0164: case 0x01AC: case 0x01AE: case 0x021A: case 0x023E: case 0x1E6A: case 0x1E6C: case 0x1E6E: case 0x1E70: putchar(0x54); /* T */ break; case 0x00D9: case 0x00DA: case 0x00DB: case 0x00DC: case 0x0168: case 0x016A: case 0x016C: case 0x016E: case 0x0170: case 0x0172: case 0x01AF: case 0x01D3: case 0x01D5: case 0x01D7: case 0x01D9: case 0x01DB: case 0x0214: case 0x0216: case 0x1D1C: case 0x1D7E: case 0x1E72: case 0x1E74: case 0x1E76: case 0x1E78: case 0x1E7A: case 0x1EE4: case 0x1EE6: case 0x1EE8: case 0x1EEA: case 0x1EEC: case 0x1EEE: case 0x1EF0: putchar(0x55); /* U */ break; case 0x01B2: case 0x1E7C: case 0x1E7E: putchar(0x56); /* V */ break; case 0x0174: case 0x1E80: case 0x1E82: case 0x1E84: case 0x1E86: case 0x1E88: putchar(0x57); /* W */ break; case 0x1E8A: case 0x1E8C: putchar(0x58); /* X */ break; case 0x00DD: case 0x0176: case 0x0178: case 0x01B3: case 0x0232: case 0x028F: case 0x1E8E: case 0x1EF2: case 0x1EF4: case 0x1EF6: case 0x1EF8: putchar(0x59); /* Y */ break; case 0x0179: case 0x017B: case 0x017D: case 0x01B5: case 0x0224: case 0x1D22: case 0x1E90: case 0x1E92: case 0x1E94: putchar(0x5A); /* Z */ break; case 0x00E0: /* a */ case 0x00E1: case 0x00E2: case 0x00E3: case 0x00E4: case 0x00E5: case 0x0101: case 0x0103: case 0x0105: case 0x01CE: case 0x01DF: case 0x01E1: case 0x01FB: case 0x0201: case 0x0203: case 0x0227: case 0x1E01: case 0x1E9A: case 0x1EA1: case 0x1EA3: case 0x1EA5: case 0x1EA7: case 0x1EA9: case 0x1EB1: case 0x1EB3: case 0x1EB5: case 0x1EB7: putchar(0x61); break; case 0x0180: /* b */ case 0x0183: case 0x0253: case 0x1E03: case 0x1E05: case 0x1E07: putchar(0x62); break; case 0x00E7: case 0x0107: case 0x0109: case 0x010B: case 0x010D: case 0x0188: case 0x0255: case 0x1E09: putchar(0x63); /* c */ break; case 0x010F: case 0x0111: case 0x018C: case 0x0221: case 0x0256: case 0x0257: case 0x1D6D: case 0x1D81: case 0x1D91: case 0x1E0B: case 0x1E0D: case 0x1E0F: case 0x1E11: case 0x1E13: putchar(0x64); /* d */ break; case 0x00E8: case 0x00E9: case 0x00EA: case 0x00EB: case 0x0113: case 0x0115: case 0x0117: case 0x0119: case 0x011B: case 0x0205: case 0x0207: case 0x0229: case 0x1E15: case 0x1E17: case 0x1E19: case 0x1E1B: case 0x1E1D: case 0x1EB9: case 0x1EBB: case 0x1EBD: case 0x1EBF: case 0x1EC1: case 0x1EC3: case 0x1EC5: case 0x1EC7: putchar(0x65); /* e */ break; case 0x0192: case 0x1D6E: case 0x1D82: case 0x1E1F: putchar(0x66); /* f */ break; case 0x011D: case 0x011F: case 0x0121: case 0x0123: case 0x01E5: case 0x01E7: case 0x01F5: case 0x0260: case 0x1E21: putchar(0x67); /* g */ break; case 0x0125: case 0x0127: case 0x021F: case 0x0266: case 0x1E23: case 0x1E25: case 0x1E27: case 0x1E29: case 0x1E2B: case 0x1E96: putchar(0x68); /* h */ break; case 0x00EC: case 0x00ED: case 0x00EE: case 0x00EF: case 0x0129: case 0x012B: case 0x012D: case 0x012F: case 0x01D0: case 0x0209: case 0x020B: case 0x0268: case 0x1D96: case 0x1E2D: case 0x1E2F: case 0x1EC9: case 0x1ECB: putchar(0x69); /* i */ break; case 0x0135: case 0x01F0: case 0x029D: putchar(0x6A); /* j */ break; case 0x0137: case 0x0199: case 0x01E9: case 0x1D84: case 0x1E31: case 0x1E33: case 0x1E35: putchar(0x6B); /* k */ break; case 0x013A: case 0x013C: case 0x013E: case 0x019A: case 0x0234: case 0x026B: case 0x026C: case 0x026D: case 0x1D85: case 0x1E37: case 0x1E39: case 0x1E3B: case 0x1E3D: putchar(0x6C); /* l */ break; case 0x0271: case 0x1D6F: case 0x1D86: case 0x1E3F: case 0x1E41: case 0x1E43: putchar(0x6D); /* m */ break; case 0x00F1: case 0x0144: case 0x0146: case 0x0148: case 0x019E: case 0x01F9: case 0x0272: case 0x0273: case 0x1D70: case 0x1D87: case 0x1E45: case 0x1E47: case 0x1E49: case 0x1E4B: putchar(0x6E); /* n */ break; case 0x00F2: case 0x00F3: case 0x00F4: case 0x00F5: case 0x00F6: case 0x00F8: case 0x014D: case 0x014F: case 0x0151: case 0x01A1: case 0x01D2: case 0x01EB: case 0x01ED: case 0x01FF: case 0x020D: case 0x020F: case 0x022B: case 0x022D: case 0x022F: case 0x0231: case 0x1E4D: case 0x1E4F: case 0x1E51: case 0x1E53: case 0x1ECD: case 0x1ECF: case 0x1ED1: case 0x1ED3: case 0x1ED5: case 0x1ED7: case 0x1ED9: case 0x1EDB: case 0x1EDD: case 0x1EDF: case 0x1EE1: case 0x1EE3: putchar(0x6F); /* o */ break; case 0x01A5: case 0x1D71: case 0x1D7D: case 0x1D88: case 0x1E55: case 0x1E57: putchar(0x70); /* p */ break; case 0x02A0: putchar(0x71); /* q */ break; case 0x0155: case 0x0157: case 0x0159: case 0x0211: case 0x0213: case 0x027C: case 0x027D: case 0x027E: case 0x1D72: case 0x1D73: case 0x1D89: case 0x1E59: case 0x1E5B: case 0x1E5D: case 0x1E5F: putchar(0x72); /* r */ break; case 0x015B: case 0x015D: case 0x0219: case 0x023F: case 0x0282: case 0x0161: case 0x1D74: case 0x1D8A: case 0x1E61: case 0x1E63: case 0x1E65: case 0x1E67: case 0x1E69: putchar(0x73); /* s */ break; case 0x0165: case 0x01AB: case 0x01AD: case 0x021B: case 0x0288: case 0x1D75: case 0x1E6B: case 0x1E6D: case 0x1E6F: case 0x1E71: case 0x1E97: putchar(0x74); /* t */ break; case 0x00F9: case 0x00FA: case 0x00FB: case 0x00FC: case 0x0169: case 0x016D: case 0x016F: case 0x0171: case 0x0173: case 0x01B0: case 0x01D4: case 0x01D6: case 0x01D8: case 0x01DA: case 0x01DC: case 0x0215: case 0x0217: case 0x0289: case 0x1D99: case 0x1E73: case 0x1E75: case 0x1E77: case 0x1E79: case 0x1E7B: case 0x1EE5: case 0x1EE7: case 0x1EE9: case 0x1EEB: case 0x1EED: case 0x1EEF: case 0x1EF1: putchar(0x75); /* u */ break; case 0x028B: case 0x1D8C: case 0x1E7D: case 0x1E7F: putchar(0x76); /* v */ break; case 0x0175: case 0x1E81: case 0x1E83: case 0x1E85: case 0x1E87: case 0x1E89: case 0x1E98: putchar(0x77); /* w */ break; case 0x1D8D: case 0x1E8B: case 0x1E8D: putchar(0x78); /* x */ break; case 0x00FD: case 0x00FE: case 0x00FF: case 0x0177: case 0x01B4: case 0x0233: case 0x1E8F: case 0x1E99: case 0x1EF3: case 0x1EF5: case 0x1EF7: case 0x1EF9: putchar(0x79); /* y */ break; case 0x017A: case 0x017C: case 0x017E: case 0x01B6: case 0x0225: case 0x0290: case 0x0291: case 0x1E91: case 0x1E93: case 0x1E95: putchar(0x7A); /* z */ break; case 0x0300: /* Combining diacrtics - just skip */ case 0x0301: case 0x0302: case 0x0303: case 0x0304: case 0x0305: case 0x0306: case 0x0307: case 0x0308: case 0x0309: case 0x030A: case 0x030B: case 0x030C: case 0x030D: case 0x030E: case 0x030F: case 0x0310: case 0x0311: case 0x0312: case 0x0313: case 0x0314: case 0x0315: case 0x0316: case 0x0317: case 0x0318: case 0x0319: case 0x031A: case 0x031B: case 0x031C: case 0x031D: case 0x031E: case 0x031F: case 0x0320: case 0x0321: case 0x0322: case 0x0323: case 0x0324: case 0x0325: case 0x0326: case 0x0327: case 0x0328: case 0x0329: case 0x032A: case 0x032B: case 0x032C: case 0x032D: case 0x032E: case 0x032F: case 0x0330: case 0x0331: case 0x0332: case 0x0333: case 0x0334: case 0x0335: case 0x0336: case 0x0337: case 0x0338: case 0x0339: case 0x033A: case 0x033B: case 0x033C: case 0x033D: case 0x033E: case 0x033F: case 0x0340: case 0x0341: case 0x0342: case 0x0343: case 0x0344: case 0x0345: case 0x0346: case 0x0347: case 0x0348: case 0x0349: case 0x034A: case 0x034B: case 0x034C: case 0x034D: case 0x034E: case 0x034F: case 0x0350: case 0x0351: case 0x0352: case 0x0353: case 0x0354: case 0x0355: case 0x0356: case 0x0357: case 0x0358: case 0x0359: case 0x035A: case 0x035B: case 0x035C: case 0x035D: case 0x035E: case 0x035F: case 0x0360: case 0x0361: case 0x0362: break; default: return 0; } return 1; } /* End of AscifyDiacritics */ /* * Convert stylistic variants to plain equivalent. * * Returns 1 if it handled the character, 0 if not. */ int AscifyStyle(UTF32 c) { switch (c) { case 0x2070: case 0x2080: case 0xFF10: putchar(0x30); /* 0 */ break; case 0x00B9: case 0x2081: case 0xFF11: putchar(0x31); /* 1 */ break; case 0x00B2: case 0x2082: case 0xFF12: putchar(0x32); break; case 0x00B3: case 0x2083: case 0xFF13: putchar(0x33); break; case 0x2074: case 0x2084: case 0xFF14: putchar(0x34); break; case 0x2075: case 0x2085: case 0xFF15: putchar(0x35); break; case 0x2076: case 0x2086: case 0xFF16: putchar(0x36); break; case 0x2077: case 0x2087: case 0xFF17: putchar(0x37); break; case 0x2078: case 0x2088: case 0xFF18: putchar(0x38); break; case 0x2079: case 0x2089: case 0xFF19: putchar(0x39); break; case 0xFE57: case 0xFF01: /* Exclamation mark */ putchar(0x21); break; case 0xFF02: /* Quotation mark */ putchar(0x22); break; case 0xFE5F: case 0xFF03: /* Number sign */ putchar(0x23); break; case 0xFE69: case 0xFF04: /* Dollar sign */ putchar(0x24); break; case 0xFE6A: case 0xFF05: /* Percent sign */ putchar(0x25); break; case 0xFE60: case 0xFF06: /* Ampersand */ putchar(0x26); break; case 0xFF07: /* Apostrophe */ putchar(0x27); break; case 0x207D: case 0x208D: case 0xFE59: case 0xFF08: /* Left parenthesis */ putchar(0x28); break; case 0x207E: case 0x208E: case 0xFE5A: case 0xFF09: /* Right parenthesis */ putchar(0x29); break; case 0xFE61: case 0xFF0A: /* Asterisk */ putchar(0x2A); break; case 0x207A: case 0x208A: case 0xFE62: case 0xFF0B: /* Plus sign */ putchar(0x2B); break; case 0xFE50: case 0xFF0C: /* Comma */ putchar(0x2C); break; case 0x207B: case 0x208B: case 0xFE63: case 0xFF0D: /* Hyphen */ putchar(0x2D); break; case 0xFE52: case 0xFF0E: /* Full stop */ putchar(0x2E); break; case 0xFF0F: /* Solidus */ putchar(0x2F); break; case 0xFE55: case 0xFF1A: /* Colon */ putchar(0x3A); break; case 0xFE54: case 0xFF1B: /* Semicolon */ putchar(0x3B); break; case 0xFE64: case 0xFF1C: /* Less than sign */ putchar(0x3C); break; case 0x207C: case 0x208C: case 0xFE66: case 0xFF1D: putchar(0x3D); /* Equals sign */ break; case 0xFE65: case 0xFF1E: /* Greater than sign */ putchar(0x3E); break; case 0xFE56: case 0xFF1F: /* Question mark */ putchar(0x3F); break; case 0xFE6B: case 0xFF20: /* At sign */ putchar(0x40); break; case 0xFF21: case 0x1D400: case 0x1D434: case 0x1D468: case 0x1D49C: case 0x1D4D0: case 0x1D504: case 0x1D538: case 0x1D56C: case 0x1D5A0: case 0x1D5D4: case 0x1D63C: case 0x1D670: putchar(0x41); break; case 0x212C: /* B */ case 0xFF22: case 0x1D401: case 0x1D435: case 0x1D469: case 0x1D4D1: case 0x1D505: case 0x1D539: case 0x1D56D: case 0x1D5A1: case 0x1D5D5: case 0x1D609: case 0x1D63D: case 0x1D671: putchar(0x42); break; case 0x2102: case 0x212D: case 0xFF23: case 0x1D402: case 0x1D436: case 0x1D46A: case 0x1D49E: case 0x1D4D2: case 0x1D56E: case 0x1D5A2: case 0x1D5D6: case 0x1D60A: case 0x1D63E: case 0x1D672: putchar(0x43); /* C */ break; case 0x2145: case 0xFF24: case 0x1D403: case 0x1D437: case 0x1D46B: case 0x1D49F: case 0x1D4D3: case 0x1D507: case 0x1D53B: case 0x1D56F: case 0x1D5A3: case 0x1D5D7: case 0x1D60B: case 0x1D63F: case 0x1D673: putchar(0x44); /* D */ break; case 0x2130: /* E*/ case 0xFF25: case 0x1D404: case 0x1D438: case 0x1D46C: case 0x1D4D4: case 0x1D508: case 0x1D53C: case 0x1D570: case 0x1D5A4: case 0x1D5D8: case 0x1D60C: case 0x1D640: case 0x1D674: putchar(0x45); break; case 0x2131: case 0x213F: case 0xFF26: case 0x1D405: case 0x1D439: case 0x1D46D: case 0x1D4D5: case 0x1D509: case 0x1D53D: case 0x1D571: case 0x1D5A5: case 0x1D5D9: case 0x1D60D: case 0x1D641: case 0x1D675: putchar(0x46); /* F */ break; case 0x0262: case 0xFF27: case 0x1D406: case 0x1D43A: case 0x1D46E: case 0x1D4A2: case 0x1D4D6: case 0x1D50A: case 0x1D53E: case 0x1D572: case 0x1D5A6: case 0x1D5DA: case 0x1D60E: case 0x1D642: case 0x1D676: putchar(0x47); /* G */ break; case 0x029C: case 0x210B: case 0x210C: case 0x210D: case 0xFF28: case 0x1D407: case 0x1D43B: case 0x1D46F: case 0x1D4D7: case 0x1D573: case 0x1D5A7: case 0x1D5DB: case 0x1D60F: case 0x1D643: case 0x1D677: putchar(0x48); /* H */ break; case 0x2110: case 0x2111: case 0x2160: case 0xFF29: case 0x1D408: case 0x1D43C: case 0x1D470: case 0x1D4D8: case 0x1D540: case 0x1D574: case 0x1D5A8: case 0x1D5DC: case 0x1D610: case 0x1D644: case 0x1D678: putchar(0x49); /* I */ break; case 0x026A: case 0xFF2A: case 0x1D409: case 0x1D43D: case 0x1D471: case 0x1D4D9: case 0x1D541: case 0x1D575: case 0x1D5A9: case 0x1D5DD: case 0x1D611: case 0x1D645: case 0x1D679: putchar(0x4A); /* J */ break; case 0xFF2B: case 0x1D40A: case 0x1D43E: case 0x1D472: case 0x1D4A5: case 0x1D4DA: case 0x1D50D: case 0x1D542: case 0x1D576: case 0x1D5AA: case 0x1D5DE: case 0x1D612: case 0x1D646: case 0x1D67A: putchar(0x4B); /* K */ break; case 0xFF2C: case 0x1D40B: case 0x1D43F: case 0x1D473: case 0x1D4A6: case 0x1D4DB: case 0x1D50E: case 0x1D543: case 0x1D577: case 0x1D5AB: case 0x1D5DF: case 0x1D613: case 0x1D647: case 0x1D67B: putchar(0x4C); /* L */ break; case 0x029F: case 0xFF2D: case 0x2112: case 0x1D40C: case 0x1D440: case 0x1D474: case 0x1D4DC: case 0x1D50F: case 0x1D544: case 0x1D578: case 0x1D5AC: case 0x1D5E0: case 0x1D614: case 0x1D648: case 0x1D67C: putchar(0x4D); /* M */ break; case 0x2133: case 0xFF2E: case 0x1D40D: case 0x1D441: case 0x1D475: case 0x1D4A9: case 0x1D4DD: case 0x1D511: case 0x1D579: case 0x1D5AD: case 0x1D5E1: case 0x1D615: case 0x1D649: case 0x1D67D: putchar(0x4E); /* N */ break; case 0x2205: case 0xFF2F: case 0x1D40E: case 0x1D442: case 0x1D476: case 0x1D4AA: case 0x1D4DE: case 0x1D512: case 0x1D546: case 0x1D57A: case 0x1D5AE: case 0x1D5E2: case 0x1D616: case 0x1D64A: case 0x1D67E: putchar(0x4F); /* O */ break; case 0x2118: case 0x2119: case 0xFF30: case 0x1D40F: case 0x1D443: case 0x1D477: case 0x1D4AB: case 0x1D4DF: case 0x1D513: case 0x1D57B: case 0x1D5AF: case 0x1D5E3: case 0x1D617: case 0x1D64B: case 0x1D67F: putchar(0x50); /* P */ break; case 0x211A: case 0xFF31: case 0x1D410: case 0x1D444: case 0x1D478: case 0x1D4AC: case 0x1D4E0: case 0x1D514: case 0x1D57C: case 0x1D5B0: case 0x1D5E4: case 0x1D618: case 0x1D64C: case 0x1D680: putchar(0x51); /* Q */ break; case 0x0280: case 0x211B: case 0x211C: case 0x211D: case 0xFF32: case 0x1D411: case 0x1D445: case 0x1D479: case 0x1D4E1: case 0x1D57D: case 0x1D5B1: case 0x1D5E5: case 0x1D619: case 0x1D64D: case 0x1D681: putchar(0x52); /* R */ break; case 0xFF33: case 0x1D412: case 0x1D446: case 0x1D47A: case 0x1D4AE: case 0x1D4E2: case 0x1D516: case 0x1D54A: case 0x1D57E: case 0x1D5B2: case 0x1D5E6: case 0x1D61A: case 0x1D64E: case 0x1D682: putchar(0x53); /* S */ break; case 0xFF34: case 0x1D413: case 0x1D447: case 0x1D47B: case 0x1D4AF: case 0x1D4E3: case 0x1D517: case 0x1D54B: case 0x1D57F: case 0x1D5B3: case 0x1D5E7: case 0x1D61B: case 0x1D64F: case 0x1D683: putchar(0x54); /* T */ break; case 0xFF35: case 0x1D414: case 0x1D448: case 0x1D47C: case 0x1D4B0: case 0x1D4E4: case 0x1D518: case 0x1D54C: case 0x1D580: case 0x1D5B4: case 0x1D5E8: case 0x1D61C: case 0x1D650: case 0x1D684: putchar(0x55); /* U */ break; case 0xFF36: case 0x1D415: case 0x1D449: case 0x1D47D: case 0x1D4B1: case 0x1D4E5: case 0x1D519: case 0x1D54D: case 0x1D581: case 0x1D5B5: case 0x1D5E9: case 0x1D61D: case 0x1D651: case 0x1D685: putchar(0x56); /* V */ break; case 0xFF37: case 0x1D416: case 0x1D44A: case 0x1D47E: case 0x1D4B2: case 0x1D4E6: case 0x1D51A: case 0x1D54E: case 0x1D582: case 0x1D5B6: case 0x1D5EA: case 0x1D61E: case 0x1D652: case 0x1D686: putchar(0x57); /* W */ break; case 0xFF38: case 0x1D417: case 0x1D44B: case 0x1D47F: case 0x1D4B3: case 0x1D4E7: case 0x1D51B: case 0x1D54F: case 0x1D583: case 0x1D5B7: case 0x1D5EB: case 0x1D61F: case 0x1D653: case 0x1D687: putchar(0x58); /* X */ break; case 0x2144: case 0xFF39: case 0x1D418: case 0x1D44C: case 0x1D480: case 0x1D4B4: case 0x1D4E8: case 0x1D51C: case 0x1D550: case 0x1D584: case 0x1D5B8: case 0x1D5EC: case 0x1D620: case 0x1D654: case 0x1D688: putchar(0x59); /* Y */ break; case 0x29F5: case 0x29F9: case 0xFE68: putchar(0x5C); /* Backslash */ break; case 0x2124: case 0x2128: case 0xFF3A: case 0x1D419: case 0x1D44D: case 0x1D656: case 0x1D68A: putchar(0x61); /* a */ break; case 0xFF42: /* b */ case 0x1D41B: case 0x1D44F: case 0x1D483: case 0x1D4B7: case 0x1D4EB: case 0x1D51F: case 0x1D553: case 0x1D587: case 0x1D5BB: case 0x1D5EF: case 0x1D623: case 0x1D657: case 0x1D68B: putchar(0x62); break; case 0x1D04: /* c */ case 0xFF43: case 0x1D41C: case 0x1D450: case 0x1D484: case 0x1D4B8: case 0x1D4EC: case 0x1D520: case 0x1D554: case 0x1D588: case 0x1D5BC: case 0x1D5F0: case 0x1D624: case 0x1D658: case 0x1D68C: putchar(0x63); break; case 0x1D05: /* d */ case 0x2146: case 0xFF44: case 0x1D41D: case 0x1D451: case 0x1D485: case 0x1D4B9: case 0x1D4ED: case 0x1D521: case 0x1D555: case 0x1D589: case 0x1D5BD: case 0x1D5F1: case 0x1D625: case 0x1D659: case 0x1D68D: putchar(0x64); break; case 0x1D07: /* e */ case 0x212F: case 0x2147: case 0xFF45: case 0x1D41E: case 0x1D452: case 0x1D486: case 0x1D4EE: case 0x1D522: case 0x1D556: case 0x1D5BE: case 0x1D5F2: case 0x1D626: case 0x1D65A: case 0x1D68E: putchar(0x65); break; case 0xFF46: /* f */ case 0x1D41F: case 0x1D453: case 0x1D487: case 0x1D4BB: case 0x1D4EF: case 0x1D523: case 0x1D557: case 0x1D58B: case 0x1D5BF: case 0x1D5F3: case 0x1D627: case 0x1D65B: case 0x1D68F: putchar(0x66); break; case 0xFF47: /* g */ case 0x210A: case 0x1D420: case 0x1D454: case 0x1D488: case 0x1D4F0: case 0x1D524: case 0x1D558: case 0x1D58C: case 0x1D5C0: case 0x1D5F4: case 0x1D628: case 0x1D65C: case 0x1D690: putchar(0x67); break; case 0xFF48: /* h */ case 0x1D421: case 0x1D489: case 0x1D4BD: case 0x1D4F1: case 0x1D525: case 0x1D559: case 0x1D58D: case 0x1D5C1: case 0x1D5F5: case 0x1D629: case 0x1D65D: case 0x1D691: putchar(0x68); break; case 0x1D09: case 0x2071: case 0xFF49: case 0x2148: case 0x1D422: case 0x1D456: case 0x1D48A: case 0x1D4BE: case 0x1D4F2: case 0x1D526: case 0x1D55A: case 0x1D58E: case 0x1D5C2: case 0x1D5F6: case 0x1D62A: case 0x1D65E: case 0x1D692: putchar(0x69); /* i */ break; case 0x1D0A: case 0x2149: case 0xFF4A: case 0x1D423: case 0x1D457: case 0x1D48B: case 0x1D4BF: case 0x1D4F3: case 0x1D527: case 0x1D55B: case 0x1D58F: case 0x1D5C3: case 0x1D5F7: case 0x1D62B: case 0x1D65F: case 0x1D693: putchar(0x6A); /* j */ break; case 0x1D0B: /* k */ case 0xFF4B: case 0x1D424: case 0x1D458: case 0x1D48C: case 0x1D4C0: case 0x1D4F4: case 0x1D528: case 0x1D55C: case 0x1D590: case 0x1D5C4: case 0x1D5F8: case 0x1D62C: case 0x1D660: case 0x1D694: putchar(0x6B); break; case 0x2113: /* l */ case 0xFF4C: case 0x1D425: case 0x1D459: case 0x1D48D: case 0x1D4C1: case 0x1D4F5: case 0x1D529: case 0x1D55D: case 0x1D591: case 0x1D5C5: case 0x1D5F9: case 0x1D62D: case 0x1D661: case 0x1D695: putchar(0x6C); break; case 0x1D0D: /* m */ case 0xFF4D: case 0x1D426: case 0x1D45A: case 0x1D48E: case 0x1D4C2: case 0x1D52A: case 0x1D55E: case 0x1D592: case 0x1D5C6: case 0x1D5FA: case 0x1D62E: case 0x1D662: case 0x1D696: putchar(0x6D); break; case 0x207F: case 0xFF4E: case 0x1D427: case 0x1D45B: case 0x1D48F: case 0x1D4C3: case 0x1D4F7: case 0x1D52B: case 0x1D55F: case 0x1D593: case 0x1D5C7: case 0x1D5FB: case 0x1D62F: case 0x1D663: case 0x1D697: putchar(0x6E); /* n */ break; case 0x1D0F: /* o */ case 0x2134: case 0xFF4F: case 0x1D428: case 0x1D45C: case 0x1D490: case 0x1D4F8: case 0x1D52C: case 0x1D560: case 0x1D594: case 0x1D5C8: case 0x1D5FC: case 0x1D630: case 0x1D664: case 0x1D698: putchar(0x6F); break; case 0x1D18: /* p */ case 0xFF50: case 0x213C: case 0x1D429: case 0x1D45D: case 0x1D491: case 0x1D4C5: case 0x1D4F9: case 0x1D52D: case 0x1D561: case 0x1D595: case 0x1D5C9: case 0x1D5FD: case 0x1D631: case 0x1D665: case 0x1D699: putchar(0x70); break; case 0xFF51: /* q */ case 0x1D42A: case 0x1D45E: case 0x1D492: case 0x1D4C6: case 0x1D4FA: case 0x1D52E: case 0x1D562: case 0x1D596: case 0x1D5CA: case 0x1D5FE: case 0x1D632: case 0x1D666: case 0x1D69A: putchar(0x71); break; case 0xFF52: /* r */ case 0x1D42B: case 0x1D45F: case 0x1D493: case 0x1D4C7: case 0x1D4FB: case 0x1D52F: case 0x1D563: case 0x1D597: case 0x1D5CB: case 0x1D5FF: case 0x1D633: case 0x1D667: case 0x1D69B: putchar(0x72); break; case 0xFF53: /* s */ case 0x1D42C: case 0x1D460: case 0x1D494: case 0x1D4C8: case 0x1D4FC: case 0x1D530: case 0x1D564: case 0x1D598: case 0x1D5CC: case 0x1D600: case 0x1D634: case 0x1D668: case 0x1D69C: putchar(0x73); break; case 0x1D1B: /* t */ case 0xFF54: case 0x1D42D: case 0x1D461: case 0x1D495: case 0x1D4C9: case 0x1D4FD: case 0x1D531: case 0x1D565: case 0x1D599: case 0x1D5CD: case 0x1D601: case 0x1D635: case 0x1D669: case 0x1D69D: putchar(0x74); break; case 0x1D1C: /* u */ case 0xFF55: case 0x1D42E: case 0x1D462: case 0x1D496: case 0x1D4CA: case 0x1D4FE: case 0x1D532: case 0x1D566: case 0x1D59A: case 0x1D5CE: case 0x1D602: case 0x1D636: case 0x1D66A: case 0x1D69E: putchar(0x75); break; case 0x1D20: /* v */ case 0xFF56: case 0x1D42F: case 0x1D463: case 0x1D497: case 0x1D4CB: case 0x1D4FF: case 0x1D533: case 0x1D567: case 0x1D59B: case 0x1D5CF: case 0x1D603: case 0x1D637: case 0x1D66B: case 0x1D69F: putchar(0x76); break; case 0x1D21: /* w */ case 0x24B2: case 0x24E6: case 0xFF57: case 0x1D430: case 0x1D464: case 0x1D498: case 0x1D4CC: case 0x1D500: case 0x1D534: case 0x1D568: case 0x1D59C: case 0x1D5D0: case 0x1D604: case 0x1D638: case 0x1D66C: case 0x1D6A0: putchar(0x77); break; case 0xFF58: /* x */ case 0x1D431: case 0x1D465: case 0x1D499: case 0x1D4CD: case 0x1D501: case 0x1D535: case 0x1D569: case 0x1D59D: case 0x1D5D1: case 0x1D605: case 0x1D639: case 0x1D66D: case 0x1D6A1: putchar(0x78); break; case 0xFF59: case 0x1D432: case 0x1D466: case 0x1D49A: case 0x1D4CE: case 0x1D502: case 0x1D536: case 0x1D56A: case 0x1D59E: case 0x1D5D2: case 0x1D606: case 0x1D63A: case 0x1D66E: case 0x1D6A2: putchar(0x79); /* y */ break; case 0x1D22: /* z */ case 0xFF5A: case 0x1D433: case 0x1D467: case 0x1D49B: case 0x1D4CF: case 0x1D503: case 0x1D537: case 0x1D56B: case 0x1D59F: case 0x1D5D3: case 0x1D607: case 0x1D63B: case 0x1D66F: case 0x1D6A3: putchar(0x7A); break; case 0xFE5B: case 0xFF5B: /* left curly bracket */ putchar(0x7B); break; case 0xFF5C: /* pipe */ putchar(0x7C); break; case 0xFE5C: case 0xFF5D: /* right curly bracket */ putchar(0x7D); break; case 0xFF5E: /* tilde */ putchar(0x7E); break; default: return 0; } return 1; } /* End of AscifyStyle */ int MakeAscii(UTF32 c) { switch(c) { case 0x00A2: /* Cent sign */ putchar('c'); break; case 0x00A3: /* Pound sign */ putchar('#'); break; case 0x00A5: /* Yen sign */ putchar('Y'); break; case 0x00A9: /* Copyright symbol */ putchar('C'); break; case 0x00AE: /* Registered symbol */ putchar('R'); break; case 0x00BC: /* One quarter */ case 0x00BD: /* One half */ case 0x00BE: /* Three quarters */ putchar('-'); break; case 0x00C6: /* Ash */ putchar('A'); break; case 0x00E6: /* ash */ putchar('a'); break; case 0x00DF: /* Eszet */ putchar('s'); break; case 0x0132: /* Ligature IJ */ putchar('I'); break; case 0x0133: /* Ligature ij */ putchar('i'); break; case 0x0152: /* Ligature OE */ putchar('O'); break; case 0x0153: /* Ligature oe */ putchar('o'); break; case 0x01F1: /* Capital DZ */ putchar('D'); break; case 0x01F2: /* Mixed Dz */ putchar('D'); break; case 0x01F3: /* Small DZ */ putchar('d'); break; case 0x02A6: /* Small ts digraph */ putchar('t'); break; case 0x20AC: /* Euro sign */ putchar('E'); break; case 0x2026: /* Horizontal ellipsis */ case 0x22EF: /* Midline horizontal ellipsis */ putchar('.'); break; case 0x2190: /* Leftwards arrow */ putchar('<'); break; case 0x2192: /* Rightwards arrow */ putchar('>'); break; case 0x21D0: /* Leftwards double arrow */ putchar('<'); break; case 0x21D2: /* Rightwards double arrow */ putchar('>'); break; default: return 0; } return 1; } int ExpandToAscii(UTF32 c) { switch(c) { case 0x00A2: /* Cent sign */ putchar('c'); putchar('e'); putchar('n'); putchar('t'); break; case 0x00A3: /* Pound sign */ putchar('p'); putchar('o'); putchar('u'); putchar('n'); putchar('d'); break; case 0x00A5: /* Yen sign */ putchar('y'); putchar('e'); putchar('n'); break; case 0x00A9: /* Copyright symbol */ putchar('('); putchar('c'); putchar(')'); break; case 0x00AE: /* Registered symbol */ putchar('('); putchar('R'); putchar(')'); break; case 0x00BC: /* One quarter */ putchar('1'); putchar('/'); putchar('4'); break; case 0x00BD: /* One half */ putchar('1'); putchar('/'); putchar('2'); break; case 0x00BE: /* Three quarters */ putchar('3'); putchar('/'); putchar('4'); break; case 0x00C6: /* Ash */ putchar('A'); putchar('E'); break; case 0x00E6: /* ash */ putchar('a'); putchar('e'); break; case 0x00DF: /* Eszet */ putchar('s'); putchar('s'); break; case 0x0132: /* Ligature IJ */ putchar('I'); putchar('J'); break; case 0x0133: /* Ligature ij */ putchar('i'); putchar('j'); break; case 0x0152: /* Ligature OE */ putchar('O'); putchar('E'); break; case 0x0153: /* Ligature oe */ putchar('o'); putchar('e'); break; case 0x01F1: /* Capital DZ */ putchar('D'); putchar('Z'); break; case 0x01F2: /* Mixed Dz */ putchar('D'); putchar('z'); break; case 0x01F3: /* Small DZ */ putchar('d'); putchar('z'); break; case 0x02A6: /* Small ts digraph */ putchar('t'); putchar('s'); break; case 0x20AC: /* Euro sign */ putchar('e'); putchar('u'); putchar('r'); putchar('o'); break; case 0x2122: putchar('('); putchar('t'); putchar('m'); putchar(')'); break; case 0x2026: /* Horizontal ellipsis */ case 0x22EF: /* Midline horizontal ellipsis */ putchar('.'); putchar('.'); putchar('.'); break; case 0x2190: /* Leftwards arrow */ putchar('<'); putchar('-'); break; case 0x2192: /* Rightwards arrow */ putchar('-'); putchar('>'); break; case 0x21D0: /* Leftwards double arrow */ putchar('<'); putchar('='); break; case 0x21D2: /* Rightwards double arrow */ putchar('='); putchar('>'); break; case 0xFB00: putchar('f'); putchar('f'); break; case 0xFB01: putchar('f'); putchar('i'); break; case 0xFB02: putchar('f'); putchar('l'); break; case 0xFB03: putchar('f'); putchar('f'); putchar('i'); break; case 0xFB04: putchar('f'); putchar('f'); putchar('l'); break; case 0xFB06: putchar('s'); putchar('t'); break; default: return 0; } return 1; } void CheckNumberError(char *pgname,char *s, char c){ if(errno == ERANGE){ fprintf(stderr,"%s: %s falls outside of the representable range\n",pgname,s); exit(OTHERERROR); } if(errno == EINVAL){ fprintf(stderr,"%s: %s is ill-formed\n",pgname,s); exit(OTHERERROR); } if(c != '\0'){ fprintf(stderr,"%s: %s is ill-formed\n",pgname,s); exit(OTHERERROR); } } struct subpair { UTF32 u; char a; }; struct subpair *SubList = NULL; int SubCnt = 0; int SubsAvailable = 0; /* * If people start using lots of custom substitutions, a more efficient * search may be advisable. For the time being we just do a linear search. */ SubstituteChar(UTF32 c) { int i; for(i = 0; i < SubCnt; i++) { if(c == SubList[i].u) { if(SubList[i].a) { putchar(SubList[i].a); return 1; } else return (-1); /* Signal deletion */ } } return 0; } AddCustomSubstitution(char *str){ char *Left; char *Right; char *Delim; char *endptr; unsigned long UCode; unsigned long ACode; Delim = strchr(str,':'); if(Delim == NULL) { fprintf(stderr,"Substition specification %s is ill-formed.\n",str); exit(BADOPTIONARG); } *Delim = '\0'; Left = str; Right = Delim+1; UCode = strtoul(Left,&endptr,0); CheckNumberError(pgname,Left,*endptr); if(*Right == '\0') ACode = 0; else { ACode = strtoul(Right,&endptr,0); CheckNumberError(pgname,Right,*endptr); } if(ACode > 127L) { fprintf(stderr,"Ascii code for substitution must be between 1 and 127 inclusive.\n"); exit(BADOPTIONARG); } SubCnt++; if(SubCnt > SubsAvailable) { SubList = realloc(SubList,sizeof(struct subpair) * (SubsAvailable+=4)); if(SubList == NULL) { fprintf(stderr,"Unable to allocate storage for substitution list.\n"); exit(OUTOFMEMORY); } } SubList[SubCnt-1].u = (UTF32) UCode; SubList[SubCnt-1].a = (char) ACode; } int main (int ac, char *av[]) { UTF32 c; char sc; /* Unicode char stripped to ASCII equivalent */ int ch; int oc; /* Command line option flag */ int ucnt; /* Index into current UTF* string */ int UCBytes; int infd; int FType = STDX; short UseEntitiesP = 0; int UTF8Type = 0; short BMPSplitP = 0; char *fmt = NULL; short dummy; /* For compatibility with ascii2uni */ unsigned char b1,b2,b3; /* The low three bytes of a 4 byte UTF-32 character */ unsigned long ByteCnt; unsigned long CharCnt; unsigned long ConvertedCnt; unsigned long SubstitutedCnt; unsigned long DeletedCnt; short PureP = 0; short PreserveNewlinesP = 1; short PreserveSpacesP = 1; short VerboseP = 1; short HexUpperP = 1; /* Use X or x in hex ? */ short AddWhitespaceP = 0; short PassThroughP = 0; /* If untransformed, pass through unicode rather than asciifying */ short AllHTMLP = 0; /* Not a valid option here - just used to detect bad cl */ short AscifyStyleP = 0; short AscifyDiacriticsP = 0; short AscifyEnclosedP = 0; short AscifyEquivP = 0; short ExpandP = 0; short MakeP = 0; short LittleEndianP = 0; short convp = 1; /* Just for local use due to complex logic */ char *AboveBMPfmt; char *WithinBMPfmt; char *e; unsigned char *ustr; /* UTF8 string */ FILE *fp; extern int optind; extern int opterr; extern int optopt; extern UTF32 UTF8in(int,int *,unsigned char **); extern int CountSlots(char *); extern void ListFormatArguments(short); extern void SetFormat(char *, int *, short *,int *, short *, short *); opterr = 0; ByteCnt = 0L; CharCnt = 0L; ConvertedCnt = 0L; SubstitutedCnt = 0L; DeletedCnt = 0L; #ifdef HAVE_SETLOCALE setlocale(LC_ALL,""); #endif #ifdef HAVE_LIBINTL_H bindtextdomain (PACKAGE,LOCALEDIR); textdomain (PACKAGE); #endif /* Handle command line arguments */ while( (oc = getopt(ac,av,":Aa:BcdeEfhlLnPpqsS:vwyxZ:")) != EOF){ switch(oc){ case 'a': SetFormat(optarg,&FType,&UseEntitiesP, &UTF8Type, &BMPSplitP,&AllHTMLP); if( (FType == FMT_UNKNOWN) || AllHTMLP) { fprintf(stderr,"Format specification %s not recognized.\n",optarg); exit(BADOPTIONARG); } if(FType == CHENT) FType = HTMLX; break; case 'A': ListSingleApproximations(); exit(INFO); case 'B': AscifyEnclosedP = 1; AscifyDiacriticsP = 1; AscifyEquivP = 1; AscifyStyleP = 1; ExpandP = 1; break; case 'c': AscifyEnclosedP = 1; break; case 'd': AscifyDiacriticsP = 1; break; case 'E': ListExpansions(); exit(INFO); case 'e': AscifyEquivP = 1; break; case 'f': AscifyStyleP = 1; break; case 'l': HexUpperP = 0; break; case 'L': ListFormatArguments(1); exit(INFO); case 'n': PreserveNewlinesP = 0; break; case 'P': PassThroughP = 1; UTF8Type = 0; break; case 'p': /* Convert even characters within the ASCII range */ PureP =1; break; case 's': PreserveSpacesP = 0; break; case 'S': AddCustomSubstitution(optarg); break; case 'x': ExpandP = 1; break; case 'y': MakeP = 1; break; case 'w': AddWhitespaceP = 1; break; case 'Z': fmt = optarg; if(CountSlots(fmt) > 1) { fprintf(stderr,"You may not supply a format with more than one empty slot.\n"); exit(BADOPTIONARG); } break; case 'h': ShowUsage(); exit(INFO); break; /* NOTREACHED */ case 'q': VerboseP = 0; break; case 'v': ShowVersion(stderr); Copyright(); exit(INFO); break; /* NOTREACHED */ case ':': fprintf(stderr,_("%s: missing argument to option flag %c.\n"),pgname,optopt); exit(BADOPTIONARG); default: fprintf(stderr,_("%1$s: invalid option flag %2$c\n"),pgname,optopt); ShowVersion(stderr); Copyright(); ShowUsage(); exit(BADOPTION); } } if(optind < ac) { infd = open(av[optind],O_RDONLY); if (infd < 0) { fprintf(stderr,"unable to open input file %s\n",av[optind]); exit(OPENERROR); } } else infd = fileno(stdin); if(VerboseP) { if(SubCnt) fprintf(stderr,"Custom substitutions defined: %d\n",SubCnt); } /* Combinatorial checks */ if(UseEntitiesP && !(FType == HTMLX || FType == HTMLD || FType == HDML)) { fprintf(stderr,"Use of character entities must be combined with either\ndecimal or hexadecimal HTML character references\nor HDML hexadecimal character references.\n"); exit(BADOPTION); } if ( (FType == BYTEO) || (FType == BYTED) || (FType == BYTEH)) { LittleEndianP = Get_Endianness(); switch (LittleEndianP) { case E_BIG_ENDIAN: LittleEndianP = 0; break; case E_LITTLE_ENDIAN: break; default: fprintf(stderr,"This machine is neither big-endian nor little-endian.\n"); exit(OTHERERROR); } } if(fmt == NULL) { fmt = Formats[(2 * FType) + HexUpperP]; } if(HexUpperP) { AboveBMPfmt = "\\U%08X"; WithinBMPfmt = "\\u%04X"; } else { AboveBMPfmt = "\\U%08x"; WithinBMPfmt = "\\u%04x"; } if(UTF8Type) { if(AscifyStyleP|AscifyDiacriticsP|AscifyEquivP|AscifyEnclosedP|ExpandP|MakeP) { while ( (c = UTF8in(infd,&UCBytes,&ustr)) <= UNI_MAX_UTF32) { ByteCnt+=UCBytes; CharCnt++; if(SubCnt) { switch(SubstituteChar(c)) { case 1: SubstitutedCnt++; continue; case -1: DeletedCnt++; continue; } } if(AscifyStyleP) { if(AscifyStyle(c)) { SubstitutedCnt++; continue; } } if(AscifyDiacriticsP) { if(AscifyDiacritics(c)) { SubstitutedCnt++; continue; } } if(ExpandP) { if(ExpandToAscii(c)) { SubstitutedCnt++; continue; } } if(MakeP) { if(MakeAscii(c)) { SubstitutedCnt++; continue; } } if(AscifyEquivP) { if(AscifyEquiv(c)) { SubstitutedCnt++; continue; } } if(AscifyEnclosedP) { if(AscifyEnclosed(c)) { SubstitutedCnt++; continue; } } ucnt= 0; while(ucnt < UCBytes) { ch = ustr[ucnt++]; convp = 1; if(ch <= 0x7F) convp = 0; switch(ch) { case 0x0A: if(!PreserveNewlinesP) convp = 1; break; case 0x20: if(!PreserveSpacesP) convp = 1; break; default: if(PureP) convp = 1; } if (!convp) putchar(ch); else { ConvertedCnt++; switch (UTF8Type) { case 1: printf("%%%02X",ch); break; case 2: printf("=%02X",ch); break; case 3: printf("\\%03o",ch); break; case 4: printf("\\x%02X",ch); break; case 5: printf("<%02X>",ch); break; } } if(AddWhitespaceP) putchar(' '); } } exit(SUCCESS); } else { /* I think we need to read from infd here, not from stdin */ fp=fdopen(infd,"r"); while( (ch = fgetc(fp)) != EOF) { /* while( (ch = getchar()) != EOF) { */ convp = 1; if(ch <= 0x7F) convp = 0; switch(ch) { case 0x0A: if(!PreserveNewlinesP) convp = 1; break; case 0x20: if(!PreserveSpacesP) convp = 1; break; default: if(PureP) convp = 1; } if (!convp) putchar(ch); else { ConvertedCnt++; switch (UTF8Type) { case 1: printf("%%%02X",ch); break; case 2: printf("=%02X",ch); break; case 3: printf("\\%03o",ch); break; case 4: printf("\\x%02X",ch); break; case 5: printf("<%02X>",ch); break; } } if(AddWhitespaceP) putchar(' '); } exit(SUCCESS); } } /* End of UTF8 types */ while ( (c = UTF8in(infd,&UCBytes,&ustr)) <= UNI_MAX_UTF32){ ByteCnt+=UCBytes; CharCnt++; if(SubCnt) { switch(SubstituteChar(c)) { case 1: SubstitutedCnt++; continue; case -1: DeletedCnt++; continue; } } if(AscifyStyleP) { if(AscifyStyle(c)) { SubstitutedCnt++; continue; } } if(AscifyDiacriticsP) { if(AscifyDiacritics(c)) { SubstitutedCnt++; continue; } } if(ExpandP) { if(ExpandToAscii(c)) { SubstitutedCnt++; continue; } } if(MakeP) { if(MakeAscii(c)) { SubstitutedCnt++; continue; } } if(AscifyEquivP) { if(AscifyEquiv(c)) { SubstitutedCnt++; continue; } } if(AscifyEnclosedP) { if(AscifyEnclosed(c)) { SubstitutedCnt++; continue; } } if ( (FType == HDML) && (c > 0xFF)) { fprintf(stderr,"Character 0x%04x encountered at character %lu skipped.\n" ,(unsigned int) c,CharCnt); fprintf(stderr," Characters above 0xFF cannot be represented in HDML.\n"); DeletedCnt++; continue; } switch (c) { case 0x000A: if(PreserveNewlinesP) putchar((int)c); else { printf(fmt,c); if(AddWhitespaceP) putchar(' '); ConvertedCnt++; } break; case 0x0020: /* space */ case 0x0009: /* tab */ if(PreserveSpacesP) putchar((int)c); else { printf(fmt,c); if(AddWhitespaceP) putchar(' '); ConvertedCnt++; } break; case 0x1361: /* ethiopic word space */ case 0x1680: /* ogham space */ case 0x3000: /* ideographic space */ if(PreserveSpacesP) putchar(0x0020); else { printf(fmt,c); if(AddWhitespaceP) putchar(' '); ConvertedCnt++; } break; default: if(PassThroughP) putu8(c); else if(!PureP && (c <= 0x7F)) putchar((int)c); else { if(BMPSplitP) { if(c > 0xFFFF) printf(AboveBMPfmt,c); else printf(WithinBMPfmt,c); ConvertedCnt++; } else { if (UseEntitiesP) { if (FType == HDML) { if ((e=LookupHDMLEntityForCode(c)) != NULL) printf("&%s;",e); else printf(fmt,c); } else { if ((e=LookupEntityForCode(c)) != NULL) printf("&%s;",e); else printf(fmt,c); } ConvertedCnt++; } else { ConvertedCnt++; if ( (FType == BYTEO) || (FType == BYTED) || (FType == BYTEH)) { /* Single byte UTF-32*/ if(LittleEndianP) lswab(&c); /* POSIX assumes big-endian */ /* Extract the low three bytes */ b1 = (char) ((c >> 16) & 0xFF); b2 = (char) ((c >> 8) & 0xFF); b3 = (char) ( c & 0xFF); printf(fmt,b1,b2,b3); } else printf(fmt,c); } } if(AddWhitespaceP) putchar(' '); } } } switch (c){ case UTF8_NOTENOUGHBYTES: fprintf(stderr,_("Truncated UTF-8 sequence encountered at byte %1$lu, character %2$lu.\n"), ByteCnt,CharCnt); exit(BADRECORD); break; case UTF8_BADINCODE: fprintf(stderr,_("Invalid UTF-8 code encountered at byte %1$lu, character %2$lu.\n"), ByteCnt,CharCnt); exit(BADRECORD); break; case UTF8_BADOUTCODE: fprintf(stderr,_("Encountered invalid Unicode at byte %1$lu, character %2$lu.\n"), ByteCnt,CharCnt); exit(BADRECORD); break; case UTF8_IOERROR: snprintf(msg,MSGSIZE-1,_ ("Error reading input at byte %1$lu, character %2$lu.\n"), ByteCnt,CharCnt); perror(msg); exit(IOERROR); break; default: /* Normal EOF */ break; } #ifdef NEWSUMMARY if(VerboseP) { fprintf(stderr,_("Total input characters %12ld\n"),CharCnt); fprintf(stderr,_("Characters converted to escapes %12ld\n"),ConvertedCnt); fprintf(stderr,_("Characters replaced with ASCII %12ld\n"),SubstitutedCnt); fprintf(stderr,_("Characters deleted %12ld\n"),DeletedCnt); } #else if(VerboseP) fprintf(stderr,_("%1$ld tokens converted out of %2$ld characters\n"),ConvertedCnt,CharCnt); #endif exit(SUCCESS); } uni2ascii-4.20/CREDITS0000644000175000017500000000243013755677100011300 00000000000000Bartosz Kuźma For patches enabling compilation under NetBSD after removal of builtin getline. Egmont Koblinger and John McGowan Pointed out bug in uni2ascii that caused a segfault if no command-line flag was given. Egmont Koblinger Suggested adding format. Suggested adding a means of specifying additional formats on the command line. Dan Jacobson Various suggestions for improvements and reports of bugs in the documentation and help messages. Several bug reports. Cedric Luthi Proposed and sent patch for additions to expansions of single characters. Jesse Peterson Patch adding conversions in version 4.4. Chung-Chieh Shan Reported bug in Get_UTF32_From_UTF8 that incorrectly treated an interrupted read in the midst of a UTF-8 sequence as a truncated sequence. Dylan Thurston Patched Get_UTF32_From_UTF8 to fix the bug reported by Chung-Chieh Shan. Huan Truong Reported problem with spurious breaks after very long lines in ascii2uni. Bruce Janson Reported bugs with lines ending in = and suggested adaptation to RFC2045 deletion of line-final equal-sign and the following newline. Stephen Markenka Suggested adding option of skipping ill-formed UTF-8 rather than aborting. uni2ascii-4.20/mkinstalldirs0000755000175000017500000000667214300546425013072 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2020-07-26.22; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the 'mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because '.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "umask 22" umask 22 echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac echo "umask 22" umask 22 for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp=$pathcomp/ done if test ! -z "$dirmode"; then echo "chmod $dirmode $file" chmod "$dirmode" "$file" || errstatus=$? fi done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: uni2ascii-4.20/Makefile.in0000644000175000017500000007645714300550032012326 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = uni2ascii$(EXEEXT) ascii2uni$(EXEEXT) @NEWSUMMARY_TRUE@am__append_1 = -DNEWSUMMARY @DEBUGBUILD_TRUE@am__append_2 = -DDEBUGBUILD subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(noinst_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_ascii2uni_OBJECTS = ascii2uni.$(OBJEXT) enttbl.$(OBJEXT) \ GetWord.$(OBJEXT) putu8.$(OBJEXT) SetFormat.$(OBJEXT) ascii2uni_OBJECTS = $(am_ascii2uni_OBJECTS) ascii2uni_LDADD = $(LDADD) am_uni2ascii_OBJECTS = endian.$(OBJEXT) enttbl.$(OBJEXT) \ SetFormat.$(OBJEXT) uni2ascii.$(OBJEXT) UTF8in.$(OBJEXT) \ putu8.$(OBJEXT) uni2ascii_OBJECTS = $(am_uni2ascii_OBJECTS) uni2ascii_LDADD = $(LDADD) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/GetWord.Po ./$(DEPDIR)/SetFormat.Po \ ./$(DEPDIR)/UTF8in.Po ./$(DEPDIR)/ascii2uni.Po \ ./$(DEPDIR)/endian.Po ./$(DEPDIR)/enttbl.Po \ ./$(DEPDIR)/putu8.Po ./$(DEPDIR)/uni2ascii.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(ascii2uni_SOURCES) $(uni2ascii_SOURCES) DIST_SOURCES = $(ascii2uni_SOURCES) $(uni2ascii_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` AM_RECURSIVE_TARGETS = cscope am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \ README TODO compile config.guess config.sub depcomp install-sh \ missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).zip GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip dist-zip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ bin_SCRIPTS = u2a dist_man_MANS = uni2ascii.1 ascii2uni.1 uni2ascii_SOURCES = endian.c enttbl.c SetFormat.c uni2ascii.c UTF8in.c putu8.c ascii2uni_SOURCES = ascii2uni.c enttbl.c GetWord.c putu8.c SetFormat.c noinst_HEADERS = u2a_endian.h enttbl.h exitcode.h formats.h unicode.h utf8error.h AM_CFLAGS = $(am__append_1) $(am__append_2) AUTOMAKE_OPTIONS = dist-zip dist-bzip2 EXTRA_DIST = TestSuiteAscii2Uni CREDITS uni2html.py ascii2uni.py u2a.tcl uni2ascii.info uni2ascii-${VERSION}.lsm all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) ascii2uni$(EXEEXT): $(ascii2uni_OBJECTS) $(ascii2uni_DEPENDENCIES) $(EXTRA_ascii2uni_DEPENDENCIES) @rm -f ascii2uni$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii2uni_OBJECTS) $(ascii2uni_LDADD) $(LIBS) uni2ascii$(EXEEXT): $(uni2ascii_OBJECTS) $(uni2ascii_DEPENDENCIES) $(EXTRA_uni2ascii_DEPENDENCIES) @rm -f uni2ascii$(EXEEXT) $(AM_V_CCLD)$(LINK) $(uni2ascii_OBJECTS) $(uni2ascii_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GetWord.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SetFormat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UTF8in.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii2uni.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endian.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enttbl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putu8.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uni2ascii.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f ./$(DEPDIR)/GetWord.Po -rm -f ./$(DEPDIR)/SetFormat.Po -rm -f ./$(DEPDIR)/UTF8in.Po -rm -f ./$(DEPDIR)/ascii2uni.Po -rm -f ./$(DEPDIR)/endian.Po -rm -f ./$(DEPDIR)/enttbl.Po -rm -f ./$(DEPDIR)/putu8.Po -rm -f ./$(DEPDIR)/uni2ascii.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f ./$(DEPDIR)/GetWord.Po -rm -f ./$(DEPDIR)/SetFormat.Po -rm -f ./$(DEPDIR)/UTF8in.Po -rm -f ./$(DEPDIR)/ascii2uni.Po -rm -f ./$(DEPDIR)/endian.Po -rm -f ./$(DEPDIR)/enttbl.Po -rm -f ./$(DEPDIR)/putu8.Po -rm -f ./$(DEPDIR)/uni2ascii.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-man uninstall-man: uninstall-man1 .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ check-am clean clean-binPROGRAMS clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ dist-zstd distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-man \ uninstall-man1 .PRECIOUS: Makefile u2a: u2a.tcl cp u2a.tcl u2a # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: uni2ascii-4.20/utf8error.h0000644000175000017500000000205613755677100012375 00000000000000/* * Codes for errors from UTF-8 input routines. * These values are all above the maximum valid UTF32 value. */ /* Normal end of file. Not really an error. */ #define UTF8_ENDOFFILE 0xA0000000 /* * An initial byte is not followed by the required number of bytes * Note that this code is returned only when the total number of following * bytes is insufficient, without regard to their type. If the total * number of following bytes is sufficient but the contiguous sequence * of continuation bytes is not long enough, the error UTF8_BADINCODE * is returned. */ #define UTF8_NOTENOUGHBYTES 0xA0000001 /* * The byte sequence is ill-formed. For example, the first byte might be a continuation * byte, or the sequence of continuation bytes following a valid first byte might * not be long enough. */ #define UTF8_BADINCODE 0xA0000002 /* Decoding was successful but the resulting value is not a legal Unicode codepoint */ #define UTF8_BADOUTCODE 0xA0000003 /* An i/o error occured while attempting to read the input */ #define UTF8_IOERROR 0xA0000004 uni2ascii-4.20/INSTALL0000644000175000017500000003662614300546425011317 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same timestamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. uni2ascii-4.20/ascii2uni.c0000644000175000017500000004620613755677100012323 00000000000000/* Time-stamp: <2019-06-28 07:33:47 poser> * * Convert text containing various 7-bit ASCII escapes to UTF-8 Unicode. * * Copyright (C) 2005-2019 William J. Poser (billposer@alum.mit.edu) * * This program is free software; you can redistribute it and/or modify * it under the terms of version 3 of the GNU General Public License * as published by the Free Software Foundation. * * 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 * Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * or go to the web page: http://www.gnu.org/licenses/gpl.txt. */ #include "config.h" #include #include #include #include #include #ifdef HAVE_LOCALE_H #include #endif #ifdef HAVE_LIBINTL_H #include #define _(String) gettext(String) #else #define _(x) (x) #endif #include "unicode.h" #include "enttbl.h" #include "exitcode.h" #include "formats.h" #if defined(__DATE__) && defined(__TIME__) #define HAVE_DATE_TIME char compdate[]= __DATE__ " " __TIME__ ; #else char compdate[]= ""; #endif char version[]=PACKAGE_VERSION; char pgname[]="ascii2uni"; #define LBUFINIT 128 #ifndef LOCALEDIR #define LOCALEDIR "/usr/local/share/locale" #endif #include #ifdef HAVE_GNU_LIBC_VERSION_H #include #endif void ShowVersion(FILE *fp) { extern char version[]; char *vp; char vnum[11+1]; struct utsname utsbuf; fprintf(fp,"%s %s\n",pgname,version); #ifdef HAVE_GNU_LIBC_VERSION_H fprintf(fp,_(" glibc %s\n"),gnu_get_libc_version()); #endif if (uname(&utsbuf) >= 0) { fprintf(fp,_("Compiled %s on %s\nunder %s %s %s\n"), compdate, utsbuf.machine, utsbuf.sysname, utsbuf.release, utsbuf.version); } else fprintf(fp,_("Compiled %s\n"),compdate); } void Copyright() { fprintf(stderr,"Copyright (C) 2004-2019 William J. Poser\n"); fprintf(stderr,"This program is free software; you can redistribute\n\ it and/or modify it under the terms of version 3 of\n\ the GNU General Public License as published by the\n\ Free Software Foundation.\n"); fprintf(stderr,"Report bugs to: billposer@alum.mit.edu.\n"); } void ShowUsage(void){ fprintf(stderr,_("This program is a filter which converts 7-bit ASCII text\n\ containing various representations for non-ASCII characters\nto UTF-8 Unicode.\n")); fprintf(stderr,_("Usage: %s [flags] ()\n"),pgname); fprintf(stderr,_(" -a .\n")); fprintf(stderr,_(" -h Print this usage message.\n")); fprintf(stderr,_(" -L List format codes.\n")); fprintf(stderr,_(" -m Accept Microsoft-style HTML entities w/o semi-colon.\n")); fprintf(stderr,_(" -p Input consists of pure escapes except for non-null whitespace.\n")); fprintf(stderr,_(" -q Quiet - don't chat.\n")); fprintf(stderr,_(" -v Print version information.\n")); fprintf(stderr, _(" -Z Convert input using the supplied format.\n")); fprintf(stderr,_("Report bugs to: billposer@alum.mit.edu\n")); } char * ExtractSubstring(char *strptr, char* Start, char* End) { char *i; char *SavedBeginning; SavedBeginning = strptr; for (i = Start; i <= End; i++) *strptr++ = *i; *strptr = '\0'; return SavedBeginning; } /* The length of the longest character entity */ #define MAXENTLEN 8 /* The library function seems not to be working. Anyhow, we want to keep this * independent of locale. */ int myisxdigit (int c) { switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': return 1; default: return 0; } } static char *Formats [] = { "&#x%lX;", /* HTMLX */ "&#%ld;", /* HTMLD */ "\\#x%lX;", /* SGMLX */ "\\#%ld;", /* SGMLD */ "\\u%8lX", /* BSLU */ "\\x%lX", /* BSLX */ "0x%4lX", /* STDX */ "#x%4lX", /* CLSX */ "%lX", /* RAWX */ "\\x{%lX}", /* BSLXB */ "", /* ABUX */ "U%lX", /* JUUX */ "u%lX", /* JuUX */ "U+%lX", /* UPLX */ "X\'%lX\'", /* XQ */ "\\u%8ld", /* BSLUD */ "v%ld", /* PERLV */ "$%04X", /* DOLLAR */ "16#%04X", /* PSPT */ "#16r%04X", /* CLR */ "16#%04X#", /* ADA */ "X;", /* HDML */ "\\%03o\\%03o\\%03o", /* BYTEO */ "\\d%03d\\d%03d\\d%03d", /* BYTED */ "\\x%02x\\x%02x\\x%02x", /* BYTEX */ "_x%4lX_", /* OOXML */ "%%u%lX", /* PCTUX */ "&%[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789];", /* CHENT */ "=%2lX", /* UTF-8 - Ifmt */ "%%%2lX", /* UTF-8 - Jfmt */ "\\%3lo", /* UTF-8 - Kfmt */ "\\x%2lX", /* UTF-8 - APACHE */ "<%2lX>" /* UTF-8 - UTF8ANGLE */ }; #define AFMTSIZE (67+2+1+2) int main (int ac, char *av[]) { char *SplitLowFormat = "\\u%4X%n"; char *SplitHighFormat = "\\U%8X%n"; char *fmt = Formats[STDX]; /* Default is plain hex format */ char afmt [AFMTSIZE]; char aHfmt [8+2+1]; char aDfmt [8+2+1]; char cbuf[5]; FILE *infp; UTF32 num; int oc; /* Command line option flag */ int Converted; long TokenNumber = 0L; long ReplacedNumber = 0L; short BMPSplitP = 0; int VerboseP = 1; int UTF8ValueP = 0; /* Are incoming values UTF-8? */ short AllHTMLP = 0; /* Translate all three kinds of HTML escape */ int PureP = 0; int StrictP = 1; /* Do not convert Microsoft-style numeric character references */ long MicrosoftStyle = 0L; /* Number of Microsoft-style ncrs detected */ int Word_Length; int NConsumed; unsigned long LineNo; char *str; char *iptr; int eof; char enam[16]; char tmpstr [16]; unsigned char b1; /* Used for byte-wise encoding */ unsigned char b2; unsigned char b3; int FType = STDX; int UTF8Type; /* Not used - for compatibility with uni2ascii */ short UseEntitiesP; /* Not used - for compatibility with uni2ascii */ int last; size_t len = LBUFINIT; ssize_t read; short AddNewlineP=1; /* Used with quoted-printable end-of-line =-sign */ char *lbuf = NULL; extern int optind; extern int opterr; extern int optopt; extern unsigned long GetWordLineNo; extern void putu8 (unsigned long); extern char * Get_Word(FILE *, int *, int *); extern int CountSlots(char *); extern void ListFormatArguments(short); extern void SetFormat(char *, int *, short *,int *, short *, short *); #ifdef DEBUGBUILD fprintf(stderr,"Execution has begun.\n");fflush(stderr); #endif opterr = 0; #ifdef HAVE_SETLOCALE setlocale(LC_ALL,""); #endif #ifdef HAVE_LIBINTL_H bindtextdomain (PACKAGE,LOCALEDIR); textdomain (PACKAGE); #endif /* Handle command line arguments */ while( (oc = getopt(ac,av,":Z:a:hLmpqv")) != EOF){ switch(oc){ case 'a': SetFormat(optarg,&FType,&UseEntitiesP, &UTF8Type, &BMPSplitP,&AllHTMLP); if(FType == FMT_UNKNOWN) { fprintf(stderr,"Format specification %s not recognized.\n",optarg); exit(BADOPTIONARG); } fmt = Formats[FType]; if( (FType == IFMT) || (FType == JFMT) || (FType == KFMT) || (FType == APACHE) || (FType == UTF8ANGLE)) UTF8ValueP =1; if( (FType == JFMT) || (FType == UTF8ANGLE)) {cbuf[0] = '0'; cbuf[1] = 'x';} if(FType == KFMT) {cbuf[0] = '\\';} if(FType == APACHE) {cbuf[0] = '0';} break; case 'L': ListFormatArguments(0); exit(INFO); case 'Z': fmt = optarg; if(CountSlots(fmt) > 1) { fprintf(stderr,_("You may not supply a format with more than one empty slot.\n")); exit(BADOPTIONARG); } break; case 'm': StrictP = 0; break; case 'p': PureP = 1; break; case 'q': VerboseP = 0; break; case 'h': ShowUsage(); exit(INFO); break; /* NOTREACHED */ case 'v': ShowVersion(stderr); Copyright(); exit(INFO); break; /* NOTREACHED */ case ':': fprintf(stderr,_("%s: missing argument to option flag %c.\n"),pgname,optopt); exit(BADOPTIONARG); default: fprintf(stderr,_("%1$s: invalid option flag %2$c\n"),pgname,optopt); ShowVersion(stderr); Copyright(); ShowUsage(); exit(INFO); } } if(optind < ac) { infp = fopen(av[optind],"r"); if (infp == NULL) { fprintf(stderr,"unable to open input file %s\n",av[optind]); exit(OPENERROR); } } else infp = stdin; #ifdef DEBUGBUILD fprintf(stderr,"Command-line arguments processed.\n");fflush(stderr); #endif if( (FType == RAWX) && (!PureP) ) { fprintf(stderr,_("It isn't possible reliably to parse raw hex unicode out of impure ASCII text.\nIf your input text is pure, add the -p flag.\n")); exit(BADOPTION); } if(AllHTMLP && PureP) { fprintf(stderr,_("Conversion of all three HTML formats is not supported in pure mode.\n")); exit(BADOPTION); } #ifdef DEBUGBUILD fprintf(stderr,"Sanity checks completed.\n");fflush(stderr); #endif if(AllHTMLP) { sprintf(aDfmt,"%s%%n",Formats[HTMLD]); sprintf(aHfmt,"%s%%n",Formats[HTMLX]); } #ifdef DEBUGBUILD fprintf(stderr,"fmt = %s\n",fmt);fflush(stderr); /* debug */ #endif snprintf(afmt,AFMTSIZE,"%s%%n",fmt); /* Add %n for NConsumed */ #ifdef DEBUGBUILD fprintf(stderr,"Setup completed.\n");fflush(stderr); /* debug */ #endif /* * This is the case in which the input consists entirely of escapes * except for arbitrary (but non-null) amounts of intervening whitespace. */ if(PureP) { GetWordLineNo = 1; while(1){ str = Get_Word(infp,&Word_Length,&eof); if(eof) break; if(Word_Length == 0) continue; TokenNumber++; if(str == NULL){ fprintf(stderr,_("%1$s: failed to allocate storage for input token %2$ld at line %3$lu.\n"), pgname,TokenNumber,GetWordLineNo); exit(OUTOFMEMORY); } if(FType == CHENT) { Converted = sscanf(str,afmt,&enam,&NConsumed); num = LookupCodeForEntity(enam); if(!num) { num = UNI_REPLACEMENT_CHAR; fprintf(stderr,"ascii2uni: unknown HTML character entity \"&%s;\" at line %lu\n", enam,GetWordLineNo); ReplacedNumber++; Converted = (-1); } else Converted = 1; } else if( (BYTEO == FType) || (BYTED == FType) || (BYTEH == FType) || (UTF8ANGLE == FType)) { Converted = sscanf(str,afmt,&b1,&b2,&b3,&NConsumed); switch(Converted) { case 3: num = (((b1 * 256) + b2) * 256) + b3; break; case 2: num = (b1 * 256) + b2; break; case 1: num = b1; break; default: break; /* This case is handled below */ } } else { Converted = sscanf(str,afmt,&num,&NConsumed); } if(Converted < 1) { fprintf(stderr,_("Ill-formed input %1$s at token %2$lu at line %3$lu\n"), str,TokenNumber,GetWordLineNo); exit(BADRECORD); } else if(Converted > 3) { fprintf(stderr,_("The character encoded as %1$s at token %2$lu at line %3$lu is outside the Unicode range.\n\tEmitting Unicode replacement character.\n"), str,TokenNumber,GetWordLineNo); putu8(UNI_REPLACEMENT_CHAR); } else { if( (FType == HTMLD) || (FType == HTMLX) || (FType == CHENT) || (FType == HDML)) { if(*(str+NConsumed-1) != ';') { MicrosoftStyle++; fprintf(stderr,_("The HTML/HDML entity %1$s at token %2$lu at line %3$lu lacks the requisite final semicolon.\n"), str,TokenNumber,GetWordLineNo); if(StrictP) { fputs(str,stdout); TokenNumber--; } else { if (UTF8ValueP) putchar(num); else putu8(num); } free((void *)str); continue; } } if (UTF8ValueP) putchar(num); else putu8(num); } free((void *)str); } goto done; } /* End of PureP */ /* This is the case in which the Unicode escapes are embedded in ASCII text */ LineNo = 0; #if defined(HAVE_GETLINE) lbuf= (char *) malloc(len); if(lbuf == NULL) { fprintf(stderr,"Failed to allocate buffer for input line.\n"); exit(2); } while ((read = getline(&lbuf, &len, infp)) != -1) { #elif defined(HAVE_FGETLN) while (NULL != (lbuf = fgetln(infp, &read))) { #else # error DIE! #endif AddNewlineP = 1; LineNo++; last = read - 1; if(lbuf[last] == '\n') { lbuf[last] = '\0'; last--; } if(last < 0) { putchar('\n'); continue; } if (FType == IFMT) { /* Quoted-printable */ if (lbuf[last] == '=') { lbuf[last] = '\0'; AddNewlineP = 0; } } iptr = lbuf; if(FType == JFMT) { while(*iptr) { if(*iptr == '%') { if(*++iptr) { if(myisxdigit(*iptr)) { if(*++iptr) { if(myisxdigit(*iptr)) { /* match */ cbuf[2] = *(iptr-1); cbuf[3] = *iptr; cbuf[4] = '\0'; num = (unsigned char)strtoul(cbuf,NULL,16); putchar(num); TokenNumber++; iptr++; } else { /* We have % X foo */ putchar('%'); putchar(*(iptr-1)); if(*iptr != '%') putchar(*iptr++); continue; } } else { /* We have % X EOL */ putchar('%'); putchar(*(iptr-1)); putchar('\n'); break; } } else { /* We have % foo */ putchar('%'); if(*iptr != '%') putchar(*iptr++); continue; } } else { /* We have % EOL */ putchar('%'); putchar('\n'); break; } } else { putchar(*iptr++); continue; } } } /* End of special case for J format */ while (*iptr) { if(BMPSplitP) { /* Check for 4 digit case, then 8 digit case */ if(sscanf(iptr,SplitLowFormat,&num,&NConsumed)) { if (NConsumed == 6) { /* 4 hex digits */ putu8(num); iptr+=NConsumed; TokenNumber++; } else putchar(*iptr++); } else if(sscanf(iptr,SplitHighFormat,&num,&NConsumed)) { if (NConsumed == 10) { /* 8 hex digits */ putu8(num); iptr+=NConsumed; TokenNumber++; if (num < 0x10000) { fprintf(stderr,"ascii2uni: warning - \\U escape encodes character within BMP at line %lu\n", LineNo); } } else putchar(*iptr++); } else putchar(*iptr++); } else if (FType == CHENT) { if (AllHTMLP){ if(sscanf(iptr,aHfmt,&num,&NConsumed) > 0) { if(*(iptr+NConsumed-1) != ';') { MicrosoftStyle++; fprintf(stderr, _("The HTML/HDML entity %1$s at token %2$lu of line %3$lu lacks the requisite final semicolon.\n"), ExtractSubstring(tmpstr,iptr,iptr+NConsumed-3),TokenNumber,LineNo); if(StrictP) {putchar(*iptr++); continue;} else {putu8(num);iptr+=NConsumed;} } else {putu8(num);iptr+=NConsumed;} TokenNumber++; continue; } if(sscanf(iptr,aDfmt,&num,&NConsumed) > 0) { if(*(iptr+NConsumed-1) != ';') { MicrosoftStyle++; fprintf(stderr, _("The HTML/HDML entity %1$s at token %2$lu of line %3$lu lacks the requisite final semicolon.\n"), ExtractSubstring(tmpstr,iptr,iptr+NConsumed-3),TokenNumber,LineNo); if (StrictP) {putchar(*iptr++); continue;} else {putu8(num);iptr+=NConsumed;} } else {putu8(num);iptr+=NConsumed;} TokenNumber++; continue; } } if(sscanf(iptr,afmt,&enam,&NConsumed) > 0) { if( (num = LookupCodeForEntity(enam))) { if(*(iptr+NConsumed-1) != ';') { MicrosoftStyle++; fprintf(stderr,_("The HTML/HDML entity %1$s at token %2$lu of line %3$lu lacks the requisite final semicolon.\n"),ExtractSubstring(tmpstr,iptr,iptr+NConsumed-3),TokenNumber,LineNo); if(StrictP) {putchar(*iptr++);continue;} else {putu8(num);iptr+=NConsumed;} } else {putu8(num);iptr+=NConsumed;} TokenNumber++; } else { /* BUG - here is where jidanni is getting a segfault - I get infinitely many error messages instead. The error only occurs if the pseudo-entity has no terminating semi-colon */ fprintf(stderr,"ascii2uni: unknown HTML/HDML character entity \"&%s;\" at line %lu\n", enam,LineNo); putu8(UNI_REPLACEMENT_CHAR); iptr+=NConsumed; ReplacedNumber++; } } else putchar(*iptr++); } /* End of Qfmt case */ else if( (BYTEO == FType) || (BYTED == FType) || (BYTEH == FType) ) { Converted=sscanf(iptr,afmt,&b1,&b2,&b3,&NConsumed); /* fprintf(stderr,"Converted = %d\n",Converted);fflush(stderr); */ switch(Converted) { case 3: num = (((b1 * 256) + b2) * 256) + b3; putu8(num);iptr+=NConsumed; break; case 2: num = (b1 * 256) + b2; putu8(num);iptr+=NConsumed; break; case 1: num = b1; putu8(num);iptr+=NConsumed; break; case 0: putchar(*iptr++); break; default: fprintf(stderr, _("The character encoded as %1$s at token %2$lu of line %3$lu is outside the Unicode range.\n\tEmitting Unicode replacement character.\n"), str,TokenNumber,LineNo); putu8(UNI_REPLACEMENT_CHAR); } /* end switch */ TokenNumber++; } else if (HDML == FType) { /* HDML character references */ /* Need to fill this in */ } else { /* Default - not BMPSplitP, Q, or byte format */ if((last = sscanf(iptr,afmt,&num,&NConsumed)) > 0) { if(FType== HTMLX) { if(*(iptr-1+NConsumed) != ';') { MicrosoftStyle++; fprintf(stderr, "The HTML entity %1$s at token %2$lu of line %3$lu lacks the requisite final semicolon.\n", ExtractSubstring(tmpstr,iptr,iptr+NConsumed-3),TokenNumber,LineNo); if(StrictP) { putchar(*iptr++); continue; } } } else if(FType == HTMLD) { if(*(iptr-1+NConsumed) != ';') { MicrosoftStyle++; fprintf(stderr, _("The HTML entity %1$s at token %2$lu of line %3$lu lacks the requisite final semicolon.\n"), ExtractSubstring(tmpstr,iptr,iptr+NConsumed-3),TokenNumber,LineNo); if(StrictP) { putchar(*iptr++); continue; } } } if (UTF8ValueP) putchar(num); else putu8(num); iptr+=NConsumed; TokenNumber++; } /* End of if(sscanf */ else putchar(*iptr++); } } /* Loop over current line */ if(AddNewlineP) putchar('\n'); } /* Loop over input lines */ #if defined(HAVE_READLINE) if(lbuf) free(lbuf); #endif done: if(VerboseP) { if (TokenNumber == 1) fprintf(stderr,_("%ld token converted\n"),TokenNumber); else fprintf(stderr,_("%ld tokens converted\n"),TokenNumber); if (ReplacedNumber) { if (ReplacedNumber == 1) fprintf(stderr, _("%ld token replaced with Unicode Replacement Character\n"),ReplacedNumber); else fprintf(stderr,_("%ld tokens replaced with Unicode Replacement Character\n"),ReplacedNumber); } if(MicrosoftStyle) { if(StrictP) { fprintf(stderr, _("%ld Microsoft-style (lacking final semi-colon) not converted\n"),MicrosoftStyle); } else { fprintf(stderr, _("%ld Microsoft-style (lacking final semi-colon) among those converted\n"),MicrosoftStyle); } } } exit(SUCCESS); } uni2ascii-4.20/uni2ascii.10000644000175000017500000003453313755677100012241 00000000000000.TH uni2ascii 1 "August, 2013" .SH NAME uni2ascii \- convert UTF-8 Unicode to various 7-bit ASCII representations .SH SYNOPSIS .B uni2ascii [options] () .SH DESCRIPTION .I uni2ascii converts UTF-8 Unicode to various 7-bit ASCII representations. If no format is specified, standard hexadecimal format (e.g. 0x00e9) is used. It reads from the standard input and writes to the standard output. .PP Command line options are: .sp 1 .TP .B \-A List the single character approximations carried out by the \-y flag. .TP .B \-a Convert to the specified format. Formats may be specified by means of the following arbitrary single character codes, by means of names such as "SGML_decimal", and by examples of the desired format. .IP .B A Generate hexadecimal numbers with prefix U in angle-brackets (). .IP .B B Generate \\x-escaped hex (e.g. \\x00E9) .IP .B C Generate \\x escaped hexadecimal numbers in braces (e.g. \\x{00E9}). .IP .B D Generate decimal HTML numeric character references (e.g. é) .IP .B E Generate hexadecimal with prefix U (U00E9). .IP .B F Generate hexadecimal with prefix u (u00E9). .IP .B G Convert hexadecimal in single quotes with prefix X (e.g. X'00E9'). .IP .B H Generate hexadecimal HTML numeric character references (e.g. é) .IP .B I Generate hexadecimal UTF-8 with each byte's hex preceded by an =-sign (e.g. =C3=A9) . This is the Quoted Printable format defined by RFC 2045. .IP .B J Generate hexadecimal UTF-8 with each byte's hex preceded by a %-sign (e.g. %C3%A9). This is the URI escape format defined by RFC 2396. .IP .B K Generate octal UTF-8 with each byte escaped by a backslash (e.g. \\303\\251) .IP .B L Generate \\U-escaped hex outside the BMP, \\u-escaped hex within the BMP (U+0000-U+FFFF). .IP .B M Generate hexadecimal SGML numeric character references (e.g. \\#xE9;) .IP .B N Generate decimal SGML numeric character references (e.g. \\#233;) .IP .B O Generate octal escapes for the three low bytes in big-endian order(e.g. \\000\\000\\351)) .IP .B P Generate hexadecimal numbers with prefix U+ (e.g. U+00E9) .IP .B Q Generate character entities (e.g. é) where possible, otherwise hexadecimal numeric character references. .IP .B R Generate raw hexadecimal numbers (e.g. 00E9) .IP .B S Generate hexadecimal escapes for the three low bytes in big-endian order (e.g. \\x00\\x00\\xE9) .IP .B T Generate decimal escapes for the three low bytes in big-endian order (e.g. \\d000\\d000\\d233) .IP .B U Generate \\u-escaped hexadecimal numbers (e.g. \\u00E9). .IP .B V Generate \\u-escaped decimal numbers (e.g. \\u00233). .IP .B X Generate standard hexadecimal numbers (e.g. 0x00E9). .IP .B 0 Generate hexadecimal UTF-8 with each byte's hex enclosed within angle brackets (e.g. ). .IP .B 1 Generate Common Lisp format hexadecimal numbers (e.g. #x00E9). .IP .B 2 Generate Perl format decimal numbers with prefix v (e.g. v233). .IP .B 3 Generate hexadecimal numbers with prefix $ (e.g. $00E9). .IP .B 4 Generate Postscript format hexadecimal numbers with prefix 16# (e.g. 16#00E9). .IP .B 5 Generate Common Lisp format hexadecimal numbers with prefix #16r (e.g. #16r00E9). .IP .B 6 Generate ADA format hexadecimal numbers with prefix 16# and suffix # (e.g. 16#00E9#). .IP .B 7 Generate Apache log format hexadecimal UTF-8 with each byte's hex preceded by a backslash-x (e.g. \\xC3\\xA9). .IP .B 8 Generate Microsoft OOXML format hexadecimal numbers with prefix _x and suffix _ (e.g. _x00E9_). .IP .B 9 Generate %\\u-escaped hexadecimal numbers (e.g. %\\u00E9). .TP .B \-B Transform to ASCII if possible. This option is equivalent to the combination cdefx. .TP .B \-c Convert circled and parenthesized characters to their unenclosed counterparts. .TP .B \-d Strip diacritics. This converts single codepoints representing characters with diacritics to the corresponding ASCII character and deletes separately encoded diacritics. .TP .B \-e Convert characters to their approximate ASCII equivalents, as follows: .br U+0085 next line 0x0A newline .br U+00A0 no break space 0x20 space .br U+00AB left-pointing double angle quotation mark 0x22 double quote .br U+00AD soft hyphen 0x2D minus .br U+00AF macron 0x2D minus .br U+00B7 middle dot 0x2E period .br U+00BB right-pointing double angle quotation mark 0x22 double quote .br U+1361 ethiopic word space 0x20 space .br U+1680 ogham space 0x20 space .br U+2000 en quad 0x20 space .br U+2001 em quad 0x20 space .br U+2002 en space 0x20 space .br U+2003 em space 0x20 space .br U+2004 three-per-em space 0x20 space .br U+2005 four-per-em space 0x20 space .br U+2006 six-per-em space 0x20 space .br U+2007 figure space 0x20 space .br U+2008 punctuation space 0x20 space .br U+2009 thin space 0x20 space .br U+200A hair space 0x20 space .br U+200B zero-width space 0x20 space .br U+2010 hyphen 0x2D minus .br U+2011 non-breaking hyphen 0x2D minus .br U+2012 figure dash 0x2D minus .br U+2013 en dash 0x2D minus .br U+2014 em dash 0x2D minus .br U+2018 left single quotation mark 0x60 left single quote .br U+2019 right single quotation mark 0x27 right or neutral single quote .br U+201A single low-9 quotation mark 0x60 left single quote .br U+201B single high-reversed-9 quotation mark 0x60 left single quote .br U+201C left double quotation mark 0x22 double quote .br U+201D right double quotation mark 0x22 double quote .br U+201E double low-9 quotation mark 0x22 double quote .br U+201F double high-reversed-9 quotation mark 0x22 double quote .br U+2022 bullet 0x6F small letter o .br U+2028 line separator 0x0A newline .br U+2032 prime 0x27 right or neutral single quote .br U+2033 double prime 0x22 double quote .br U+2039 single left-pointing angle quotation mark 0x60 left single quote .br U+203A single right-pointing angle quotation mark 0x27 right or neutral single quote .br U+204E low asterisk 0x2A asterisk .br U+2212 minus sign 0x2D minus .br U+2216 set minus 0x5C backslash .br U+2217 asterisk operator 0x2A asterisk .br U+2223 divides 0x7C vertical line .br U+2500 box drawing light horizontal 0x2D minus .br U+2501 box drawing heavy horizontal 0x2D minus .br U+2502 box drawing light vertical 0x7C vertical line .br U+2503 box drawing heavy vertical 0x7C vertical line .br U+2731 heavy asterisk 0x2A asterisk .br U+275D heavy double turned comma quotation mark 0x22 double quote .br U+275E heavy double comma quotation mark 0x22 double quote .br U+3000 ideographic space 0x20 space .br U+FE60 small ampersand 0x26 ampersand .br U+FE61 small asterisk 0x2A asterisk .br U+FE62 small plus sign 0x2B plus sign .TP .B \-E List the expansions performed by the \-x flag. .TP .B \-f Convert stylistic variants to plain ASCII. Stylistic equivalents include: superscript and subscript forms, small capitals (e.g. U+1D04), script forms (e.g. U+212C), black letter forms (e.g. U+212D), fullwidth forms (e.g. U+FF01), halfwidth forms (e.g. U+FF7B), and the mathematical alphanumeric symbols (e.g. U+1D400). .TP .B \-h Help. Print the usage message and exit. .TP .B \-l Use lowercase a-f when generating hexadecimal numbers. .TP .B \-n Convert newlines too. By default, they are left alone. .TP .B \-P Pass through Unicode rather than converting to ASCII escapes if the character is not converted to an ASCII character by a transformation such as diacritic stripping. Note that if this option is used the output may not be pure ASCII. .TP .B \-p Pure. Convert characters within the ASCII range except for space and newline as well as those above. .TP .B \-q Quiet. Do not chat unnecessarily while working. .TP .B \-s Convert space characters too. By default, they are left alone. .TP .B \-S Define a custom substitution. The argument should consist of the Unicode codepoint to be replaced followed by the ASCII code of the character to be used as replacement, separated by a colon. If no ASCII code follows the colon, the specified Unicode character will be deleted. The code values may be in hexadecimal, octal, or decimal following the usual conventions (to be precise,those of strtoul(3)). This option may be repeated as many times as desired to define multiple substitutions. .TP .B \-v Print program version information and exit. .TP .B \-w Add a space after each converted item. .TP .B \-x Expand certain characters to multicharacter sequences. The characters affected are the same as those affected by the \-y option. .br U+00A2 CENT SIGN -> cent .br U+00A3 POUND SIGN -> pound .br U+00A5 YEN SIGN -> yen .br U+00A9 COPYRIGHT SYMBOL -> (c) .br U+00AE REGISTERED SYMBOL -> (R) .br U+00BC ONE QUARTER -> 1/4 .br U+00BD ONE HALF -> 1/2 .br U+00BE THREE QUARTERS -> 3/4 .br U+00C6 CAPITAL LETTER ASH -> AE .br U+00DF SMALL LETTER SHARP S -> ss .br U+00E6 SMALL LETTER ASH -> ae .br U+0132 LIGATURE IJ -> IJ .br U+0133 LIGATURE ij -> ij .br U+0152 LIGATURE OE -> OE .br U+0153 LIGATURE oe -> oe .br U+01F1 CAPITAL LETTER DZ -> DZ .br U+01F2 MIXED LETTER Dz -> Dz .br U+01F3 SMALL LETTER DZ -> dz .br U+02A6 SMALL LETTER TS DIGRAPH -> ts .br U+2026 HORIZONTAL ELLIPSIS -> ... .br U+20AC EURO SIGN -> euro .br U+2122 TRADEMARK SIGN -> (tm) br U+22EF MIDLINE HORIZONTAL ELLIPSIS -> ... .br U+2190 LEFTWARDS ARROW -> <- .br U+2192 RIGHTWARDS ARROW -> -> .br U+21D0 LEFTWARDS DOUBLE ARROW -> <= .br U+21D2 RIGHTWARDS DOUBLE ARROW -> => .br U+FB00 LATIN SMALL LIGATURE FF -> ff .br U+FB01 LATIN SMALL LIGATURE FI -> fi .br U+FB02 LATIN SMALL LIGATURE FL -> fl .br U+FB03 LATIN SMALL LIGATURE FFI -> ffi .br U+FB04 LATIN SMALL LIGATURE FFL -> ffl .br U+FB06 LATIN SMALL LIGATURE ST -> st .TP .B \-y Convert certain characters having multi-character expansions to single-character ascii approximations instead (e.g. to maintain character-positioning). The characters affected are the same as those affected by the \-x option. .br U+00A2 CENT SIGN -> c .br U+00A3 POUND SIGN -> # .br U+00A5 YEN SIGN -> Y .br U+00A9 COPYRIGHT SYMBOL -> C .br U+00AE REGISTERED SYMBOL -> R .br U+00BC ONE QUARTER -> - .br U+00BD ONE HALF -> - .br U+00BE THREE QUARTERS -> - .br U+00C6 CAPITAL LETTER ASH -> A .br U+00DF SMALL LETTER SHARP S -> s .br U+00E6 SMALL LETTER ASH -> a .br U+0132 LIGATURE IJ -> I .br U+0133 LIGATURE ij -> i .br U+0152 LIGATURE OE -> O .br U+0153 LIGATURE oe -> o .br U+01F1 CAPITAL LETTER DZ -> D .br U+01F2 MIXED LETTER Dz -> D .br U+01F3 SMALL LETTER DZ -> d .br U+02A6 SMALL LETTER TS DIGRAPH -> t .br U+2026 HORIZONTAL ELLIPSIS -> . .br U+20AC EURO SIGN -> E .br U+22EF MIDLINE HORIZONTAL ELLIPSIS -> . .br U+2190 LEFTWARDS ARROW -> < .br U+2192 RIGHTWARDS ARROW -> > .br U+21D0 LEFTWARDS DOUBLE ARROW -> < .br U+21D2 RIGHTWARDS DOUBLE ARROW -> > .TP .B \-Z Generate output using the supplied format. The format specified will be used as the format string in a call to printf(3) with a single argument consisting of an unsigned long integer. For example, to obtain the same output as with the \-U flag, the format would be: \\u%04X. .PP If conversion of spaces is disabled (as it is by default), if space characters outside the ASCII range are encountered (U+3000 ideographic space, U+1351 Ethiopic word space, and U+1680 ogham space mark), they are replaced with the ASCII space character (0x20) so as to keep the output pure 7-bit ASCII. .PP Note that XML and XHTML numeric character entities are like those of HTML with two restrictions. First, in X(HT)ML the terminating semi-colon may not be omitted. Second, in X(HT)ML the "x" must be lower-case, while in HTML it may be either upper- or lower-case. We always generate the terminating semi-colon and use a lower-case "x", so the option dubbed "HTML" produces valid XML and XHTML as well. .SH "EXIT STATUS" .PP The following values are returned on exit: .IP "0 SUCCESS" The input was successfully converted. .IP "2 I/O ERROR" A system error ocurred during input or output. .IP "3 INFO" The user requested information such as the version number or usage synopsis and this has been provided. .IP "5 BAD OPTION" An incorrect option flag was given on the command line. .IP "8 BAD RECORD" Ill-formed UTF-8 was detected in the input. .SH "SEE ALSO" ascii2uni(1), Text::Unidecode .sp 1 .SH AUTHOR Bill Poser .SH LICENSE GNU General Public License uni2ascii-4.20/endian.c0000644000175000017500000000276313755677100011673 00000000000000/* * Time-stamp: <2010-08-29 20:55:45 poser> * * Copyright (C) 2003 William J. Poser. * This program is free software; you can redistribute it and/or modify * it under the terms of version 3 of the GNU General Public License as published by * the Free Software Foundation. * * 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * or go to the web page: http://www.gnu.org/licenses/gpl.txt. */ #include "u2a_endian.h" /* Returns a value indicating the endianness of the machine */ short Get_Endianness() { unsigned int qp = 0x0f0d0501; /* By definition, msb = 0f, lsb = 01 */ char *bp; bp = (char *) &qp; /* bp now points at first byte of 4 byte sequence */ if((bp[0] == 0x01) && /* 1234 pattern */ (bp[1] == 0x05) && (bp[2] == 0x0d) && (bp[3] == 0x0f)) return(E_LITTLE_ENDIAN); if((bp[3] == 0x01) && /* 4321 pattern */ (bp[2] == 0x05) && (bp[1] == 0x0d) && (bp[0] == 0x0f)) return(E_BIG_ENDIAN); if((bp[2] == 0x01) && /* 3412 pattern */ (bp[3] == 0x05) && (bp[0] == 0x0d) && (bp[1] == 0x0f)) return(E_PDP_ENDIAN); return(E_UNKNOWN_ENDIAN); } uni2ascii-4.20/config.h.in0000644000175000017500000000636714300547601012305 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fgetln' function. */ #undef HAVE_FGETLN /* Define to 1 if you have the `getline' function. */ #undef HAVE_GETLINE /* Define to 1 if you have the `gettext' function. */ #undef HAVE_GETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_GNU_LIBC_VERSION_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have libintl. */ #undef HAVE_LIBINTL /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `regcomp' function. */ #undef HAVE_REGCOMP /* Define to 1 if you have the header file. */ #undef HAVE_REGEX_H /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t uni2ascii-4.20/missing0000755000175000017500000001533614300546425011660 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: uni2ascii-4.20/ChangeLog0000644000175000017500000004057114300544632012030 000000000000002022-08-21 Bill Poser * uni2ascii.c: Fixed bug in which in certain formats input from stdin worked input directly from a file caused a hang. 2013-08-18 Bill Poser * uni2ascii.c (ExpandToAscii): Added expansion of trademark sign U+2122 -> (tm) 2011-08-24 Bill Poser * ascii2uni.c (main): Fixed bug in handling of L (WWW) format. \uXXXX is now handled correctly even if immediately followed by a possible hex digit. \U followed by fewer than 8 hex digits is not treated as an escape. A warning is issued if the \U format encodes a character within the BMP. 2011-07-01 Bill Poser * uni2ascii.c (ShowUsage): Added -A flag to usage message. 2011-06-30 Bill Poser * uni2ascii.c (AscifyEquiv): Added conversion of U+2032 prime to single quote. 2011-05-14 Bill Poser Release of version 4.18. * ascii2uni.c (main): Applied patch supplied by Bartosz Kuzma to handle the situation in NetBSD which lacks getline. * uni2ascii.c (AscifyStyle): Fixed bug in which a couple of ascii characters were included in the list of characters replaced by them. This did not affect the output but threw off the substitution count. 2011-04-10 Bill Poser * uni2ascii.c: Clarified semantics of pure option as converting characters in ascii range other than space and newline. Fixed bug in which this was not implemented correctly for UTF8 types. 2011-02-04 Bill Poser Release of version 4.17 * uni2ascii.c (AscifyEquiv): Now convert U+00B7 middle dot to period. Now convert U+0085 next line and U+2028 line separator to newline. 2011-01-20 Bill Poser * uni2ascii.c (AscifyEquiv): Now convert U+2022 bullet to 'o'. 2010-12-12 Bill Poser Release of version 4.16. * uni2ascii.c (main): in -a option now translate FType of CHENT to HTMLX to resolve problem of compatibility between the two directions. * SetFormat.c (SetFormat): Q now sets FType to CHENT rather than HTMLX. * uni2ascii.c (AscifyEquiv): Added U+2033 to characters converted to nearest ascii equivalent by B option. 2010-08-29 Bill Poser * ascii2uni.c: Removed getline.c dependent on GNU_SOURCE since getline is standard as of POSIX2008. * uni2ascii.c: Renamed endian.h u2a_endian.h to avoid conflict with external endian.h. 2010-04-12 Bill Poser * ascii2uni.c (main): Changed Lineno from int to unsigned long and resolved half-a-dozen incompatibilities between its type and conversion specs. 2009-08-04 Bill Poser Release of version 4.14. * uni2ascii.c SetFormat.c: Now set escape type to hexadecimal HTML numeric reference in Q option rather than incorrect CHENT. 2009-05-11 Bill Poser * uni2ascii.c: Fixed bug in which ascification of U+2502 and U+2503 added double quote to output. 2009-04-22 Bill Poser * ascii2uni.c: Fixed a bug in which -a S option generated a "Converted so many chars" line for each character due to leaving in debugging code. 2009-04-21 Bill Poser Release of version 4.13 * uni2ascii.c: Fixed bug that caused excessive number of characters changed to ASCII to be reported. 2009-03-25 Bill Poser Release of version 4.12 * uni2ascii.c ascii2uni.c: The input file may now be specified on the command line without redirection. 2008-10-02 Bill Poser Release of version 4.11. * ascii2uni.c uni2ascii.c SetFormat.c formats.h: Added support for format. 2008-09-27 Bill Poser * ascii2uni.c uni2ascii.c SetFormat.c formats.h: Added support for %uXXXX format. 2008-08-30 Bill Poser * SetFormat.c (SetFormat): Added setting of *Ftype to CHENT in Y case. This fixes bug in which Y was a no-op. * ascii2uni.1: Added documentation for Y argument to -a flag. Corrected documentation for Q argument to -a flag. * SetFormat.c: Modified ListFormatArguments to give slightly different explanations for Q according to the direction of the conversion. * uni2ascii.c (main): Made Y argument to -a flag illegal. 2008-07-30 Bill Poser * ascii2uni.c uni2ascii.c: Switched to more informative ShowVersion and separated out Copyright(). 2008-06-03 Bill Poser * uni2ascii.c: Shifted to new, more detailed action summary. Due to incompatibility with u2a, which I am no longer updating, the old action summary can be chosen at configuration time by using the option --disable-newsummary. 2008-05-06 Bill Poser Release of version 4.9 2008-05-04 Bill Poser * ascii2uni.c: Fixed bug that produced bad output or segfault if a line ended in the prefix to an escape, e.g. just an =-sign in quoted-printable format. In quoted-printable format if a line ends in an =-sign, both the equal sign and the following newline are skipped in accordance with RFC2045. 2008-05-04 Bill Poser * ascii2uni.c: Release of version 4.8 Restored correct version of ascii2uni.c. Version 4.7 was inadvertently released with the 4.5 version of ascii2uni with a constant set much too low for testing purposes. Release 4.8 has ascii2uni.c with getline as in 4.6, with the unnecessary strlen call eliminated. 2008-04-26 Bill Poser * uni2ascii.c (main): Added option -P which passes through Unicode rather than converting to an escape if it is not transformed. This is intended to allow options like diacritic stripping to be used followed by another program. Added option -B which transforms to ASCII if possible. It is equivalent to the combination defxy. Added expansion of ligatures U+FB00,U+FB01,U+FB02,U+FB03,U+FB04, U+FB06 to -x option. Added conversion of U+00AF, U+2215, U+2216, U+2223 to -e option. 2008-04-02 Bill Poser * ascii2uni.c: Eliminated unnecessary strlen call now that we're using getline. 2008-04-02 Bill Poser Release of version 4.6. * ascii2uni.c: Replaced fgets call with GNU getline so as to handle arbitrarily long input lines. 2008-03-25 Bill Poser * uni2ascii.c (main): Added support for OOXML format. Fixed bug affecting BYTEQ, BYTED, and BYTEH formats. * ascii2uni.c: Added support for OOXML format. 2008-03-20 Bill Poser * ascii2uni.c: Release of version 4.5 Error messages now include the line number. Microsoft-style HTML entities lacking final semi-colon are now passed on by default rather than converted. The new -m flag causes them to be converted. 2008-03-19 Bill Poser * ascii2uni.c (main): Initialized FType to STDX, fixing bug arising when user fails to specify type on command line. 2008-03-10 Bill Poser * ascii2uni.c: Corrected FSF address in header as per bug report by Kartik Mistry. Made minor improvements in man pages as per patch by Kartik Mistry. 2008-01-14 Bill Poser * uni2ascii.c: Added -y option for single-character ascii approximations as per patch provided by Jesse Peterson (jesse.peterson@exbiblio.com) Changed license to GPL v.3 2007-08-07 Bill Poser * ascii2uni.c (main): Version 4.3.2 Fixed bug that deleted blank lines in certain cases. Removed obsolete -8 flag from usage message. 2007-03-11 Bill Poser * uni2ascii.c (main): Added ability to define custom substitutions and deletions. Added 0x2500-0x2503 to -e flag. 2007-03-02 Bill Poser Released version 4.2 * SetFormat.c: Added some format names. Added missing pattern matches for examples of I, J, and K formats. Added return of error code for unrecognized format spec, with tests in both uni2ascii and ascii2uni. 2007-03-01 Bill Poser Released version 4.1.1 * ascii2uni.c uni2ascii.c: Removed inadertently introduced direct calls to gettext. These will prevent compilation on systems without gettext. 2007-02-26 Bill Poser Released version 4.1 * TestSuiteAscii2Uni: Added entries for missing formats. * ascii2uni.c: Removed leftover format spec info from ShowUsage(); Fixed bugs bugs that screwed up several conversions. 2007-02-22 Bill Poser * u2a.tcl (ExplainExpansions): Added information about new expansions. * uni2ascii.c: Corrected typos in usage info. Moved list of expansions from general info to its own info flag. Added expansions proposed and implemented by Cedric Luthi. 2007-02-20 Bill Poser * u2a.tcl: Modified to handle new method of specifying formats. 2007-02-14 Bill Poser * ascii2uni.c uni2ascii.c: Fixed bug introduced in 3.10 in which an HTML numeric character reference lacking the final semi-colon led to the program not termiminating. Added check to Z flag argument to make sure that user supplied formats do not contain more than one conversion specification. Replaced the numerous format options with arguments to the -a flag. 2007-02-13 Bill Poser * uni2ascii.c (main): Replaced the numerous format options with arguments to the -a flag. 2007-02-10 Bill Poser * uni2ascii.c ascii2uni.c: Adds support for hexadecimal numbers with prefix "16#" as in Postscript. Adds support for hexadecimal numbers with prefix "#16r" as in Common Lisp. Adds support for hexadecimal numbers with prefix "16#" and suffix "#" as in ADA. * u2a.tcl: Added the above. Improved look a little, I hope. 2007-01-09 Bill Poser * ascii2uni.c (main): Added support for the format consisting of a decimal integer prefixed by "v" as used in Perl. 2006-12-20 Bill Poser * uni2ascii.c: Added 38 missing characters to AscifyDiacritics and moved one that was mapped to the wrong ASCII value. 2006-12-02 Bill Poser * ascii2uni.c (main): Added G to getopt string. Somehow it got left out, causing option to be treated as erroneous. Fixed error messages for missing arguments to command line options. Fixed bug in -J format. 2006-07-31 Bill Poser * ascii2uni.c (main): Now suppress info about use of Unicode Replacement Character if none were emitted. Now print info about individual ill-formed HTML entities missing final semi-colon. 2006-07-05 Bill Poser * uni2ascii.c (main): Fixed bug in which a space was not added after spaces or newlines when AddWhitespaceP was set in non-UTF-8 formats. 2006-07-03 Bill Poser * Get_UTF32_From_UTF8.c: Incorporated a patch by Dylan Thurston that allows correct handling of a read interrupted in the middle of a UTF-8 sequence. * Release 3.9.4. 2006-06-06 Bill Poser * ascii2uni.1 uni2ascii.1: Corrected incorrect references to uni2ascii in ascii2uni.1. Added mention of default format. This fixes Debian Bug#367546. 2006-05-11 Bill Poser * uni2ascii.c (AscifyStyle): Fixed bugs in which -f option changed "9" to "y" and "Z" to "a" per Debian bug report http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=365962 Now convert superscript and subscript digits and plus sign to ASCII equivalents. 2006-04-30 Bill Poser * u2a.tcl, uni2ascii.c Fixed a bug that reversed the value of the switch for converting ASCII characters in going from Unicode to ASCII. Fixed miscellaneous bugs in the reporting of the number of characters converted, replaced, etc. Uni2ascii now reports the total number of characters processed and the number actually converted. 2006-04-28 Bill Poser * uni2ascii.c: Corrected handling of small caps. Added those that were missing and changed some from converting to plain upper case to converting to plain lower case as per Unicode classification. Added expansion of plain single and double arrows. Added replacement of union with U. 2006-04-21 Bill Poser * uni2ascii.c: Added expansion of U+2026 to ... under -x per user request. 2006-04-17 Bill Poser * uni2ascii.c: Added detection of bad option argument in getopt. * ascii2uni.c: Added the three POSIX charmap formats - octal, decimal, and hex escapes for the three low bytes of a UTF-32 character in big-endian order. Added detection of bad option argument in getopt. 2006-04-16 Bill Poser * uni2ascii.c: Added the three POSIX charmap formats - octal, decimal, and hex escapes for the three low bytes of a UTF-32 character in big-endian order. 2006-02-24 Bill Poser * ascii2uni.c (main): Added detection of HTML character entities and numeric character references lacking the final semi-colon. These are converted but a warning message is printed. * ascii2uni.c (main): Q mode now works in pure mode. * ascii2uni.1 uni2ascii.1: Corrected examples missing final semi-colon. 2006-01-22 Bill Poser * uni2ascii.c: Added support for SGML numeric character references. 2006-01-14 Bill Poser * ascii2uni.c: Added RTF format (\uN with N decimal). * uni2ascii.c: Fixed bug that prevented -G option from working. Added RTF format (\uN with N decimal). Added option of expanding some characters to sequences, e.g. ts-digraph to ts. 2006-01-12 Bill Poser * uni2ascii.c: Extended the ascii replacement options to the UTF-8 formats. 2006-01-11 Bill Poser * uni2ascii.c: Added options for replacing Unicode characters with ascii equivalents rather than a textual representation, e.g. various dashes with hyphen, e-acute with e, boldface with plain. 2005-12-12 Bill Poser * Added GUI U2A.tcl. 2005-12-06 Bill Poser * uni2ascii.c: The option is now available of converting Unicode to HTML character entities if one exists. Fixed bug in which -q option was not recognized. 2005-12-05 Bill Poser * uni2ascii.c ascii2uni: Added support for format X'00E9'. 2005-09-27 Bill Poser * uni2ascii.c ascii2uni.c: Added support for octal-escaped UTF-8. 2005-09-21 Bill Poser * ascii2uni.c uni2ascii.c: Added the two UTF-8 formats =XX and %XX. Updated man pages to reflect this. 2005-09-15 Bill Poser * ascii2uni.c: Added option of converting all three HTML escapes, including character entities, for which support was added. 2005-09-10 Bill Poser * Added to both programs the -Z command line flag which allows the user to set the conversion format directly. 2005-09-09 Bill Poser * uni2ascii.c (main): Initialized FType to STDX to prevent segfault when called with no arguments. *uni2ascii.c: Added -q flag to suppress chat. *uni2ascii.c and ascii2uni.c: Added formats , U00E9, u00E9, U+00E9 2005-09-08 Bill Poser * uni2ascii.c (main) Added formats \x00E9, =x{00E9}, and Tcl \u~\U. * ascii2uni.c (main) Added program that does the inverse mapping. 2005-09-04 Bill Poser * uni2ascii.c (main): Added -B flag to generate backslash-escaped hex, e.g. \x0561. uni2ascii-4.20/Makefile.am0000644000175000017500000000115014300550021012265 00000000000000bin_PROGRAMS = uni2ascii ascii2uni bin_SCRIPTS = u2a dist_man_MANS = uni2ascii.1 ascii2uni.1 uni2ascii_SOURCES = endian.c enttbl.c SetFormat.c uni2ascii.c UTF8in.c putu8.c ascii2uni_SOURCES = ascii2uni.c enttbl.c GetWord.c putu8.c SetFormat.c noinst_HEADERS = u2a_endian.h enttbl.h exitcode.h formats.h unicode.h utf8error.h AM_CFLAGS = if NEWSUMMARY AM_CFLAGS += -DNEWSUMMARY endif if DEBUGBUILD AM_CFLAGS += -DDEBUGBUILD endif AUTOMAKE_OPTIONS = dist-zip dist-bzip2 EXTRA_DIST = TestSuiteAscii2Uni CREDITS uni2html.py ascii2uni.py u2a.tcl uni2ascii.info uni2ascii-${VERSION}.lsm u2a: u2a.tcl cp u2a.tcl u2a uni2ascii-4.20/enttbl.c0000644000175000017500000002730713755677100011726 00000000000000/* Time-stamp: <2008-03-10 12:05:41 poser> * * Copyright (C) 2005-2007 William J. Poser (billposer@alum.mit.edu) * * This program is free software; you can redistribute it and/or modify * it under the terms of version 3 of the GNU General Public License as published by * the Free Software Foundation. * * 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 * Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * or go to the web page: http://www.gnu.org/licenses/gpl.txt. */ #include "config.h" #include #include "unicode.h" struct ent { char *name; UTF32 code; }; static struct ent EntityCodeTable[] = { {"AElig",0x00C6}, {"Aacute",0x00C1}, {"Acirc",0x00C2}, {"Agrave",0x00C0}, {"Alpha",0x0391}, {"Aring",0x00C5}, {"Atilde",0x00C3}, {"Auml",0x00C4}, {"Beta",0x0392}, {"Ccedil",0x00C7}, {"Chi",0x03A7}, {"Dagger",0x2021}, {"Delta",0x0394}, {"ETH",0x00D0}, {"Eacute",0x00C9}, {"Ecirc",0x00CA}, {"Egrave",0x00C8}, {"Epsilon",0x0395}, {"Eta",0x0397}, {"Euml",0x00CB}, {"Gamma",0x0393}, {"Iacute",0x00CD}, {"Icirc",0x00CE}, {"Igrave",0x00CC}, {"Iota",0x0399}, {"Iuml",0x00CF}, {"Kappa",0x039A}, {"Lambda",0x039B}, {"Mu",0x039C}, {"Ntilde",0x00D1}, {"Nu",0x039D}, {"OElig",0x0152}, {"Oacute",0x00D3}, {"Ocirc",0x00D4}, {"Ograve",0x00D2}, {"Omega",0x03A9}, {"Omicron",0x039F}, {"Oslash",0x00D8}, {"Otilde",0x00D5}, {"Ouml",0x00D6}, {"Phi",0x03A6}, {"Pi",0x03A0}, {"Prime",0x2033}, {"Psi",0x03A8}, {"Rho",0x03A1}, {"Scaron",0x0160}, {"Sigma",0x03A3}, {"Thorn",0x00DE}, {"Tau",0x03A4}, {"Theta",0x0398}, {"Uacute",0x00DA}, {"Ucirc",0x00DB}, {"Ugrave",0x00D9}, {"Upsilon",0x03A5}, {"Uuml",0x00DC}, {"Xi",0x039E}, {"Yacute",0x00DD}, {"Yuml",0x0178}, {"Zeta",0x0396}, {"aacute",0x00E1}, {"acirc",0x00E2}, {"acute",0x00B4}, {"aelig",0x00E6}, {"agrave",0x00E0}, {"alpha",0x03B1}, {"amp",0x0026}, {"and",0x2227}, {"ang",0x2220}, {"aring",0x00E5}, {"asymp",0x2248}, {"atilde",0x00E3}, {"auml",0x00E4}, {"bdquo",0x201E}, {"beta",0x03B2}, {"brvbar",0x00A6}, {"bull",0x2022}, {"cap",0x2229}, {"ccedil",0x00E7}, {"cedil",0x00B8}, {"cent",0x00A2}, {"chi",0x03C7}, {"circ",0x02C6}, {"clubs",0x2663}, {"cong",0x2245}, {"copy",0x00A9}, {"crarr",0x21B5}, {"cup",0x222A}, {"curren",0x00A4}, {"dArr",0x21D3}, {"dagger",0x2020}, {"darr",0x2193}, {"deg",0x00B0}, {"delta",0x03B4}, {"diams",0x2666}, {"divide",0x00F7}, {"eacute",0x00E9}, {"ecirc",0x00EA}, {"egrave",0x00E8}, {"empty",0x2205}, {"emsp",0x2003}, {"ensp",0x2002}, {"epsilon",0x03B5}, {"equiv",0x2261}, {"eta",0x03B7}, {"eth",0x00F0}, {"euml",0x00EB}, {"euro",0x20AC}, {"exist",0x2203}, {"fnof",0x0192}, {"forall",0x2200}, {"frac12",0x00BD}, {"frac14",0x00BC}, {"frac34",0x00BE}, {"frasl",0x2044}, {"gamma",0x03B3}, {"ge",0x2265}, {"gt",0x003E}, {"hArr",0x21D4}, {"harr",0x2194}, {"hearts",0x2665}, {"hellip",0x2026}, {"iacute",0x00ED}, {"icirc",0x00EE}, {"iexcl",0x00A1}, {"igrave",0x00EC}, {"infin",0x221E}, {"int",0x222B}, {"iota",0x03B9}, {"iquest",0x00BF}, {"isin",0x2208}, {"iuml",0x00EF}, {"kappa",0x03BA}, {"lArr",0x21D0}, {"lambda",0x03BB}, {"lang",0x2329}, {"laquo",0x00AB}, {"lceil",0x2308}, {"ldquo",0x201C}, {"le",0x2264}, {"lfloor",0x230A}, {"lowast",0x2217}, {"loz",0x25CA}, {"lrm",0x200E}, {"lsaquo",0x2039}, {"lsquo",0x2018}, {"lt",0x003C}, {"macr",0x00AF}, {"mdash",0x2014}, {"micro",0x00B5}, {"middot",0x00B7}, {"minus",0x2212}, {"mu",0x03BC}, {"nabla",0x2207}, {"nbsp",0x00A0}, {"ndash",0x2013}, {"ne",0x2260}, {"ni",0x220B}, {"not",0x00AC}, {"notin",0x2209}, {"nsub",0x2284}, {"ntilde",0x00F1}, {"nu",0x03BD}, {"oacute",0x00F3}, {"ocirc",0x00F4}, {"oelig",0x0153}, {"ograve",0x00F2}, {"oline",0x203E}, {"omega",0x03C9}, {"omicron",0x03BF}, {"oplus",0x2295}, {"or",0x2228}, {"ordf",0x00AA}, {"ordm",0x00BA}, {"oslash",0x00F8}, {"otilde",0x00F5}, {"otimes",0x2297}, {"ouml",0x00F6}, {"para",0x00B6}, {"part",0x2202}, {"permil",0x2030}, {"perp",0x22A5}, {"phi",0x03C6}, {"pi",0x03C0}, {"piv",0x03D6}, {"plusmn",0x00B1}, {"pound",0x00A3}, {"prime",0x2032}, {"prod",0x220F}, {"prop",0x221D}, {"psi",0x03C8}, {"quot",0x0022}, {"rArr",0x21D2}, {"radic",0x221A}, {"rang",0x232A}, {"raquo",0x00BB}, {"rarr",0x2192}, {"rceil",0x2309}, {"rdquo",0x201D}, {"reg",0x00AE}, {"rfloor",0x230B}, {"rho",0x03C1}, {"rlm",0x200F}, {"rsaquo",0x203A}, {"rsquo",0x2019}, {"sbquo",0x201A}, {"scaron",0x0161}, {"sdot",0x22C5}, {"sect",0x00A7}, {"shy",0x00AD}, {"sigma",0x03C3}, {"sigmaf",0x03C2}, {"sim",0x223C}, {"spades",0x2660}, {"sub",0x2282}, {"sube",0x2286}, {"sum",0x2211}, {"sup",0x2283}, {"sup1",0x00B9}, {"sup2",0x00B2}, {"sup3",0x00B3}, {"supe",0x2287}, {"szlig",0x00DF}, {"tau",0x03C4}, {"there4",0x2234}, {"theta",0x03B8}, {"thetasym",0x03D1}, {"thinsp",0x2009}, {"thorn",0x00FE}, {"tilde",0x02DC}, {"times",0x00D7}, {"uArr",0x21D1}, {"uacute",0x00FA}, {"uarr",0x2191}, {"ucirc",0x00FB}, {"ugrave",0x00F9}, {"uml",0x00A8}, {"upsih",0x03D2}, {"upsilon",0x03C5}, {"uuml",0x00FC}, {"weierp",0x2118}, {"xi",0x03BE}, {"yacute",0x00FD}, {"yen",0x00A5}, {"yuml",0x00FF}, {"zeta",0x03B6}, {"zwj",0x200D}, {"zwnj",0x200C} }; static struct ent CodeEntityTable[] = { {"quot",0x0022}, {"amp",0x0026}, {"lt",0x003C}, {"gt",0x003E}, {"nbsp",0x00A0}, {"iexcl",0x00A1}, {"cent",0x00A2}, {"pound",0x00A3}, {"curren",0x00A4}, {"yen",0x00A5}, {"brvbar",0x00A6}, {"sect",0x00A7}, {"uml",0x00A8}, {"copy",0x00A9}, {"ordf",0x00AA}, {"laquo",0x00AB}, {"not",0x00AC}, {"shy",0x00AD}, {"reg",0x00AE}, {"macr",0x00AF}, {"deg",0x00B0}, {"plusmn",0x00B1}, {"sup2",0x00B2}, {"sup3",0x00B3}, {"acute",0x00B4}, {"micro",0x00B5}, {"para",0x00B6}, {"middot",0x00B7}, {"cedil",0x00B8}, {"sup1",0x00B9}, {"ordm",0x00BA}, {"raquo",0x00BB}, {"frac14",0x00BC}, {"frac12",0x00BD}, {"frac34",0x00BE}, {"iquest",0x00BF}, {"Agrave",0x00C0}, {"Aacute",0x00C1}, {"Acirc",0x00C2}, {"Atilde",0x00C3}, {"Auml",0x00C4}, {"Aring",0x00C5}, {"AElig",0x00C6}, {"Ccedil",0x00C7}, {"Egrave",0x00C8}, {"Eacute",0x00C9}, {"Ecirc",0x00CA}, {"Euml",0x00CB}, {"Igrave",0x00CC}, {"Iacute",0x00CD}, {"Icirc",0x00CE}, {"Iuml",0x00CF}, {"ETH",0x00D0}, {"Ntilde",0x00D1}, {"Ograve",0x00D2}, {"Oacute",0x00D3}, {"Ocirc",0x00D4}, {"Otilde",0x00D5}, {"Ouml",0x00D6}, {"times",0x00D7}, {"Oslash",0x00D8}, {"Ugrave",0x00D9}, {"Uacute",0x00DA}, {"Ucirc",0x00DB}, {"Uuml",0x00DC}, {"Yacute",0x00DD}, {"Thorn",0x00DE}, {"szlig",0x00DF}, {"agrave",0x00E0}, {"aacute",0x00E1}, {"acirc",0x00E2}, {"atilde",0x00E3}, {"auml",0x00E4}, {"aring",0x00E5}, {"aelig",0x00E6}, {"ccedil",0x00E7}, {"egrave",0x00E8}, {"eacute",0x00E9}, {"ecirc",0x00EA}, {"euml",0x00EB}, {"igrave",0x00EC}, {"iacute",0x00ED}, {"icirc",0x00EE}, {"iuml",0x00EF}, {"eth",0x00F0}, {"ntilde",0x00F1}, {"ograve",0x00F2}, {"oacute",0x00F3}, {"ocirc",0x00F4}, {"otilde",0x00F5}, {"ouml",0x00F6}, {"divide",0x00F7}, {"oslash",0x00F8}, {"ugrave",0x00F9}, {"uacute",0x00FA}, {"ucirc",0x00FB}, {"uuml",0x00FC}, {"yacute",0x00FD}, {"thorn",0x00FE}, {"yuml",0x00FF}, {"OElig",0x0152}, {"oelig",0x0153}, {"Scaron",0x0160}, {"scaron",0x0161}, {"Yuml",0x0178}, {"fnof",0x0192}, {"circ",0x02C6}, {"tilde",0x02DC}, {"Alpha",0x0391}, {"Beta",0x0392}, {"Gamma",0x0393}, {"Delta",0x0394}, {"Epsilon",0x0395}, {"Zeta",0x0396}, {"Eta",0x0397}, {"Theta",0x0398}, {"Iota",0x0399}, {"Kappa",0x039A}, {"Lambda",0x039B}, {"Mu",0x039C}, {"Nu",0x039D}, {"Xi",0x039E}, {"Omicron",0x039F}, {"Pi",0x03A0}, {"Rho",0x03A1}, {"Sigma",0x03A3}, {"Tau",0x03A4}, {"Upsilon",0x03A5}, {"Phi",0x03A6}, {"Chi",0x03A7}, {"Psi",0x03A8}, {"Omega",0x03A9}, {"alpha",0x03B1}, {"beta",0x03B2}, {"gamma",0x03B3}, {"delta",0x03B4}, {"epsilon",0x03B5}, {"zeta",0x03B6}, {"eta",0x03B7}, {"theta",0x03B8}, {"iota",0x03B9}, {"kappa",0x03BA}, {"lambda",0x03BB}, {"mu",0x03BC}, {"nu",0x03BD}, {"xi",0x03BE}, {"omicron",0x03BF}, {"pi",0x03C0}, {"rho",0x03C1}, {"sigmaf",0x03C2}, {"sigma",0x03C3}, {"tau",0x03C4}, {"upsilon",0x03C5}, {"phi",0x03C6}, {"chi",0x03C7}, {"psi",0x03C8}, {"omega",0x03C9}, {"thetasym",0x03D1}, {"upsih",0x03D2}, {"piv",0x03D6}, {"ensp",0x2002}, {"emsp",0x2003}, {"thinsp",0x2009}, {"zwnj",0x200C}, {"zwj",0x200D}, {"lrm",0x200E}, {"rlm",0x200F}, {"ndash",0x2013}, {"mdash",0x2014}, {"lsquo",0x2018}, {"rsquo",0x2019}, {"sbquo",0x201A}, {"ldquo",0x201C}, {"rdquo",0x201D}, {"bdquo",0x201E}, {"dagger",0x2020}, {"Dagger",0x2021}, {"bull",0x2022}, {"hellip",0x2026}, {"permil",0x2030}, {"prime",0x2032}, {"Prime",0x2033}, {"lsaquo",0x2039}, {"rsaquo",0x203A}, {"oline",0x203E}, {"frasl",0x2044}, {"euro",0x20AC}, {"weierp",0x2118}, {"uarr",0x2191}, {"rarr",0x2192}, {"darr",0x2193}, {"harr",0x2194}, {"crarr",0x21B5}, {"lArr",0x21D0}, {"uArr",0x21D1}, {"rArr",0x21D2}, {"dArr",0x21D3}, {"hArr",0x21D4}, {"forall",0x2200}, {"part",0x2202}, {"exist",0x2203}, {"empty",0x2205}, {"nabla",0x2207}, {"isin",0x2208}, {"notin",0x2209}, {"ni",0x220B}, {"prod",0x220F}, {"sum",0x2211}, {"minus",0x2212}, {"lowast",0x2217}, {"radic",0x221A}, {"prop",0x221D}, {"infin",0x221E}, {"ang",0x2220}, {"and",0x2227}, {"or",0x2228}, {"cap",0x2229}, {"cup",0x222A}, {"int",0x222B}, {"there4",0x2234}, {"sim",0x223C}, {"cong",0x2245}, {"asymp",0x2248}, {"ne",0x2260}, {"equiv",0x2261}, {"le",0x2264}, {"ge",0x2265}, {"sub",0x2282}, {"sup",0x2283}, {"nsub",0x2284}, {"sube",0x2286}, {"supe",0x2287}, {"oplus",0x2295}, {"otimes",0x2297}, {"perp",0x22A5}, {"sdot",0x22C5}, {"lceil",0x2308}, {"rceil",0x2309}, {"lfloor",0x230A}, {"rfloor",0x230B}, {"lang",0x2329}, {"rang",0x232A}, {"loz",0x25CA}, {"spades",0x2660}, {"clubs",0x2663}, {"hearts",0x2665}, {"diams",0x2666} }; static struct ent HDMLEntityCodeTable[] = { {">",0x003E}, {"<",0x003C}, {"&",0x0026}, {"&dol;",0x0024}, {" ",0x00A0} }; static int Entities = sizeof(EntityCodeTable)/sizeof(struct ent); static int HDMLEntities = sizeof(HDMLEntityCodeTable)/sizeof(struct ent); /* * Look up an HTML character entity name and return the corresponding *Unicode codepoint or 0x00 if not found. */ UTF32 LookupCodeForEntity (char *s) { int l; /* Lower bound of region */ int u; /* Upper bound of region */ int m; /* Midpoint of region */ int c; l = 0; u = Entities -1; /* Standard binary search */ while(l <= u){ m = (l + u) / 2; c =strcmp(s,EntityCodeTable[m].name); if (c < 0) u = m - 1; else if(c > 0) l = m + 1; else return(EntityCodeTable[m].code); } return 0L; } /* * If there exists a character entity corresponding to a * Unicode codepoint, return it. If not, return a null * string. */ char * LookupEntityForCode (UTF32 s) { int l; /* Lower bound of region */ int u; /* Upper bound of region */ int m; /* Midpoint of region */ int c; l = 0; u = Entities -1; /* Standard binary search */ while(l <= u){ m = (l + u) / 2; c = s - CodeEntityTable[m].code; if (c < 0) u = m - 1; else if(c > 0) l = m + 1; else return(CodeEntityTable[m].name); } return (char *) 0; } char * LookupHDMLEntityForCode (UTF32 c) { switch (c) { case 0x003E: return ">"; case 0x003C: return "<"; case 0x0026: return "&"; case 0x0024: return "&dol;"; case 0xA0: return " "; default: return NULL; } } /* * Look up an HDML character entity name and return the corresponding *Unicode codepoint or 0x00 if not found. */ UTF32 LookupCodeForHDMLEntity (char *s) { int l; /* Lower bound of region */ int u; /* Upper bound of region */ int m; /* Midpoint of region */ int c; l = 0; u = HDMLEntities -1; /* Standard binary search */ while(l <= u){ m = (l + u) / 2; c =strcmp(s,HDMLEntityCodeTable[m].name); if (c < 0) u = m - 1; else if(c > 0) l = m + 1; else return(HDMLEntityCodeTable[m].code); } return 0L; } uni2ascii-4.20/u2a_endian.h0000644000175000017500000000034113755677100012435 00000000000000#ifndef GET_ENDIAN extern short Get_Endianness(void); #endif #define GET_ENDIAN /* Constants defining endian-ness values */ #define E_LITTLE_ENDIAN 0 #define E_BIG_ENDIAN 1 #define E_PDP_ENDIAN 2 #define E_UNKNOWN_ENDIAN 3 uni2ascii-4.20/configure0000755000175000017500000056434714300547432012202 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for uni2ascii 4.20. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: billposer@alum.mit.edu about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='uni2ascii' PACKAGE_TARNAME='uni2ascii' PACKAGE_VERSION='4.20' PACKAGE_STRING='uni2ascii 4.20' PACKAGE_BUGREPORT='billposer@alum.mit.edu' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS host_os host_vendor host_cpu host build_os build_vendor build_cpu build EGREP GREP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC DEBUGBUILD_FALSE DEBUGBUILD_TRUE NEWSUMMARY_FALSE NEWSUMMARY_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_newsummary enable_debugbuild enable_dependency_tracking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures uni2ascii 4.20 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/uni2ascii] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of uni2ascii 4.20:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --disable-newsummary Do not use new summary incompatible with u2a.tcl. --enable-debugbuild. Compile for debugging. --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF uni2ascii configure 4.20 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by uni2ascii $as_me 4.20, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='uni2ascii' VERSION='4.20' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Check whether --enable-newsummary was given. if test ${enable_newsummary+y} then : enableval=$enable_newsummary; case "${enableval}" in yes) newsummary=true ;; no) newsummary=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-newsummary" "$LINENO" 5 ;; esac else $as_nop newsummary=true fi if test "$newsummary" = true; then NEWSUMMARY_TRUE= NEWSUMMARY_FALSE='#' else NEWSUMMARY_TRUE='#' NEWSUMMARY_FALSE= fi # Check whether --enable-debugbuild was given. if test ${enable_debugbuild+y} then : enableval=$enable_debugbuild; case "${enableval}" in yes) debugbuild=true ;; no) debugbuild=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-debugbuild" "$LINENO" 5 ;; esac else $as_nop debugbuild=false fi if test "$debugbuild" = true; then DEBUGBUILD_TRUE= DEBUGBUILD_FALSE='#' else DEBUGBUILD_TRUE='#' DEBUGBUILD_FALSE= fi # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if ${debugbuild}; then CFLAGS="-ggdb -g3" else CFLAGS="-g -O2" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes else $as_nop ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then printf "%s\n" "#define const /**/" >>confdefs.h fi ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else $as_nop printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 printf %s "checking for gettext in -lintl... " >&6; } if test ${ac_cv_lib_intl_gettext+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char gettext (); int main (void) { return gettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_intl_gettext=yes else $as_nop ac_cv_lib_intl_gettext=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5 printf "%s\n" "$ac_cv_lib_intl_gettext" >&6; } if test "x$ac_cv_lib_intl_gettext" = xyes then : printf "%s\n" "#define HAVE_LIBINTL 1" >>confdefs.h fi # Autoupdate added the next two lines to ensure that your configure # script's behavior did not change. They are probably safe to remove. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes then : printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "gnu/libc-version.h" "ac_cv_header_gnu_libc_version_h" "$ac_includes_default" if test "x$ac_cv_header_gnu_libc_version_h" = xyes then : printf "%s\n" "#define HAVE_GNU_LIBC_VERSION_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes then : printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes then : printf "%s\n" "#define HAVE_LOCALE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "regex.h" "ac_cv_header_regex_h" "$ac_includes_default" if test "x$ac_cv_header_regex_h" = xyes then : printf "%s\n" "#define HAVE_REGEX_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" if test "x$ac_cv_header_stddef_h" = xyes then : printf "%s\n" "#define HAVE_STDDEF_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" if test "x$ac_cv_header_stdio_h" = xyes then : printf "%s\n" "#define HAVE_STDIO_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes then : printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes then : printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" if test "x$ac_cv_header_sys_types_h" = xyes then : printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" if test "x$ac_cv_header_sys_stat_h" = xyes then : printf "%s\n" "#define HAVE_SYS_STAT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "type.h" "ac_cv_header_type_h" "$ac_includes_default" if test "x$ac_cv_header_type_h" = xyes then : printf "%s\n" "#define HAVE_TYPE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes then : printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" if test "x$ac_cv_header_wchar_h" = xyes then : printf "%s\n" "#define HAVE_WCHAR_H 1" >>confdefs.h fi # Checks for library functions. # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 printf %s "checking for GNU libc compatible malloc... " >&6; } if test ${ac_cv_func_malloc_0_nonnull+y} then : printf %s "(cached) " >&6 else $as_nop if test "$cross_compiling" = yes then : case "$host_os" in # (( # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ | hpux* | solaris* | cygwin* | mingw* | msys* ) ac_cv_func_malloc_0_nonnull=yes ;; # If we don't know, assume the worst. *) ac_cv_func_malloc_0_nonnull=no ;; esac else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { void *p = malloc (0); int result = !p; free (p); return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_malloc_0_nonnull=yes else $as_nop ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes then : printf "%s\n" "#define HAVE_MALLOC 1" >>confdefs.h else $as_nop printf "%s\n" "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac printf "%s\n" "#define malloc rpl_malloc" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 printf %s "checking for GNU libc compatible realloc... " >&6; } if test ${ac_cv_func_realloc_0_nonnull+y} then : printf %s "(cached) " >&6 else $as_nop if test "$cross_compiling" = yes then : case "$host_os" in # (( # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ | hpux* | solaris* | cygwin* | mingw* | msys* ) ac_cv_func_realloc_0_nonnull=yes ;; # If we don't know, assume the worst. *) ac_cv_func_realloc_0_nonnull=no ;; esac else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { void *p = realloc (0, 0); int result = !p; free (p); return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_realloc_0_nonnull=yes else $as_nop ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 printf "%s\n" "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes then : printf "%s\n" "#define HAVE_REALLOC 1" >>confdefs.h else $as_nop printf "%s\n" "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac printf "%s\n" "#define realloc rpl_realloc" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fgetln" "ac_cv_func_fgetln" if test "x$ac_cv_func_fgetln" = xyes then : printf "%s\n" "#define HAVE_FGETLN 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline" if test "x$ac_cv_func_getline" = xyes then : printf "%s\n" "#define HAVE_GETLINE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp" if test "x$ac_cv_func_regcomp" = xyes then : printf "%s\n" "#define HAVE_REGCOMP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" if test "x$ac_cv_func_setlocale" = xyes then : printf "%s\n" "#define HAVE_SETLOCALE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" if test "x$ac_cv_func_strtoul" = xyes then : printf "%s\n" "#define HAVE_STRTOUL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "gettext" "ac_cv_func_gettext" if test "x$ac_cv_func_gettext" = xyes then : printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h fi ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${NEWSUMMARY_TRUE}" && test -z "${NEWSUMMARY_FALSE}"; then as_fn_error $? "conditional \"NEWSUMMARY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DEBUGBUILD_TRUE}" && test -z "${DEBUGBUILD_FALSE}"; then as_fn_error $? "conditional \"DEBUGBUILD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by uni2ascii $as_me 4.20, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ uni2ascii config.status 4.20 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi uni2ascii-4.20/config.sub0000755000175000017500000010511614300546425012240 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 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 to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: uni2ascii-4.20/NEWS0000644000175000017500000000751613755677100010771 000000000000002015-09-03 4.20 In documentation and messages clarified use of R format in ascii2uni. Added expansion of trademark sign. 2011-08-24 4.19 Fixed bug in handling of L (WWW) format. \uXXXX is now handled correctly even if immediately followed by a possible hex digit. \U followed by fewer than 8 hex digits is not treated as an escape. A warning is issued if the \U format encodes a character within the BMP. 2011-05-14 4.18 Fixed bug in uni2ascii in which in certain cases the subsitution count was too high, fixing Debian bug #626268. Patched to handle situation in NetBSD which lacks getline. Clarified semantics of pure option as converting characters in ascii range other than space and newline. Fixed bug in which this was not implemented correctly for UTF8 types. 2011-02-16 4.17 Added to uni2ascii the following conversions to nearest ascii equivalent: U+2022 bullet to 'o' U+00B7 middle dot to period U+0085 next line to newline U+2028 line separator to newline 2010-12-12 4.16 Ascii2uni Q format now works again. Added U+2033 to characters converted to nearest ascii equivalent by uni2ascii B option. 2010-08-29 4.15 Renamed endian.h u2a_endian.h to avoid conflict with external endian.h. Removed getline() from ascii2uni.c since it is standard as of POSIX2008. 2009-08-04 4.14 Fixed a bug that interfered with the use of the Q format in uni2ascii. Fixed bug in which ascification of U+2502 and U+2503 added double quote to output. Fixed a bug in which -a S option generated a "Converted so many chars" line for each character due to leaving in debugging code. 2009-04-22 4.13 Fixed Debian bug #511527 which caused the count of characters converted to ASCII by uni2ascii to be excessive. 2009-03-25 4.12 Both programs now allow the input file name to be specified on the command line without redirection. 2008-10-02 4.11 Added support for %uXXXX format. Added support for format. 2008-08-30 version 4.10 Fixed bug that made Y argument to -a flag in ascii2uni a no-op. Added documentation for Y argument to -a flag to man page for ascii2uni. Corrected documentation for Q argument to -a flag in man page for ascii2uni. The help flag for both programs now provides correct information about the Q argument to the -a flag. Giving Y as the argument to the -a flag is now an error for uni2ascii. The action summary is now more informative. The new version is incompatible with u2a, which I am no longer updating. The old action summary can be chosen at configuration time by using the option --disable-newsummary. More informative version information is now provided. 2008-05-06 version 4.9 Fixed bug that produced bad output or segfault if a line ended in the prefix to an escape, e.g. just an =-sign in quoted-printable format. In quoted-printable format if a line ends in an =-sign, both the equal sign and the following newline are skipped in accordance with RFC2045. 2008-05-04 version 4.8 Fixes serious bug in ascii2uni due to inclusion in release of test version. 2008-04-26 version 4.7 Added -P option to pass through untransformed Unicode. Added -B option as shorthand for defxy. Added characters to -e and -x options (see ChangeLog for details). Since hardly anyone seems to use it, the GUI u2a is no longer being developed. 2008-03-25 version 4.6 Replaced fgets call with GNU getline so as to handle arbitrarily long input lines. Added support for OOXML format (e.g. _x00E9_). Fixed bug affecting BYTEQ, BYTED, and BYTEH formats. 2008-03-20 version 4.5 Error messages now include the line number. Microsoft-style HTML entities lacking final semi-colon are now passed on by default rather than converted. The new -m flag causes them to be converted. 2008-01-14 version 4.4 Added -y option for single-character ascii approximations as per patch provided by Jesse Peterson (jesse.peterson@exbiblio.com) Changed license to GPL v.3 uni2ascii-4.20/ascii2uni.py0000644000175000017500000000335613755677100012530 00000000000000#!/usr/bin/env python # Time-stamp: <2008-03-10 12:05:26 poser> # # This is a filter that reads 7-bit ASCII containing \u-escaped Unicode # and converts it to UTF-8 Unicode. # # Copyright (C) 2005 William J. Poser (billposer@alum.mit.edu) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # or go to the web page: http://www.gnu.org/licenses/gpl.txt. import sys import codecs Version = '1.0' argc = len(sys.argv) if (argc > 1) and (sys.argv[1] == "-v"): sys.stdout.write("ascii2uni %s\n" % (Version)) sys.stdout.write("Copyright 2005 William J. Poser\n") sys.stdout.write("Released under the terms of the GNU General Public License.\n") sys.exit(2) else: sys.stdout.write("This program is a filter that converts from 7-bit ASCII containing\n\u-escaped Unicode (as used in Python and Tcl) and UTF-8 Unicode.\n") sys.stdout.write("So long as Python's Unicode implementation is restricted to 16 bits\nonly the Basic Multilingual Plane (Plane 0) is covered.\n") outfile = codecs.getwriter('utf-8')(sys.stdout) outfile.write(unicode(sys.stdin.read(),'unicode-escape')) sys.exit(0) uni2ascii-4.20/exitcode.h0000644000175000017500000000033713755677100012241 00000000000000 /* Exit statuses */ #define SUCCESS 0 #define OPENERROR 1 #define IOERROR 2 #define INFO 3 #define LIMITEXCEEDED 4 #define BADOPTION 5 #define BADOPTIONARG 6 #define OUTOFMEMORY 7 #define BADRECORD 8 #define OTHERERROR 9 uni2ascii-4.20/depcomp0000755000175000017500000005602014300546425011631 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 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 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: uni2ascii-4.20/TODO0000644000175000017500000000226713755677100010760 00000000000000Add GNU-style long options. from jidanni@jidanni.org reply-to jidanni@jidanni.org, 615228@bugs.debian.org to submit@bugs.debian.org date Sat, Feb 26, 2011 at 4:10 AM subject Bug#615228: triangles hide details 4:10 AM (6 hours ago) X-debbugs-Cc: Bill Poser Package: uni2ascii Version: 4.17-1 Severity: wishlist Perhaps replace with "V" or "v". character: â–¼ (9660, #o22674, #x25bc) code point: 0x217E buffer code: #xE2 #x96 #xBC name: BLACK DOWN-POINTING TRIANGLE old-name: BLACK DOWN POINTING TRIANGLE general-category: So (Symbol, Other) Bet there are others nearby it too... Add support for: backslash escapes (\t etc.) trigraphs --- Probably the way to provide the option requested for Debian of passing over ill-formed utf-8 characters is to handle this within UTF8in. --- Add test suite. --- Add base64, uuencode, ascii85, binhex --- Flow control is too complicated now. Need to package so as to make it comprehensible. Also check memory usage with valgrind. ___ Need to finish adding HDML support to ascii2uni. --- Add to web page and documentation explanation of the relationship between these programs and encoding converters. uni2ascii-4.20/putu8.c0000644000175000017500000000122013755677100011505 00000000000000 #include "config.h" #include #include #include /* * Takes a UTF-32 code as input and outputs UTF-8. * Based on Roman Czyborra: http://czyborra.com/utf/ */ void putu8(wchar_t c) { if (c < 0x80) { /* ASCII */ putchar(c); } else if (c < 0x800) { putchar(0xC0 | c>>6); putchar(0x80 | (c & 0x3F)); } else if (c < 0x10000) { putchar(0xE0 | c>>12); putchar(0x80 | (c>>6 & 0x3F)); putchar(0x80 | (c & 0x3F)); } else if (c < 0x200000) { /* 2^21 */ putchar(0xF0 | c>>18); putchar(0x80 | (c>>12 & 0x3F)); putchar(0x80 | (c>>6 & 0x3F)); putchar(0x80 | (c & 0x3F)); } } uni2ascii-4.20/aclocal.m40000644000175000017500000012251214300547432012113 00000000000000# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, [m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR uni2ascii-4.20/uni2ascii-4.20.lsm0000644000175000017500000000167513755677100013256 00000000000000Begin3 Title: uni2ascii Version: 4.20 Entered-date: 28JUN2019 Description: This package provides conversion in both directions between UTF-8 Unicode and more than thirty 7-bit ASCII equivalents, including RFC 2396 URI format and RFC 2045 Quoted Printable format, the representations used in HTML, SGML, XML, OOXML, the Unicode standard, Rich Text Format, POSIX portable charmaps, POSIX locale specifications, and Apache log files, and the escapes used for including Unicode in Ada, C, Common Lisp, Java, Pascal, Perl, Postscript, Python, Scheme, and Tcl. It also provides ways of converting non-ASCII characters to similar ASCII characters, e.g. by stripping diacritics. Keywords: unicode Author: billposer@alum.mit.edu (Bill Poser) Primary-site: billposer.org /Software/Downloads/ 154 kbytes uni2ascii-4.20.tar.gz Platforms: POSIX (including Linux, FreeBSD) Copying-policy: GPL End uni2ascii-4.20/SetFormat.c0000644000175000017500000004156613755677100012345 00000000000000/* Time-stamp: <2010-12-12 19:41:51 poser> * * Copyright (C) 2008 William J. Poser (billposer@alum.mit.edu) * * This program is free software; you can redistribute it and/or modify * it under the terms of version 3 of the GNU General Public License as published by * the Free Software Foundation. * * 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 * Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * or go to the web page: http://www.gnu.org/licenses/gpl.txt. */ /* This file contains SetFormat, the function that determines the ascii format to be read or * written, the associated help function ListFormatArguments, and CountSlots, which is * used to validate user-supplied formats. */ #include "config.h" #include #include #include #include #ifdef HAVE_LIBINTL_H #include #define _(String) gettext(String) #else #define _(x) (x) #endif #include #include "formats.h" #include "exitcode.h" /* Ancillary function */ int mystrcasecmp(char *a, char *b) { char ac; char bc; while(*a != '\0') { ac = tolower(*a++); bc = tolower(*b++); if(ac < bc) return (-1); if(ac > bc) return (1); } if(*b != '\0') return (-1); return (0); } /* This is the public function. Note that only the first argument is an input parameter. * The other arguments are output parameters. */ void SetFormat(char *fs, int *FType, short *UseEntitiesP, int *UTF8Type, short *BMPSplitP, short *AllHTMLP ) { regex_t rx; /* First, check for old flag characters */ if(strlen(fs) == 1) { switch(fs[0]) { case 'O': *FType = BYTEO; return; case 'S': *FType = BYTEH; return; case 'T': *FType = BYTED; return; case 'A': *FType = ABUX; return; case 'B': *FType = BSLX; return; case 'C': *FType = BSLXB; return; case 'D': *FType = HTMLD; return; case 'E': *FType = JUUX; return; case 'F': *FType = JuUX; return; case 'G': *FType = XQ; return; case 'H': *FType = HTMLX; return; case 'I': *FType = IFMT; *UTF8Type = 2; return; case 'J': *FType = JFMT; *UTF8Type = 1; return; case 'K': *FType = KFMT; *UTF8Type = 3; return; case 'L': *FType = BSLU; *BMPSplitP = 1; return; case 'M': *FType = SGMLX; return; case 'N': *FType = SGMLD; return; case 'P': *FType = UPLX; return; case 'Q': *FType = CHENT; *UseEntitiesP = 1; return; case 'R': *FType = RAWX; return; case 'U': *FType = BSLU; *BMPSplitP = 0; return; case 'V': *FType = BSLUD; *BMPSplitP = 0; return; /* case 'W': *FType = HDML; return; */ case 'X': *FType = STDX; return; case 'Y': *FType = CHENT; *AllHTMLP = 1; return; case '0': *FType = UTF8ANGLE; *UTF8Type = 5; return; case '1': *FType = CLSX; return; case '2': *FType = PERLV; return; case '3': *FType = DOLLAR; return; case '4': *FType = PSPT; return; case '5': *FType = CLR; return; case '6': *FType = ADA; return; case '7': *FType = APACHE; *UTF8Type = 4; return; case '8': *FType = OOXML; return; case '9': *FType = PCTUX; return; default: fprintf(stderr,"Unknown format %s\n",fs); exit(BADOPTIONARG); } } /* Now look for fixed strings */ if(mystrcasecmp(fs,"RFC2396") == 0) {*FType = JFMT;*UTF8Type = 1;return;} if( (mystrcasecmp(fs,"RFC2045") == 0) || (mystrcasecmp(fs,"quoted_printable") == 0)) {*FType = IFMT; *UTF8Type = 2;return;} /* if(mystrcasecmp(fs,"HDML") == 0) {*FType = HDML;return;} */ if(mystrcasecmp(fs,"HTML_hexadecimal") == 0) {*FType = HTMLX;return;} if(mystrcasecmp(fs,"HTML_decimal") == 0) {*FType = HTMLD;return;} if(mystrcasecmp(fs,"SGML_hexadecimal") == 0) {*FType = SGMLX;return;} if(mystrcasecmp(fs,"SGML_decimal") == 0) {*FType = SGMLD;return;} if(mystrcasecmp(fs,"ADA") == 0) {*FType = ADA;return;} if(mystrcasecmp(fs,"Python") == 0) {*FType = BSLU;return;} if(mystrcasecmp(fs,"RTF") == 0) {*FType = BSLUD;*BMPSplitP = 0;return;} if(mystrcasecmp(fs,"Unicode") == 0) {*FType = UPLX;return;} if(mystrcasecmp(fs,"Apache") == 0) {*FType = APACHE;*UTF8Type=4;return;} if(mystrcasecmp(fs,"OOXML") == 0) {*FType = OOXML;return;} /* Match regexps against examples */ regcomp(&rx,"^&#[xX][[:xdigit:]]{4,};$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* HTMLX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = HTMLX;return;} regfree(&rx); regcomp(&rx,"^&#[[:digit:]]{4,};$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* HTMLD */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = HTMLD;return;} regfree(&rx); regcomp(&rx,"^[\\]#[xX][[:xdigit:]]{4,};$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED);/* SGMLX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = SGMLX;return;} regfree(&rx); regcomp(&rx,"^[\\]#[[:digit:]]{4,};$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* SGMLD */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = SGMLD;return;} regfree(&rx); /* regcomp(&rx,"^&#[[:xdigit:]]{2};$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); HDML */ /* if(!regexec(&rx,fs,0,NULL,0)) {*FType = HDML;return;} */ /* regfree(&rx); */ regcomp(&rx,"^[\\]u[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* BSLU */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = BSLU;return;} regfree(&rx); regcomp(&rx,"^[\\][xX][[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* BSLX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = BSLX;return;} regfree(&rx); regcomp(&rx,"^0x[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* STDX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = STDX;return;} regfree(&rx); regcomp(&rx,"^#x[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* CLSX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = CLSX;return;} regfree(&rx); regcomp(&rx,"^[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* RAWX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = RAWX;return;} regfree(&rx); regcomp(&rx,"^[\\]x[{][[:xdigit:]]{4,}[}]$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* BSLXB */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = BSLXB;return;} regfree(&rx); regcomp(&rx,"^$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* ABUX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = ABUX;return;} regfree(&rx); regcomp(&rx,"^U[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* JUUX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = JUUX;return;} regfree(&rx); regcomp(&rx,"^u[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* JuUX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = JuUX;return;} regfree(&rx); regcomp(&rx,"^%u[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* PCTUX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = PCTUX;return;} regfree(&rx); regcomp(&rx,"^U\\+[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* UPLX */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = UPLX;return;} regfree(&rx); regcomp(&rx,"^X\'[[:xdigit:]]{4,}\'$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* XQ */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = XQ;return;} regfree(&rx); regcomp(&rx,"^[\\]u[[:digit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* BSLUD */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = BSLUD;return;} regfree(&rx); regcomp(&rx,"^v[[:digit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* PERLV */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = PERLV;return;} regfree(&rx); regcomp(&rx,"^[$][[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* DOLLAR */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = DOLLAR;return;} regfree(&rx); regcomp(&rx,"^16#[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* PSPT */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = PSPT;return;} regfree(&rx); regcomp(&rx,"^#16r[[:xdigit:]]{4,}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* CLR */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = CLR;return;} regfree(&rx); regcomp(&rx,"^16#[[:xdigit:]]{4,}#$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* ADA */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = ADA;return;} regfree(&rx); regcomp(&rx,"^[\\][0-7]{3}[\\][0-7]{3}[\\][0-7]{3}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* BYTEO */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = BYTEO;return;} regfree(&rx); regcomp(&rx,"^[\\]d[0-9]{3}[\\]d[0-9]{3}[\\]d[0-9]{3}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* BYTED */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = BYTED;return;} regfree(&rx); regcomp(&rx,"^[\\]x[[:xdigit:]]{2}[\\]x[[:xdigit:]]{2}[\\]x[[:xdigit:]]{2}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* BYTEH */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = BYTEH;return;} regfree(&rx); regcomp(&rx,"^(<[[:xdigit:]]{2}>){1,3}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* UTF8ANGLE */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = UTF8ANGLE;return;} regfree(&rx); regcomp(&rx,"^&[^0-9]+;$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* Non-numeric Character entity */ if(!regexec(&rx,fs,0,NULL,0)) {*UseEntitiesP = 1;return;} regfree(&rx); regcomp(&rx,"^(=[[:xdigit:]]{2}){1,3}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* I format */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = IFMT;*UTF8Type=2;return;} regfree(&rx); regcomp(&rx,"^(%[[:xdigit:]]{2}){1,3}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* J format */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = JFMT;*UTF8Type=1;return;} regfree(&rx); regcomp(&rx,"^([\\][0-7]{3}){1,3}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* K format */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = KFMT;*UTF8Type=3;return;} regcomp(&rx,"^([\\][xX][[:xdigit:]]{2}){1,3}$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* Apache */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = APACHE;*UTF8Type=4;return;} regfree(&rx); regcomp(&rx,"^_[xX][[:xdigit:]]{1,6}_$",REG_NEWLINE|REG_NOSUB|REG_EXTENDED); /* OOXML */ if(!regexec(&rx,fs,0,NULL,0)) {*FType = OOXML;return;} regfree(&rx); regfree(&rx); *FType = FMT_UNKNOWN; } int CountSlots(char *s) { char PreviousChar = '\0'; char c; char *p; int cnt = 0; p = s; while( (c=*p++) != '\0') { if(c == '\%') { if(PreviousChar != '\%') cnt++; } PreviousChar = c; } return(cnt); } void OldListFormatArguments (short ToAsciiP) { fprintf(stderr, "The argument to the -a option may be be a format name, an example,\n"); fprintf(stderr, "or an arbitrary single character specifier.\n"); fprintf(stderr, _(" 1 Common Lisp format hexadecimal numbers (#x00E9)\n")); fprintf(stderr, _(" 2 Perl style decimal numbers with prefix v (v233)\n")); fprintf(stderr, _(" 3 hexadecimal numbers with prefix $ ($00E9)\n")); fprintf(stderr, _(" 4 hexadecimal numbers with prefix 16# (16#00E9)\n")); fprintf(stderr, _(" 5 hexadecimal numbers with prefix #16r (#16r00E9)\n")); fprintf(stderr, _(" 6 hexadecimal numbers with prefix 16# and suffix # (16#00E9#)\n")); fprintf(stderr, _(" A hexadecimal numbers with prefix U in anglebrackets()\n")); fprintf(stderr, _(" B backslash-x escaped hexadecimal numbers (\\x00E9)\n")); fprintf(stderr, _(" C backslash-x escaped hexadecimal numbers in braces (\\x{00E9})\n")); fprintf(stderr, _(" D decimal numeric character references (é)\n")); fprintf(stderr, _(" E hexadecimal with prefix U (U00E9)\n")); fprintf(stderr, _(" F hexadecimal with prefix u (u00E9)\n")); fprintf(stderr, _(" G hexadecimal in single quotes with prefix X (X\'00E9\')\n")); fprintf(stderr, _(" H hexadecimal numeric character references (é)\n")); fprintf(stderr, _(" I hexadecimal UTF-8 with each byte's hex preceded by an =-sign (=C3=A9).\n\t\tThis is the Quoted Printable format defined by RFC 2045.\n")); fprintf(stderr, _(" J hexadecimal UTF-8 with each byte's hex preceded by a %%-sign (%%C3%%A9)\n\t\tThis is the URI escape format defined by RFC 2396.\n")); fprintf(stderr, _(" K octal UTF-8 with backslash escapes (\303\251)\n")); fprintf(stderr, _(" L \\U-escaped hex outside the BMP (U+0000-U+FFFF), \\u-escaped hex within.\n")); fprintf(stderr, _(" M hexadecimal SGML numeric character references (\\#x00E9;)\n")); fprintf(stderr, _(" N decimal SGML numeric character references (\\#0233;)\n")); fprintf(stderr, _(" O octal escapes for the three low bytes in big-endian order (\\000\\000\\351)\n")); fprintf(stderr, _(" P hexadecimal numbers with prefix U+ (U+00E9)\n")); fprintf(stderr, _(" Q character entities where possible (é)\n")); fprintf(stderr, _(" R raw hexadecimal numbers (00E9)\n")); fprintf(stderr, _(" S hexadecimal escapes for the three low bytes in big-endian order (\\x00\\x00\\xE9)\n")); fprintf(stderr, _(" T decimal escapes for the three low bytes in big-endian order (\\d000\\d000\\d233)\n")); fprintf(stderr, _(" U \\u-escaped hex (\\u00E9)\n")); fprintf(stderr, _(" V \\u-escaped decimal (\\u0233)\n")); /* fprintf(stderr, _(" W HDML two hexadecimal digits (&#E9;)\n")); */ fprintf(stderr, _(" X standard form hexadecimal numbers (0x00E9)\n")); if(!ToAsciiP) { fprintf(stderr, _(" Y all three types of HTML escape: hexadecimal character references,\ndecimal character references, and character entities\n")); } } void ListFormatArguments (short ToAsciiP) { fprintf(stderr, "The argument to the -a option may be be a format name, an example,\n"); fprintf(stderr, "or an arbitrary single character specifier.\n"); fprintf(stderr, _(" raw hexadecimal numbers\n")); fprintf(stderr,"\t(00E9)\tR\n"); fprintf(stderr, _(" standard form hexadecimal numbers\n")); fprintf(stderr,"\t(0x00E9)\tX\n"); fprintf(stderr, _(" prefix v decimal (Perl format)\n")); fprintf(stderr,"\t(v233)\t2\n"); fprintf(stderr, _(" prefix $ hexadecimal ($00E9)\t3\n")); fprintf(stderr, _(" prefix 16# hexadecimal (16#00E9)\t4\n")); fprintf(stderr, _(" prefix #x hexadecimal (Common Lisp format) (#x00E9)\t1\n")); fprintf(stderr, _(" prefix #16r hexadecimal (#16r00E9)\t5\n")); fprintf(stderr, _(" prefix \\u decimal (\\u0233)\tV\n")); fprintf(stderr, _(" prefix \\u hexadecimal (\\u00E9)\tU\n")); fprintf(stderr, _(" prefix \\U outside BMP, \\u within, hexadecimal (U+0000-U+FFFF)\tL\n")); fprintf(stderr, _(" prefix U hexadecimal (U00E9)\tE\n")); fprintf(stderr, _(" prefix u hexadecimal (u00E9)\tF\n")); fprintf(stderr, _(" prefix %%u hexadecimal (%%u00E9)\t9\n")); fprintf(stderr, _(" prefix U+ hexadecimal (U+00E9)\tP\n")); fprintf(stderr, _(" prefix X with hexadecimal in single quotes (X\'00E9\')\tG\n")); fprintf(stderr, _(" prefix 16# and suffix # hexadecimal (16#00E9#)\t6\n")); fprintf(stderr, _(" prefix U in anglebrackets hexadecimal ()\tA\n")); fprintf(stderr, _(" prefix backslash-x hexadecimal (\\x00E9)\tB\n")); fprintf(stderr, _(" prefix backslash-x hexadecimal in braces (\\x{00E9})\tC\n")); fprintf(stderr, _(" HTML numeric character references - decimal (é)\tD\n")); fprintf(stderr, _(" HTML numeric character references - hexadecimal (é)\tH\n")); fprintf(stderr, _(" SGML numeric character references -decimal (\\#0233;)\tN\n")); fprintf(stderr, _(" SGML numeric character references - hexadecimal (\\#x00E9;)\tM\n")); /* fprintf(stderr, _(" HDML two hexadecimal digits (&#E9;)\tW\n")); */ fprintf(stderr, _(" octal escapes for 3 low bytes in big-endian order (\\000\\000\\351)\tO\n")); fprintf(stderr, _(" hexadecimal escapes for 3 low bytes in big-endian order\n")); fprintf(stderr,"\t(\\x00\\x00\\xE9)\tS\n"); fprintf(stderr, _(" decimal escapes for 3 low bytes in big-endian order (\\d000\\d000\\d233)\tT\n")); fprintf(stderr, _(" hexadecimal UTF-8 with each byte's hex preceded by an =-sign (=C3=A9).\n\t\tRFC 2045 Quoted Printable.\tI\n")); fprintf(stderr, _(" hexadecimal UTF-8 with each byte's hex preceded by a %%-sign (%%C3%%A9)\n\t\tRFC 2396 URI escape format.\tJ\n")); fprintf(stderr, _(" hexadecimal UTF-8 with each byte's hex preceded by a backslash-x (\\xC3\\xA9)\n\t\tApache log format.\t7\n")); fprintf(stderr, _(" hexadecimal UTF-8 with each byte's hex surrounded by angle brackets ()\n\t\t\t0\n")); fprintf(stderr, _(" octal UTF-8 with backslash escapes (\303\251)\tK\n")); if(ToAsciiP) fprintf(stderr, _(" HTML character entities where possible (é), else numeric\tQ\n")); else { fprintf(stderr, _(" HTML character entities\tQ\n")); } if(!ToAsciiP) fprintf(stderr, _(" all three types of HTML escape: hexadecimal character references,\n\tdecimal character references, and character entities\tY\n")); } uni2ascii-4.20/install-sh0000755000175000017500000003577614300546425012277 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: uni2ascii-4.20/AUTHORS0000644000175000017500000000004413755677100011327 00000000000000Bill Poser (billposer@alum.mit.edu) uni2ascii-4.20/uni2ascii.info0000644000175000017500000000061413755677100013025 00000000000000Package: uni2ascii Version: 4.11 Revision: 0 Source: http://billposer.org/Software/Downloads/%n-4.11.tar.bz2 Source-MD5: uni2ascii-4.11.tar.bz2 SourceDirectory: %n-%v SetLDFLAGS: -lintl ConfigureParams: --mandir="%i/share/man" License: GPL Maintainer: Trevor Harmon Description: Converts text between Unicode and ASCII Homepage: http://billposer.org/Software/uni2ascii.html uni2ascii-4.20/configure.ac0000644000175000017500000000274714300547423012550 00000000000000AC_PREREQ([2.71]) AC_INIT([uni2ascii],[4.20],[billposer@alum.mit.edu]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE AC_ARG_ENABLE(newsummary, [--disable-newsummary Do not use new summary incompatible with u2a.tcl.], [case "${enableval}" in yes) newsummary=true ;; no) newsummary=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-newsummary) ;; esac],[newsummary=true]) AM_CONDITIONAL(NEWSUMMARY,test "$newsummary" = true) AC_ARG_ENABLE(debugbuild, [--enable-debugbuild. Compile for debugging.], [case "${enableval}" in yes) debugbuild=true ;; no) debugbuild=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debugbuild) ;; esac],[debugbuild=false]) AM_CONDITIONAL(DEBUGBUILD,test "$debugbuild" = true) # Checks for programs. AC_PROG_CC if ${debugbuild}; then CFLAGS="-ggdb -g3" else CFLAGS="-g -O2" fi AC_PROG_INSTALL AC_C_CONST AC_TYPE_SIZE_T AC_CHECK_LIB([intl], [gettext],AC_DEFINE([HAVE_LIBINTL], [1],[Define to 1 if you have libintl.]),) # Autoupdate added the next two lines to ensure that your configure # script's behavior did not change. They are probably safe to remove. AC_CHECK_INCLUDES_DEFAULT AC_PROG_EGREP AC_CHECK_HEADERS([fcntl.h gnu/libc-version.h libintl.h locale.h regex.h stddef.h stdio.h stdlib.h string.h sys/types.h sys/stat.h type.h unistd.h wchar.h]) # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([fgetln getline regcomp setlocale strtoul gettext]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT uni2ascii-4.20/compile0000755000175000017500000001635014300546425011634 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: uni2ascii-4.20/uni2html.py0000644000175000017500000000516413755677100012403 00000000000000#!/usr/bin/env python # Time-stamp: <2008-03-10 12:06:19 poser> # # Filter to read a UTF-8 Unicode file and convert every character # not within the 7-bit ASCII range to an HTML hexadecimal numeric character entity. # At present this does not work for codepoints outside the BMP since # the Python Unicode library is presently limited to 16 bit values. # # Copyright (C) 2004 William J. Poser (billposer@alum.mit.edu) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # or go to the web page: http://www.gnu.org/licenses/gpl.txt. import sys import codecs Version = '1.2' if len(sys.argv) > 1: if sys.argv[1] == '-v': sys.stdout.write("uni2html %s\n" % (Version)) sys.stdout.write("Copyright 2004, 2005 William J. Poser\n") sys.stdout.write("Released under the terms of the GNU General Public License.\n") else: sys.stdout.write("This program reads UTF-8 Unicode from the standard input\n") sys.stdout.write("and writes on the standard output the 7-bit ASCII resulting from\n") sys.stdout.write("the translation of every byte above 0x7F into the equivalent\n") sys.stdout.write("HTML hexadecimal numeric character entity.\n") sys.stdout.write("So long as Python's Unicode implementation is restricted to 16 bits\nonly the Basic Multilingual Plane (Plane 0) is covered.\n") sys.exit(2) infile = codecs.getreader('utf-8')(sys.stdin) CharCnt = 0 while 1: try: ch = infile.read(1) if not ch: sys.exit(0) CharCnt+=1 c = ord(ch) if c > 0x7F: sys.stdout.write("&#x%X;" % (c)) else: sys.stdout.write(ch); except ValueError: sys.stderr.write("Invalid UTF-8 encountered in input after character %d.\n" % (CharCnt)) sys.exit(1) except SystemExit: sys.exit(0) except IOError: sys.exit(0) except: sys.stderr.write("Error reading input after character %d.\n" % (CharCnt)) sys.exit(2) uni2ascii-4.20/unicode.h0000644000175000017500000000034113755677100012056 00000000000000typedef unsigned long UTF32; /* at least 32 bits */ typedef unsigned char UTF8; /* 8 bits */ typedef unsigned char Boolean; /* 0 or 1 */ #define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF #define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD uni2ascii-4.20/u2a.tcl0000644000175000017500000030035213755677100011457 00000000000000#!/bin/sh #-*- mode: Tcl;time-stamp-start:"TimeStamp[ ]+\\\\?[\"<]+";-*- # the next line restarts using wish \ exec wish $0 -- $@ set TimeStamp "2010-08-29 21:04:40 poser" # # Copyright (C) 2005-2008 William J. Poser (billposer@alum.mit.edu) # This program is free software; you can redistribute it and/or modify # it under the terms of version 3 of the GNU General Public License as # published by the Free Software Foundation. # # 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. # # A copy of the GNU General Public License is contained in the # procedure "License" in this file. # If it is not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # or go to the web page: http://www.gnu.org/licenses/gpl.txt. set Version "4.15" encoding system utf-8 set DebugP 0; # General debugging? package require tablelist package require msgcat proc _ {s} {return [::msgcat::mc $s]}; # Define shorthand for gettext set NonBinPath [file join /usr share uni2ascii]; fconfigure stdout -encoding utf-8 #set ColorSpecs(AsciiOptionEven,Background) "\#E9C8AC" set ColorSpecs(AsciiOptionEven,Background) "\#d7c7ff" set ColorSpecs(AsciiOptionOdd,Background) "\#ffbb9f" set ColorSpecs(BalloonHelp,Background) white set ColorSpecs(BalloonHelp,Foreground) blue set ColorSpecs(Button,Background) "\#8BD664" set ColorSpecs(Button,Foreground) black set ColorSpecs(Button,ActiveBackground) LightBlue set ColorSpecs(Button,ActiveForeground) red set ColorSpecs(CheckButton,Background) coral set ColorSpecs(CheckButton,ActiveForeground) red set ColorSpecs(CheckButton,ActiveBackground) LightBlue set ColorSpecs(CheckButton,Select) red #set ColorSpecs(Default,Background) "\#DEDEFF" set ColorSpecs(Default,Background) "\#c8dcfe" set ColorSpecs(DefaultActive,Background) "\#d4e4fe"; set ColorSpecs(Entry,Background) "navajo white" set ColorSpecs(Entry,DisabledBackground) blue set ColorSpecs(LabelText,Foreground) "\#d4e4fe"; set ColorSpecs(ListHeader,Background) "\#CBD7FF" set ColorSpecs(ListHeader,Foreground) black set ColorSpecs(ListHeader,ActiveBackground) "\#8f89fe"; set ColorSpecs(ListHeader,ActiveForeground) black set ColorSpecs(MainFrame,Background) grey15 set ColorSpecs(Menu,ActiveBackground) salmon; set ColorSpecs(Menu,ActiveForeground) maroon set ColorSpecs(Menu,Background) azure3 set ColorSpecs(Menu,Foreground) black set ColorSpecs(Menu,Select) coral set ColorSpecs(Menubar,ActiveBackground) RoyalBlue2 set ColorSpecs(Menubar,ActiveForeground) red set ColorSpecs(Menubar,Background) "\#c36176"; set ColorSpecs(Menubar,Foreground) "\#fee4a9"; set ColorSpecs(Messages,Background) NavajoWhite set ColorSpecs(Messages,Foreground) "\#000000"; set ColorSpecs(RadioButton,Background) "\#A0A0FF" set ColorSpecs(RadioButton,ActiveForeground) red set ColorSpecs(RadioButton,ActiveBackground) LightBlue set ColorSpecs(RadioButton,SelectedBackground) red set ColorSpecs(RadioButton,Select) red set ColorSpecs(UserTextEntry,Background) "\#ffaf80" set ColorSpecs(UserTextEntry,Foreground) black set ColorSpecs(TableList,SelectBackground) "\#FFCFBF" set ColorSpecs(TableList,SelectForeground) black option add *Background $ColorSpecs(Default,Background) option add *Balloonhelp*background $ColorSpecs(BalloonHelp,Background) 80 option add *Balloonhelp*foreground $ColorSpecs(BalloonHelp,Foreground) 80 option add *Button.Background $ColorSpecs(Button,Background) option add *Button.Foreground $ColorSpecs(Button,Foreground) option add *Menu.Background $ColorSpecs(Menu,Background) option add *Menu.Foreground $ColorSpecs(Menu,Foreground) option add *Menu.activeBackground $ColorSpecs(Menu,ActiveBackground) option add *Menu.activeForeground $ColorSpecs(Menu,ActiveForeground) option add *Menu.SelectBackground purple option add *Radiobutton.activeBackground $ColorSpecs(RadioButton,ActiveBackground) option add *Radiobutton.activeForeground $ColorSpecs(RadioButton,ActiveForeground) option add *Radiobutton.selectColor $ColorSpecs(RadioButton,Select) 80 option add *Checkbutton*background $ColorSpecs(CheckButton,Background) option add *Checkbutton.activeBackground $ColorSpecs(CheckButton,ActiveBackground) option add *Checkbutton.activeForeground $ColorSpecs(CheckButton,ActiveForeground) option add *Checkbutton.selectColor $ColorSpecs(CheckButton,Select) option add *Text.Font MainFont 100 option add *Menu.Font MenuFont 100 option add *Balloonhelpinfo.wrapLength 3i widgetDefault option add *Balloonhelp.info.justify left widgetDefault font create BalloonHelpFont -family lucida -size 12 font create MenuFont -family courier -size 12 font create MainFont -family courier -size 13 set MSG .mf.msg #For debugging messages proc dmsg {msg} { if {$::DebugP} { puts $msg; flush stdout; } } proc ShowMessage {msg} { if {[winfo exists $::MSG]} { $::MSG configure -state normal; $::MSG delete 1.0 end; $::MSG insert 1.0 $msg; $::MSG configure -state disabled; return } puts stderr $msg; } proc ClearMessage {} { $::MSG configure -state normal $::MSG delete 1.0 end; $::MSG configure -state disabled } #Portability #Figure out what system we are running on if {[string equal $tcl_platform(platform) windows]} { set SystemInfo(System) MSWindows; dmsg "Running under MS Windows"; } elseif {[string equal $tcl_platform(platform) unix]} { if {[string equal $tcl_platform(os) Darwin]} { set SystemInfo(System) MacOSX; dmsg "Running under Mac OS X"; } else { set SystemInfo(System) Unix; dmsg "Running under Unix"; } } if {[string match $SystemInfo(System) MSWindows]} { set NonBinPath [file dirname [info script]]; } if {[info exists ::env(TMP)]} { set TempDir $::env(TMP); } elseif {[info exists ::env(TEMP)]} { set TempDir $::env(TEMP); } else { if { $SystemInfo(System)== "MSWindows"} { set TempDir "C:\tmp"; } else { set TempDir "/tmp"; } } set ResultFile [file join $TempDir "a2u.log"] proc SetupEvents {sys} { switch $sys { Unix { event add <> event add <> } MacOSX { event add <> event add <> } MSWindows { event add <> event add <> } } } proc DetermineGraphicsSystem {} { global SystemInfo if {[string match X11* [winfo server .]]} { set SystemInfo(AquaP) 0 set SystemInfo(WindowSystem) X11 } else { if {[string match $SystemInfo(System) "MSWindows"]} { set SystemInfo(AquaP) 0; set SystemInfo(WindowSystem) MSWindows; } if {[string match $SystemInfo(System) "MacOSX"]} { set SystemInfo(AquaP) 1 set SystemInfo(WindowSystem) Aqua } } } DetermineGraphicsSystem SetupEvents $SystemInfo(System) set SubstitutionList {} set DeletionList {} #Determines which program to use # 1 = ascii2uni # 0 = uni2ascii set WhichWay 0 #Daughter program options the user may set set HexUpperCaseP 1 set PreserveNewlinesP 1 set PreserveSpaceP 1 set ConvertAsciiP 0 set AddSpaceP 0 set InputPureP 0 set AcceptWithoutSemicolonP 1; # Convert semi-colon-less entities and references set WhichConversion 7 set ConvertStyleP 0 set ConvertEnclosedP 0 set StripDiacriticsP 0 set ConvertApproximateP 0 set ExpandToAsciiP 0 set BalloonHelpP 1 set DefaultBrowser dillo set BrowserList [list firefox mozilla epiphany galeon konqueror dillo netscape] set BrowserPIDS [list]; proc ShutDown {} { global BrowserPIDS; #Shutdown child browsers foreach pid $BrowserPIDS { catch {exec kill $pid}; } exit 0; } proc ShowWebPage {url} { global BrowserPIDS; global SystemInfo if {[string equal $SystemInfo(System) MacOSX]} { lappend BrowserPIDS [exec osascript -e "\"open location $url\""] return } set BrowserFound 0; foreach Browser $::BrowserList { if { [string length [auto_execok $Browser]]} { set BrowserFound 1; break ; } else { ShowMessage [format \ [_ "The browser %s is not available on this machine or not in your path."]\ $Browser]; } } if {$BrowserFound} { lappend BrowserPIDS [exec $Browser $url &] } else { ShowMessage [_ "No browser on the browser list was located."] } } proc new_dialog_create {class {win "auto"}} { if {$win == "auto"} { set count 0 set win ".ndialog[incr count]" while {[winfo exists $win]} { set win ".ndialog[incr count]" } } toplevel $win -class $class; frame $win.info pack $win.info -expand yes -fill both -padx 4 -pady 4 wm title $win $class wm group $win . after idle [format { update idletasks wm minsize %s [winfo reqwidth %s] [winfo reqheight %s] } $win $win $win] return $win } # The following code is taken from the Efftcl library by Mark Harrison and # Michael McLennan, copyrighted by Mark Harrison and Lucent Technologies, available # from http://www.awprofessional.com/content/images/0201634740/sourcecode/efftcl.zip. # As the authors explicitly give permission to "steal the code for your own applications" # the relevant portions are included here so as not to require the user to install # to install the library. If you install the library, remove the following and # uncomment the line "#package require Efftcl" by deleting the crosshatch. # Effective Tcl/Tk Programming # Mark Harrison, DSC Communications Corp. # Michael McLennan, Bell Labs Innovations for Lucent Technologies # Addison-Wesley Professional Computing Series # ====================================================================== # Copyright (c) 1996-1997 Lucent Technologies Inc. and Mark Harrison # ====================================================================== proc dialog_info {win} { return "$win.info" } proc dialog_controls {win} { return "$win.controls" } proc dialog_wait {win varName} { dialog_safeguard $win set x [expr [winfo rootx .]+50] set y [expr [winfo rooty .]+50] wm geometry $win "+$x+$y" wm deiconify $win grab set $win vwait $varName grab release $win wm withdraw $win } bind modalDialog { wm deiconify %W raise %W } proc dialog_safeguard {win} { if {[lsearch [bindtags $win] modalDialog] < 0} { bindtags $win [linsert [bindtags $win] 0 modalDialog] } } proc CreateTextDisplay {title width height {bg "\#e6b483"} {fg "\#000080"} } { set top [new_dialog_create Textdisplay] wm title $top $title set info [dialog_info $top] scrollbar $info.sbar -command "$info.text yview" pack $info.sbar -side right -fill y text $info.text -height $height -width $width -font MainFont -wrap word -yscrollcommand "$info.sbar set" -background $bg -foreground $fg -exportselection 1; pack $info.text -side left -expand yes -fill both $info.text configure -state disabled bind $info.sbar <> "ScrollbarMoveBigIncrement $info.sbar 0.2 %x %y" return $top } proc PopupDown {n} { global HelpPopups; if {[info exists HelpPopups($n)]} { if {[winfo exists $HelpPopups($n)]} { destroy $HelpPopups($n); return 1; } } return 0; } proc AppendToTextDisplay {top mesg} { set info [dialog_info $top] $info.text configure -state normal $info.text insert end $mesg $info.text configure -state disabled } set linkNum 0; proc AppendLinkToTextDisplay {top mesg LinkCode} { global linkNum set info [dialog_info $top] $info.text configure -state normal set tag "link[incr linkNum]" bind $info.text break $info.text insert end $mesg [list body $tag] $info.text tag configure $tag -foreground red -underline 1 $info.text tag bind $tag \ "$info.text tag configure $tag -foreground blue" $info.text tag bind $tag \ "$info.text tag configure $tag -foreground red" $info.text tag bind $tag \ "$LinkCode" $info.text configure -state disabled } proc ExplainEquivalences {} { global Version; if {[PopupDown ExplainEquivalences] ==1} {return} set po [CreateTextDisplay [_ "Equivalences"] 72 12] set ::HelpPopups(ExplainEquivalences) $po AppendToTextDisplay $po "U+00A0 no break space 0x20 space\n" AppendToTextDisplay $po "U+00AB left-pointing double angle quotation mark 0x22 double quote\n" AppendToTextDisplay $po "U+00AD soft hyphen 0x2D minus\n" AppendToTextDisplay $po "U+00BB right-pointing double angle quotation mark 0x22 double quote\n" AppendToTextDisplay $po "U+1361 ethiopic word space 0x20 space\n" AppendToTextDisplay $po "U+1680 ogham space 0x20 space\n" AppendToTextDisplay $po "U+2000 en quad 0x20 space\n" AppendToTextDisplay $po "U+2001 em quad 0x20 space\n" AppendToTextDisplay $po "U+2002 en space 0x20 space\n" AppendToTextDisplay $po "U+2003 em space 0x20 space\n" AppendToTextDisplay $po "U+2004 three-per-em space 0x20 space\n" AppendToTextDisplay $po "U+2005 four-per-em space 0x20 space\n" AppendToTextDisplay $po "U+2006 six-per-em space 0x20 space\n" AppendToTextDisplay $po "U+2007 figure space 0x20 space\n" AppendToTextDisplay $po "U+2008 punctuation space 0x20 space\n" AppendToTextDisplay $po "U+2009 thin space 0x20 space\n" AppendToTextDisplay $po "U+200A hair space 0x20 space\n" AppendToTextDisplay $po "U+200B zero-width space 0x20 space\n" AppendToTextDisplay $po "U+2010 hyphen 0x2D minus\n" AppendToTextDisplay $po "U+2011 non-breaking hyphen 0x2D minus\n" AppendToTextDisplay $po "U+2012 figure dash 0x2D minus\n" AppendToTextDisplay $po "U+2013 en dash 0x2D minus\n" AppendToTextDisplay $po "U+2014 em dash 0x2D minus\n" AppendToTextDisplay $po "U+2018 left single quotation mark 0x60 left single quote\n" AppendToTextDisplay $po "U+2019 right single quotation mark 0x27 right or neutral single quote\n" AppendToTextDisplay $po "U+201A single low-9 quotation mark 0x60 left single quote\n" AppendToTextDisplay $po "U+201B single high-reversed-9 quotation mark 0x60 left single quote\n" AppendToTextDisplay $po "U+201C left double quotation mark 0x22 double quote\n" AppendToTextDisplay $po "U+201D right double quotation mark 0x22 double quote\n" AppendToTextDisplay $po "U+201E double low-9 quotation mark 0x22 double quote\n" AppendToTextDisplay $po "U+201F double high-reversed-9 quotation mark 0x22 double quote\n" AppendToTextDisplay $po "U+2039 single left-pointing angle quotation mark 0x60 left single quote\n" AppendToTextDisplay $po "U+203A single right-pointing angle quotation mark 0x27 right or neutral single quote\n" AppendToTextDisplay $po "U+204E low asterisk 0x2A asterisk\n" AppendToTextDisplay $po "U+2212 minus sign 0x2D minus\n" AppendToTextDisplay $po "U+2217 asterisk operator 0x2A asterisk\n" AppendToTextDisplay $po "U+222A union symbol 0x55 capital U\n" AppendToTextDisplay $po "U+2731 heavy asterisk 0x2A asterisk\n" AppendToTextDisplay $po "U+275D heavy double turned comma quotation mark 0x22 double quote\n" AppendToTextDisplay $po "U+275E heavy double comma quotation mark 0x22 double quote\n" AppendToTextDisplay $po "U+3000 ideographic space 0x20 space\n" AppendToTextDisplay $po "U+FE60 small ampersand 0x26 ampersand\n" AppendToTextDisplay $po "U+FE61 small asterisk 0x2A asterisk\n" AppendToTextDisplay $po "U+FE62 small plus sign 0x2B plus sign\n"; } proc ExplainExpansions {} { global Version; if {[PopupDown ExplainExpansions] ==1} {return} set po [CreateTextDisplay [_ "Expansions"] 72 12] set ::HelpPopups(ExplainExpansions) $po AppendToTextDisplay $po "If this option is chosen, certain characters are expanded to sequences of approximately equivalent plain ASCII characters. The expansions are:\n" AppendToTextDisplay $po "\tU+00A2 \u00A2\tCENT SIGN \t\u2192 cent\n" AppendToTextDisplay $po "\tU+00A3 \u00A3\tPOUND SIGN \t\u2192 pound\n" AppendToTextDisplay $po "\tU+00A5 \u00A5\tYEN SIGN \t\u2192 yen\n" AppendToTextDisplay $po "\tU+00A9 \u00A9\tCOPYRIGHT SYMBOL \t\u2192 (c)\n" AppendToTextDisplay $po "\tU+00AE \u00AE\tREGISTERED SYMBOL \t\u2192 (R)\n" AppendToTextDisplay $po "\tU+00BC \u00BC\tONE QUARTER \t\u2192 1/4\n" AppendToTextDisplay $po "\tU+00BD \u00BD\tONE HALF \t\u2192 1/2\n" AppendToTextDisplay $po "\tU+00BE \u00BE\tTHREE QUARTERS \t\u2192 3/4\n" AppendToTextDisplay $po "\tU+00C6 \u00C6\tCAPITAL LETTER ASH \t\u2192 AE\n" AppendToTextDisplay $po "\tU+00DF \u00DF\tSMALL LETTER SHARP S \t\u2192 ss\n" AppendToTextDisplay $po "\tU+00E6 \u00E6\tSMALL LETTER ASH \t\u2192 ae\n" AppendToTextDisplay $po "\tU+0132 \u0132\tLIGATURE IJ \t\u2192 IJ\n" AppendToTextDisplay $po "\tU+0133 \u0133\tLIGATURE ij \t\u2192 ij\n" AppendToTextDisplay $po "\tU+0152 \u0152\tLIGATURE OE \t\u2192 OE\n" AppendToTextDisplay $po "\tU+0153 \u0153\tLIGATURE oe \t\u2192 oe\n" AppendToTextDisplay $po "\tU+01F1 \u01F1\tCAPITAL LETTER DZ \t\u2192 DZ\n" AppendToTextDisplay $po "\tU+01F2 \u01F2\tCAPITAL LETTER Dz \t\u2192 Dz\n" AppendToTextDisplay $po "\tU+01F3 \u01F3\tSMALLL LETTER DZ \t\u2192 dz\n" AppendToTextDisplay $po "\tU+02A6 \u02A6\tSMALLL LETTER TS DIGRAPH \t\u2192 ts\n" AppendToTextDisplay $po "\tU+2026 \u2026\tHORIZONTAL ELLIPSIS \t\u2192 ...\n" AppendToTextDisplay $po "\tU+20AC \u20AC\tEURO SIGN \t\u2192 euro\n" AppendToTextDisplay $po "\tU+2190 \u2190\tLEFTWARDS ARROW \t\u2192 <-\n" AppendToTextDisplay $po "\tU+2192 \u2192\tRIGHTWARDS ARROW \t\u2192 ->\n" AppendToTextDisplay $po "\tU+21D0 \u21D0\tLEFTWARDS DOUBLE ARROW \t\u2192 <=\n" AppendToTextDisplay $po "\tU+21D2 \u21D2\tRIGHTWARDS DOUBLE ARROW \t\u2192 =>\n" AppendToTextDisplay $po "\tU+22EF \u22EF\tMIDLINE HORIZONTAL ELLIPSIS\t\u2192 ...\n" } proc ExplainSingleApproximations {} { global Version; if {[PopupDown ExplainSingleApproximations] ==1} {return} set po [CreateTextDisplay [_ "Single Character Approximations"] 72 12] set ::HelpPopups(ExplainSingleApproximations) $po AppendToTextDisplay $po "If this option is chosen, certain characters are converted to a single equivalent plain ASCII character. The conversions are:\n" AppendToTextDisplay $po "\tU+00A2 \u00A2\tCENT SIGN \t\u2192 C\n" AppendToTextDisplay $po "\tU+00A3 \u00A3\tPOUND SIGN \t\u2192 \#\n" AppendToTextDisplay $po "\tU+00A5 \u00A5\tYEN SIGN \t\u2192 Y\n" AppendToTextDisplay $po "\tU+00A9 \u00A9\tCOPYRIGHT SYMBOL \t\u2192 C\n" AppendToTextDisplay $po "\tU+00AE \u00AE\tREGISTERED SYMBOL \t\u2192 R\n" AppendToTextDisplay $po "\tU+00BC \u00BC\tONE QUARTER \t\u2192 -\n" AppendToTextDisplay $po "\tU+00BD \u00BD\tONE HALF \t\u2192 -\n" AppendToTextDisplay $po "\tU+00BE \u00BE\tTHREE QUARTERS \t\u2192 -\n" AppendToTextDisplay $po "\tU+00C6 \u00C6\tCAPITAL LETTER ASH \t\u2192 A\n" AppendToTextDisplay $po "\tU+00DF \u00DF\tSMALL LETTER SHARP S \t\u2192 s\n" AppendToTextDisplay $po "\tU+00E6 \u00E6\tSMALL LETTER ASH \t\u2192 a\n" AppendToTextDisplay $po "\tU+0132 \u0132\tLIGATURE IJ \t\u2192 I\n" AppendToTextDisplay $po "\tU+0133 \u0133\tLIGATURE ij \t\u2192 i\n" AppendToTextDisplay $po "\tU+0152 \u0152\tLIGATURE OE \t\u2192 O\n" AppendToTextDisplay $po "\tU+0153 \u0153\tLIGATURE oe \t\u2192 o\n" AppendToTextDisplay $po "\tU+01F1 \u01F1\tCAPITAL LETTER DZ \t\u2192 D\n" AppendToTextDisplay $po "\tU+01F2 \u01F2\tCAPITAL LETTER Dz \t\u2192 D\n" AppendToTextDisplay $po "\tU+01F3 \u01F3\tSMALLL LETTER DZ \t\u2192 d\n" AppendToTextDisplay $po "\tU+02A6 \u02A6\tSMALLL LETTER TS DIGRAPH \t\u2192 t\n" AppendToTextDisplay $po "\tU+2026 \u2026\tHORIZONTAL ELLIPSIS \t\u2192 .\n" AppendToTextDisplay $po "\tU+20AC \u20AC\tEURO SIGN \t\u2192 E\n" AppendToTextDisplay $po "\tU+2190 \u2190\tLEFTWARDS ARROW \t\u2192 <\n" AppendToTextDisplay $po "\tU+2192 \u2192\tRIGHTWARDS ARROW \t\u2192 >\n" AppendToTextDisplay $po "\tU+21D0 \u21D0\tLEFTWARDS DOUBLE ARROW \t\u2192 <\n" AppendToTextDisplay $po "\tU+21D2 \u21D2\tRIGHTWARDS DOUBLE ARROW \t\u2192 >\n" AppendToTextDisplay $po "\tU+22EF \u22EF\tMIDLINE HORIZONTAL ELLIPSIS\t\u2192 .\n" } proc About {} { global Version; if {[PopupDown About] ==1} {return} set AboutPopup [CreateTextDisplay [_ "About This Program"] 72 12] set ::HelpPopups(About) $AboutPopup; AppendToTextDisplay $AboutPopup [format [_ "This is U2A version %s. "] $Version]; AppendToTextDisplay $AboutPopup [_ "It converts between Unicode and various textual representations of Unicode."]; AppendToTextDisplay $AboutPopup [_ "You can obtain the latest version of U2A from: "]; AppendLinkToTextDisplay $AboutPopup "http://billposer.org/Software/uni2ascii.html." {ShowWebPage http://billposer.org/Software/uni2ascii.html}; AppendToTextDisplay $AboutPopup "\n\n"; AppendToTextDisplay $AboutPopup "Copyright (C) 2005-2008 William J. Poser (billposer@alum.mit.edu). "; AppendToTextDisplay $AboutPopup [_ "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."]; AppendToTextDisplay $AboutPopup "\n\n"; AppendToTextDisplay $AboutPopup [_ "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.\n"]; AppendToTextDisplay $AboutPopup [_ "See the GNU General Public License for more details."]; AppendToTextDisplay $AboutPopup "\n\n"; AppendToTextDisplay $AboutPopup [_ "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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA."]; } set BugReportPopup ""; proc BugReports {} { global Version; global tcl_platform; global BugReportPopup if {[PopupDown BugReports] ==1} {return} set BugReportPopup [CreateTextDisplay [_ "Bug Reports"] 50 21]; set ::HelpPopups(BugReports) $BugReportPopup; AppendToTextDisplay $BugReportPopup [_ "Report bugs to: billposer@alum.mit.edu.\n"]; AppendToTextDisplay $BugReportPopup [_ "Please include the following information:\n\n"]; AppendToTextDisplay $BugReportPopup [_ "\tWhat version of U2A are you using?\n"]; AppendToTextDisplay $BugReportPopup [format [_ "\t\t(This is version %s.)\n\n"] $Version]; AppendToTextDisplay $BugReportPopup [_ "\tWhat operating system are you running?.\n"]; set OS $tcl_platform(os); if {$OS == "Linux"} {set OS "GNU/Linux"}; AppendToTextDisplay $BugReportPopup [format [_ "\t\t(This is %s %s.)\n\n"] $OS $tcl_platform(osVersion)]; AppendToTextDisplay $BugReportPopup [_ "\tWhat window system are you using?.\n"]; AppendToTextDisplay $BugReportPopup [format [_ "\t\t(This is %s.)\n\n"] $::SystemInfo(WindowSystem)] AppendToTextDisplay $BugReportPopup [_ "\tWhat version of tcl/tk are you using?.\n"]; AppendToTextDisplay $BugReportPopup [format [_ "\t\t(This is version %s.)\n\n"] [info patchlevel]]; AppendToTextDisplay $BugReportPopup [_ "Bug reports may be sent in any language that I can read without too much trouble or am trying to learn or improve. These include:\n\n"]; AppendLinkToTextDisplay $BugReportPopup [_ "\tCatalan"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=cat}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tDakelh (Carrier)"] {ShowWebPage http://ydli.org} AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tDutch"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=nld}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tEnglish"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=eng}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tEsperanto"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=epo}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tFrench"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=fra}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tGerman"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=deu}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tItalian"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=ita}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tJapanese"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=jpn}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tKazakh"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=kaz}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tKorean"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=kor}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tLatin"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=lat}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tPortuguese"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=por}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tSpanish"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=spa}; AppendToTextDisplay $BugReportPopup "\n"; AppendLinkToTextDisplay $BugReportPopup [_ "\tTurkish"] {ShowWebPage http://www.ethnologue.com/show_language.asp?code=tur}; AppendToTextDisplay $BugReportPopup "\n\n"; AppendToTextDisplay $BugReportPopup [_ "Please note that in many cases although I can understand the language my ability to respond in it may be limited.\n"]; AppendToTextDisplay $BugReportPopup "\n"; } proc ShowGPL {} { if {[PopupDown ShowGPL] ==1} {return} set po [CreateTextDisplay [_ "License"] 70 24] set ::PopupList(ShowGPL) $po; AppendToTextDisplay $po [format "%s%s" [format "%s\n\t%s\n" [_ "For this license in your language see:"] [_ "http://www.gnu.org/copyleft/gpl.html"]] "\ \ GNU GENERAL PUBLIC LICENSE\ Version 3, 29 June 2007\ Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. \ Preamble \ The GNU General Public License is a free, copyleft license for software and other kinds of works. \ The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. \ For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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. \ Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. \ For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. \ Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. \ Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. \ The precise terms and conditions for copying, distribution and modification follow. \ TERMS AND CONDITIONS \ 0. Definitions. \ \"This License\" refers to version 3 of the GNU General Public License. \ \"Copyright\" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. \ \"The Program\" refers to any copyrightable work licensed under this License. Each licensee is addressed as \"you\". \"Licensees\" and \"recipients\" may be individuals or organizations. \ To \"modify\" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \"modified version\" of the earlier work or a work \"based on\" the earlier work. \ A \"covered work\" means either the unmodified Program or a work based on the Program. \ To \"propagate\" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. \ To \"convey\" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. \ An interactive user interface displays \"Appropriate Legal Notices\" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. \ 1. Source Code. \ The \"source code\" for a work means the preferred form of the work for making modifications to it. \"Object code\" means any non-source form of a work. \ A \"Standard Interface\" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. \ The \"System Libraries\" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \"Major Component\", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. \ The \"Corresponding Source\" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. \ The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. \ The Corresponding Source for a work in source code form is that same work. \ 2. Basic Permissions. \ All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. \ You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. \ Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. \ 3. Protecting Users' Legal Rights From Anti-Circumvention Law. \ No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. \ When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. \ 4. Conveying Verbatim Copies. \ You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. \ You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. \ 5. Conveying Modified Source Versions. \ You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: \ a) The work must carry prominent notices stating that you modified it, and giving a relevant date. \ b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \"keep intact all notices\". \ c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. \ d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. \ A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an \"aggregate\" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. \ 6. Conveying Non-Source Forms. \ You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: \ a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. \ b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. \ c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. \ d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. \ e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. \ A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. \ A \"User Product\" is either (1) a \"consumer product\", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \"normally used\" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. \ \"Installation Information\" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. \ If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). \ The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. \ Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. \ 7. Additional Terms. \ \"Additional permissions\" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. \ When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. \ Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: \ a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or \ b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or \ c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or \ d) Limiting the use for publicity purposes of names of licensors or authors of the material; or \ e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or \ f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. \ All other non-permissive additional terms are considered \"further restrictions\" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. \ If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. \ Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. \ 8. Termination. \ You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). \ However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. \ Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. \ Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. \ 9. Acceptance Not Required for Having Copies. \ You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. \ 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. \ An \"entity transaction\" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. \ You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. \ 11. Patents. \ A \"contributor\" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \"contributor version\". \ A contributor's \"essential patent claims\" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \"control\" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. \ Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. \ In the following three paragraphs, a \"patent license\" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \"grant\" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. \ If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \"Knowingly relying\" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. \ If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. \ A patent license is \"discriminatory\" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. \ Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. \ 12. No Surrender of Others' Freedom. \ If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. \ 13. Use with the GNU Affero General Public License. \ Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. \ 14. Revised Versions of this License. \ The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License \"or any later version\" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. \ If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. \ Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. \ 15. Disclaimer of Warranty. \ 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. \ 16. Limitation of Liability. \ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. \ 17. Interpretation of Sections 15 and 16. \ If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. "] } set OtherPopups(HowTo) ""; proc HowTo {} { if {[PopupDown HowTo] ==1} {return} set po [CreateTextDisplay [_ "How to Use this Program"] 60 15] set ::HelpPopups(HowTo) $po; AppendToTextDisplay $po [_ "This program provides an interface to two programs that do the actual conversions between Unicode and ASCII. It assembles the necessary information and then runs the appropriate program. What you need to do is to provide information about what you want to do. When you are ready, press the 'Convert' button.\n\n"] AppendToTextDisplay $po [_ "The first thing that you need to indicate is the direction of the conversion: from Unicode to ASCII or from ASCII to Unicode.\n\n"] AppendToTextDisplay $po [_ "Next, select the file from which the input is to be read and specify the name of the file into which the result of the conversion should be put. You can type the filenames directly into the entry boxes or you can browse by pressing the 'Browse' buttons.\n\n"] AppendToTextDisplay $po [_ "Next specify the ASCII format that is used in the input text if you are converting from ASCII to Unicode, or the ASCII format that you want to use if you are converting from Unicode to ASCII. If you select a format with your left mouse button and then click your right mouse button, some additional information about that format will be displayed if there is any.\n\n"] AppendToTextDisplay $po [_ "Finally, make any changes that you wish to make in the character replacement options and miscellaneous options and press 'Convert'. If you have made all the necessary choices, U2A will execute the appropriate conversion program and report the result. If you have not yet provided all the necessary information you will be notified of what is missing.\n\n"] AppendToTextDisplay $po [format [_ "If you often have to do this same conversion, you may wish to create a shell script rather than using this graphical interface all the time. To assist you in this, the 'Show Command Line' command on the File menu displays the command that would be executed if the 'Convert' button were pressed. Note that the last part of the command line, '2> %s', sends the standard error output to a temporary file. You may not want to do this when running the programs yourself.\n\n"] $::ResultFile]; AppendToTextDisplay $po [_ "If you become tired of the balloon help, you can disable it using the checkbox on the 'Help' menu."] } #The order in which the options are listed here is the order in which they will be #displayed. set OptionList {r x f e u v l a p b c g 1 3 d 2 4 5 6 7 8 h n m q y k i j o s t} set AsciiOptions(1,example) "\#x00E9" set AsciiOptions(1,description) "Hexadecimal with \#x preceding four digits" set AsciiOptions(1,info) "This notation is used in Common Lisp." set AsciiOptions(2,example) "v233" set AsciiOptions(2,description) "Decimal with v preceding number" set AsciiOptions(2,info) "This notation is used in Perl." set AsciiOptions(3,example) "\$00E9" set AsciiOptions(3,description) "Hexadecimal with \$ preceding number" set AsciiOptions(3,info) "This notation is used in Pascal and by many assemblers." set AsciiOptions(a,example) "" set AsciiOptions(a,description) "hexadecimal with prefix U in angle brackets" set AsciiOptions(a,info) "This notation is used in POSIX locale specifications." set AsciiOptions(b,example) "\\x00E9" set AsciiOptions(b,description) "hexadecimal with prefix \\x" set AsciiOptions(c,example) "\\x\{00E9\}" set AsciiOptions(c,description) "hexadecimal in braces with prefix \\x" set AsciiOptions(c,info) "This notation is used in Perl." set AsciiOptions(d,example) "&\#0233;" set AsciiOptions(d,description) "decimal numeric character reference" set AsciiOptions(d,info) "This notation is used in HTML" set AsciiOptions(e,example) "U00E9" set AsciiOptions(e,description) "hexadecimal with prefix U" set AsciiOptions(f,example) "u00E9" set AsciiOptions(f,description) "hexadecimal with prefix u" set AsciiOptions(g,example) "X\'00E9\'" set AsciiOptions(g,description) "hexadecimal in single quotes with prefix X" set AsciiOptions(h,example) "&\#x00E9" set AsciiOptions(h,description) "hexadecimal numeric character reference" set AsciiOptions(h,info) "This notation is used in HTML." set AsciiOptions(i,example) "=C3=A9" set AsciiOptions(i,description) "hexadecimal UTF-8 with =-sign prefix" set AsciiOptions(i,info) "This is the Quoted Printable format defined in RFC2045" set AsciiOptions(j,example) "%C3%A9" set AsciiOptions(j,description) "hexadecimal UTF-8 with %-sign prefixes" set AsciiOptions(j,info) "This is the Universal Resource Indicator notation defined in RFC2396." set AsciiOptions(k,example) "\\303\\251" set AsciiOptions(k,description) "octal UTF-8 with backslash prefixes" set AsciiOptions(l,example) "\\u00E9 / \\U10001" set AsciiOptions(l,description) "hexadecimal with prefix \\u within BMP, \\U outside" set AsciiOptions(l,info) "This format is used in Tcl and Scheme source code." set AsciiOptions(m,example) "\\\#xE9;" set AsciiOptions(m,description) "hexadecimal with prefix backslash crosshatch x and suffix semi-colon" set AsciiOptions(m,info) "This format is used in SGML." set AsciiOptions(n,example) "\\\#233;" set AsciiOptions(n,description) "decimal with prefix backslash crosshatch x and suffix semi-colon" set AsciiOptions(n,info) "This format is used in SGML." set AsciiOptions(o,example) "\\000\\000\\351" set AsciiOptions(o,description) "The low three bytes in octal in big-endian order." set AsciiOptions(s,info) "This format is one of three permitted in POSIX portable charmaps." set AsciiOptions(p,example) "U+00E9" set AsciiOptions(p,description) "hexadecimal with prefix U+" set AsciiOptions(p,info) "This is the notation used by the Unicode Consortium" set AsciiOptions(q,example) "é" set AsciiOptions(q,description) "character entity;" set AsciiOptions(q,info) "This notation is used in HTML.\nSelecting this conversion in going from ASCII to Unicode\nmeans that only character entities will be converted to Unicode.\nSelecting this conversion in the direction from Unicode\nto ASCII means that character entities will be generated\nwhere possible. Where character entities do not exist,\nhexadecimal character references will be generated." set AsciiOptions(r,example) "00E9" set AsciiOptions(r,description) "raw hexadecimal number" set AsciiOptions(s,example) "\\x00\\x00\\xE9" set AsciiOptions(s,description) "The low three bytes in hexadecimal in big-endian order." set AsciiOptions(s,info) "This format is one of three permitted in POSIX portable charmaps." set AsciiOptions(t,example) "\\d000\\d000\\d233" set AsciiOptions(t,description) "The low three bytes in decimal in big-endian order." set AsciiOptions(t,info) "This format is one of three permitted in POSIX portable charmaps." set AsciiOptions(u,example) "\\u00E9" set AsciiOptions(u,description) "hexadecimal with prefix \\u" set AsciiOptions(u,info) "This notation is used in Java and Python source code." set AsciiOptions(v,example) "\\u00233" set AsciiOptions(v,description) "decimal with prefix \\u" set AsciiOptions(v,info) "This notation is used in Rich Text Format (RTF)." set AsciiOptions(x,example) "0x00E9" set AsciiOptions(x,description) "standard format hexadecimal number" set AsciiOptions(y,example) "" set AsciiOptions(y,description) "all three HTML formats" set AsciiOptions(4,description) "Generate hexadecimal numbers with prefix 16\#" set AsciiOptions(4,example) "16\#00E9" set AsciiOptions(4,info) "This notation is used in Postscript" set AsciiOptions(5,description) "Generate hexadecimal numbers with prefix \#16r" set AsciiOptions(5,example) "\#16r00E9" set AsciiOptions(5,info) "This notation is used in Common Lisp" set AsciiOptions(6,description) "Generate hexadecimal numbers with prefix 16\# and suffix \#" set AsciiOptions(6,example) "16\#00E9\#" set AsciiOptions(6,info) "This notation is used in Ada" set AsciiOptions(7,example) "\\xC3\\xA9" set AsciiOptions(7,description) "hexadecimal UTF-8 with \\x prefixes" set AsciiOptions(7,info) "This notation is used in Apache log files" set AsciiOptions(8,example) "_x00E9_" set AsciiOptions(8,description) "hexadecimal with _x prefix and _ suffix" set AsciiOptions(8,info) "This notation is used in Microsoft's OOXML document file format" set AsciiOptions(Example,info) "This column shows examples of the various types of notation.\nIn most cases the example is of the representation of the\nletter \u00E9 \"e with acute accent\". The exception is the\ncase in which the notation is different within the BMP and\noutside it. Here the first example is of \u00E9 and the second\nis of \"Linear B syllable E\"." set AsciiOptions(Description,info) "This column contains a description of the notation." trace add variable WhichWay write ToggleOptionsEnabled proc ToggleOptionsEnabled {e o n} { upvar $e aup; if {$aup} { $::GENOPTIONS.tbl.ipt configure -state normal $::GENOPTIONS.tbl.aws configure -state normal $::GENOPTIONS.tbl.hu configure -state disabled $::GENOPTIONS.tbl.pt configure -state disabled $::GENOPTIONS.tbl.nt configure -state disabled $::GENOPTIONS.tbl.wt configure -state disabled $::GENOPTIONS.tbl.at configure -state disabled $::DOWNOPTIONS.tbl.sty configure -state disabled $::DOWNOPTIONS.tbl.cir configure -state disabled $::DOWNOPTIONS.tbl.dia configure -state disabled $::DOWNOPTIONS.tbl.app configure -state disabled $::DOWNOPTIONS.tbl.aps configure -state disabled $::DOWNOPTIONS.tbl.exp configure -state disabled } else { $::GENOPTIONS.tbl.ipt configure -state disabled $::GENOPTIONS.tbl.aws configure -state disabled $::GENOPTIONS.tbl.hu configure -state normal $::GENOPTIONS.tbl.pt configure -state normal $::GENOPTIONS.tbl.nt configure -state normal $::GENOPTIONS.tbl.wt configure -state normal $::GENOPTIONS.tbl.at configure -state normal $::DOWNOPTIONS.tbl.sty configure -state normal $::DOWNOPTIONS.tbl.cir configure -state normal $::DOWNOPTIONS.tbl.dia configure -state normal $::DOWNOPTIONS.tbl.app configure -state normal $::DOWNOPTIONS.tbl.aps configure -state normal $::DOWNOPTIONS.tbl.exp configure -state normal } } proc ProgramTimeDateStamp {} { set sts [split $::TimeStamp] return "[lindex $sts 0] [lindex $sts 1]" } #Set up balloon help toplevel .balloonhelp -class Balloonhelp -background black -borderwidth 1 -relief flat #label .balloonhelp.arrow -anchor nw -bitmap @arrow.xbm #pack .balloonhelp.arrow -side left -fill y label .balloonhelp.info -font BalloonHelpFont; pack .balloonhelp.info -side left -fill y wm overrideredirect .balloonhelp 1 wm withdraw .balloonhelp set bhInfo(active) 1 proc balloonhelp_control {state} { global bhInfo if {$state} { set bhInfo(active) 1 } else { balloonhelp_cancel set bhInfo(active) 0 } } proc balloonhelp_for {win mesg} { global bhInfo set bhInfo($win) $mesg set ::bhOverlapP($win) 1; bind $win {+balloonhelp_pending %W} bind $win {+balloonhelp_cancel} } proc balloonhelpd_for {win mesg} { global bhInfo set ::bhOverlapP($win) 0; set bhInfo($win) $mesg bind $win {+balloonhelp_show %W} bind $win {+wm withdraw .balloonhelp} } proc balloonhelp_pending {win} { global bhInfo balloonhelp_cancel set bhInfo(pending) [after 1000 [list balloonhelp_show $win]] } proc balloonhelp_cancel {} { global bhInfo if { [info exists bhInfo(pending)]} { after cancel $bhInfo(pending) unset bhInfo(pending) } wm withdraw .balloonhelp } proc balloonhelp_show {win} { global bhInfo; global bhOverlapP; if {$bhOverlapP($win)} { set Overlap 25; } else { set Overlap -10; } if {[winfo exists $win]} { if {$bhInfo(active)} { .balloonhelp.info configure -text $bhInfo($win) #Set abcissa set MaxStringWidth 0; foreach line [split $bhInfo($win) "\n"] { set StringWidth [font measure BalloonHelpFont -displayof .balloonhelp.info $line] if {$StringWidth > $MaxStringWidth} { set MaxStringWidth $StringWidth; } } set ScreenWidth [winfo screenwidth $win] set Width [winfo width $win]; set LeftEdge [winfo rootx $win]; set RightEdge [expr $LeftEdge + $Width]; if {$ScreenWidth - $RightEdge < $MaxStringWidth} { if {$LeftEdge > $MaxStringWidth} { set x [expr $LeftEdge - $MaxStringWidth + $Overlap]; } else { if {$ScreenWidth - $MaxStringWidth > 0} { set x [expr $RightEdge - $MaxStringWidth]; } else { set x [expr $ScreenWidth - $MaxStringWidth]; } } } else { set x [expr $RightEdge - $Overlap]; } #Set ordinate set Height [winfo height $win]; set TopEdge [winfo rooty $win]; # set y [expr $TopEdge + ($Height/2)]; set y [expr $TopEdge + int(($Height/1.5))]; wm geometry .balloonhelp +$x+$y wm deiconify .balloonhelp raise .balloonhelp } } if {[info exist bhInfo(pending)]} { unset bhInfo(pending) } } proc ToggleBalloonHelp {} { global BalloonHelpP; global BalloonHelpIndex; global m; if {$BalloonHelpP} { set BalloonHelpP 0; balloonhelp_control 0 ShowMessage [_ "Irritating Balloon Help Disabled"]; $m.configure entryconfigure $BalloonHelpIndex -label [_ "Show Balloon Help"]; } else { set BalloonHelpP 1; balloonhelp_control 1 ShowMessage [_ "Balloon Help Enabled"]; $m.configure entryconfigure $BalloonHelpIndex -label [_ "Hide Irritating Balloon Help"]; } } proc ConstructUACommandLine {ind} { set cl [list] lappend cl uni2ascii if {$::ConvertEnclosedP} { lappend cl "-c" } if {$::StripDiacriticsP} { lappend cl "-d" } if {$::ConvertApproximateP} { lappend cl "-e" } if {$::ConvertStyleP} { lappend cl "-f" } if {$::ExpandToAsciiP} { lappend cl "-x" } if {$::ConvertSingleApproximateP} { lappend cl "-y" } if {$::HexUpperCaseP == 0} { lappend cl "-l" } if {$::PreserveNewlinesP == 0} { lappend cl "-n" } if {$::PreserveSpaceP == 0} { lappend cl "-s" } if {$::ConvertAsciiP} { lappend cl "-p" } if {$::AddSpaceP} { lappend cl "-w" } if {$::AcceptWithoutSemicolonP} { lappend cl "-m" } foreach s $::SubstitutionList { lappend cl "-S" lappend cl [format "%s:%s" [lindex $s 0] [lindex $s 1]] } foreach d $::DeletionList { lappend cl "-S" lappend cl [format "%s:" $d] } set i [lindex $::OptionList $ind] lappend cl "-a" lappend cl [format "%s" [string toupper $i]] if {[string equal $i "q"]} { lappend cl "-a H" } return $cl } proc ConstructAUCommandLine {ind} { set cl [list] lappend cl ascii2uni if {$::InputPureP} { lappend cl "-p" } lappend cl [format "\-%s" [string toupper [lindex $::OptionList $ind]]] return $cl } proc ConstructCommandLine {ind inf outf} { if {$::WhichWay} { set cl [ConstructAUCommandLine $ind] } else { set cl [ConstructUACommandLine $ind] } lappend cl "<" lappend cl $inf; lappend cl ">" lappend cl $outf; lappend cl "2>" lappend cl $::ResultFile return $cl } set PreviousIndex ""; proc ExecuteDaughter {ReallyP} { ClearMessage set index [$::AFORMATS.f.tl curselection] if {[string equal $index ""]} { if {[string equal $::PreviousIndex ""]} { ShowMessage "No ASCII format has been selected." return ""; } else { set index $::PreviousIndex; } } else { set ::PreviousIndex $index; } set inf [$::INPUT.ent get] if {[string equal $inf ""]} { ShowMessage "No input file has been specified." return ""; } if {[file readable $inf] == 0} { ShowMessage "The specified input file is not readable." return "" } set outf [$::OUTPUT.ent get] if {[string equal $outf ""]} { ShowMessage "No output file has been specified." return ""; } if {[file exist $outf] && ([file writable $outf] == 0)} { ShowMessage "The specified output file is not writable." return "" } set cl [ConstructCommandLine $index $inf $outf] if {$ReallyP} { set cl [linsert $cl 0 "exec"] set result [eval $cl]; set rlist [GetResultInfo] set Converted [lindex $rlist 0] set msg [format "tokens converted: %d" $Converted] if {$::WhichWay} { # Ascii to unicode set MicrosoftStyle [lindex $rlist 2] append msg [format " (Microsoft-style %d)" $MicrosoftStyle] set Replaced [lindex $rlist 1] append msg [format " replaced: %d" $Replaced] } else { set TotalChars [lindex $rlist 1] append msg [format " out of %d total characters" $TotalChars] } ShowMessage $msg return $result; } else { ShowMessage $cl; } } #Return a list of three values: number of tokens converted, number replaced, number #of Microsoft-style non-standard HTML. proc GetResultInfo {} { if {[catch {open $::ResultFile "r"} ResultHandle ] != 0} { ShowMessage [format [_ "Mysterious failure to open temporary file %s."] $::ResultFile]; return ""; } #Read first line of log if {[gets $ResultHandle line] <= 0} { return [list 0 0 0] } set rlist [split $line] lappend res [lindex $rlist 0] if {!$::WhichWay} { lappend res [lindex $line 5] } #Attempt to read second line of log, which will contain replacement count, if ascii2uni, #or the number of input characters, if uni2ascii. if {[gets $ResultHandle line] > 0} { lappend res [lindex $line 0] } else { lappend res 0 if {$::WhichWay} { lappend res 0 } return $res } if {[gets $ResultHandle line] > 0} { lappend res [lindex $line 0] } else { if {$::WhichWay} { lappend res 0 } } return $res; } proc PopupInfo {o} { if {[info exist ::AsciiOptions($o,info)]} { set info $::AsciiOptions($o,info); if {[PopupDown $o] ==1} {return} set po [CreateTextDisplay $o 72 12] set ::HelpPopups($o) $po AppendToTextDisplay $po $info; } } proc CellInfo {} { set row [lindex [split [$::AFORMATS.f.tl curcellselection] ","] 0] PopupInfo [lindex $::OptionList $row] } #If the filename passed as argument is a pathname #leading to a file in the current working directory, #return just the basename+extension. Otherwise #return the argument. proc MinimizeFileName {s} { set cwd [pwd]; set sdir [file dirname $s] if {[string equal $cwd $sdir]} { return [file tail $s] } else { return $s; } } proc SelectInputFile {} { set InputFile [tk_getOpenFile]; if {$InputFile == ""} { ShowMessage [_ "File selection aborted."] } else { $::INPUT.ent delete 0 end $::INPUT.ent insert 0 [MinimizeFileName $InputFile] } } proc SelectOutputFile {} { set OutputFile [tk_getSaveFile -initialfile [_ "MinpairOutput"]]; if {$OutputFile == ""} { ShowMessage [_ "File selection aborted."] } else { $::OUTPUT.ent delete 0 end $::OUTPUT.ent insert 0 [MinimizeFileName $OutputFile] } } proc DescribeColumn {w c} { if {$c == 0} { PopupInfo Description; } else { PopupInfo Example; } } puts "u2a $Version"; puts "Copyright (C) 2005-2008 William J. Poser."; puts [_ "This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation."]; set m [menu .menubar -tearoff 0 -font MenuFont \ -bg $ColorSpecs(Menubar,Background) \ -fg $ColorSpecs(Menubar,Foreground) \ -activebackground $ColorSpecs(Menubar,ActiveBackground)\ -activeforeground $ColorSpecs(Menubar,ActiveForeground)] set MenuBarItemCnt -1; $m add cascade -label [_ "File"] -menu [menu $m.file] $m.file add command -label [_ "Show Command Line"] -command {ExecuteDaughter 0} $m.file add command -label [_ "Quit"] -command ShutDown; $m add cascade -label [_ "Help"] -menu [menu $m.help] $m.help add command -label "About" -command About $m.help add checkbutton -label "Balloon Help" -variable BalloonHelpP \ -onvalue 1 -offvalue 0 -command {balloonhelp_control $::BalloonHelpP} -indicatoron 1 \ -selectcolor coral $m.help add command -label "Bug Reports" -command BugReports $m.help add command -label "How to Use this Program" -command HowTo $m.help add command -label "License" -command ShowGPL $m.help add command -label "Unicode Consortium Web Site" -command {ShowWebPage http://www.unicode.org} . configure -menu .menubar frame .mf -background $ColorSpecs(MainFrame,Background) pack .mf text $MSG -bg $ColorSpecs(Messages,Background) \ -fg $ColorSpecs(Messages,Foreground) \ -height 1 -width 60\ -relief sunken -font MainFont -exportselection 1 -state disabled balloonhelp_for $MSG "Messages from the program appear here." set WHICHWAY .mf.whichway frame $WHICHWAY -border 2 -relief ridge frame $WHICHWAY.f -border 2 -relief ridge label $WHICHWAY.f.tit -text "Direction of Conversion" radiobutton $WHICHWAY.f.tou -variable WhichWay -value 1 -text "ASCII to Unicode" radiobutton $WHICHWAY.f.toa -variable WhichWay -value 0 -text "Unicode to ASCII" button $WHICHWAY.exe -text "Convert" -command {ExecuteDaughter 1} \ -bg "\#FF9f8c" -fg black -activeforeground black -activebackground red pack $WHICHWAY.f.tit -side top -expand 0 -fill none -padx 2 -pady {4 5} -anchor w pack $WHICHWAY.f.tou -side left -expand 1 -fill both -padx {2 4} -pady 5 pack $WHICHWAY.f.toa -side left -expand 1 -fill both -padx {4 5} -pady 5 pack $WHICHWAY.f -side left -expand 1 -fill both -padx {5 40} -pady {6 6} pack $WHICHWAY.exe -side left -expand 1 -fill both -padx {40 10} -pady 6 set msg "Here is where you choose whether to convert from Unicode to an ASCII representation or from an ASCII representation to Unicode." balloonhelp_for $WHICHWAY $msg set msg "When you have set everything up and are ready to actually carry out the conversion, press this button." balloonhelp_for $WHICHWAY.exe $msg set GENOPTIONS .mf.f frame $GENOPTIONS -border 2 -relief ridge label $GENOPTIONS.tit -text "Miscellaneous Options" frame $GENOPTIONS.tbl checkbutton $GENOPTIONS.tbl.hu -variable HexUpperCaseP -text "Upper case hexadecimal numbers" \ -indicatoron 0 checkbutton $GENOPTIONS.tbl.pt -variable ConvertAsciiP -offvalue 0 -onvalue 1 \ -text "Convert ASCII characters" -indicatoron 0 checkbutton $GENOPTIONS.tbl.nt -variable PreserveNewlinesP -offvalue 1 -onvalue 0 \ -text "Convert linefeed characters" -indicatoron 0 checkbutton $GENOPTIONS.tbl.wt -variable PreserveSpaceP -offvalue 1 -onvalue 0 \ -text "Convert space characters" -indicatoron 0 checkbutton $GENOPTIONS.tbl.at -variable AddSpaceP -text "Add a space after each item" \ -indicatoron 0 checkbutton $GENOPTIONS.tbl.ipt -variable InputPureP -text "Input is pure" \ -indicatoron 0 checkbutton $GENOPTIONS.tbl.aws -variable AcceptWithoutSemicolonP -text "No Semicolon OK?" \ -indicatoron 0 set msg "Here is where you can set various options. Note that some options apply only to uni2ascii and others only to ascii2uni. The options that are not relevant to the current direction of conversion are disabled and appear greyed out." balloonhelp_for $GENOPTIONS $msg set msg "Select this option if you want to use the upper case letters A, B, C, D, E, and F in hexadecimal numbers, where they represent the numbers 10, 11, 12, 13, 14, and 15. For example, the letter \u00E9, e with acute accent, will look like this in standard hexadecimal notation: 0x00E9 If you do not select it, the letters a, b, c, d, e, and f will be used in hexadecimal numbers, where they represent the numbers 10, 11, 12, 13, 14, and 15. For example, the letter \u00E9, e with acute accent, will look like this in standard hexadecimal notation: 0x00e9 This is usually an aesthetic choice, but some programs care about case." balloonhelp_for $GENOPTIONS.tbl.hu $msg set msg "Select this option if you want to convert all characters in the input, even ASCII characters (those at codepoints less than 0x0080) to a textual representation. For example, if the input contains the letter \'a\', it will be converted to a textual representation such as the standard hexadecimal 0x0061. For example, the French word \u00e9\u0074\u00e9 \'summer\' will look like: 0x00E9 0x0074 0x00E9 (with spaces inserted to make it easier to parse). If this option is selected ASCII characters other than space (U+0020), tab (U+0009), and newline (U+000A) will be converted. The conversion of space, tab, and newline is controlled by other options. Do not select this option if you want to preserve ASCII characters (those at codepoints less than 0x0080) rather than converting them to textual representation. If the input text contains a mixture of ASCII and non-ASCII characters, the output will contain a mixture of ASCII characters and textual representations. For example, the French word \u00e9\u0074\u00e9 \'summer\' will look like: 0x00E9 t 0x00E9 (with spaces inserted to make it easier to parse)." balloonhelp_for $GENOPTIONS.tbl.pt $msg set msg "Select this option if you wish to convert linefeed characters (U+000A) to textual representations. Note that unless you select this option the space and tab characters will not be converted even if you have chosen to convert ASCII characters in general." balloonhelp_for $GENOPTIONS.tbl.nt $msg set msg "Select this option if you wish to convert the whitespace characters space (U+0020), tab (U+0009), ethiopic word space (U+1361), ogham space (U+1680), and ideographic space (U+3000) to textual representation. Note that unless you select this option the space and tab characters will not be converted even if you have chosen to convert ASCII characters in general. Do not select this option if you do not wish to convert whitespace characters to textual representation. If this option is not chosen, the characters space (U+0020) and tab (U+0009) will not be converted even if other ASCII characters are. The characters ethiopic word space (U+1361), ogham space (U+1680), and ideographic space (U+3000) will not be converted into their textual representations but will be converted to the ASCII space character (U+0020) in order to make the output pure ASCII. Leaving whitespace unconverted preserves word boundaries and the like which is helpful if you need to visually inspect the text." balloonhelp_for $GENOPTIONS.tbl.wt $msg set msg "Select this option to add a space after the ASCII representation of each character. If you are converting Unicode to ASCII in order to inspect it, it is generally easier to parse this way. Typical output will look like this: 0x0074 0x0065 0x0078 0x0074 Leave this option unselected if you want the ASCII representations of the Unicode to come one right after the other. Typical output will look like this: 0x00740x00650x00780x0074" balloonhelp_for $GENOPTIONS.tbl.at $msg set msg "Select this option if the input text consists entirely of escapes, separated by whitespace, with no regular text. For example, if the Unicode is represented by canonical hexadecimal numbers, it might look like this: 0x0074 0x0065 0x0078 0x0074 After conversion it would look like this: text Leave this option unselected if the input text consists of a mixture of escapes and regular text. For example, if the Unicode is represented by canonical hexadecimal numbers, the input text might look like this: the symbol 0x0E3F represents the baht, the Thai unit of currency After conversion it would look like this: the symbol \u0E3F represents the baht, the Thai unit of currency." balloonhelp_for $GENOPTIONS.tbl.ipt $msg set OXP 4 set OYP 2 grid $GENOPTIONS.tbl.pt -row 0 -column 0 -sticky w -padx $OXP -pady $OYP grid $GENOPTIONS.tbl.nt -row 0 -column 1 -sticky w -padx $OXP -pady $OYP grid $GENOPTIONS.tbl.wt -row 0 -column 2 -sticky w -padx $OXP -pady $OYP grid $GENOPTIONS.tbl.at -row 1 -column 0 -sticky w -padx $OXP -pady $OYP grid $GENOPTIONS.tbl.hu -row 1 -column 1 -sticky w -padx $OXP -pady $OYP grid $GENOPTIONS.tbl.aws -row 1 -column 2 -sticky w -padx $OXP -pady $OYP grid $GENOPTIONS.tbl.ipt -row 1 -column 3 -sticky w -padx $OXP -pady $OYP pack $GENOPTIONS.tit -side top -expand 0 -fill none -padx 2 -pady {4 2} -anchor w pack $GENOPTIONS.tbl -side top -expand 1 -fill both -padx {6 2} -pady {4 6} -anchor w set DOWNOPTIONS .mf.d frame $DOWNOPTIONS -border 2 -relief ridge label $DOWNOPTIONS.tit -text "Character Replacement Options" frame $DOWNOPTIONS.tbl checkbutton $DOWNOPTIONS.tbl.sty -text [_ "Stylistic Equivalents"] -variable ConvertStyleP \ -indicatoron 0 checkbutton $DOWNOPTIONS.tbl.cir -text [_ "Remove Enclosures"] -variable ConvertEnclosedP \ -indicatoron 0 checkbutton $DOWNOPTIONS.tbl.dia -text [_ "Strip Diacritics"] -variable StripDiacriticsP \ -indicatoron 0 checkbutton $DOWNOPTIONS.tbl.app -text [_ "Approximate"] -variable ConvertApproximateP \ -indicatoron 0 checkbutton $DOWNOPTIONS.tbl.aps -text [_ "Approximate Single"] -variable ApproximateSingleP \ -indicatoron 0 checkbutton $DOWNOPTIONS.tbl.exp -text [_ "Expand"] -variable ExpandToAsciiP \ -indicatoron 0 pack $DOWNOPTIONS.tbl.sty $DOWNOPTIONS.tbl.dia $DOWNOPTIONS.tbl.cir $DOWNOPTIONS.tbl.app $DOWNOPTIONS.tbl.exp $DOWNOPTIONS.tbl.aps -side left -expand 1 -fill both -padx 6 pack $DOWNOPTIONS.tit -side top -expand 0 -fill none -padx 2 -pady {4 2} -anchor w pack $DOWNOPTIONS.tbl -side top -expand 1 -fill both -padx 2 -pady {4 6} bind $DOWNOPTIONS.tbl.app <> ExplainEquivalences bind $DOWNOPTIONS.tbl.aps <> ExplainSingleApproximations bind $DOWNOPTIONS.tbl.exp <> ExplainExpansions set msg "If this option is chosen, characters differing from ASCII characters only in style, such as bold, italic, full width, and fraktur characters, are converted to the corresponding ASCII character. " balloonhelp_for $DOWNOPTIONS.tbl.sty $msg set msg "If this option is chosen, characters enclosed in circles or parentheses are converted to their plain equivalents." balloonhelp_for $DOWNOPTIONS.tbl.cir $msg set msg "If this option is chosen, combining diacritics are deleted and characters with intrinsic diacritics are replaced with their plain ASCII equivalents." balloonhelp_for $DOWNOPTIONS.tbl.dia $msg set msg "If this option is chosen, characters are replaced with approximate ASCII equivalents. Right-click for the complete list." balloonhelp_for $DOWNOPTIONS.tbl.app $msg set msg "If this option is chosen, certain characters are expanded to sequences of approximately equivalent plain ASCII characters. The expansions are: \tU+00A2 \u00A2\tCENT SIGN \t\u2192 cent \tU+00A3 \u00A3\tPOUND SIGN \t\u2192 pound \tU+00A5 \u00A5\tYEN SIGN \t\u2192 yen \tU+00A9 \u00A9\tCOPYRIGHT SYMBOL \t\u2192 (c) \tU+00DF \u00DF \tSMALL LETTER SHARP S \t\u2192 ss \tU+00C6 \u00C6\tCAPITAL LETTER ASH \t\u2192 AE \tU+00E6 \u00E6 \tSMALL LETTER ASH \t\u2192 ae \tU+01F1 \u01F1\tCAPITAL LETTER DZ \t\u2192 DZ \tU+01F3 \u01F3\tSMALLL LETTER DZ \t\u2192 dz \tU+02A6 \u02A6 \tSMALLL LETTER TS DIGRAPH \t\u2192 ts \tU+2026 \u2026 \tHORIZONTAL ELLIPSIS \t\u2192 ... \tU+20AC \u20AC\tEURO SIGN \t\u2192 euro \tU+2190 \u2190 \tLEFTWARDS ARROW \t\u2192 <- \tU+2192 \u2192 \tRIGHTWARDS ARROW \t\u2192 -> \tU+21D0 \u21D0 \tLEFTWARDS DOUBLE ARROW \t\u2192 <= \tU+21D2 \u21D2 \tRIGHTWARDS DOUBLE ARROW \t\u2192 => \tU+22EF \u22EF \tMIDLINE HORIZONTAL ELLIPSIS\t\u2192 ..." balloonhelp_for $DOWNOPTIONS.tbl.exp $msg set msg "If this option is chosen, certain characters are converted to a single approximately equivalent plain ASCII character. The conversions are: \tU+00A2 \u00A2\tCENT SIGN \t\u2192 C \tU+00A3 \u00A3\tPOUND SIGN \t\u2192 \# \tU+00A5 \u00A5\tYEN SIGN \t\u2192 Y \tU+00A9 \u00A9\tCOPYRIGHT SYMBOL \t\u2192 C \tU+00DF \u00DF \tSMALL LETTER SHARP S \t\u2192 s \tU+00C6 \u00C6\tCAPITAL LETTER ASH \t\u2192 A \tU+00E6 \u00E6 \tSMALL LETTER ASH \t\u2192 a \tU+01F1 \u01F1\tCAPITAL LETTER DZ \t\u2192 D \tU+01F3 \u01F3\tSMALLL LETTER DZ \t\u2192 d \tU+02A6 \u02A6 \tSMALLL LETTER TS DIGRAPH \t\u2192 t \tU+2026 \u2026 \tHORIZONTAL ELLIPSIS \t\u2192 . \tU+20AC \u20AC\tEURO SIGN \t\u2192 E \tU+2190 \u2190 \tLEFTWARDS ARROW \t\u2192 < \tU+2192 \u2192 \tRIGHTWARDS ARROW \t\u2192 > \tU+21D0 \u21D0 \tLEFTWARDS DOUBLE ARROW \t\u2192 < \tU+21D2 \u21D2 \tRIGHTWARDS DOUBLE ARROW \t\u2192 > \tU+22EF \u22EF \tMIDLINE HORIZONTAL ELLIPSIS\t\u2192 ." balloonhelp_for $DOWNOPTIONS.tbl.aps $msg set AFORMATS .mf.aformats frame $AFORMATS -border 2 -relief ridge label $AFORMATS.tit -text "ASCII Format" frame $AFORMATS.f tablelist::tablelist $AFORMATS.f.tl -columns {0 "Description" 0 "Example"} \ -stretch all -background white -width 60 -height 5 -yscrollcommand {$::AFORMATS.f.sb set} \ -labelbackground $ColorSpecs(ListHeader,Background) \ -labelforeground $ColorSpecs(ListHeader,Foreground) \ -labelactivebackground $ColorSpecs(ListHeader,ActiveBackground) \ -labelactiveforeground $ColorSpecs(ListHeader,ActiveForeground) \ -labelcommand DescribeColumn \ -selectbackground $ColorSpecs(TableList,SelectBackground) \ -selectforeground $ColorSpecs(TableList,SelectForeground) $AFORMATS.f.tl columnconfigure 0 -labelalign left $AFORMATS.f.tl columnconfigure 1 -labelalign left scrollbar $AFORMATS.f.sb -command {$::AFORMATS.f.tl yview} -activebackground red pack $AFORMATS.tit -side top -expand 0 -fill none -padx 2 -pady {4 2} -anchor w pack $AFORMATS.f.sb -side right -expand 0 -fill y -anchor w pack $AFORMATS.f.tl -side left -expand 1 -fill both -anchor w pack $AFORMATS.f -side top -expand 1 -fill both -padx 2 -pady {2 4} bind [$AFORMATS.f.tl bodytag] <> {+CellInfo} set cnt 0 foreach o $OptionList { $AFORMATS.f.tl insert end \ [list $AsciiOptions($o,description) $AsciiOptions($o,example)] if {$cnt % 2} { $AFORMATS.f.tl rowconfigure $cnt -background $ColorSpecs(AsciiOptionEven,Background) } else { $AFORMATS.f.tl rowconfigure $cnt -background $ColorSpecs(AsciiOptionOdd,Background) } incr cnt; } set msg "Here is where you select the kind of textual representation that you want to convert to or from." balloonhelp_for $AFORMATS $msg set INPUT .mf.inf set OUTPUT .mf.ouf set BPAD .mf.bpad #Name of input file frame $INPUT -relief ridge -border 1 label $INPUT.title -text [_ "Input File"] -anchor w set btxt [_ "Browse"] set blen [string length $btxt]; button $INPUT.brb -text $btxt -width $blen -anchor w -command SelectInputFile \ -activeforeground $ColorSpecs(Button,ActiveForeground) \ -activebackground $ColorSpecs(Button,ActiveBackground) entry $INPUT.ent -foreground $::ColorSpecs(UserTextEntry,Foreground) \ -background $ColorSpecs(UserTextEntry,Background)\ -font MainFont -width 30 set ifypd 3 pack $INPUT.title -side top -expand y -fill x -anchor w -pady $ifypd pack $INPUT.brb -expand 0 -fill none -anchor w -side left -padx 4 -pady $ifypd pack $INPUT.ent -expand 1 -fill x -anchor w -side left -pady $ifypd -padx 3 set bhmsg [_ "Specify the name of the input file. You can type the name in the entry box or choose it interactively by pressing the Browse button."]; balloonhelp_for $INPUT $bhmsg; balloonhelp_for $INPUT.title $bhmsg; balloonhelp_for $INPUT.ent [_ "Input will be read from the file whose name is shown in\nthis entry box. You may enter its name directly or\npress the Browse button and use the file selection dialogue."]; balloonhelp_for $INPUT.brb [_ "Press this button to select the name of the input file."] #Name of output file frame $OUTPUT -relief ridge -border 1 label $OUTPUT.title -text [_ "Output File"] -anchor w button $OUTPUT.brb -text $btxt -width $blen -anchor w -command SelectOutputFile \ -activeforeground $ColorSpecs(Button,ActiveForeground) \ -activebackground $ColorSpecs(Button,ActiveBackground) entry $OUTPUT.ent -foreground $::ColorSpecs(UserTextEntry,Foreground) \ -background $ColorSpecs(UserTextEntry,Background)\ -font MainFont -width 30 set ofypd 3 pack $OUTPUT.title -side top -expand y -fill x -anchor w -pady $ofypd pack $OUTPUT.brb -expand 0 -fill none -anchor w -side left -padx 4 -pady $ofypd pack $OUTPUT.ent -expand 1 -fill x -anchor w -side left -pady $ofypd -padx 3 set bhmsg [_ "Specify the name of the output file. You can type the name in the entry box or choose it interactively by pressing the Browse button."]; balloonhelp_for $OUTPUT $bhmsg; balloonhelp_for $OUTPUT.title $bhmsg; balloonhelp_for $OUTPUT.ent [_ "Output will be written to the file whose name is shown in\nthis entry box. You may enter its name directly or\npress the Browse button and use the file selection dialogue."]; balloonhelp_for $OUTPUT.brb [_ "Press this button to select the name of the output file."] set XP 8 set YP 3 pack $MSG -side top -expand 1 -fill both -padx $XP -pady $YP -anchor w pack $WHICHWAY -side top -expand 1 -fill both -padx $XP -pady $YP -anchor w pack $INPUT -side top -expand 1 -fill both -padx $XP -pady $YP -anchor w pack $OUTPUT -side top -expand 1 -fill both -padx $XP -pady $YP -anchor w pack $AFORMATS -side top -expand 1 -fill both -padx $XP -pady $YP -anchor w pack $DOWNOPTIONS -side top -expand 1 -fill both -padx $XP -pady $YP -anchor w pack $GENOPTIONS -side top -expand 1 -fill both -padx $XP -pady [list $YP 8] -anchor w set WhichWay $WhichWay wm title . [format [_ "Unicode/Ascii Converter %s \[%s\]"] $Version [ProgramTimeDateStamp]] #If the default browser is on the list, remove it. set di [lsearch -exact $BrowserList $DefaultBrowser] if {$di >= 0} { set BrowserList [lreplace $BrowserList $di $di] } #Add the default browser to the beginning of the list. set BrowserList [linsert $BrowserList 0 $DefaultBrowser]; uni2ascii-4.20/README0000644000175000017500000000023113755677100011135 00000000000000See INSTALL for installation instructions. On systems with the GNU autoconf/automake system: ./configure make (su) make install-strip should do it. uni2ascii-4.20/ascii2uni.10000644000175000017500000001242213755677100012232 00000000000000.TH ascii2uni 1 "August, 2011" .SH NAME ascii2uni \- convert 7-bit ASCII representations to UTF-8 Unicode .SH SYNOPSIS .B ascii2uni [options] () .SH DESCRIPTION .I ascii2uni converts various 7-bit ASCII representations to UTF-8. It reads from the standard input and writes to the standard output. The representations understood are listed below under the command line options. If no format is specified, standard hexadecimal format (e.g. 0x00e9) is assumed. .PP .SH "COMMAND LINE OPTIONS" .sp 1 .B \-a Convert from the specified format. Formats may be specified by means of the following arbitrary single character codes, by means of names such as "SGML_decimal", and by examples of the desired format. .IP .B A Convert hexadecimal numbers with prefix U in angle-brackets (). .IP .B B Convert \\x-escaped hex (e.g. \\x00E9) .IP .B C Convert \\x escaped hexadecimal numbers in braces (e.g. \\x{00E9}). .IP .B D Convert decimal HTML numeric character references (e.g. é) .IP .B E Convert hexadecimal with prefix U (U00E9). .IP .B F Convert hexadecimal with prefix u (u00E9). .IP .B G Convert hexadecimal in single quotes with prefix X (e.g. X'00E9'). .IP .B H Convert hexadecimal HTML numeric character references (e.g. é) .IP .B I Convert hexadecimal UTF-8 with each byte's hex preceded by an =-sign (e.g. =C3=A9) . This is the Quoted Printable format defined by RFC 2045. .IP .B J Convert hexadecimal UTF-8 with each byte's hex preceded by a %-sign (e.g. %C3%A9). This is the URIescape format defined by RFC 2396. .IP .B K Convert octal UTF-8 with each byte escaped by a backslash (e.g. \\303\\251) .IP .B L Convert \\U followed by eight hex digits or \\u followed by four hex digits. \\UXXXXXXXX encoding a character within the BMP (U+0000-U+FFFF) is converted but a warning is issued since this violates the WWW specification. .IP .B M Convert hexadecimal SGML numeric character references (e.g. \\#xE9;) .IP .B N Convert decimal SGML numeric character references (e.g. \\#233;) .IP .B O Convert octal escapes for the three low bytes in big-endian order(e.g. \\000\\000\\351)) .IP .B P Convert hexadecimal numbers with prefix U+ (e.g. U+00E9) .IP .B Q Convert HTML character entities (e.g. é). .IP .B R Convert raw hexadecimal numbers (e.g. 00E9). Requires the \-p flag. .IP .B S Convert hexadecimal escapes for the three low bytes in big-endian order (e.g. \\x00\\x00\\xE9) .IP .B T Convert decimal escapes for the three low bytes in big-endian order (e.g. \\d000\\d000\\d233) .IP .B U Convert \\u-escaped hexadecimal numbers (e.g. \\u00E9). .IP .B V Convert \\u-escaped decimal numbers (e.g. \\u00233). .IP .B X Convert standard hexadecimal numbers (e.g. 0x00E9). .IP .B Y Convert all three types of HTML escape: hexadecimal and decimal character references and character entities. .IP .B 0 Convert hexadecimal UTF-8 with each byte's hex enclosed within angle brackets (e.g. ). .IP .B 1 Convert Common Lisp format hexadecimal numbers (e.g. #x00E9). .IP .B 2 Convert Perl format decimal numbers with prefix v (e.g. v233). .IP .B 3 Convert hexadecimal numbers with prefix $ (e.g. $00E9). .IP .B 4 Convert Postscript format hexadecimal numbers with prefix 16# (e.g. 16#00E9). .IP .B 5 Convert Common Lisp format hexadecimal numbers with prefix #16r (e.g. #16r00E9). .IP .B 6 Convert ADA format hexadecimal numbers with prefix 16# and suffix # (e.g. 16#00E9#). .IP .B 7 Convert Apache log format hexadecimal UTF-8 with each byte's hex preceded by a backslash-x (e.g. \\xC3\\xA9). .IP .B 8 Convert Microsoft OOXML format hexadecimal numbers with prefix _x and suffix _ (e.g. _x00E9_). .IP .B 9 Convert %\\u-escaped hexadecimal numbers (e.g. %\\u00E9). .TP .B \-h Help. Print the usage message and exit. .TP .B \-v Print program version information and exit. .TP .B \-m Accept deprecated HTML entities lacking final semicolon, e.g. "é" in place of "é". .TP .B \-p Pure. Assume that the input consists entirely of escapes except for arbitrary (but non-null) amounts of separating whitespace. .TP .B \-q Be quiet. Do not chat unnecessarily. .sp 1 .TP .B \-Z Convert input using the supplied format. The format specified will be used as the format string in a call to sscanf(3) with a single argument consisting of a pointer to an unsigned long integer. For example, to obtain the same results as with the \-U flag, the format would be: \\u%04X. .PP If the format is Quoted-Printable, although it is not strictly speaking conversion of an ASCII escape to Unicode, in accordance with RFC 2045, if an equal-sign occurs at the end of an input line, both the equal-sign and the immediately following newline are skipped. .PP All options that accept hexadecimal input recognize both upper- and lower-case hexadecimal digits. .SH "EXIT STATUS" .PP The following values are returned on exit: .IP "0 SUCCESS" The input was successfully converted. .IP "3 INFO" The user requested information such as the version number or usage synopsis and this has been provided. .IP "5 BAD OPTION" An incorrect option flag was given on the command line. .IP "7 OUT OF MEMORY" Additional memory was unsuccessfully requested. .IP "8 BAD RECORD" An ill-formed record was detected in the input. .sp 1 .SH "SEE ALSO" uni2ascii(1) .sp 1 .SH AUTHOR Bill Poser .SH LICENSE GNU General Public License uni2ascii-4.20/GetWord.c0000644000175000017500000000270513755677100012004 00000000000000#include "config.h" #include #include #include /* * Read a chunk of arbitrary length from a file, terminated * by whitespace. * * Return a pointer to the null-terminated string allocated, or null on failure * to allocate sufficient storage. * The length of the word is placed in the variable pointed to by * the second argument. * * On EOF, the eof flag in the third command line argument is set. * It is the responsibility of the caller to free the space allocated. */ #define INITLENGTH 16 unsigned long GetWordLineNo; char * Get_Word(FILE *fp, int *WordLength,int *eofptr) { int c; int Available; int CharsRead; char *Word; Available = INITLENGTH; CharsRead=0; Word = (char *) malloc((size_t)Available); if(Word == NULL) return (Word); *eofptr = 0; while(1){ c=getc(fp); // if(isspace(c)) { if ( (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') || (c == '\f') || (c == '\v')) { if (c == '\n') GetWordLineNo++; Word[CharsRead]='\0'; *WordLength=CharsRead; return(Word); } if(c == EOF){ Word[CharsRead]='\0'; *WordLength=CharsRead; *eofptr = 1; return(Word); } if(CharsRead == (Available-1)){ /* -1 because of null */ Available += INITLENGTH/2; Word = (char *) realloc( (void *) Word, (size_t) (Available * sizeof (char))); if(Word == NULL) return(Word); } Word[CharsRead++]= (char) c; } } uni2ascii-4.20/TestSuiteAscii2Uni0000644000175000017500000000150413755677100013644 00000000000000You can test ascii2uni by giving it this file as input and varying the conversion flag. For example, the command: ascii2uni -A < TestSuiteAscii2Uni should reproduce this file except for the fact that will be replaced with lower-case e with acute accent. All of the characters in the right-hand column should be lower-case e with acute accent when converted with the exception of the L: row, which should be a mathematical bold upper-case A. A: B: \x00E9 C: \x{00E9} D: é E: U00E9 F: u00E9 G: X'00E9' H: é I: =C3=A9 J: %C3%A9 K: \303\251 L: \U0001D400 M: \#x00E9; N: \#233; O: \000\000\351 P: U+00E9 Q: é S: \x00\x00\xe9 T: \d000\d000\d233 U: \u00E9 V: \u00233 X: 0x00E9 0: 1: #x00E9 2: v233 3: $00E9 4: 16#00E9 5: #16r00E9 6: 16#00E9# 7: \xC3\xA9 8: _x00E9_ 9: %u00E9 Hm: é uni2ascii-4.20/config.guess0000755000175000017500000014051214300546425012574 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 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 to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then LIBCABI=${LIBC}x32 fi fi GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; x86_64:Haiku:*:*) GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: uni2ascii-4.20/UTF8in.c0000644000175000017500000001063613755677100011510 00000000000000/* Time-stamp: <2008-06-04 01:22:32 poser> * * This function reads from a file descriptor presumed to contain text encoded * in UTF-8 and returns the next UTF-32 character. It performs the same * conversion from UTF-8 to UTF-32 as the model function provided by the * Unicode consortium but is intended for reading from streams. For some * applications it may be more efficient to read large blocks of input * and then use the buffer conversion function, but this is not compatible * with reading from pipes. * * This version "returns" via pointers passed as arguments the number of bytes read * and a pointer to the raw byte string. * * Author: Bill Poser (billposer@alum.mit.edu) * Patch by Dylan Thurston to resume read interrupted in mid-sequence. * * I place the code in this file in the public domain. */ #include #include #include "unicode.h" #include "utf8error.h" #define FALSE 0 #define TRUE 1 /* * The following are based on the Unicode consortium code. */ /* * Index into the table below with the first byte of a UTF-8 sequence to * get the number of bytes that should follow. */ static const char TrailingBytesForUTF8[256] = { 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,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,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,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,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,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; /* * Magic values subtracted from a buffer value during UTF8 conversion. * This table contains as many values as there might be trailing bytes * in a UTF-8 sequence. */ static const UTF32 OffsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; /* * Utility routine to tell whether a sequence of bytes is legal UTF-8. * This must be called with the length pre-determined by the first byte. * If not calling this from ConvertUTF8to*, then the length can be set by: * length = TrailingBytesForUTF8[*source]+1; */ static Boolean LegalUTF8P(const UTF8 *source, int length) { UTF8 a; const UTF8 *srcptr = source+length; switch (length) { default: return FALSE; /* Everything else falls through when "TRUE"... */ case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return FALSE; case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return FALSE; case 2: if ((a = (*--srcptr)) > 0xBF) return FALSE; switch (*source) { /* no fall-through in this inner switch */ case 0xE0: if (a < 0xA0) return FALSE; break; case 0xF0: if (a < 0x90) return FALSE; break; case 0xF4: if (a > 0x8F) return FALSE; break; default: if (a < 0x80) return FALSE; } case 1: if (*source >= 0x80 && *source < 0xC2) return FALSE; if (*source > 0xF4) return FALSE; } return TRUE; } /* End of Unicode Consortium code */ UTF32 UTF8in (int fd, int *bytes, unsigned char **bstr) { int BytesSoFar; int BytesRead; int BytesNeeded; /* Additional bytes after initial byte */ static unsigned char c[6]; UTF32 ch; /* Result character */ unsigned char *cptr; cptr = &(c[0]); /* Get the first byte */ BytesRead = read(fd,(void *) c,1); if (BytesRead == 0) { *bytes = 0; return (UTF8_ENDOFFILE); } if (BytesRead < 0) { *bytes = 0; return (UTF8_IOERROR); } /* Now get the remaining bytes */ BytesNeeded = (int) TrailingBytesForUTF8[c[0]]; BytesSoFar = 0; do { BytesRead = read(fd,(void *) &c[BytesSoFar+1],(size_t) (BytesNeeded-BytesSoFar)); BytesSoFar += BytesRead; } while (BytesRead > 0 || BytesSoFar < BytesNeeded); if(BytesSoFar != BytesNeeded) { *bytes = (BytesSoFar + 1); return(UTF8_NOTENOUGHBYTES); } *bytes = BytesNeeded+1; *bstr = &c[0]; /* Check validity of source */ if(! LegalUTF8P((void *) c,BytesNeeded+1)) return(UTF8_BADINCODE); ch = 0; switch (BytesNeeded) { case 5: ch += *cptr++; ch <<= 6; case 4: ch += *cptr++; ch <<= 6; case 3: ch += *cptr++; ch <<= 6; case 2: ch += *cptr++; ch <<= 6; case 1: ch += *cptr++; ch <<= 6; case 0: ch += *cptr++; } ch -= OffsetsFromUTF8[BytesNeeded]; if(ch <= UNI_MAX_UTF32) return(ch); else return(UNI_REPLACEMENT_CHAR); } uni2ascii-4.20/formats.h0000644000175000017500000000132213755677100012103 00000000000000#define FMT_UNKNOWN (-1) #define HTMLX 0 /* HTML hex numeric */ #define HTMLD 1 #define SGMLX 2 #define SGMLD 3 #define BSLU 4 #define BSLX 5 /* Tcl hex number as opposed to character code */ #define STDX 6 #define CLSX 7 #define RAWX 8 #define BSLXB 9 #define ABUX 10 #define JUUX 11 #define JuUX 12 #define UPLX 13 #define XQ 14 #define BSLUD 15 #define PERLV 16 #define DOLLAR 17 #define PSPT 18 #define CLR 19 #define ADA 20 #define HDML 21 #define BYTEO 22 #define BYTED 23 #define BYTEH 24 #define OOXML 25 #define PCTUX 26 #define CHENT 27 /* Used only by ascii2uni */ #define IFMT 28 #define JFMT 29 #define KFMT 30 #define APACHE 31 #define UTF8ANGLE 32