initial import
This commit is contained in:
parent
77b82a8db4
commit
b396d2c39f
1
unac/.version
Normal file
1
unac/.version
Normal file
@ -0,0 +1 @@
|
||||
1.7.0
|
||||
1
unac/AUTHORS
Normal file
1
unac/AUTHORS
Normal file
@ -0,0 +1 @@
|
||||
Loic Dachary loic@senga.org
|
||||
340
unac/COPYING
Normal file
340
unac/COPYING
Normal file
@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
160
unac/ChangeLog
Normal file
160
unac/ChangeLog
Normal file
@ -0,0 +1,160 @@
|
||||
Mon Sep 02 12:37:45 2002 Loic Dachary <loic@gnu.org>
|
||||
|
||||
* release 1.7.0
|
||||
|
||||
* unac.3, unaccent.1: rewrote and proofread
|
||||
|
||||
Wed Aug 28 13:26:12 2002 Loic Dachary <loic@gnu.org>
|
||||
|
||||
* unaccent.c: debug options --debug_low and --debug_high
|
||||
|
||||
* configure.in: test vsnprintf, if not disable debug functions
|
||||
|
||||
* unac.[ch]: implement debug functions
|
||||
|
||||
* UnicodeData-3.2.0.txt: added UCD terms and original file
|
||||
location.
|
||||
|
||||
* README: Add license section mentioning UCD terms
|
||||
|
||||
* t_unac: added regression test to make sure the bug
|
||||
reported by Rune Nordbøe Skillingstad does not show
|
||||
up again. Improved information level when a bug is
|
||||
found.
|
||||
|
||||
* UnicodeData-3.2.0.txt: Rune Nordbøe Skillingstad
|
||||
<runesk@linpro.no> says: 2 LATIN characters used in Norway
|
||||
didn't have a "Character Decomposition Mapping". I've submitted
|
||||
a patch to unicode.org that fixes this problem, but it might
|
||||
take some time before somebody there have time to do something
|
||||
about it.
|
||||
|
||||
Wed Jul 03 07:30:36 2002 Loic Dachary <loic@gnu.org>
|
||||
|
||||
* release 1.6.0
|
||||
|
||||
* configure.in, README: update libiconv URLs
|
||||
|
||||
* Makefile.am: update to Unicode-3.2.0
|
||||
|
||||
* acinclude.m4: autoconf archive updates
|
||||
|
||||
Thu Jul 19 10:26:24 2001 Loic Dachary <loic@gnu.org>
|
||||
|
||||
* release 1.5.0
|
||||
|
||||
* autotools: upgrade libtool-1.4 and config.guess + config.sub
|
||||
|
||||
* unac.c: use ICONV_CONST or define it to nothing if config.h
|
||||
is not available.
|
||||
|
||||
* configure.in, acinclude.m4: use AM_ICONV instead of custom made
|
||||
macro.
|
||||
|
||||
* *: copyright and documentation upgrade
|
||||
|
||||
* unac.c: include string.h
|
||||
|
||||
Sun Jan 14 19:05:31 2001 Loic Dachary <loic@senga.org>
|
||||
|
||||
* release 1.4.0
|
||||
|
||||
Fri Jan 12 19:00:07 2001 Loic Dachary <loic@senga.org>
|
||||
|
||||
* unac.h: Add function unac_version.
|
||||
|
||||
* unaccent.c (main): Add version number in usage.
|
||||
|
||||
* unactest1.c: check unac_string error code, add test
|
||||
for 1/4 ISO-8859-1 char.
|
||||
|
||||
* unac.c (convert): Transparently convert EILSEQ characters
|
||||
to SPACE. Some characters may be decomposed with characters
|
||||
that cannot be mapped back to the original charset. For
|
||||
instance the 1/4 ISO-8859-1 char is mapped to
|
||||
ONE, FRACTION SLASH, FOUR and the FRACTION SLASH cannot
|
||||
be mapped back to ISO-8859-1.
|
||||
|
||||
Sat Jan 06 15:12:44 2001 Loic Dachary <loic@senga.org>
|
||||
|
||||
* release 1.3.0
|
||||
|
||||
* unac.c (utf16be): return UTF-16BE if available, otherwise
|
||||
return UTF-16, assuming it is big endian.
|
||||
|
||||
Sat Jan 06 14:39:24 2001 Loic Dachary <loic@senga.org>
|
||||
|
||||
* unac.c (unac_string): do nothing when an empty string is
|
||||
sent but allocate the buffer anyway.
|
||||
|
||||
* unac.c (convert): fix allocation bug: it may occur that
|
||||
E2BIG is returned and out_remain is not 0. Do not alloc
|
||||
the output buffer from a size taken from the input_length
|
||||
if the input_length is null.
|
||||
|
||||
Wed Jan 03 16:41:11 2001 Loic Dachary <loic@senga.org>
|
||||
|
||||
* unactest1.c: Add test for re-allocation.
|
||||
|
||||
* unactest.c: move simple conversion test to unactest1.c
|
||||
|
||||
Wed Dec 20 12:58:14 2000 Loic Dachary <loic@senga.org>
|
||||
|
||||
* release 1.2.0
|
||||
|
||||
* configure.in: generate unac.spec so that version is updated.
|
||||
|
||||
* unac.{c,h} (unac_string_*): length arguments must be
|
||||
of type size_t to conform to the single unix specification.
|
||||
|
||||
* unac.c (unac_string): Helios De Creisquer (creis@zehc.net)
|
||||
reported a bug related to endianness under RedHat-7.0.
|
||||
Now always use UTF-16BE.
|
||||
|
||||
Mon Oct 16 11:06:14 2000 Loic Dachary <loic@senga.org>
|
||||
|
||||
* README.debian: Added to capture the debian packaging knowledge
|
||||
from Rémi Perrot <remi_perrot@users.sourceforge.net>.
|
||||
|
||||
Wed Oct 11 13:16:59 2000 Loic Dachary <loic@senga.org>
|
||||
|
||||
* debian: remove debian dir, replace by unac_1.1.0-2.diff.gz that
|
||||
appears in the CVS tree for archival but will never be distributed.
|
||||
Debian specific stuff must not show in the sources so that debian
|
||||
team may produce various diffs according to the debian distribution
|
||||
and do not depend on the author. Thanks to Remi Perrot for making
|
||||
this point clear.
|
||||
|
||||
Sun Oct 01 11:56:35 2000 Loic Dachary <loic@senga.org>
|
||||
|
||||
* Makefile.am: change -release into -version-info
|
||||
|
||||
Sat Sep 30 11:48:35 2000 Loic Dachary <loic@senga.org>
|
||||
|
||||
* debian: debian packaging specifications contributed by
|
||||
Rémi Perrot <remi_perrot@users.sourceforge.net>
|
||||
|
||||
Thu Sep 28 21:19:48 2000 Loic Dachary <loic@senga.org>
|
||||
|
||||
* unac.3: document EINVAL error code.
|
||||
|
||||
Thu Sep 28 18:13:41 2000 Loic Dachary <loic@senga.org>
|
||||
|
||||
* release 1.1.0
|
||||
|
||||
* README (install): Add recommendations for Solaris
|
||||
|
||||
* unaccent.c (main): free the unaccented string before exit
|
||||
|
||||
* acinclude.m4: add --with-iconv option that does *not* include
|
||||
iconv by default and allows to specify a specific directory
|
||||
as root of iconv installation.
|
||||
|
||||
* unac.c (convert): fix error condition tests that failed because
|
||||
they are unsigned and cannot be compared to -1. Change inclusion
|
||||
of sys/errno.h for errno.h.
|
||||
|
||||
Wed Sep 20 19:34:07 2000 Loic Dachary <loic@senga.org>
|
||||
|
||||
* release 1.0.0
|
||||
|
||||
182
unac/INSTALL
Normal file
182
unac/INSTALL
Normal file
@ -0,0 +1,182 @@
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
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. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. 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.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. 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.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
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 must use a version of `make' that
|
||||
supports the `VPATH' variable, such as 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 `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have 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.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
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 host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
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.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--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.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
101
unac/Makefile.am
Normal file
101
unac/Makefile.am
Normal file
@ -0,0 +1,101 @@
|
||||
#
|
||||
# Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
|
||||
#
|
||||
# Documentation
|
||||
#
|
||||
man_MANS = unaccent.1 unac.3
|
||||
INCLUDES = -DUNAC_VERSION=\"$(VERSION)\"
|
||||
|
||||
#
|
||||
# Support programs
|
||||
#
|
||||
noinst_HEADERS = \
|
||||
getopt.h
|
||||
|
||||
bin_PROGRAMS = unaccent
|
||||
unaccent_SOURCES = unaccent.c
|
||||
unaccent_LDFLAGS = $(PROFILING)
|
||||
unaccent_LDADD = @LIBOBJS@ libunac.la
|
||||
|
||||
#
|
||||
# Library and headers
|
||||
#
|
||||
lib_LTLIBRARIES = libunac.la
|
||||
libunac_la_LDFLAGS = -version-info $(MAJOR_VERSION):$(MINOR_VERSION):$(MICRO_VERSION)
|
||||
libunac_la_SOURCES = unac.c
|
||||
|
||||
include_HEADERS = \
|
||||
unac.h
|
||||
|
||||
unac.c: $(UNICODEDATA) builder.in
|
||||
$(PERL) builder -source -database=$(srcdir)/$(UNICODEDATA)
|
||||
|
||||
#
|
||||
# Tests
|
||||
#
|
||||
TESTS = t_unac
|
||||
|
||||
noinst_PROGRAMS = unactest unactest1
|
||||
|
||||
unactest_SOURCES = unactest.c
|
||||
unactest_LDFLAGS = $(PROFILING)
|
||||
unactest_LDADD = libunac.la
|
||||
|
||||
unactest1_SOURCES = unactest1.c
|
||||
unactest1_LDFLAGS = $(PROFILING)
|
||||
unactest1_LDADD = libunac.la
|
||||
|
||||
#
|
||||
# Packaging
|
||||
#
|
||||
|
||||
MAINTAINERCLEANFILES = $(DISTCLEANFILES)
|
||||
|
||||
DISTCLEANFILES = config.log config.status
|
||||
|
||||
UNICODEDATA = UnicodeData-$(UNICODE_VERSION).txt
|
||||
|
||||
EXTRA_DIST = builder.in $(UNICODEDATA) .version t_unac.in \
|
||||
unaccent.1 unac.3
|
||||
|
||||
pkgconfigdir = ${libdir}/pkgconfig
|
||||
pkgconfig_DATA = unac.pc
|
||||
|
||||
#
|
||||
# Build source and binary rpms. As of rpm-3.0, the ~/.rpmmacros
|
||||
# must contain the following line:
|
||||
# %_topdir /home/loic/local/rpm
|
||||
# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
|
||||
#
|
||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||
|
||||
rpm:
|
||||
RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
|
||||
cp $(PACKAGE).spec $$RPM_TOPDIR/SPECS ; \
|
||||
cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
|
||||
rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(PACKAGE).spec ; \
|
||||
mv $$RPM_TOPDIR/RPMS/i386/$(PACKAGE)-$(VERSION)-1.i386.rpm . ; \
|
||||
mv $$RPM_TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-1.src.rpm .
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
clean-local:
|
||||
rm -f unac.reference
|
||||
|
||||
778
unac/Makefile.in
Normal file
778
unac/Makefile.in
Normal file
@ -0,0 +1,778 @@
|
||||
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# 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@
|
||||
|
||||
#
|
||||
# Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
|
||||
#
|
||||
# Documentation
|
||||
#
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = @program_transform_name@
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AMTAR = @AMTAR@
|
||||
AS = @AS@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
HAVE_LIB = @HAVE_LIB@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LIB = @LIB@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIB = @LTLIB@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
MAINT = @MAINT@
|
||||
MAJOR_VERSION = @MAJOR_VERSION@
|
||||
MICRO_VERSION = @MICRO_VERSION@
|
||||
MINOR_VERSION = @MINOR_VERSION@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PERL = @PERL@
|
||||
RANLIB = @RANLIB@
|
||||
SH = @SH@
|
||||
STRIP = @STRIP@
|
||||
UNICODE_VERSION = @UNICODE_VERSION@
|
||||
am__include = @am__include@
|
||||
am__quote = @am__quote@
|
||||
install_sh = @install_sh@
|
||||
|
||||
#
|
||||
# Build source and binary rpms. As of rpm-3.0, the ~/.rpmmacros
|
||||
# must contain the following line:
|
||||
# %_topdir /home/loic/local/rpm
|
||||
# and that /home/loic/local/rpm contains the directory SOURCES, BUILD etc.
|
||||
#
|
||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||
|
||||
man_MANS = unaccent.1 unac.3
|
||||
INCLUDES = -DUNAC_VERSION=\"$(VERSION)\"
|
||||
|
||||
#
|
||||
# Support programs
|
||||
#
|
||||
noinst_HEADERS = \
|
||||
getopt.h
|
||||
|
||||
|
||||
bin_PROGRAMS = unaccent
|
||||
unaccent_SOURCES = unaccent.c
|
||||
unaccent_LDFLAGS = $(PROFILING)
|
||||
unaccent_LDADD = @LIBOBJS@ libunac.la
|
||||
|
||||
#
|
||||
# Library and headers
|
||||
#
|
||||
lib_LTLIBRARIES = libunac.la
|
||||
libunac_la_LDFLAGS = -version-info $(MAJOR_VERSION):$(MINOR_VERSION):$(MICRO_VERSION)
|
||||
libunac_la_SOURCES = unac.c
|
||||
|
||||
include_HEADERS = \
|
||||
unac.h
|
||||
|
||||
|
||||
#
|
||||
# Tests
|
||||
#
|
||||
TESTS = t_unac
|
||||
|
||||
noinst_PROGRAMS = unactest unactest1
|
||||
|
||||
unactest_SOURCES = unactest.c
|
||||
unactest_LDFLAGS = $(PROFILING)
|
||||
unactest_LDADD = libunac.la
|
||||
|
||||
unactest1_SOURCES = unactest1.c
|
||||
unactest1_LDFLAGS = $(PROFILING)
|
||||
unactest1_LDADD = libunac.la
|
||||
|
||||
|
||||
#
|
||||
# Packaging
|
||||
#
|
||||
MAINTAINERCLEANFILES = $(DISTCLEANFILES)
|
||||
|
||||
DISTCLEANFILES = config.log config.status
|
||||
|
||||
UNICODEDATA = UnicodeData-$(UNICODE_VERSION).txt
|
||||
|
||||
EXTRA_DIST = builder.in $(UNICODEDATA) .version t_unac.in \
|
||||
unaccent.1 unac.3
|
||||
|
||||
|
||||
pkgconfigdir = ${libdir}/pkgconfig
|
||||
pkgconfig_DATA = unac.pc
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = unac.pc unac.spec t_unac builder
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
|
||||
libunac_la_LIBADD =
|
||||
am_libunac_la_OBJECTS = unac.lo
|
||||
libunac_la_OBJECTS = $(am_libunac_la_OBJECTS)
|
||||
bin_PROGRAMS = unaccent$(EXEEXT)
|
||||
noinst_PROGRAMS = unactest$(EXEEXT) unactest1$(EXEEXT)
|
||||
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
|
||||
|
||||
am_unaccent_OBJECTS = unaccent.$(OBJEXT)
|
||||
unaccent_OBJECTS = $(am_unaccent_OBJECTS)
|
||||
unaccent_DEPENDENCIES = @LIBOBJS@ libunac.la
|
||||
am_unactest_OBJECTS = unactest.$(OBJEXT)
|
||||
unactest_OBJECTS = $(am_unactest_OBJECTS)
|
||||
unactest_DEPENDENCIES = libunac.la
|
||||
am_unactest1_OBJECTS = unactest1.$(OBJEXT)
|
||||
unactest1_OBJECTS = $(am_unactest1_OBJECTS)
|
||||
unactest1_DEPENDENCIES = libunac.la
|
||||
|
||||
DEFS = @DEFS@
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/getopt.Po $(DEPDIR)/unac.Plo \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/unaccent.Po $(DEPDIR)/unactest.Po \
|
||||
@AMDEP_TRUE@ $(DEPDIR)/unactest1.Po
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
|
||||
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
CFLAGS = @CFLAGS@
|
||||
DIST_SOURCES = $(libunac_la_SOURCES) $(unaccent_SOURCES) \
|
||||
$(unactest_SOURCES) $(unactest1_SOURCES)
|
||||
|
||||
NROFF = nroff
|
||||
MANS = $(man_MANS)
|
||||
DATA = $(pkgconfig_DATA)
|
||||
|
||||
HEADERS = $(include_HEADERS) $(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = README $(include_HEADERS) $(noinst_HEADERS) \
|
||||
././stamp-h.in ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
|
||||
Makefile.am Makefile.in NEWS THANKS acinclude.m4 aclocal.m4 \
|
||||
builder.in config.guess config.h.in config.sub configure \
|
||||
configure.ac depcomp getopt.c install-sh ltconfig ltmain.sh \
|
||||
missing mkinstalldirs t_unac.in unac.pc.in unac.spec.in
|
||||
SOURCES = $(libunac_la_SOURCES) $(unaccent_SOURCES) $(unactest_SOURCES) $(unactest1_SOURCES)
|
||||
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) && \
|
||||
CONFIG_HEADERS= CONFIG_LINKS= \
|
||||
CONFIG_FILES=$@ $(SHELL) ./config.status
|
||||
|
||||
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.ac acinclude.m4
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
config.h: stamp-h
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
else :; fi
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h stamp-hT
|
||||
@echo timestamp > stamp-hT 2> /dev/null
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
||||
$(SHELL) ./config.status
|
||||
@mv stamp-hT stamp-h
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/./stamp-h.in
|
||||
@if test ! -f $@; then \
|
||||
rm -f $(srcdir)/./stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/./stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4)
|
||||
@rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
|
||||
@echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
unac.pc: $(top_builddir)/config.status unac.pc.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
|
||||
unac.spec: $(top_builddir)/config.status unac.spec.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
|
||||
t_unac: $(top_builddir)/config.status t_unac.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
|
||||
builder: $(top_builddir)/config.status builder.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p"; \
|
||||
$(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
libunac.la: $(libunac_la_OBJECTS) $(libunac_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libunac_la_LDFLAGS) $(libunac_la_OBJECTS) $(libunac_la_LIBADD) $(LIBS)
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
|| test -f $$p1 \
|
||||
; then \
|
||||
f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$f; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
|
||||
rm -f $(DESTDIR)$(bindir)/$$f; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
|
||||
unaccent$(EXEEXT): $(unaccent_OBJECTS) $(unaccent_DEPENDENCIES)
|
||||
@rm -f unaccent$(EXEEXT)
|
||||
$(LINK) $(unaccent_LDFLAGS) $(unaccent_OBJECTS) $(unaccent_LDADD) $(LIBS)
|
||||
unactest$(EXEEXT): $(unactest_OBJECTS) $(unactest_DEPENDENCIES)
|
||||
@rm -f unactest$(EXEEXT)
|
||||
$(LINK) $(unactest_LDFLAGS) $(unactest_OBJECTS) $(unactest_LDADD) $(LIBS)
|
||||
unactest1$(EXEEXT): $(unactest1_OBJECTS) $(unactest1_DEPENDENCIES)
|
||||
@rm -f unactest1$(EXEEXT)
|
||||
$(LINK) $(unactest1_LDFLAGS) $(unactest1_OBJECTS) $(unactest1_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT) core *.core
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/unac.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/unaccent.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/unactest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/unactest1.Po@am__quote@
|
||||
|
||||
distclean-depend:
|
||||
-rm -rf $(DEPDIR)
|
||||
|
||||
.c.o:
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
|
||||
|
||||
.c.obj:
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(COMPILE) -c `cygpath -w $<`
|
||||
|
||||
.c.lo:
|
||||
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
uninstall-info-am:
|
||||
|
||||
man1dir = $(mandir)/man1
|
||||
install-man1: $(man1_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
uninstall-man1:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
|
||||
man3dir = $(mandir)/man3
|
||||
install-man3: $(man3_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(man3dir)
|
||||
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.3*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man3dir)/$$inst; \
|
||||
done
|
||||
uninstall-man3:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.3*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f $(DESTDIR)$(man3dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man3dir)/$$inst; \
|
||||
done
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgconfigdir)
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
$(INSTALL_DATA) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; for p in $$list; do \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " rm -f $(DESTDIR)$(pkgconfigdir)/$$f"; \
|
||||
rm -f $(DESTDIR)$(pkgconfigdir)/$$f; \
|
||||
done
|
||||
install-includeHEADERS: $(include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(includedir)
|
||||
@list='$(include_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " $(INSTALL_HEADER) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
|
||||
$(INSTALL_HEADER) $$d$$p $(DESTDIR)$(includedir)/$$f; \
|
||||
done
|
||||
|
||||
uninstall-includeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(include_HEADERS)'; for p in $$list; do \
|
||||
f="`echo $$p | sed -e 's|^.*/||'`"; \
|
||||
echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
|
||||
rm -f $(DESTDIR)$(includedir)/$$f; \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|
||||
|| etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)
|
||||
|
||||
GTAGS:
|
||||
here=`CDPATH=: && cd $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
|
||||
|
||||
check-TESTS: $(TESTS)
|
||||
@failed=0; all=0; xfail=0; xpass=0; \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
list='$(TESTS)'; \
|
||||
if test -n "$$list"; then \
|
||||
for tst in $$list; do \
|
||||
if test -f ./$$tst; then dir=./; \
|
||||
elif test -f $$tst; then dir=; \
|
||||
else dir="$(srcdir)/"; fi; \
|
||||
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*" $$tst "*) \
|
||||
xpass=`expr $$xpass + 1`; \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "XPASS: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
echo "PASS: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
elif test $$? -ne 77; then \
|
||||
all=`expr $$all + 1`; \
|
||||
case " $(XFAIL_TESTS) " in \
|
||||
*" $$tst "*) \
|
||||
xfail=`expr $$xfail + 1`; \
|
||||
echo "XFAIL: $$tst"; \
|
||||
;; \
|
||||
*) \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "FAIL: $$tst"; \
|
||||
;; \
|
||||
esac; \
|
||||
fi; \
|
||||
done; \
|
||||
if test "$$failed" -eq 0; then \
|
||||
if test "$$xfail" -eq 0; then \
|
||||
banner="All $$all tests passed"; \
|
||||
else \
|
||||
banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
|
||||
fi; \
|
||||
else \
|
||||
if test "$$xpass" -eq 0; then \
|
||||
banner="$$failed of $$all tests failed"; \
|
||||
else \
|
||||
banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"; \
|
||||
test "$$failed" -eq 0; \
|
||||
fi
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
top_distdir = .
|
||||
# Avoid unsightly `./'.
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
|
||||
GZIP_ENV = --best
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkinstalldirs) $(distdir)/. $(distdir)/./.
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
$(mkinstalldirs) "$(distdir)/$$dir"; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pR $$d/$$file $(distdir) \
|
||||
|| exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -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 $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(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
|
||||
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
|
||||
&& cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
|
||||
|| (echo "Error: files left after uninstall" 1>&2; \
|
||||
exit 1) ) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distclean \
|
||||
&& rm -f $(distdir).tar.gz \
|
||||
&& (test `find . -type f -print | wc -l` -eq 0 \
|
||||
|| (echo "Error: files left after distclean" 1>&2; \
|
||||
exit 1) )
|
||||
-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
|
||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||
sed 'h;s/./=/g;p;x;p;x'
|
||||
check-am: all-am
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) \
|
||||
config.h
|
||||
install-binPROGRAMS: install-libLTLIBRARIES
|
||||
|
||||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(man3dir) $(DESTDIR)$(pkgconfigdir) $(DESTDIR)$(includedir)
|
||||
|
||||
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:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
|
||||
clean-libtool clean-local clean-noinstPROGRAMS mostlyclean-am
|
||||
|
||||
dist-all: distdir
|
||||
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
|
||||
distclean: distclean-am
|
||||
-rm -f config.status config.cache config.log
|
||||
distclean-am: clean-am distclean-compile distclean-depend \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-includeHEADERS install-man \
|
||||
install-pkgconfigDATA
|
||||
|
||||
install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man: install-man1 install-man3
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
|
||||
uninstall-info-am uninstall-libLTLIBRARIES uninstall-man \
|
||||
uninstall-pkgconfigDATA
|
||||
|
||||
uninstall-man: uninstall-man1 uninstall-man3
|
||||
|
||||
.PHONY: GTAGS all all-am check check-TESTS check-am clean \
|
||||
clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
|
||||
clean-libtool clean-local clean-noinstPROGRAMS dist dist-all \
|
||||
distcheck distclean distclean-compile distclean-depend \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am info info-am install \
|
||||
install-am install-binPROGRAMS install-data install-data-am \
|
||||
install-exec install-exec-am install-includeHEADERS \
|
||||
install-info install-info-am install-libLTLIBRARIES install-man \
|
||||
install-man1 install-man3 install-pkgconfigDATA install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool tags uninstall \
|
||||
uninstall-am uninstall-binPROGRAMS uninstall-includeHEADERS \
|
||||
uninstall-info-am uninstall-libLTLIBRARIES uninstall-man \
|
||||
uninstall-man1 uninstall-man3 uninstall-pkgconfigDATA
|
||||
|
||||
|
||||
unac.c: $(UNICODEDATA) builder.in
|
||||
$(PERL) builder -source -database=$(srcdir)/$(UNICODEDATA)
|
||||
|
||||
rpm:
|
||||
RPM_TOPDIR=`rpm --showrc | $(PERL) -n -e 'print if(s/.*_topdir\s+(.*)/$$1/)'` ; \
|
||||
cp $(PACKAGE).spec $$RPM_TOPDIR/SPECS ; \
|
||||
cp $(PACKAGE)-$(VERSION).tar.gz $$RPM_TOPDIR/SOURCES ; \
|
||||
rpm -ba --clean --rmsource $$RPM_TOPDIR/SPECS/$(PACKAGE).spec ; \
|
||||
mv $$RPM_TOPDIR/RPMS/i386/$(PACKAGE)-$(VERSION)-1.i386.rpm . ; \
|
||||
mv $$RPM_TOPDIR/SRPMS/$(PACKAGE)-$(VERSION)-1.src.rpm .
|
||||
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
clean-local:
|
||||
rm -f unac.reference
|
||||
# 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:
|
||||
58
unac/NEWS
Normal file
58
unac/NEWS
Normal file
@ -0,0 +1,58 @@
|
||||
Version 1.7.0
|
||||
|
||||
* Rune Nordbøe Skillingstad fixed Unicode-3.2 bug
|
||||
|
||||
* Added debug information and improved regression test
|
||||
information level
|
||||
|
||||
* Re-wrote manual pages for clarity and content
|
||||
|
||||
Version 1.6.0
|
||||
|
||||
* Upgrade to Unicode-3.2.0
|
||||
|
||||
Version 1.5.0
|
||||
|
||||
* Better detection of the iconv library, using the AM_ICONV
|
||||
macro of Bruno Haible.
|
||||
|
||||
* Upgrade autotools files
|
||||
|
||||
* Minor documentation upgrades.
|
||||
|
||||
Version 1.4.0
|
||||
|
||||
* When unac_string finds an illegal sequence while converting,
|
||||
it replaces it with a space. For instance 1/4 ISO-8859-1 character
|
||||
is converted to 1 4 (one space four) because the fraction character
|
||||
does not exist in ISO-8859-1.
|
||||
|
||||
* The new unac_version function returns the version number.
|
||||
|
||||
Version 1.3.0
|
||||
|
||||
* Add support for systems that do not have UTF-16BE defined
|
||||
but only UTF-16 being implicitly big endian. It means that
|
||||
it will work with both glibc-2.1.3 and glibc-2.1.94.
|
||||
|
||||
* Fix occasional allocation bug
|
||||
|
||||
* Allocate returned buffer even if an empty string is given
|
||||
in input.
|
||||
|
||||
* Add more regression tests
|
||||
|
||||
Version 1.2.0
|
||||
|
||||
* Fix endianess problem that shows on RedHat-7.0
|
||||
|
||||
* Fix prototype mistake (int used where size_t required)
|
||||
|
||||
Version 1.1.0
|
||||
|
||||
* Fix error handling bug
|
||||
|
||||
* Recommend alternative iconv implementation for Solaris-2.6
|
||||
|
||||
Version 1.0.0
|
||||
|
||||
93
unac/README
Normal file
93
unac/README
Normal file
@ -0,0 +1,93 @@
|
||||
$Header: /cvsroot/unac/unac/README,v 1.5 2002/09/02 10:40:09 loic Exp $
|
||||
|
||||
What is it ?
|
||||
------------
|
||||
|
||||
unac is a C library that removes accents from characters, regardless
|
||||
of the character set (ISO-8859-15, ISO-CELTIC, KOI8-RU...) as long as
|
||||
iconv(3) is able to convert it into UTF-16 (Unicode). For instance
|
||||
the string été will become ete. It provides a command line interface
|
||||
(unaccent) that removes accents from an input flow or a string given
|
||||
in argument. When using the library function or the command, the
|
||||
charset of the input must be specified. The input is converted to
|
||||
UTF-16 using iconv(3), accents are removed and the result is converted
|
||||
back to the original charset. The iconv -l command on GNU/Linux will
|
||||
show all charset supported.
|
||||
|
||||
Where is the documentation ?
|
||||
----------------------------
|
||||
|
||||
The manual page of the unaccent command : man unaccent.
|
||||
The manual page of the unac library : man unac.
|
||||
|
||||
How to install it ?
|
||||
-------------------
|
||||
|
||||
For OS that are not GNU/Linux we recommend to use the iconv library
|
||||
provided by Bruno Haible <haible@ilog.fr> at
|
||||
ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.8.tar.gz.
|
||||
|
||||
./configure [--with-iconv=/my/local]
|
||||
|
||||
make all
|
||||
|
||||
make check
|
||||
|
||||
make install
|
||||
|
||||
How to link with unac ?
|
||||
-------------------------
|
||||
|
||||
Assuming you've installed unac in the /usr/local directory use something
|
||||
similar to the following:
|
||||
|
||||
In the sources:
|
||||
...
|
||||
#include <unac.h>
|
||||
...
|
||||
|
||||
On the command line:
|
||||
|
||||
cc -I/usr/local/include -o prog prog.cc -L/usr/local/lib -lunac
|
||||
|
||||
Where can I download it ?
|
||||
-------------------------
|
||||
The main distribution site is http://www.senga.org/unac/.
|
||||
|
||||
What is the license ?
|
||||
---------------------
|
||||
unac is distributed under the GNU GPL, as found at
|
||||
http://www.gnu.org/licenses/gpl.txt. Unicode data files are
|
||||
under the following license, which is compatible with the
|
||||
GNU GPL:
|
||||
|
||||
http://www.unicode.org/Public/3.2-Update/UnicodeData-3.2.0.html#UCD_Terms
|
||||
UCD Terms of Use
|
||||
|
||||
Disclaimer
|
||||
|
||||
The Unicode Character Database is provided as is by Unicode, Inc. No
|
||||
claims are made as to fitness for any particular purpose. No
|
||||
warranties of any kind are expressed or implied. The recipient agrees
|
||||
to determine applicability of information provided. If this file has
|
||||
been purchased on magnetic or optical media from Unicode, Inc., the
|
||||
sole remedy for any claim will be exchange of defective media within
|
||||
90 days of receipt.
|
||||
|
||||
This disclaimer is applicable for all other data files accompanying
|
||||
the Unicode Character Database, some of which have been compiled by
|
||||
the Unicode Consortium, and some of which have been supplied by other
|
||||
sources. Limitations on Rights to Redistribute This Data
|
||||
|
||||
Recipient is granted the right to make copies in any form for internal
|
||||
distribution and to freely use the information supplied in the
|
||||
creation of products supporting the Unicode(TM) Standard. The files
|
||||
in the Unicode Character Database can be redistributed to third
|
||||
parties or other organizations (whether for profit or not) as long as
|
||||
this notice and the disclaimer notice are retained. Information can
|
||||
be extracted from these files and used in documentation or programs,
|
||||
as long as there is an accompanying notice indicating the source.
|
||||
|
||||
Loic Dachary
|
||||
loic@senga.org
|
||||
http://www.senga.org/
|
||||
9
unac/THANKS
Normal file
9
unac/THANKS
Normal file
@ -0,0 +1,9 @@
|
||||
Rune Nordbøe Skillingstad <runesk@linpro.no>
|
||||
UnicodeData-3.2.0 patch for Norway
|
||||
"Character Decomposition Mapping"
|
||||
|
||||
Remi Perrot remi_perrot@users.sourceforge.net
|
||||
contributed the expertise for debian packaging
|
||||
|
||||
Helios De Creisquer creis@zehc.net
|
||||
contributed bug fixes
|
||||
13903
unac/UnicodeData-3.2.0.txt
Normal file
13903
unac/UnicodeData-3.2.0.txt
Normal file
File diff suppressed because it is too large
Load Diff
156
unac/acinclude.m4
Normal file
156
unac/acinclude.m4
Normal file
@ -0,0 +1,156 @@
|
||||
dnl Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2 of the License, or
|
||||
dnl (at your option) any later version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License
|
||||
dnl along with this program; if not, write to the Free Software
|
||||
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
dnl
|
||||
dnl Local autoconf definitions. Try to follow the guidelines of the autoconf
|
||||
dnl macro repository so that integration in the repository is easy.
|
||||
dnl To submit a macro to the repository send the macro (one macro per mail)
|
||||
dnl to Peter Simons <simons@cryp.to>.
|
||||
dnl The repository itself is at httphttp://savannah.gnu.org/projects/ac-archive/
|
||||
dnl
|
||||
|
||||
dnl @synopsis AC_MANDATORY_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||
dnl
|
||||
dnl Same semantic as AC_CHECK_HEADER except that it aborts the configuration
|
||||
dnl script if the header file is not found.
|
||||
dnl
|
||||
dnl @version $Id: acinclude.m4,v 1.5 2002/09/02 10:40:09 loic Exp $
|
||||
dnl @author Loic Dachary <loic@senga.org>
|
||||
dnl
|
||||
AC_DEFUN([AC_MANDATORY_HEADER],
|
||||
[dnl Do the transliteration at runtime so arg 1 can be a shell variable.
|
||||
ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
|
||||
AC_MSG_CHECKING([for $1])
|
||||
AC_CACHE_VAL(ac_cv_header_$ac_safe,
|
||||
[AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes",
|
||||
eval "ac_cv_header_$ac_safe=no")])dnl
|
||||
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_ERROR(header not found check config.log)
|
||||
ifelse([$3], , , [$3
|
||||
])dnl
|
||||
fi
|
||||
])
|
||||
|
||||
dnl @synopsis AC_MANDATORY_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||
dnl
|
||||
dnl Same semantic as AC_CHECK_HEADERS except that it aborts the configuration
|
||||
dnl script if one of the headers file is not found.
|
||||
dnl
|
||||
dnl @version $Id: acinclude.m4,v 1.5 2002/09/02 10:40:09 loic Exp $
|
||||
dnl @author Loic Dachary <loic@senga.org>
|
||||
dnl
|
||||
AC_DEFUN([AC_MANDATORY_HEADERS],
|
||||
[for ac_hdr in $1
|
||||
do
|
||||
AC_MANDATORY_HEADER($ac_hdr,
|
||||
[changequote(, )dnl
|
||||
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
|
||||
changequote([, ])dnl
|
||||
AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl
|
||||
done
|
||||
])
|
||||
|
||||
dnl @synopsis AC_MANDATORY_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
|
||||
dnl
|
||||
dnl Same semantic as AC_CHECK_LIB except that it aborts the configuration
|
||||
dnl script if the library is not found or compilation fails.
|
||||
dnl
|
||||
dnl @version $Id: acinclude.m4,v 1.5 2002/09/02 10:40:09 loic Exp $
|
||||
dnl @author Loic Dachary <loic@senga.org>
|
||||
dnl
|
||||
AC_DEFUN([AC_MANDATORY_LIB],
|
||||
[AC_MSG_CHECKING([for $2 in -l$1])
|
||||
dnl Use a cache variable name containing both the library and function name,
|
||||
dnl because the test really is for library $1 defining function $2, not
|
||||
dnl just for library $1. Separate tests with the same $1 and different $2s
|
||||
dnl may have different results.
|
||||
ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
|
||||
AC_CACHE_VAL(ac_cv_lib_$ac_lib_var,
|
||||
[ac_save_LIBS="$LIBS"
|
||||
LIBS="-l$1 $5 $LIBS"
|
||||
AC_TRY_LINK(dnl
|
||||
ifelse(AC_LANG, [FORTRAN77], ,
|
||||
ifelse([$2], [main], , dnl Avoid conflicting decl of main.
|
||||
[/* Override any gcc2 internal prototype to avoid an error. */
|
||||
]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
])dnl
|
||||
[/* We use char because int might match the return type of a gcc2
|
||||
builtin and then its argument prototype would still apply. */
|
||||
char $2();
|
||||
])),
|
||||
[$2()],
|
||||
eval "ac_cv_lib_$ac_lib_var=yes",
|
||||
eval "ac_cv_lib_$ac_lib_var=no")
|
||||
LIBS="$ac_save_LIBS"
|
||||
])dnl
|
||||
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$3], ,
|
||||
[changequote(, )dnl
|
||||
ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
|
||||
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
|
||||
changequote([, ])dnl
|
||||
AC_DEFINE_UNQUOTED($ac_tr_lib)
|
||||
LIBS="-l$1 $LIBS"
|
||||
], [$3])
|
||||
else
|
||||
AC_MSG_ERROR(library not found check config.log)
|
||||
ifelse([$4], , , [$4
|
||||
])dnl
|
||||
fi
|
||||
])
|
||||
|
||||
dnl @synopsis AC_COMPILE_WARNINGS
|
||||
dnl
|
||||
dnl Set the maximum warning verbosity according to compiler used.
|
||||
dnl Currently supports g++ and gcc.
|
||||
dnl This macro must be put after AC_PROG_CC and AC_PROG_CXX in
|
||||
dnl configure.in
|
||||
dnl
|
||||
dnl @version $Id: acinclude.m4,v 1.5 2002/09/02 10:40:09 loic Exp $
|
||||
dnl @author Loic Dachary <loic@senga.org>
|
||||
dnl
|
||||
|
||||
AC_DEFUN(AC_COMPILE_WARNINGS,
|
||||
[AC_MSG_CHECKING(maximum warning verbosity option)
|
||||
if test -n "$CXX"
|
||||
then
|
||||
if test "$GXX" = "yes"
|
||||
then
|
||||
ac_compile_warnings_opt='-Wall -Woverloaded-virtual'
|
||||
fi
|
||||
CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
|
||||
ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
|
||||
fi
|
||||
|
||||
if test -n "$CC"
|
||||
then
|
||||
if test "$GCC" = "yes"
|
||||
then
|
||||
ac_compile_warnings_opt='-Wall -Wmissing-declarations -Wmissing-prototypes'
|
||||
fi
|
||||
CFLAGS="$CFLAGS $ac_compile_warnings_opt"
|
||||
ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
|
||||
fi
|
||||
AC_MSG_RESULT($ac_compile_warnings_msg)
|
||||
unset ac_compile_warnings_msg
|
||||
unset ac_compile_warnings_opt
|
||||
])
|
||||
|
||||
5253
unac/aclocal.m4
vendored
Normal file
5253
unac/aclocal.m4
vendored
Normal file
File diff suppressed because it is too large
Load Diff
405
unac/builder.in
Normal file
405
unac/builder.in
Normal file
@ -0,0 +1,405 @@
|
||||
#
|
||||
# Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
#
|
||||
# Generate a table mapping UTF-16 characters to their unaccented
|
||||
# equivalent. Some characters such as fi (one character) are expanded
|
||||
# into two letters : f and i. In Unicode jargon it means that the table
|
||||
# map each character to its compatibility decomposition in which marks
|
||||
# were stripped.
|
||||
#
|
||||
# The format of the $base file can be found at:
|
||||
# http://www.unicode.org/Public/3.2-Update/UnicodeData-3.2.0.html
|
||||
#
|
||||
use strict;
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
sub main {
|
||||
my($base) = "UnicodeData-@UNICODE_VERSION@.txt";
|
||||
my($verbose);
|
||||
my($source);
|
||||
my($reference);
|
||||
|
||||
GetOptions("verbose+" => \$verbose,
|
||||
"database=s" => \$base,
|
||||
"source!" => \$source,
|
||||
"reference!" => \$reference);
|
||||
|
||||
my(%decomposition, %mark, %name);
|
||||
my(%ranges);
|
||||
open(FILE, "<$base") or die "cannot open $base for reading : $!";
|
||||
while(<FILE>) {
|
||||
next if(/^\s*#/); # Skip comments
|
||||
my($code_value,
|
||||
$character_name,
|
||||
$general_category,
|
||||
$canonical_combining_classes,
|
||||
$bidirectional_category,
|
||||
$character_decomposition_mapping,
|
||||
$decimal_digit_value,
|
||||
$digit_value,
|
||||
$numeric_value,
|
||||
$mirrored,
|
||||
$unicode_1_0_name,
|
||||
$_10646_comment_field,
|
||||
$uppercase_mapping,
|
||||
$lowercase_mapping,
|
||||
$titlecase_mapping) = split(/;/, $_);
|
||||
#
|
||||
# Generate ranges of values that are not explicitly listed.
|
||||
# CJK ideographs for instance.
|
||||
#
|
||||
if($character_name =~ /^<(.*), (First|Last)>/) {
|
||||
$ranges{$1}{$2} = $code_value;
|
||||
}
|
||||
if($character_decomposition_mapping =~ /(<.*>)?\s*(.+)/) {
|
||||
$decomposition{$code_value} = $2;
|
||||
}
|
||||
if($general_category =~ /^M/) {
|
||||
$mark{$code_value} = 1;
|
||||
}
|
||||
$name{$code_value} = $character_name;
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
#
|
||||
# Generate compatibility decomposition and strip marks
|
||||
# (marks == diacritics == accents)
|
||||
#
|
||||
my($from, $to);
|
||||
while(($from, $to) = each(%decomposition)) {
|
||||
my(@code_values) = split(' ', $to);
|
||||
my($code_value);
|
||||
my(@decomposition);
|
||||
while(@code_values) {
|
||||
my($code_value) = shift(@code_values);
|
||||
if(exists($decomposition{$code_value})) {
|
||||
push(@code_values, split(' ', $decomposition{$code_value}));
|
||||
} elsif(!exists($mark{$code_value})) {
|
||||
push(@decomposition, $code_value);
|
||||
}
|
||||
}
|
||||
if(@decomposition) {
|
||||
$decomposition{$from} = "@decomposition";
|
||||
} else {
|
||||
delete($decomposition{$from});
|
||||
}
|
||||
}
|
||||
|
||||
reference(\%decomposition, $verbose) if($reference);
|
||||
source(\%decomposition, \%name, $verbose) if($source);
|
||||
}
|
||||
|
||||
#
|
||||
# Generate machine readable file mapping all UTF-16 codes
|
||||
# to their unaccented replacement. This file can be compared
|
||||
# with the output of a program doing the same mapping using the
|
||||
# libunac library.
|
||||
#
|
||||
sub reference {
|
||||
my($decomposition, $verbose) = @_;
|
||||
|
||||
my($code_value);
|
||||
foreach $code_value (0 .. 0xFFFF) {
|
||||
$code_value = uc(sprintf("%04x", $code_value));
|
||||
print "$code_value";
|
||||
if(exists($decomposition->{$code_value})) {
|
||||
print " => $decomposition->{$code_value}\n";
|
||||
} else {
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Read input file into hash table and return it.
|
||||
#
|
||||
# The input is divided in chuncks according to special markers. For
|
||||
# instance:
|
||||
#
|
||||
# before
|
||||
# /* Generated by builder. Do not modify. Start a_tag */
|
||||
# bla bla
|
||||
# /* Generated by builder. Do not modify. End a_tag */
|
||||
# after
|
||||
# /* Generated by builder. Do not modify. Start b_tag */
|
||||
# more stuff
|
||||
# /* Generated by builder. Do not modify. End b_tag */
|
||||
# still something
|
||||
#
|
||||
# Will generate the following hash:
|
||||
#
|
||||
# {
|
||||
# 'list' => [ 1, a_tag, 2, b_tag, 3 ],
|
||||
# '1' => "before\n",
|
||||
# 'a_tag' => undef,
|
||||
# '2' => "after\n";
|
||||
# 'b_tag' => undef,
|
||||
# '3' => "still something\n"
|
||||
# }
|
||||
#
|
||||
# The caller may then assign a string to the a_tag and b_tag entries
|
||||
# and then call the spit function to rebuild the file.
|
||||
#
|
||||
sub slurp {
|
||||
my($file) = @_;
|
||||
my(%content);
|
||||
my($count) = 1;
|
||||
my(@lines);
|
||||
open(FILE, "<$file") or die "cannot open $file for reading : $!";
|
||||
while(<FILE>) {
|
||||
if(/Do not modify. Start\s+(\w+)/i) {
|
||||
push(@{$content{'list'}}, $count);
|
||||
$content{$count} = join("", @lines);
|
||||
$count++;
|
||||
push(@{$content{'list'}}, $1);
|
||||
@lines = ();
|
||||
}
|
||||
next if(/Do not modify. Start/i .. /Do not modify. End/i);
|
||||
push(@lines, $_);
|
||||
}
|
||||
if(@lines) {
|
||||
push(@{$content{'list'}}, $count);
|
||||
$content{$count} = join("", @lines);
|
||||
}
|
||||
close(FILE);
|
||||
return \%content;
|
||||
}
|
||||
|
||||
#
|
||||
# Write the $file with the content of the $content hash table.
|
||||
# See the slurp function for a description of the $content format.
|
||||
#
|
||||
sub spit {
|
||||
my($file, $content) = @_;
|
||||
open(FILE, ">$file") or die "cannot open $file for writing : $!";
|
||||
my($tag);
|
||||
foreach $tag (@{$content->{'list'}}) {
|
||||
print(FILE "/* Generated by builder. Do not modify. Start $tag */\n") if($tag !~ /^\d+$/);
|
||||
print FILE $content->{$tag};
|
||||
print(FILE "/* Generated by builder. Do not modify. End $tag */\n") if($tag !~ /^\d+$/);
|
||||
}
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
#
|
||||
# Generate tables, defines and code in the unac.c and unac.h files.
|
||||
# The unac.c and unac.h files are substituted in place.
|
||||
#
|
||||
sub source {
|
||||
my($decomposition, $name, $verbose) = @_;
|
||||
|
||||
my($csource) = slurp("unac.c");
|
||||
my($hsource) = slurp("unac.h");
|
||||
#
|
||||
# Human readable table
|
||||
#
|
||||
my(@comment);
|
||||
push(@comment, "/*\n");
|
||||
my($from);
|
||||
foreach $from (sort(keys(%$decomposition))) {
|
||||
my($character_name) = $name->{$from};
|
||||
$character_name = "??" if(!$character_name);
|
||||
push(@comment, " * $from $character_name\n");
|
||||
my($code_value);
|
||||
foreach $code_value (split(' ', $decomposition->{$from})) {
|
||||
$character_name = $name->{$code_value} || "??";
|
||||
push(@comment, " * \t$code_value $character_name\n");
|
||||
}
|
||||
}
|
||||
push(@comment, "*/\n");
|
||||
my($comment) = join("", @comment);
|
||||
|
||||
#
|
||||
# Select the best block size (the one that takes less space)
|
||||
#
|
||||
# result: $best_blocks (array of blocks that contain exactly
|
||||
# $block_count replacements. Each block
|
||||
# is a string containing replacements
|
||||
# separated by |)
|
||||
# $best_indexes (array mapping block number to a block
|
||||
# in the $best_blocks array)
|
||||
# $best_block_shift (the size of the block)
|
||||
#
|
||||
# Within a block, if the character has no replacement the 0xFFFF
|
||||
# placeholder is inserted.
|
||||
#
|
||||
my($best_blocks);
|
||||
my($best_indexes);
|
||||
my($best_block_shift);
|
||||
my($best_total_size) = 10 * 1024 * 1024;
|
||||
my($block_shift);
|
||||
foreach $block_shift (2 .. 10) {
|
||||
my($block_count) = 1 << $block_shift;
|
||||
my(@blocks, @indexes);
|
||||
my($duplicate) = 0;
|
||||
my(@values);
|
||||
my($code_value);
|
||||
foreach $code_value (0 .. 0x10000) {
|
||||
if($code_value > 0 && $code_value % $block_count == 0) {
|
||||
my($block) = join("|", @values);
|
||||
my($existing_block);
|
||||
my($index) = 0;
|
||||
my($found);
|
||||
foreach $existing_block (@blocks) {
|
||||
if($block eq $existing_block) {
|
||||
push(@indexes, $index);
|
||||
$found = 1;
|
||||
$duplicate++;
|
||||
last;
|
||||
}
|
||||
$index++;
|
||||
}
|
||||
if(!$found) {
|
||||
push(@indexes, $index);
|
||||
push(@blocks, $block);
|
||||
}
|
||||
@values = ();
|
||||
}
|
||||
$code_value = uc(sprintf("%04x", $code_value));
|
||||
if(exists($decomposition->{$code_value})) {
|
||||
push(@values, $decomposition->{$code_value});
|
||||
} else {
|
||||
push(@values, "FFFF");
|
||||
}
|
||||
}
|
||||
print STDERR scalar(@blocks) . " blocks of " . $block_count . " entries, factorized $duplicate blocks\n\t" if($verbose);
|
||||
my($block_size) = 0;
|
||||
my($block);
|
||||
foreach $block (@blocks) {
|
||||
my(@tmp) = split(/[| ]/, $block);
|
||||
$block_size += scalar(@tmp) * 2;
|
||||
}
|
||||
#
|
||||
# Pointer to the block array
|
||||
#
|
||||
$block_size += scalar(@blocks) * 4;
|
||||
#
|
||||
# Positions of the entries in the block
|
||||
#
|
||||
$block_size += $block_count * scalar(@blocks) * 2;
|
||||
print STDERR "total block size = $block_size, " if($verbose);
|
||||
my($index_size) = (1 << (16 - $block_shift)) * 2;
|
||||
print STDERR "index size = " . $index_size . "\n\t" if($verbose);
|
||||
my($total_size) = $block_size + $index_size;
|
||||
print STDERR "total size = $total_size\n" if($verbose);
|
||||
|
||||
if($total_size < $best_total_size) {
|
||||
$best_total_size = $total_size;
|
||||
$best_blocks = \@blocks;
|
||||
$best_indexes = \@indexes;
|
||||
$best_block_shift = $block_shift;
|
||||
}
|
||||
}
|
||||
|
||||
my($block_count) = scalar(@$best_blocks);
|
||||
my($block_size) = 1 << $best_block_shift;
|
||||
|
||||
#
|
||||
# Constants that depend on the block size.
|
||||
# result : $defines
|
||||
#
|
||||
my($defines) = <<EOF;
|
||||
#define UNAC_BLOCK_SHIFT $best_block_shift
|
||||
#define UNAC_BLOCK_MASK ((1 << UNAC_BLOCK_SHIFT) - 1)
|
||||
#define UNAC_BLOCK_SIZE (1 << UNAC_BLOCK_SHIFT)
|
||||
#define UNAC_BLOCK_COUNT $block_count
|
||||
#define UNAC_INDEXES_SIZE (0x10000 >> UNAC_BLOCK_SHIFT)
|
||||
EOF
|
||||
#
|
||||
# Mapping block number to index in data_table or position table.
|
||||
# result : $index_out
|
||||
#
|
||||
my($count) = 0;
|
||||
my($index);
|
||||
my($index_out) = "unsigned short unac_indexes[UNAC_INDEXES_SIZE] = {\n";
|
||||
foreach $index (@$best_indexes) {
|
||||
$count++;
|
||||
$index_out .= sprintf("%4s,", $index);
|
||||
if($count % 15 == 0) {
|
||||
$index_out .= "\n";
|
||||
}
|
||||
}
|
||||
$index_out =~ s/,\s*\Z/\n/s;
|
||||
$index_out .= "};\n";
|
||||
|
||||
#
|
||||
# Generate the position table (map character number in block to
|
||||
# position in the data string), the data_table that maps a block
|
||||
# to a unsigned short array that contains the character (aka the
|
||||
# data array) and the data arrays themselves that is a pure concatenation
|
||||
# of all the unsigned short in a block.
|
||||
# result : $position_out, $data_table_out, $data_out
|
||||
#
|
||||
my(@positions_out);
|
||||
my($highest_position) = 0;
|
||||
my(@data_table_out);
|
||||
my($data_table_out) = "unsigned short* unac_data_table[UNAC_BLOCK_COUNT] = {\n";
|
||||
my(@data_out);
|
||||
my($block_number) = 0;
|
||||
my($block);
|
||||
foreach $block (@$best_blocks) {
|
||||
my(@index);
|
||||
my($position) = 0;
|
||||
my($entry);
|
||||
my(@data);
|
||||
foreach $entry (split('\|', $block)) {
|
||||
push(@index, $position);
|
||||
my(@tmp) = split(' ', $entry);
|
||||
push(@data, @tmp);
|
||||
$position += scalar(@tmp);
|
||||
}
|
||||
push(@index, $position);
|
||||
$highest_position = $position if($position > $highest_position);
|
||||
push(@positions_out, "/* $block_number */ { " . join(", ", @index) . " }");
|
||||
push(@data_table_out, "unac_data$block_number");
|
||||
push(@data_out, "unsigned short unac_data$block_number" . "[] = { 0x" . join(", 0x", @data) . " };\n");
|
||||
$block_number++;
|
||||
}
|
||||
my($position_type) = $highest_position >= 256 ? "short" : "char";
|
||||
my($positions_out) = "unsigned $position_type unac_positions[UNAC_BLOCK_COUNT][UNAC_BLOCK_SIZE + 1] = {\n";
|
||||
|
||||
$positions_out .= join(",\n", @positions_out);
|
||||
$positions_out .= "\n};\n";
|
||||
my($data_out) = join("", @data_out);
|
||||
$data_table_out .= join(",\n", @data_table_out);
|
||||
$data_table_out .= "\n};\n";
|
||||
|
||||
#
|
||||
# Tables declarations
|
||||
# result : $declarations
|
||||
#
|
||||
my($declarations);
|
||||
$declarations = <<EOF;
|
||||
extern unsigned short unac_indexes[UNAC_INDEXES_SIZE];
|
||||
extern unsigned $position_type unac_positions[UNAC_BLOCK_COUNT][UNAC_BLOCK_SIZE + 1];
|
||||
extern unsigned short* unac_data_table[UNAC_BLOCK_COUNT];
|
||||
EOF
|
||||
for($block_number = 0; $block_number < $block_count; $block_number++) {
|
||||
$declarations .= "extern unsigned short unac_data$block_number" . "[];\n";
|
||||
}
|
||||
|
||||
$csource->{'tables'} = "$comment\n$index_out\n$positions_out\n$data_out\n$data_table_out";
|
||||
$hsource->{'defines'} = $defines;
|
||||
$hsource->{'declarations'} = $declarations;
|
||||
|
||||
spit("unac.c", $csource);
|
||||
spit("unac.h", $hsource);
|
||||
}
|
||||
|
||||
main();
|
||||
1325
unac/config.guess
vendored
Executable file
1325
unac/config.guess
vendored
Executable file
File diff suppressed because it is too large
Load Diff
71
unac/config.h.in
Normal file
71
unac/config.h.in
Normal file
@ -0,0 +1,71 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the `getopt_long' function. */
|
||||
#undef HAVE_GETOPT_LONG
|
||||
|
||||
/* Define if you have the iconv() function. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define to 1 if you have the `iconv_open' function. */
|
||||
#undef HAVE_ICONV_OPEN
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
#undef ICONV_CONST
|
||||
|
||||
/* 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 version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
1460
unac/config.sub
vendored
Executable file
1460
unac/config.sub
vendored
Executable file
File diff suppressed because it is too large
Load Diff
9713
unac/configure
vendored
Executable file
9713
unac/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
62
unac/configure.ac
Normal file
62
unac/configure.ac
Normal file
@ -0,0 +1,62 @@
|
||||
#
|
||||
# Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
AC_INIT(config.h.in)
|
||||
VERSION=`cat ${srcdir}/.version`
|
||||
MAJOR_VERSION=[`expr $VERSION : '\([0-9][0-9]*\)'`]
|
||||
AC_SUBST(MAJOR_VERSION)
|
||||
MINOR_VERSION=[`expr $VERSION : '[0-9][0-9]*\.\([0-9][0-9]*\)'`]
|
||||
AC_SUBST(MINOR_VERSION)
|
||||
MICRO_VERSION=[`expr $VERSION : '[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)'`]
|
||||
AC_SUBST(MICRO_VERSION)
|
||||
AM_INIT_AUTOMAKE([unac], $VERSION, nosubst)
|
||||
AC_PREREQ(2.13)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
dnl
|
||||
dnl Unicode version used by unac, as published at http://www.unicode.org/Public/
|
||||
dnl
|
||||
UNICODE_VERSION=3.2.0
|
||||
AC_SUBST(UNICODE_VERSION)
|
||||
|
||||
AC_PROG_CC
|
||||
AC_AIX
|
||||
AC_COMPILE_WARNINGS
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_PATH_PROG(PERL, perl, /usr/bin/perl)
|
||||
AC_PATH_PROG(SH, sh, /bin/sh)
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AM_ICONV
|
||||
|
||||
AC_CHECK_FUNCS(iconv_open,,AC_MSG_ERROR([
|
||||
iconv_open not found try to install replacement from
|
||||
http://www.gnu.org/software/libiconv/
|
||||
ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.8.tar.gz]))
|
||||
|
||||
AC_CHECK_FUNCS(vsnprintf)
|
||||
|
||||
AC_LIBSOURCES(getopt.c)
|
||||
AC_CHECK_FUNCS(getopt_long,,[AC_LIBOBJ(getopt)])
|
||||
|
||||
AC_OUTPUT(Makefile unac.pc unac.spec t_unac builder, chmod +x t_unac)
|
||||
411
unac/depcomp
Executable file
411
unac/depcomp
Executable file
@ -0,0 +1,411 @@
|
||||
#! /bin/sh
|
||||
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
# Copyright 1999, 2000 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
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
|
||||
# `libtool' can also be set to `yes' or `no'.
|
||||
|
||||
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# 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
|
||||
|
||||
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.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## 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).
|
||||
## - 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 -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## 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.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## 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.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -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 -eq 0; then :
|
||||
else
|
||||
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 ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. 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.
|
||||
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
outname="$stripped.o"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 AIX 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.
|
||||
|
||||
tmpdepfile1="$object.d"
|
||||
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile1"; then
|
||||
tmpdepfile="$tmpdepfile1"
|
||||
else
|
||||
tmpdepfile="$tmpdepfile2"
|
||||
fi
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a space and a tab in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#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 proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*) # this is libtool, let us make it quiet
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case "$arg" in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
;;
|
||||
esac
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
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)
|
||||
# X makedepend
|
||||
(
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in no)
|
||||
set ""; shift
|
||||
cleared=yes
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift;;
|
||||
-*)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tail +3 "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
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 proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*)
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case $arg in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
;;
|
||||
esac
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
"$@" -E |
|
||||
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
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 proprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
( IFS=" "
|
||||
case " $* " in
|
||||
*" --mode=compile "*)
|
||||
for arg
|
||||
do # cycle over the arguments
|
||||
case $arg in
|
||||
"--mode=compile")
|
||||
# insert --quiet before "--mode=compile"
|
||||
set fnord "$@" --quiet
|
||||
shift # fnord
|
||||
;;
|
||||
esac
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # "$arg"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
) &
|
||||
proc=$!
|
||||
"$@"
|
||||
stat=$?
|
||||
wait "$proc"
|
||||
if test "$stat" != 0; then exit $stat; fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
1279
unac/getopt.c
Normal file
1279
unac/getopt.c
Normal file
File diff suppressed because it is too large
Load Diff
181
unac/getopt.h
Normal file
181
unac/getopt.h
Normal file
@ -0,0 +1,181 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
|
||||
#ifndef __need_getopt
|
||||
# define _GETOPT_H 1
|
||||
#endif
|
||||
|
||||
/* If __GNU_LIBRARY__ is not already defined, either we are being used
|
||||
standalone, or this is the first header included in the source file.
|
||||
If we are being used with glibc, we need to include <features.h>, but
|
||||
that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
|
||||
not defined, include <ctype.h>, which will pull in <features.h> for us
|
||||
if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
|
||||
doesn't flood the namespace with stuff the way some other headers do.) */
|
||||
#if !defined __GNU_LIBRARY__
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* For communication from `getopt' to the caller.
|
||||
When `getopt' finds an option that takes an argument,
|
||||
the argument value is returned here.
|
||||
Also, when `ordering' is RETURN_IN_ORDER,
|
||||
each non-option ARGV-element is returned here. */
|
||||
|
||||
extern char *optarg;
|
||||
|
||||
/* Index in ARGV of the next element to be scanned.
|
||||
This is used for communication to and from the caller
|
||||
and for communication between successive calls to `getopt'.
|
||||
|
||||
On entry to `getopt', zero means this is the first call; initialize.
|
||||
|
||||
When `getopt' returns -1, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, `optind' communicates from one call to the next
|
||||
how much of ARGV has been scanned so far. */
|
||||
|
||||
extern int optind;
|
||||
|
||||
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||
for unrecognized options. */
|
||||
|
||||
extern int opterr;
|
||||
|
||||
/* Set to an option character which was unrecognized. */
|
||||
|
||||
extern int optopt;
|
||||
|
||||
#ifndef __need_getopt
|
||||
/* Describe the long-named options requested by the application.
|
||||
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||
of `struct option' terminated by an element containing a name which is
|
||||
zero.
|
||||
|
||||
The field `has_arg' is:
|
||||
no_argument (or 0) if the option does not take an argument,
|
||||
required_argument (or 1) if the option requires an argument,
|
||||
optional_argument (or 2) if the option takes an optional argument.
|
||||
|
||||
If the field `flag' is not NULL, it points to a variable that is set
|
||||
to the value given in the field `val' when the option is found, but
|
||||
left unchanged if the option is not found.
|
||||
|
||||
To have a long-named option do something other than set an `int' to
|
||||
a compiled-in constant, such as set a value from `optarg', set the
|
||||
option's `flag' field to zero and its `val' field to a nonzero
|
||||
value (the equivalent single-letter option character, if there is
|
||||
one). For long options that have a zero `flag' field, `getopt'
|
||||
returns the contents of the `val' field. */
|
||||
|
||||
struct option
|
||||
{
|
||||
# if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||
const char *name;
|
||||
# else
|
||||
char *name;
|
||||
# endif
|
||||
/* has_arg can't be an enum because some compilers complain about
|
||||
type mismatches in all the code that assumes it is an int. */
|
||||
int has_arg;
|
||||
int *flag;
|
||||
int val;
|
||||
};
|
||||
|
||||
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||
|
||||
# define no_argument 0
|
||||
# define required_argument 1
|
||||
# define optional_argument 2
|
||||
#endif /* need getopt */
|
||||
|
||||
|
||||
/* Get definitions and prototypes for functions to process the
|
||||
arguments in ARGV (ARGC of them, minus the program name) for
|
||||
options given in OPTS.
|
||||
|
||||
Return the option character from OPTS just read. Return -1 when
|
||||
there are no more options. For unrecognized options, or options
|
||||
missing arguments, `optopt' is set to the option letter, and '?' is
|
||||
returned.
|
||||
|
||||
The OPTS string is a list of characters which are recognized option
|
||||
letters, optionally followed by colons, specifying that that letter
|
||||
takes an argument, to be placed in `optarg'.
|
||||
|
||||
If a letter in OPTS is followed by two colons, its argument is
|
||||
optional. This behavior is specific to the GNU `getopt'.
|
||||
|
||||
The argument `--' causes premature termination of argument
|
||||
scanning, explicitly telling `getopt' that there are no more
|
||||
options.
|
||||
|
||||
If OPTS begins with `--', then non-option arguments are treated as
|
||||
arguments to the option '\0'. This behavior is specific to the GNU
|
||||
`getopt'. */
|
||||
|
||||
#if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||
# ifdef __GNU_LIBRARY__
|
||||
/* Many other libraries have conflicting prototypes for getopt, with
|
||||
differences in the consts, in stdlib.h. To avoid compilation
|
||||
errors, only prototype getopt for the GNU C library. */
|
||||
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
|
||||
# else /* not __GNU_LIBRARY__ */
|
||||
extern int getopt ();
|
||||
# endif /* __GNU_LIBRARY__ */
|
||||
|
||||
# ifndef __need_getopt
|
||||
extern int getopt_long (int ___argc, char *const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind);
|
||||
extern int getopt_long_only (int ___argc, char *const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind);
|
||||
|
||||
/* Internal only. Users should not call this directly. */
|
||||
extern int _getopt_internal (int ___argc, char *const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind,
|
||||
int __long_only);
|
||||
# endif
|
||||
#else /* not __STDC__ */
|
||||
extern int getopt ();
|
||||
# ifndef __need_getopt
|
||||
extern int getopt_long ();
|
||||
extern int getopt_long_only ();
|
||||
|
||||
extern int _getopt_internal ();
|
||||
# endif
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Make sure we later can get all the definitions and declarations. */
|
||||
#undef __need_getopt
|
||||
|
||||
#endif /* getopt.h */
|
||||
251
unac/install-sh
Executable file
251
unac/install-sh
Executable file
@ -0,0 +1,251 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
3114
unac/ltconfig
Executable file
3114
unac/ltconfig
Executable file
File diff suppressed because it is too large
Load Diff
5055
unac/ltmain.sh
Normal file
5055
unac/ltmain.sh
Normal file
File diff suppressed because it is too large
Load Diff
283
unac/missing
Executable file
283
unac/missing
Executable file
@ -0,0 +1,283 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
|
||||
# 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
|
||||
|
||||
run=:
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing 0.3 - GNU automake"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
||||
# We have makeinfo, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar ${1+"$@"} && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar ${1+"$@"} && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" ${1+"$@"} && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
40
unac/mkinstalldirs
Executable file
40
unac/mkinstalldirs
Executable file
@ -0,0 +1,40 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id: mkinstalldirs,v 1.4 2002/09/02 10:51:42 loic Exp $
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
||||
1
unac/stamp-h.in
Normal file
1
unac/stamp-h.in
Normal file
@ -0,0 +1 @@
|
||||
timestamp
|
||||
35
unac/t_unac.in
Executable file
35
unac/t_unac.in
Executable file
@ -0,0 +1,35 @@
|
||||
#!@SH@
|
||||
|
||||
@PERL@ builder -reference -database $srcdir/UnicodeData-@UNICODE_VERSION@.txt > unac.reference
|
||||
|
||||
if ./unactest | diff -bu - unac.reference
|
||||
then
|
||||
:
|
||||
else
|
||||
echo "unactest | diff - unac.reference must not show any difference" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ./unaccent ISO-8859-1 été ete > /dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
./unaccent --debug_high ISO-8859-1 été ete
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# Rune Nordbøe Skillingstad <runesk@linpro.no> on
|
||||
# UnicodeData-3.2.0.txt: 2 LATIN characters used in Norway didn't have
|
||||
# a "Character Decomposition Mapping". I've submitted a patch to
|
||||
# unicode.org that fixes this problem, but it might take some time
|
||||
# before somebody there have time to do something about it.
|
||||
#
|
||||
if ./unaccent ISO-8859-1 æøåÆØÅ aeoaAEOA > /dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
./unaccent --debug_high ISO-8859-1 æøåÆØÅ aeoaAEOA
|
||||
exit 1
|
||||
fi
|
||||
|
||||
390
unac/unac.3
Normal file
390
unac/unac.3
Normal file
@ -0,0 +1,390 @@
|
||||
'''
|
||||
''' Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
'''
|
||||
''' This program is free software; you can redistribute it and/or modify
|
||||
''' it under the terms of the GNU General Public License as published by
|
||||
''' the Free Software Foundation; either version 2 of the License, or
|
||||
''' (at your option) any later version.
|
||||
'''
|
||||
''' This program is distributed in the hope that it will be useful,
|
||||
''' but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
''' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
''' GNU General Public License for more details.
|
||||
'''
|
||||
''' You should have received a copy of the GNU General Public License
|
||||
''' along with this program; if not, write to the Free Software
|
||||
''' Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
'''
|
||||
.TH unac 3 local
|
||||
.SH NAME
|
||||
unac \- remove accents from string or character
|
||||
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.ft CW
|
||||
#include <unac.h>
|
||||
|
||||
const char* unac_version();
|
||||
|
||||
int unac_string(const char* charset,
|
||||
const char* in, int in_length,
|
||||
char** out, int* out_length);
|
||||
|
||||
int unac_string_utf16(const char* in, int in_length,
|
||||
char** out, int* out_length);
|
||||
|
||||
/* MACRO: side effect on unaccented and length */
|
||||
unac_char_utf16(unsigned short c,
|
||||
unsigned short* unaccented,
|
||||
int length);
|
||||
|
||||
const char* unac_version()
|
||||
|
||||
/*
|
||||
* level: UNAC_DEBUG_NONE UNAC_DEBUG_LOW UNAC_DEBUG_HIGH
|
||||
*/
|
||||
void unac_debug(int level)
|
||||
|
||||
/* typedef void (*unac_debug_print_t)(const char* message, void* data); */
|
||||
void unac_debug_callback(int level, unac_debug_print_t function, void* data)
|
||||
|
||||
.ft R
|
||||
.fi
|
||||
|
||||
.SH DESCRIPTION
|
||||
.I unac
|
||||
is a C library that removes accents from characters, regardless of the
|
||||
character set (ISO-8859-15, ISO-CELTIC, KOI8-RU...) as long as
|
||||
.I iconv(3)
|
||||
is able to convert it into UTF-16 (Unicode).
|
||||
|
||||
The
|
||||
.B unac_string
|
||||
function is given a charset (ISO-8859-15 for instance) and a string. It
|
||||
converts the string into UTF-16 and calls the
|
||||
.B unac_string_utf16
|
||||
function to remove all accents from the UTF-16 version. The unaccented
|
||||
string is then converted into the original charset (ISO-8859-15 for
|
||||
instance) and sent back to the caller of
|
||||
.B unac_string.
|
||||
|
||||
.I unac
|
||||
does a little more than removing accents:
|
||||
every character that is made of two character such as
|
||||
.B æ
|
||||
(ISO-8859-15 octal code 346)
|
||||
will be expanded in two characters
|
||||
.B a
|
||||
and
|
||||
.B e.
|
||||
Should a character be made of three characters, it would be
|
||||
decomposed in the same way.
|
||||
|
||||
The conversion from and to UTF-16 is
|
||||
done with
|
||||
.I iconv(3).
|
||||
The
|
||||
.B iconv -l
|
||||
will list all available charsets. Using UTF-16 as a pivot implies an
|
||||
overhead but ensures that accents can be removed from all character
|
||||
for which there is an equivalent character in Unicode.
|
||||
|
||||
.B unac_char_utf16
|
||||
is a macro that returns a pointer to the unaccented equivalent
|
||||
of any UTF-16 character. It is the basic building block of
|
||||
.I unac.
|
||||
|
||||
.B unac_string_utf16
|
||||
repeatidly applies the
|
||||
.B unac_char_utf16
|
||||
function on each character of an UTF-16 string.
|
||||
|
||||
.SH FUNCTIONS
|
||||
|
||||
.TP
|
||||
.B int unac_string(const char* charset, const char* in, int in_length, char** out, int* out_length)
|
||||
|
||||
Returns the unaccented equivalent of the string
|
||||
.B 'in'
|
||||
of length
|
||||
.B 'in_length'.
|
||||
The returned string is stored in the pointer pointed by the
|
||||
.B 'out'
|
||||
argument and the length of the string is stored in the integer pointed by
|
||||
the
|
||||
.B 'out_length '
|
||||
argument.
|
||||
If the
|
||||
.B '*out'
|
||||
pointer is not null, it must point to an area allocated by
|
||||
.I malloc(3)
|
||||
and the length of the array must be specified in the
|
||||
.B '*out_length'
|
||||
argument. Both arguments
|
||||
.B '*out'
|
||||
and
|
||||
.B '*out_length'
|
||||
will be replaced with the return values when the function returns
|
||||
on success. The
|
||||
.B '*out'
|
||||
pointer may point to a memory location that has been reallocated
|
||||
by the
|
||||
.B unac_string
|
||||
function. There is no guarantee that '*out' is identical to the
|
||||
value given by the caller and the malloc'ed memory location given
|
||||
by the caller may not be useable when the function returns (either
|
||||
error or success).
|
||||
If the
|
||||
.B '*out'
|
||||
pointer is null, the
|
||||
.B unac_string
|
||||
function allocates a new memory block using
|
||||
.I malloc(3).
|
||||
It is the responsibility of the caller to deallocate the area returned
|
||||
in the
|
||||
.B '*out'
|
||||
pointer.
|
||||
|
||||
The return value of
|
||||
.B unac_string
|
||||
is 0 on success and -1 on error, in which case
|
||||
the errno variable is set to the corresponding error code. See
|
||||
ERROR section below for more information, the
|
||||
.I iconv(3)
|
||||
manual page may also help.
|
||||
|
||||
.TP
|
||||
int unac_string_utf16(const char* in, int in_length, char** out, int* out_length)
|
||||
|
||||
Has the same effect as
|
||||
.B unac_string("UTF-16", in, in_length, out, out_length).
|
||||
Since the
|
||||
.B unac_string_utf16
|
||||
is the backend function of the
|
||||
.B unac_string
|
||||
function it is more efficient because no charset conversion of the
|
||||
input string (from and to UTF-16) is necessary.
|
||||
|
||||
.TP
|
||||
unac_char_utf16(const unsigned short c, unsigned short* p, int l)
|
||||
|
||||
.B Warning: this is a macro, each argument may be evaluated more than once.
|
||||
Returns the unaccented equivalent of the UTF-16 character
|
||||
.B 'c'
|
||||
in the pointer
|
||||
.B 'p'.
|
||||
The length of the unsigned short array pointed by
|
||||
.B 'p'
|
||||
is returned in the
|
||||
.B 'l'
|
||||
argument.
|
||||
|
||||
.TP
|
||||
.B const char* unac_version()
|
||||
|
||||
Return the version number of
|
||||
.B unac.
|
||||
|
||||
.TP
|
||||
.B void unac_debug(int level)
|
||||
Set the debug level of the unac library to
|
||||
.B 'level'.
|
||||
Possible values are: UNAC_DEBUG_NONE for no debug at all, UNAC_DEBUG_LOW
|
||||
for terse human readable information, UNAC_DEBUG_HIGH for very detailed
|
||||
information only usable when translating a few strings.
|
||||
|
||||
unac_debug_callback with anything but UNAC_DEBUG_NONE is not
|
||||
thread safe.
|
||||
|
||||
.TP
|
||||
void unac_debug_callback(int level, unac_debug_print_t function, void* data)
|
||||
|
||||
Set the debug level and define a printing function callback.
|
||||
The
|
||||
.B 'level'
|
||||
is the same as in unac_debug. The
|
||||
.B 'function'
|
||||
is in charge of dealing with the debug messages,
|
||||
presumably to print them to the user.
|
||||
The
|
||||
.B 'data'
|
||||
is an opaque pointer that is passed along to
|
||||
.B function, should it
|
||||
need to manage a persistent context.
|
||||
|
||||
The prototype of
|
||||
.B 'function'
|
||||
accepts two arguments. The first
|
||||
is the debug message
|
||||
.I (const char*),
|
||||
the second is the opaque
|
||||
pointer given as
|
||||
.B 'data'
|
||||
argument to
|
||||
.B unac_debug_callback.
|
||||
|
||||
If
|
||||
.B 'function'
|
||||
is NULL, messages are printed on the standard
|
||||
error output using fprintf(stderr...).
|
||||
|
||||
unac_debug_callback with anything but UNAC_DEBUG_NONE is not
|
||||
thread safe.
|
||||
.B
|
||||
.SH ERRORS
|
||||
|
||||
.TP
|
||||
EINVAL
|
||||
|
||||
the requested conversion pair is not available. For instance, when
|
||||
specifying the ISO-0000 charset (imaginary), it means it is not possible to
|
||||
convert from ISO-0000 to UTF-16.
|
||||
|
||||
.SH EXAMPLES
|
||||
Convert the
|
||||
.B été
|
||||
string into
|
||||
.B ete.
|
||||
.nf
|
||||
.ft CW
|
||||
#include <unac.h>
|
||||
|
||||
char* out = 0;
|
||||
int out_length = 0;
|
||||
if(unac_string("ISO-8859-1", "été", strlen("été"), &out, &out_length)) {
|
||||
perror("unac_string");
|
||||
} else {
|
||||
printf("%.*s\n", out_length, out);
|
||||
free(out);
|
||||
}
|
||||
.ft R
|
||||
.fi
|
||||
|
||||
.SH IMPLEMENTATION NOTES
|
||||
|
||||
The endianess of the UTF-16 strings manipulated by
|
||||
.I unac
|
||||
must always be big endian. When using
|
||||
.I iconv(3)
|
||||
to translate strings, UTF-16BE should be used instead of UTF-16 to make sure
|
||||
it is big endian (BE). On some systems where UTF-16BE is not available,
|
||||
.B unac
|
||||
will rely on UTF-16 and hope it is properly big endian encoded.
|
||||
For more information check RFC2781 (http://www.faqs.org/rfcs/rfc2781.html: UTF-16,
|
||||
an encoding of ISO 10646).
|
||||
|
||||
The
|
||||
.I unac
|
||||
library uses the Unicode database to map accented letters to their unaccented
|
||||
equivalent. Mapping tables are generated from the
|
||||
.I UnicodeData-3.2.0.txt
|
||||
file (as found at http://www.unicode.org/Public/3.2-Update/) by the
|
||||
.I builder
|
||||
perl script. The
|
||||
.I builder
|
||||
script inserts these tables in the
|
||||
.I unac.h
|
||||
and
|
||||
.I unac.c
|
||||
files, replacing the existing ones. Looking for the
|
||||
.B 'Generated by builder'
|
||||
string in the
|
||||
.I unac.[ch]
|
||||
files allows to spot the various parts handled by the builder script.
|
||||
|
||||
The library data occupies 25KB where a simple minded table would
|
||||
occupy around 512Kbytes. The idea used to compress the tables is that
|
||||
many Unicode characters do not have unaccented equivalent. Instead of
|
||||
relying on a table mapping each Unicode character to the corresponding
|
||||
unaccented character, an intermediate array of pointers is created. In
|
||||
the drawing below, the range of UTF-16 character is not accurate but
|
||||
illustrates the method. The
|
||||
.B unac_data_table
|
||||
points to a set of
|
||||
.B unac_dataXX
|
||||
arrays. Each pointer covers a range of UTF-16 characters (4 in the example
|
||||
below). When a range of character does not contain any accented character,
|
||||
unac_data_table always points to the same array : unac_data0. Since there
|
||||
are many characters without accents, this is enough to achieve a good
|
||||
compression.
|
||||
.nf
|
||||
.ft CW
|
||||
|
||||
|
||||
unac_data15 unac_data16
|
||||
[ NULL, NULL, NULL, e ] <----\ /------> [ a, NULL, NULL, NULL ]
|
||||
| |
|
||||
| |
|
||||
^ ^
|
||||
|-----| |-----| |-----| |-----| |-----| |-----|
|
||||
[ ... a b c d e f g h i j k é à 0 1 2 3 4 5 6 7 8 9 A... ] unac_data_table
|
||||
|-----| |-----| |-----| |-----| |-----| |-----|
|
||||
v v v v
|
||||
| | | |
|
||||
| | | |
|
||||
\--------------------------------------/
|
||||
|
|
||||
V
|
||||
[ NULL, NULL, NULL, NULL ]
|
||||
unac_data0
|
||||
|
||||
|
||||
.ft R
|
||||
.fi
|
||||
Beside this simple optimization, a table (unac_positions) listing the
|
||||
actual position of the unaccented replacement within a block
|
||||
(unac_dataXX) is necessary because they are not of fixed length. Some
|
||||
characters such as
|
||||
.B æ
|
||||
will
|
||||
be replaced by two characters
|
||||
.B a
|
||||
and
|
||||
.B e
|
||||
therefore unac_dataXX has a variable size.
|
||||
|
||||
The unaccented equivalent of an UTF-16 character is calculated by
|
||||
applying a
|
||||
.I compatibility decomposition
|
||||
and then stripping all characters that belong to the
|
||||
.I mark
|
||||
category. For a precise definition see the Unicode-3.2 normalization
|
||||
forms at http://www.unicode.org/unicode/reports/tr28/.
|
||||
|
||||
All original Unicode data files were taken from
|
||||
http://www.unicode.org/Public and prepended with the
|
||||
.B UCD Terms of Use.
|
||||
|
||||
.SH BUGS
|
||||
The input string must not contain partially formed characters, there is
|
||||
no support for this case.
|
||||
|
||||
UTF-16 surrogates are not handled.
|
||||
|
||||
Unicode may contain bugs in the decomposition of characters. When
|
||||
you suspect such a bug on a given string, add a test case with the
|
||||
faulty string in the
|
||||
.B t_unac.in
|
||||
test script in the source distribution and run
|
||||
make check. It will describe, in a very verbose way, how the string was
|
||||
unaccented. You may then fix the UnicodeData-3.2.0.txt file and
|
||||
run make check again to make sure the problem is solved. Please
|
||||
send such fixes to the author and to the Unicode consortium.
|
||||
|
||||
.SH SEE ALSO
|
||||
unaccent(1), iconv(3)
|
||||
.nf
|
||||
.ft CW
|
||||
http://www.unicode.org/
|
||||
http://oss.software.ibm.com/icu/
|
||||
http://www.gnu.org/manual/glibc-2.2.5/libc.html
|
||||
.ft R
|
||||
.fi
|
||||
|
||||
.SH AUTHOR
|
||||
Loic Dachary loic@senga.org
|
||||
.nf
|
||||
.ft CW
|
||||
http://www.senga.org/unac/
|
||||
.ft R
|
||||
.fi
|
||||
12843
unac/unac.c
Normal file
12843
unac/unac.c
Normal file
File diff suppressed because it is too large
Load Diff
330
unac/unac.h
Normal file
330
unac/unac.h
Normal file
@ -0,0 +1,330 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Provides functions to strip accents from a string in all the
|
||||
* charset supported by iconv(3).
|
||||
*
|
||||
* See the unac(3) manual page for more information.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _unac_h
|
||||
#define _unac_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Generated by builder. Do not modify. Start defines */
|
||||
#define UNAC_BLOCK_SHIFT 5
|
||||
#define UNAC_BLOCK_MASK ((1 << UNAC_BLOCK_SHIFT) - 1)
|
||||
#define UNAC_BLOCK_SIZE (1 << UNAC_BLOCK_SHIFT)
|
||||
#define UNAC_BLOCK_COUNT 178
|
||||
#define UNAC_INDEXES_SIZE (0x10000 >> UNAC_BLOCK_SHIFT)
|
||||
/* Generated by builder. Do not modify. End defines */
|
||||
|
||||
/*
|
||||
* Return the unaccented equivalent of the UTF-16 character <c>
|
||||
* in the pointer <p>. The length of the unsigned short array pointed
|
||||
* by <p> is returned in the <l> argument.
|
||||
* The C++ prototype of this macro would be:
|
||||
*
|
||||
* void unac_char(const unsigned short c, unsigned short*& p, int& l)
|
||||
*
|
||||
* See unac(3) in IMPLEMENTATION NOTES for more information about the
|
||||
* tables (unac_data_table, unac_positions) layout.
|
||||
*/
|
||||
#define unac_char_utf16(c,p,l) \
|
||||
{ \
|
||||
unsigned short index = unac_indexes[(c) >> UNAC_BLOCK_SHIFT]; \
|
||||
unsigned char position = (c) & UNAC_BLOCK_MASK; \
|
||||
(p) = &(unac_data_table[index][unac_positions[index][position]]); \
|
||||
(l) = unac_positions[index][position + 1] - unac_positions[index][position]; \
|
||||
if((l) == 1 && *(p) == 0xFFFF) { \
|
||||
(p) = 0; \
|
||||
(l) = 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the unaccented equivalent of the UTF-16 string <in> of
|
||||
* length <in_length> in the pointer <out>. The length of the UTF-16
|
||||
* string returned in <out> is stored in <out_length>. If the pointer
|
||||
* *out is null, a new string is allocated using malloc(3). If the
|
||||
* pointer *out is not null, the available length must also be given
|
||||
* in the *out_length argument. The pointer passed to *out must have
|
||||
* been allocated by malloc(3) and may be reallocated by realloc(3) if
|
||||
* needs be. It is the responsibility of the caller to free the
|
||||
* pointer returned in *out. The return value is 0 on success and -1
|
||||
* on error, in which case the errno variable is set to the
|
||||
* corresponding error code.
|
||||
*/
|
||||
int unac_string_utf16(const char* in, size_t in_length,
|
||||
char** out, size_t* out_length);
|
||||
|
||||
/*
|
||||
* The semantic of this function is stricly equal to the function
|
||||
* unac_string_utf16. The <charset> argument applies to the content of the
|
||||
* input string. It is converted to UTF-16 using iconv(3) before calling
|
||||
* the unac_string function and the result is converted from UTF-16 to
|
||||
* the specified <charset> before returning it in the <out> pointer.
|
||||
* For efficiency purpose it is recommended that the caller uses
|
||||
* unac_string and iconv(3) to save buffer allocations overhead.
|
||||
* The return value is 0 on success and -1 on error, in which case
|
||||
* the errno variable is set to the corresponding error code.
|
||||
*/
|
||||
int unac_string(const char* charset,
|
||||
const char* in, size_t in_length,
|
||||
char** out, size_t* out_length);
|
||||
|
||||
/*
|
||||
* Return unac version number.
|
||||
*/
|
||||
const char* unac_version(void);
|
||||
|
||||
#define UNAC_DEBUG_NONE 0x00
|
||||
#define UNAC_DEBUG_LOW 0x01
|
||||
#define UNAC_DEBUG_HIGH 0x02
|
||||
|
||||
#ifdef HAVE_VSNPRINTF
|
||||
#define UNAC_DEBUG_AVAILABLE 1
|
||||
/*
|
||||
* Set the unac debug level. <l> is one of:
|
||||
* UNAC_DEBUG_NONE for no debug messages at all
|
||||
* UNAC_DEBUG_LOW for minimal information
|
||||
* UNAC_DEBUG_HIGH for extremely verbose information,
|
||||
* only usable when translating a few short strings.
|
||||
*
|
||||
* unac_debug with anything but UNAC_DEBUG_NONE is not
|
||||
* thread safe.
|
||||
*/
|
||||
#define unac_debug(l) unac_debug_callback((l), 0, (void*)0);
|
||||
|
||||
/*
|
||||
* Set the debug level and define a printing function callback.
|
||||
* The <level> debug level is the same as in unac_debug. The
|
||||
* <function> is in charge of dealing with the debug messages,
|
||||
* presumably to print them to the user. The <data> is an opaque
|
||||
* pointer that is passed along to <function>, should it
|
||||
* need to manage a persistent context.
|
||||
*
|
||||
* The prototype of <function> allows two arguments. The first
|
||||
* is the debug message (const char*), the second is the opaque
|
||||
* pointer given as <data> argument to unac_debug_callback.
|
||||
*
|
||||
* If <function> is NULL, messages are printed on the standard
|
||||
* error output using fprintf(stderr...).
|
||||
*
|
||||
* unac_debug_callback with anything but UNAC_DEBUG_NONE is not
|
||||
* thread safe.
|
||||
*
|
||||
*/
|
||||
typedef void (*unac_debug_print_t)(const char* message, void* data);
|
||||
void unac_debug_callback(int level, unac_debug_print_t function, void* data);
|
||||
#endif /* HAVE_VSNPRINTF */
|
||||
|
||||
/* Generated by builder. Do not modify. Start declarations */
|
||||
extern unsigned short unac_indexes[UNAC_INDEXES_SIZE];
|
||||
extern unsigned char unac_positions[UNAC_BLOCK_COUNT][UNAC_BLOCK_SIZE + 1];
|
||||
extern unsigned short* unac_data_table[UNAC_BLOCK_COUNT];
|
||||
extern unsigned short unac_data0[];
|
||||
extern unsigned short unac_data1[];
|
||||
extern unsigned short unac_data2[];
|
||||
extern unsigned short unac_data3[];
|
||||
extern unsigned short unac_data4[];
|
||||
extern unsigned short unac_data5[];
|
||||
extern unsigned short unac_data6[];
|
||||
extern unsigned short unac_data7[];
|
||||
extern unsigned short unac_data8[];
|
||||
extern unsigned short unac_data9[];
|
||||
extern unsigned short unac_data10[];
|
||||
extern unsigned short unac_data11[];
|
||||
extern unsigned short unac_data12[];
|
||||
extern unsigned short unac_data13[];
|
||||
extern unsigned short unac_data14[];
|
||||
extern unsigned short unac_data15[];
|
||||
extern unsigned short unac_data16[];
|
||||
extern unsigned short unac_data17[];
|
||||
extern unsigned short unac_data18[];
|
||||
extern unsigned short unac_data19[];
|
||||
extern unsigned short unac_data20[];
|
||||
extern unsigned short unac_data21[];
|
||||
extern unsigned short unac_data22[];
|
||||
extern unsigned short unac_data23[];
|
||||
extern unsigned short unac_data24[];
|
||||
extern unsigned short unac_data25[];
|
||||
extern unsigned short unac_data26[];
|
||||
extern unsigned short unac_data27[];
|
||||
extern unsigned short unac_data28[];
|
||||
extern unsigned short unac_data29[];
|
||||
extern unsigned short unac_data30[];
|
||||
extern unsigned short unac_data31[];
|
||||
extern unsigned short unac_data32[];
|
||||
extern unsigned short unac_data33[];
|
||||
extern unsigned short unac_data34[];
|
||||
extern unsigned short unac_data35[];
|
||||
extern unsigned short unac_data36[];
|
||||
extern unsigned short unac_data37[];
|
||||
extern unsigned short unac_data38[];
|
||||
extern unsigned short unac_data39[];
|
||||
extern unsigned short unac_data40[];
|
||||
extern unsigned short unac_data41[];
|
||||
extern unsigned short unac_data42[];
|
||||
extern unsigned short unac_data43[];
|
||||
extern unsigned short unac_data44[];
|
||||
extern unsigned short unac_data45[];
|
||||
extern unsigned short unac_data46[];
|
||||
extern unsigned short unac_data47[];
|
||||
extern unsigned short unac_data48[];
|
||||
extern unsigned short unac_data49[];
|
||||
extern unsigned short unac_data50[];
|
||||
extern unsigned short unac_data51[];
|
||||
extern unsigned short unac_data52[];
|
||||
extern unsigned short unac_data53[];
|
||||
extern unsigned short unac_data54[];
|
||||
extern unsigned short unac_data55[];
|
||||
extern unsigned short unac_data56[];
|
||||
extern unsigned short unac_data57[];
|
||||
extern unsigned short unac_data58[];
|
||||
extern unsigned short unac_data59[];
|
||||
extern unsigned short unac_data60[];
|
||||
extern unsigned short unac_data61[];
|
||||
extern unsigned short unac_data62[];
|
||||
extern unsigned short unac_data63[];
|
||||
extern unsigned short unac_data64[];
|
||||
extern unsigned short unac_data65[];
|
||||
extern unsigned short unac_data66[];
|
||||
extern unsigned short unac_data67[];
|
||||
extern unsigned short unac_data68[];
|
||||
extern unsigned short unac_data69[];
|
||||
extern unsigned short unac_data70[];
|
||||
extern unsigned short unac_data71[];
|
||||
extern unsigned short unac_data72[];
|
||||
extern unsigned short unac_data73[];
|
||||
extern unsigned short unac_data74[];
|
||||
extern unsigned short unac_data75[];
|
||||
extern unsigned short unac_data76[];
|
||||
extern unsigned short unac_data77[];
|
||||
extern unsigned short unac_data78[];
|
||||
extern unsigned short unac_data79[];
|
||||
extern unsigned short unac_data80[];
|
||||
extern unsigned short unac_data81[];
|
||||
extern unsigned short unac_data82[];
|
||||
extern unsigned short unac_data83[];
|
||||
extern unsigned short unac_data84[];
|
||||
extern unsigned short unac_data85[];
|
||||
extern unsigned short unac_data86[];
|
||||
extern unsigned short unac_data87[];
|
||||
extern unsigned short unac_data88[];
|
||||
extern unsigned short unac_data89[];
|
||||
extern unsigned short unac_data90[];
|
||||
extern unsigned short unac_data91[];
|
||||
extern unsigned short unac_data92[];
|
||||
extern unsigned short unac_data93[];
|
||||
extern unsigned short unac_data94[];
|
||||
extern unsigned short unac_data95[];
|
||||
extern unsigned short unac_data96[];
|
||||
extern unsigned short unac_data97[];
|
||||
extern unsigned short unac_data98[];
|
||||
extern unsigned short unac_data99[];
|
||||
extern unsigned short unac_data100[];
|
||||
extern unsigned short unac_data101[];
|
||||
extern unsigned short unac_data102[];
|
||||
extern unsigned short unac_data103[];
|
||||
extern unsigned short unac_data104[];
|
||||
extern unsigned short unac_data105[];
|
||||
extern unsigned short unac_data106[];
|
||||
extern unsigned short unac_data107[];
|
||||
extern unsigned short unac_data108[];
|
||||
extern unsigned short unac_data109[];
|
||||
extern unsigned short unac_data110[];
|
||||
extern unsigned short unac_data111[];
|
||||
extern unsigned short unac_data112[];
|
||||
extern unsigned short unac_data113[];
|
||||
extern unsigned short unac_data114[];
|
||||
extern unsigned short unac_data115[];
|
||||
extern unsigned short unac_data116[];
|
||||
extern unsigned short unac_data117[];
|
||||
extern unsigned short unac_data118[];
|
||||
extern unsigned short unac_data119[];
|
||||
extern unsigned short unac_data120[];
|
||||
extern unsigned short unac_data121[];
|
||||
extern unsigned short unac_data122[];
|
||||
extern unsigned short unac_data123[];
|
||||
extern unsigned short unac_data124[];
|
||||
extern unsigned short unac_data125[];
|
||||
extern unsigned short unac_data126[];
|
||||
extern unsigned short unac_data127[];
|
||||
extern unsigned short unac_data128[];
|
||||
extern unsigned short unac_data129[];
|
||||
extern unsigned short unac_data130[];
|
||||
extern unsigned short unac_data131[];
|
||||
extern unsigned short unac_data132[];
|
||||
extern unsigned short unac_data133[];
|
||||
extern unsigned short unac_data134[];
|
||||
extern unsigned short unac_data135[];
|
||||
extern unsigned short unac_data136[];
|
||||
extern unsigned short unac_data137[];
|
||||
extern unsigned short unac_data138[];
|
||||
extern unsigned short unac_data139[];
|
||||
extern unsigned short unac_data140[];
|
||||
extern unsigned short unac_data141[];
|
||||
extern unsigned short unac_data142[];
|
||||
extern unsigned short unac_data143[];
|
||||
extern unsigned short unac_data144[];
|
||||
extern unsigned short unac_data145[];
|
||||
extern unsigned short unac_data146[];
|
||||
extern unsigned short unac_data147[];
|
||||
extern unsigned short unac_data148[];
|
||||
extern unsigned short unac_data149[];
|
||||
extern unsigned short unac_data150[];
|
||||
extern unsigned short unac_data151[];
|
||||
extern unsigned short unac_data152[];
|
||||
extern unsigned short unac_data153[];
|
||||
extern unsigned short unac_data154[];
|
||||
extern unsigned short unac_data155[];
|
||||
extern unsigned short unac_data156[];
|
||||
extern unsigned short unac_data157[];
|
||||
extern unsigned short unac_data158[];
|
||||
extern unsigned short unac_data159[];
|
||||
extern unsigned short unac_data160[];
|
||||
extern unsigned short unac_data161[];
|
||||
extern unsigned short unac_data162[];
|
||||
extern unsigned short unac_data163[];
|
||||
extern unsigned short unac_data164[];
|
||||
extern unsigned short unac_data165[];
|
||||
extern unsigned short unac_data166[];
|
||||
extern unsigned short unac_data167[];
|
||||
extern unsigned short unac_data168[];
|
||||
extern unsigned short unac_data169[];
|
||||
extern unsigned short unac_data170[];
|
||||
extern unsigned short unac_data171[];
|
||||
extern unsigned short unac_data172[];
|
||||
extern unsigned short unac_data173[];
|
||||
extern unsigned short unac_data174[];
|
||||
extern unsigned short unac_data175[];
|
||||
extern unsigned short unac_data176[];
|
||||
extern unsigned short unac_data177[];
|
||||
/* Generated by builder. Do not modify. End declarations */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _unac_h */
|
||||
13
unac/unac.pc.in
Normal file
13
unac/unac.pc.in
Normal file
@ -0,0 +1,13 @@
|
||||
#
|
||||
# pkg-config(1) specification file for http://www.senga.org/unac/
|
||||
#
|
||||
prefix=@prefix@
|
||||
exec_prefix=@prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: unac
|
||||
Description: A C programmer's library that removes accents from a string.
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lunac
|
||||
Cflags: -I${includedir}
|
||||
50
unac/unac.spec.in
Normal file
50
unac/unac.spec.in
Normal file
@ -0,0 +1,50 @@
|
||||
Summary: A C library and a command that remove accents.
|
||||
Name: unac
|
||||
Version: @VERSION@
|
||||
Release: 1
|
||||
License: GPL
|
||||
Vendor: Senga
|
||||
Group: Development/Libraries
|
||||
Source: http://www.senga.org/download/unac/unac-%{version}.tar.gz
|
||||
Prefix: %{_prefix}
|
||||
BuildRoot: %{_tmppath}/%{name}-root
|
||||
|
||||
%description
|
||||
unac is a C library and command that remove accents from a string.
|
||||
For instance the string été will become ete. It provides a command
|
||||
line interface that removes accents from a string given in argument
|
||||
(unaccent command). In the library function and the command, the
|
||||
charset of the input string is specified as an argument. The input
|
||||
string is converted to UTF-16 using iconv(3), accents are stripped and
|
||||
the result is converted back to the original charset. The iconv --list
|
||||
command on GNU/Linux will show all charset supported.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
|
||||
%configure
|
||||
make
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
%clean
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc ChangeLog README
|
||||
%{_bindir}/*
|
||||
%{_libdir}/*
|
||||
%{_includedir}/*
|
||||
%{_mandir}/man*/*
|
||||
|
||||
%changelog
|
||||
* Fri Sep 21 2000 Loic Dachary <loic@senga.org>
|
||||
- Create
|
||||
115
unac/unaccent.1
Normal file
115
unac/unaccent.1
Normal file
@ -0,0 +1,115 @@
|
||||
'''
|
||||
''' Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
'''
|
||||
''' This program is free software; you can redistribute it and/or modify
|
||||
''' it under the terms of the GNU General Public License as published by
|
||||
''' the Free Software Foundation; either version 2 of the License, or
|
||||
''' (at your option) any later version.
|
||||
'''
|
||||
''' This program is distributed in the hope that it will be useful,
|
||||
''' but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
''' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
''' GNU General Public License for more details.
|
||||
'''
|
||||
''' You should have received a copy of the GNU General Public License
|
||||
''' along with this program; if not, write to the Free Software
|
||||
''' Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
'''
|
||||
.TH unaccent 1 local
|
||||
.SH NAME
|
||||
unaccent \- remove accents from input stream or a string
|
||||
|
||||
.SH SYNOPSIS
|
||||
unaccent [--debug_low] [--debug_high] [-h] charset [string] [expected]
|
||||
.SH DESCRIPTION
|
||||
With a single argument,
|
||||
.I unaccent
|
||||
reads data from stdin, replaces accented letters by their unaccented
|
||||
equivalent and writes the result on stdout.
|
||||
If the second argument
|
||||
.B ('string')
|
||||
is provided
|
||||
.I unaccent
|
||||
transforms it by replacing accented letters by their unaccented
|
||||
equivalent. The
|
||||
result is printed on the standard output.
|
||||
The charset of the input
|
||||
string or the data read from stdin is specified by the
|
||||
.B 'charset'
|
||||
argument (ISO-8859-15 for instance). The output is printed using the same charset.
|
||||
.P
|
||||
If the
|
||||
.B 'expected'
|
||||
argument is provided, the output string is compared to it. If they
|
||||
are not equal
|
||||
.I unaccent
|
||||
exits on error.
|
||||
.P
|
||||
.I unaccent
|
||||
relies on the
|
||||
.B iconv(3)
|
||||
library to convert from the specified charset to UTF-16BE (or UTF-16
|
||||
if UTF-16BE is not available). You should check the manual pages for
|
||||
available charsets. On GNU/Linux the command
|
||||
|
||||
.nf
|
||||
.ft CW
|
||||
iconv -l
|
||||
.ft R
|
||||
.fi
|
||||
|
||||
shows all available charsets.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B --debug_low
|
||||
Prints human readable information about the unaccentuation process. See
|
||||
.B unac(3)
|
||||
for more information.
|
||||
|
||||
.TP
|
||||
.B --debug_high
|
||||
Prints very detailed information about the unaccentuation process.
|
||||
See
|
||||
.B unac(3)
|
||||
for more information.
|
||||
|
||||
.TP
|
||||
.B --help -h
|
||||
Prints a short usage and exits.
|
||||
|
||||
.SH EXAMPLES
|
||||
Remove accents from the string
|
||||
.B été
|
||||
and check that the result is
|
||||
.B ete.
|
||||
|
||||
.nf
|
||||
.ft CW
|
||||
unaccent ISO-8859-1 été ete
|
||||
.ft R
|
||||
.fi
|
||||
|
||||
.P
|
||||
Remove accents from file
|
||||
.B myfile
|
||||
and put the result in file
|
||||
.B myfile.unaccent
|
||||
|
||||
.nf
|
||||
.ft CW
|
||||
unaccent ISO-8859-1 < myfile > myfile.unaccent
|
||||
.ft R
|
||||
.fi
|
||||
|
||||
.SH SEE ALSO
|
||||
unac(3), iconv(3)
|
||||
|
||||
.SH AUTHOR
|
||||
Loic Dachary loic@senga.org
|
||||
.nf
|
||||
.ft CW
|
||||
http://www.senga.org/unac/
|
||||
.ft R
|
||||
.fi
|
||||
|
||||
137
unac/unaccent.c
Normal file
137
unac/unaccent.c
Normal file
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001 Loic Dachary
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "unac.h"
|
||||
|
||||
static int usage(const char* message)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s"
|
||||
"usage: unaccent [--debug_low] [--debug_high] [--help|-h]\n"
|
||||
"\t\t<charset> [<string>] [<expected>]\n"
|
||||
"\tVersion "UNAC_VERSION"\n"
|
||||
"\tReads input from stdin and remove accents from each line,\n"
|
||||
"\tassuming it is encoded in <charset> (iconv -l shows a list of\n"
|
||||
"\tall available charsets).\n"
|
||||
"\tIf <string> is provided, remove accents from <string>.\n"
|
||||
"\tIf <expected> is provided, compare the result and exit on error\n"
|
||||
"\tif not equal. \n"
|
||||
"\tThe unaccented result is always output on stdout.\n",
|
||||
message);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int c;
|
||||
static int debug_level = UNAC_DEBUG_NONE;
|
||||
|
||||
while (1) {
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"debug_low", no_argument, &debug_level, UNAC_DEBUG_LOW},
|
||||
{"debug_high", no_argument, &debug_level, UNAC_DEBUG_HIGH},
|
||||
{"help", no_argument, 0, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
c = getopt_long (argc, argv, "h",
|
||||
long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
case 0:
|
||||
break;
|
||||
|
||||
case '?':
|
||||
break;
|
||||
|
||||
default:
|
||||
usage("");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef UNAC_DEBUG_AVAILABLE
|
||||
unac_debug(debug_level);
|
||||
#else /* UNAC_DEBUG_AVAILABLE */
|
||||
if(debug_level > UNAC_DEBUG_NONE)
|
||||
fprintf(stderr, "debug is not available, means vsnprintf was not found by configure\n");
|
||||
#endif /* UNAC_DEBUG_AVAILABLE */
|
||||
|
||||
if(optind >= argc)
|
||||
usage("missing <charset>\n");
|
||||
else {
|
||||
const char* charset = argv[optind++];
|
||||
|
||||
char* unaccented = 0;
|
||||
int unaccented_length = 0;
|
||||
|
||||
if(optind >= argc) {
|
||||
#define BUFFER_SIZE 10240
|
||||
char buffer[BUFFER_SIZE];
|
||||
while(fgets(buffer, BUFFER_SIZE, stdin)) {
|
||||
if(unac_string(charset, buffer, strlen(buffer), &unaccented, &unaccented_length) < 0) {
|
||||
fprintf(stderr, "unac_string attempt to unaccent %s with charset %s failed: ", buffer, charset);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
printf("%.*s", unaccented_length, unaccented);
|
||||
}
|
||||
} else {
|
||||
const char* string = argv[optind++];
|
||||
|
||||
if(unac_string(charset, string, strlen(string), &unaccented, &unaccented_length) < 0) {
|
||||
fprintf(stderr, "unac_string attempt to unaccent %s with charset %s failed: ", string, charset);
|
||||
perror("");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(debug_level > UNAC_DEBUG_NONE)
|
||||
fprintf(stderr, "unaccented version is");
|
||||
printf("%.*s\n", unaccented_length, unaccented);
|
||||
|
||||
if(optind < argc) {
|
||||
const char* expected = argv[optind++];
|
||||
|
||||
if(unaccented_length != strlen(expected) ||
|
||||
!memcpy(unaccented, expected, unaccented_length)) {
|
||||
if(debug_level > UNAC_DEBUG_NONE)
|
||||
fprintf(stderr, "attempt to unaccent %s with charset %s does not match expected string %s\n", string, charset, expected);
|
||||
|
||||
free(unaccented);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(unaccented);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
53
unac/unactest.c
Normal file
53
unac/unactest.c
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generate a machine readable file mapping each UTF-16 character to
|
||||
* its unaccented equivalent using the libunac library. The output may
|
||||
* then be compared with the output of builder -reference. Both must be
|
||||
* equal (ignoring space differences).
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unac.h"
|
||||
|
||||
int main() {
|
||||
unsigned int c;
|
||||
unsigned short* p;
|
||||
int l;
|
||||
(void)unac_version();
|
||||
for(c = 0; c <= 0xFFFF; c++) {
|
||||
unac_char_utf16(c, p, l);
|
||||
printf("%04X", c);
|
||||
if(l == 0) {
|
||||
printf("\n");
|
||||
} else {
|
||||
int i;
|
||||
printf(" => ");
|
||||
for(i = 0; i < l; i++) {
|
||||
printf("%04X ", p[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
497
unac/unactest1.c
Normal file
497
unac/unactest1.c
Normal file
@ -0,0 +1,497 @@
|
||||
/*
|
||||
* Copyright (C) 2000, 2001, 2002 Loic Dachary <loic@senga.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Run unac_string on an input large enough to trigger re-allocation.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unac.h"
|
||||
|
||||
static char* longstr_expected = "
|
||||
|
||||
Senga - Catalog software
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
senga.org
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
December 28, 2000
|
||||
|
||||
January 27, 2000
|
||||
Catalog-1.02
|
||||
is available.
|
||||
|
||||
The dmoz loading process has been dramatically simplified. It is
|
||||
now only available as a command. No more fancy web interface that
|
||||
confuses everyone. In addition the convert_dmoz script now generates
|
||||
text files that can be directly loaded into Catalog instead of the
|
||||
intermediate XML file. The whole loading process now takes from
|
||||
one to two hours depending on your machine. It took around 10 hours
|
||||
with the previous version.
|
||||
The -exclude option was added to convert_dmoz to get rid of
|
||||
a whole branch of the catalog at load time. Typical usage would
|
||||
be convert_dmoz -exclude '^/Adult' -what content content.rdf.gz.
|
||||
A lot more sanity checks and repair have been added to deal with
|
||||
duplicates, category id conflicts and the like.
|
||||
Hopefully this new method will also be more understandable and
|
||||
generate less traffic on the mailing list. There is room for
|
||||
improvements and contributors are welcome.
|
||||
|
||||
A new set of software is available in the
|
||||
download directory under the RedHat-6.1 section. These
|
||||
are the most up to date versions on which Catalog depends. Although the
|
||||
binaries depend on RedHat-6.1 the perl modules are source and can be
|
||||
used on any platform.
|
||||
|
||||
September 7, 1999
|
||||
Catalog-1.01
|
||||
is available.
|
||||
This is a maintainance release.
|
||||
|
||||
Various bug fixes. All easy
|
||||
to fix bugs have been fixed. Take a look at Bug Track to see what hasn't been fixed.
|
||||
The _PATHTEXT_ and _PATHFILE_
|
||||
tags syntax has been extended to specify a range of path component.
|
||||
|
||||
Graham Barr added a recursive
|
||||
template feature for a catalog root page. This allows to show sub-categories
|
||||
of the root categories in the root page of a catalog.
|
||||
|
||||
|
||||
Don't hesitate to submit bugs
|
||||
or ideas to bug track. Hopefully the next version of Catalog will have
|
||||
a fast full text indexing mechanism and I'll be able to implement new
|
||||
functionalities.
|
||||
|
||||
Have fun !
|
||||
July 3, 1999
|
||||
Catalog-1.00
|
||||
is available.
|
||||
This release includes PHP3
|
||||
code to display a catalog. The author is Weston Bustraan (weston@infinityteldata.net).
|
||||
The main motivation to jump directly to version 1.00 is to avoid version
|
||||
number problems on CPAN.
|
||||
July 2, 1999
|
||||
Catalog-0.19
|
||||
is available.
|
||||
This is a minor release. The
|
||||
most noticeable addition is the new search mechanism.
|
||||
|
||||
Searching : two search modes
|
||||
are now available. AltaVista simple syntax and AltaVista advanced syntax.
|
||||
Both use the Text-Query and Text-Query-SQL perl modules.
|
||||
Dmoz loading is much more
|
||||
fault tolerant. In addition it can handle compressed versions of content.rdf
|
||||
and structure.rdf. The comments are now stored in text fields instead
|
||||
of char(255).
|
||||
The template system was
|
||||
extended with the pre_fill and post_fill parameters.
|
||||
Searching associated to
|
||||
a catalog dumped to static pages is now possible using the 'static'
|
||||
mode.
|
||||
Fixed two security weakness
|
||||
in confedit and recursive cgi handling.
|
||||
Many sql queries have been
|
||||
optimized.
|
||||
The configuration was changed
|
||||
a bit to fix bugs and to isolate database dependencies.
|
||||
The tests were updated to
|
||||
isolate database dependencies.
|
||||
Fixed numerous minor bugs,
|
||||
check ChangeLog if you're interested in details.
|
||||
|
||||
Many thanks to Tim Bunce for
|
||||
his numerous contributions and ideas. He is the architect of the Text-Query
|
||||
and Text-Query-SQL modules, Eric Bohlman and Loic Dachary did the programming.
|
||||
|
||||
Thanks to Eric Bohlman for
|
||||
his help on the Text-Query module. He was very busy but managed to spend
|
||||
the time needed to release it.
|
||||
There is not yet anything usable
|
||||
for full text indexing but we keep working on it. The storage management
|
||||
is now handled by the reiserfs file system thanks to Hans Reiser who is
|
||||
working full time on this. Loic Dachary does his best to get something
|
||||
working, if you're interested go to http://www.senga.org/mifluz/.
|
||||
For some mysterious reason
|
||||
CPAN lost track of Catalog name. In order to install catalog you should
|
||||
use perl -MCPAN -e 'install Catalog::db'. Weird but temporary.
|
||||
Have fun !
|
||||
The Senga Team
|
||||
Ecila
|
||||
100 Av. du General Leclerc
|
||||
93 500 Pantin
|
||||
Tel: 33 1 56 96 09 80
|
||||
Fax: 33 1 56 96 09 81
|
||||
WEB: http://www.senga.org/
|
||||
Mail: senga@senga.org
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[
|
||||
Catalog |
|
||||
webbase |
|
||||
mifluz |
|
||||
unac |
|
||||
Search-Mifluz |
|
||||
Text-Query |
|
||||
uri |
|
||||
Statistics |
|
||||
News
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
";
|
||||
|
||||
static char* longstr = "
|
||||
|
||||
Senga - Catalog software
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
senga.org
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
December 28, 2000
|
||||
|
||||
January 27, 2000
|
||||
Catalog-1.02
|
||||
is available.
|
||||
|
||||
The dmoz loading process has been dramatically simplified. It is
|
||||
now only available as a command. No more fancy web interface that
|
||||
confuses everyone. In addition the convert_dmoz script now generates
|
||||
text files that can be directly loaded into Catalog instead of the
|
||||
intermediate XML file. The whole loading process now takes from
|
||||
one to two hours depending on your machine. It took around 10 hours
|
||||
with the previous version.
|
||||
The -exclude option was added to convert_dmoz to get rid of
|
||||
a whole branch of the catalog at load time. Typical usage would
|
||||
be convert_dmoz -exclude '^/Adult' -what content content.rdf.gz.
|
||||
A lot more sanity checks and repair have been added to deal with
|
||||
duplicates, category id conflicts and the like.
|
||||
Hopefully this new method will also be more understandable and
|
||||
generate less traffic on the mailing list. There is room for
|
||||
improvements and contributors are welcome.
|
||||
|
||||
A new set of software is available in the
|
||||
download directory under the RedHat-6.1 section. These
|
||||
are the most up to date versions on which Catalog depends. Although the
|
||||
binaries depend on RedHat-6.1 the perl modules are source and can be
|
||||
used on any platform.
|
||||
|
||||
September 7, 1999
|
||||
Catalog-1.01
|
||||
is available.
|
||||
This is a maintainance release.
|
||||
|
||||
Various bug fixes. All easy
|
||||
to fix bugs have been fixed. Take a look at Bug Track to see what hasn't been fixed.
|
||||
The _PATHTEXT_ and _PATHFILE_
|
||||
tags syntax has been extended to specify a range of path component.
|
||||
|
||||
Graham Barr added a recursive
|
||||
template feature for a catalog root page. This allows to show sub-categories
|
||||
of the root categories in the root page of a catalog.
|
||||
|
||||
|
||||
Don't hesitate to submit bugs
|
||||
or ideas to bug track. Hopefully the next version of Catalog will have
|
||||
a fast full text indexing mechanism and I'll be able to implement new
|
||||
functionalities.
|
||||
|
||||
Have fun !
|
||||
July 3, 1999
|
||||
Catalog-1.00
|
||||
is available.
|
||||
This release includes PHP3
|
||||
code to display a catalog. The author is Weston Bustraan (weston@infinityteldata.net).
|
||||
The main motivation to jump directly to version 1.00 is to avoid version
|
||||
number problems on CPAN.
|
||||
July 2, 1999
|
||||
Catalog-0.19
|
||||
is available.
|
||||
This is a minor release. The
|
||||
most noticeable addition is the new search mechanism.
|
||||
|
||||
Searching : two search modes
|
||||
are now available. AltaVista simple syntax and AltaVista advanced syntax.
|
||||
Both use the Text-Query and Text-Query-SQL perl modules.
|
||||
Dmoz loading is much more
|
||||
fault tolerant. In addition it can handle compressed versions of content.rdf
|
||||
and structure.rdf. The comments are now stored in text fields instead
|
||||
of char(255).
|
||||
The template system was
|
||||
extended with the pre_fill and post_fill parameters.
|
||||
Searching associated to
|
||||
a catalog dumped to static pages is now possible using the 'static'
|
||||
mode.
|
||||
Fixed two security weakness
|
||||
in confedit and recursive cgi handling.
|
||||
Many sql queries have been
|
||||
optimized.
|
||||
The configuration was changed
|
||||
a bit to fix bugs and to isolate database dependencies.
|
||||
The tests were updated to
|
||||
isolate database dependencies.
|
||||
Fixed numerous minor bugs,
|
||||
check ChangeLog if you're interested in details.
|
||||
|
||||
Many thanks to Tim Bunce for
|
||||
his numerous contributions and ideas. He is the architect of the Text-Query
|
||||
and Text-Query-SQL modules, Eric Bohlman and Loic Dachary did the programming.
|
||||
|
||||
Thanks to Eric Bohlman for
|
||||
his help on the Text-Query module. He was very busy but managed to spend
|
||||
the time needed to release it.
|
||||
There is not yet anything usable
|
||||
for full text indexing but we keep working on it. The storage management
|
||||
is now handled by the reiserfs file system thanks to Hans Reiser who is
|
||||
working full time on this. Loic Dachary does his best to get something
|
||||
working, if you're interested go to http://www.senga.org/mifluz/.
|
||||
For some mysterious reason
|
||||
CPAN lost track of Catalog name. In order to install catalog you should
|
||||
use perl -MCPAN -e 'install Catalog::db'. Weird but temporary.
|
||||
Have fun !
|
||||
The Senga Team
|
||||
Ecila
|
||||
100 Av. du Général Leclerc
|
||||
93 500 Pantin
|
||||
Tel: 33 1 56 96 09 80
|
||||
Fax: 33 1 56 96 09 81
|
||||
WEB: http://www.senga.org/
|
||||
Mail: senga@senga.org
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[
|
||||
Catalog |
|
||||
webbase |
|
||||
mifluz |
|
||||
unac |
|
||||
Search-Mifluz |
|
||||
Text-Query |
|
||||
uri |
|
||||
Statistics |
|
||||
News
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
";
|
||||
|
||||
int main() {
|
||||
int i;
|
||||
char* out = 0;
|
||||
size_t out_length = 0;
|
||||
{
|
||||
if(unac_string("ISO-8859-1", "été", 3, &out, &out_length) < 0) {
|
||||
perror("unac été");
|
||||
exit(1);
|
||||
}
|
||||
if(out_length != 3) {
|
||||
fprintf(stderr, "out_length == %d instead of 3\n", (int)out_length);
|
||||
exit(1);
|
||||
}
|
||||
if(memcmp("ete", out, out_length)) {
|
||||
fprintf(stderr, "out == %.*s instead of ete\n", (int)out_length, out);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
char tmp[10];
|
||||
sprintf(tmp, "%c", 0xBC);
|
||||
if(unac_string("ISO-8859-1", tmp, 1, &out, &out_length) < 0) {
|
||||
perror("unac 0xBC (1/4)");
|
||||
exit(1);
|
||||
}
|
||||
if(out_length != 3) {
|
||||
fprintf(stderr, "out_length == %d instead of 3\n", (int)out_length);
|
||||
exit(1);
|
||||
}
|
||||
if(memcmp("1 4", out, out_length)) {
|
||||
fprintf(stderr, "out == %.*s instead of '1 4'\n", (int)out_length, out);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for(i = 0; i < 3; i++) {
|
||||
int longstr_length = strlen(longstr);
|
||||
if(unac_string("ISO-8859-1", longstr, longstr_length, &out, &out_length) == -1) {
|
||||
perror("unac_string longstr failed");
|
||||
exit(1);
|
||||
}
|
||||
if(out_length != longstr_length) {
|
||||
fprintf(stderr, "out_length == %d instead of %d\n", (int)out_length, longstr_length);
|
||||
exit(1);
|
||||
}
|
||||
if(memcmp(longstr_expected, out, out_length)) {
|
||||
fprintf(stderr, "out == %.*s instead of ete\n", (int)out_length, out);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
free(out);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user