pax_global_header00006660000000000000000000000064122514002320014501gustar00rootroot0000000000000052 comment=3f559c8106d0ad1ddef23576e5359340bcacb0d0 ydpdict-1.0.2+1.0.3/000077500000000000000000000000001225140023200135745ustar00rootroot00000000000000ydpdict-1.0.2+1.0.3/COPYING000066400000000000000000000431061225140023200146330ustar00rootroot00000000000000 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 Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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. , 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. ydpdict-1.0.2+1.0.3/Makefile.am000066400000000000000000000007021225140023200156270ustar00rootroot00000000000000AUTOMAKE_OPTIONS = foreign SUBDIRS = src contrib po DIST_SUBDIRS = src contrib po EXTRA_DIST = autogen.sh autoclean.sh configure.ac ydpdict.1 ydpdict.pl.1 ydpdict.conf.in man_MANS = ydpdict.1 ACLOCAL_AMFLAGS = -I m4 sysconf_DATA = ydpdict.conf install-data-local: $(MKINSTALLDIRS) $(DESTDIR)$(dictdir) test -d $(DESTDIR)$(mandir)/pl/man1 || mkdir -p $(DESTDIR)$(mandir)/pl/man1 $(INSTALL_DATA) ydpdict.pl.1 $(DESTDIR)$(mandir)/pl/man1/ydpdict.1 ydpdict-1.0.2+1.0.3/README000066400000000000000000000237421225140023200144640ustar00rootroot00000000000000 ydpdict 1.0.3 (C) Copyright 1998-2013 Wojtek Kaniewski Program, którego dokumentację w tej chwili czytasz, służy do obsługi multimedialnych słowników angielsko-polskiego i polsko-angielskiego Collinsa oraz niemiecko-polskiego i polsko-niemieckiego Langenscheidta. Oryginalne pakiety oferowane przez firmę Young Digital Planet (http://www.ydp.com.pl) zawierają jedynie programy dla systemu Windows, co uniemożliwia korzystanie z nich pod innymi systemami. Niniejszy program pozwala korzystać z tych słowników pod kontrolą Linuksa. Możliwe, że zadziała również pod innymi systemami, ponieważ jest pisany w miarę możliwości przenośnie. Do prawidłowej pracy niezbędna jest dystrybucja Linuksa (lub innego systemu uniksowego) z biblioteką ncurses wspierającą Unikod oraz zainstalowana biblioteka libydpdict (dostępna na stronie projektu). W przypadku systemu operacyjnego, który nie wspiera Unikodu, należy użyć wersji wcześniejszej niż 0.99. Aby skompilować i zainstalować pakiet, należy wykonać polecenia (ostatnie z nich z uprawnieniami administratora): ./configure make make install Ze względu na domyślne zachowanie autoconfa, strony manuali będą instalowane w katalogu $(prefix)/man, zamiast $(prefix)/share/man. Jeśli chcesz je zainstalować w odpowiednim miejscu, wpisz: ./configure --mandir=/usr/local/share/man make make install Następnie należy skopiować cztery pliki z katalogu "database" oryginalnego, pracującego pod systemem Windows programu: dict100.dat dict100.idx dict101.dat dict101.idx dla słownika angielsko-polskiego i polsko-angielskiego, lub: dict200.dat dict200.idx dict201.dat dict201.idx dla słownika niemiecko-polskiego i polsko-niemieckiego, do katalogu, w którym znajduje się program. Dodatkowo program będzie szukał plików słownika w systemowym katalogu, np. /usr/local/share/ydpdict jeśli do skryptu ./configure nie przekazano parametru --prefix lub /usr/share/ydpdict jeśli program pochodzi pakietu dystrybucji). Można też podać ścieżkę, w której się one znajdują w parametrze "Path" pliku konfiguracyjnego. Należy również zmienić parametr "CDPath" na ścieżkę, gdzie znajduje się podmontowana płyta CD. Jego brak uniemożliwi odtwarzanie próbek dźwiękowych. Aby móc odtwarzać próbki ze słownika angielsko-polskiego i niemiecko-polskiego, należy utworzyć katalog, a w nim katalog "en" z zawartością płyty CD słownika angielsko-polskiego oraz katalog "de" z plikami słownika niemiecko-polskiego. Obsługa programu jest bajecznie prosta. Wystarczy wpisać szukane słowo lub wybrać je klawiszami kursorów. Do przemieszania się między listą słów, a definicją służy klawisz Tab. Odtwarzanie próbek to F2. Zmiana na inny słownik to F3, F4, F5, F6. Program obsługiwać można częściowo za pomocą myszki. Kliknięcie na słowo z listy, spowoduje wyświetlenie jego tłumaczenia. Klikając na dolne i górne krawędzie ekranu, można przewijać listę lub opis. Jeśli klikniemy dwukrotnie na słowo z okienka tłumaczenia, zostanie ono automatycznie wyszukane. ydpdict jest wydany na licencji GPL w wersji 2 (treść w języku angielskim dostępna w pliku COPYING). Wszelkie poprawki wysłane do autora na licencji innej niż GPL w wersji 2 zostaną odrzucone. Brak informacji o licencji będzie traktowany jak przyjęcie licencji kodu, który jest poprawiany. Wyjątkiem są pliki adpcm.c i adpcm.h autorstwa Stanley'a J. Brooksa wydane na licencji LGPL w wersji 2: Copyright (C) 1999 Stanley J. Brooks Najnowszą wersję można znaleźć pod adresem http://toxygen.net/ydpdict/ Lista zmian: - 1.0.3 (2013-12-xx): Dodanie informacji o katalogu z plikami słownika. - 1.0.2 (2013-01-11): Poprawka błędnego wyświetlania słów z końca słownika zgłoszone przez Jakuba Wilka. - 1.0.1 (2011-05-10): Rozszerzenie pomocy o oznaczenia kwalifikatorów gramatycznych oraz zmiana sposobu działania klawisza Esc: obie modyfikacje autorstwa Cezarego M. Kruka (c.kruk@bigfoot.com). Poprawki dokumentacji. Poprawka roku copyrightów. Poprawka odtwarzania niektórych próbek dźwiękowych Pawła Sobczaka (psobcza@o2.pl). Dodanie obsługi próbek dźwiękowych słownika angielskiego i niemieckiego wg pomysłu Mateusza B. (incusiek@gmail.com). Poprawka błędu odtwarzania niemieckich próbek zgłoszonego przez Krzysztofa Sucheckiego (hetteh@life.pl). Poprawka kompilacji bez libao. Lepsze wyświetlanie indeksów górnych (¹, ²... zamiast ^1, ^2...), jeśli libydpdict jest w wersji 1.0.3 lub nowszej. Poprawka błędu współpracy z nowymi wersjami libao zgłoszonego przez Pawła Sobczaka. - 1.0.0 (2008-02-26): Poprawka błędu zawijania zgłoszonego przez Marcina Owsianego. Aktualizacja pliku z tłumaczeniem. - 0.99.3 (2007-12-16): Poprawki parametrów wywołania programu Tomasza Kojma (tkojm@clamav.net). Dostosowanie do API libydpdict-0.99.3. - 0.99.2 (2007-08-19): Uniezależnienie od wielkości liter w nazwach plików słownika na podstawie poprawki Marcina Owsianego (marcin@owsiany.pl). - 0.99.1 (2007-08-09): Poprawka błędu kompilacji bez libao zgłoszonego przez Piotra Jaroszyńskiego (peper@gentoo.org). Poprawki dokumentacji, dodanie parametru skryptu configure określającego domyślny katalog słownika (marcin@owsiany.pl). - 0.99.0 (2007-02-26): Całkowita zmiana architektury -- wydzielenie biblioteki obsługującej słowniki, modyfikacja kodu do poprawnej pracy w Unikodzie, dodanie obsługi próbek dźwiękowych w formacie ADPCM. Lista zmian starej gałęzi kodu: - 0.67 (2006-xx-xx): Dodanie $(DESTDIR) przy instalacji przez Stanisława Halika (weirdo%tehran.lain.pl). - 0.66 (2006-01-02): Poprawka odtwarzania próbek Tomasza Jakuba Skrynnyka (skrynnyk%post.pl). Poprawka obsługi parametrów Jasia (jasiu%tool.eu.org). Poprawka skryptów budowania. - 0.65 (2005-11-16): Poprawki Jakuba Wilka (ubanus%users.sf.net): usunięcie złych zachowań prowadzących do segfaultów. Dodanie informacji o licencji poprawek. Kosmetyka dokumentacji. - 0.64 (2005-10-18): Poprawki strony manuala Kamila Jarosławskiego (kamil%visual.pl). Obsługa próbek o rozszerzeniu .ogg Tomasza Marciniaka (ciniol%atos.wmid.amu.edu.pl). Oficjalne włączenie poprawki Michała Maternika (michal_m%ks.k.pl) pozwalającej korzystać z niemieckiego słownika. Poprawka działania na amd64 Arkadiusza Kołacza (akolacz%gmail.com). - 0.63 (2004-05-31): Poprawka adresu. Poprawki Marcina Owsianego (marcin%owsiany.pl): poprawne zamykanie plików słownika, usunięcie czytania konfiguracji z aktualnego katalogu, napisanie stron manuali. - 0.62 (2003-11-23): Poprawka Piotra Domagalskiego (szalik%szalik.net): przezroczyste tło w atermie. Poprawki Jarosława Kruka (jareq%pld-linux.org): skok do danego słowa z linii komend, zmiana adresów PLD na aktualne. - 0.61 (2003-10-01): Wyświetlanie pomocy zaraz po uruchomieniu programu. poprawki Cezarego M. Kruka: substytuty dla klawiszy funkcyjnych, blokada odtwarzania próbek dźwiękowych podczas przeglądania słownika polsko-angielskiego, szczegółowa pomoc, drobne zmiany w transkrypcji fonetycznej, korekta zapobiegająca śmieceniu po ekranie podczas odtwarzania plików w formacie MP3. Dodane skrypty do konwersji z formatu WAV do MP3. - 0.60 (2003-08-27): Poprawki Piotra Domagalskiego: buforowanie odczytu przyspieszające start programu. - 0.59 (2003-07-22): Poprawki Jerzego Kędra (jxa%adm.onet.pl): program nie zajmuje już 100% czasu procesora. Patch Michała Maternika (michal_m%ks.k.pl) pozwalający korzystać z niemieckiego słownika w pliku Deutsch.diff. - 0.58 (2003-05-16): Poprawki Piotra Domagalskiego: prosta obsługa myszki, możliwość edycji wpisywanego słowa, Enter zatwierdza i wyszukuje, lepsza reakcja na zmianę rozmiaru terminala, CTRL-L, kosmetyka, xmalloc. - 0.57 (2003-04-15): Kolejne poprawki Piotra Domagalskiego porządkujące kompilację na nielinuksowych systemach. poprawka Pawła Fenglera (pawfen%wp.pl): wywoływanie zewnętrznego odtwarzacza w poprawny sposób. - 0.56 (2003-03-21): Wiosenne porządki w kodzie; obsługa plików bazy z nazwami pisanymi wielkimi literami; obsługa próbek dźwiękowych o rozszerzeniu mp3; uzupełnienie dokumentacji na podstawie archiwalnej wersji 0.5. - 0.55 (2003-03-12): Poprawki Piotra Domagalskiego (szalik%szalik.net): poprawna kompilacja na OpenBSD, dokładniejsze formatowanie tekstu. - 0.54 (2003-01-27): Poprawki Pawła Jabłońskiego (pawelj%lodz.dialog.net.pl): wyświetlenie innego słowa przewija okno definicji do góry; rozpoczęcie pisania słowa, bedąc w oknie definicji, usuwa poprzednie; klawisz F12 równoważny z Ctrl-U. - 0.53 (2003-01-07): Z powodu awarii dysku straciłem poprawki, które podesłano mi od wydania 0.52. dlatego proszę o kontakt. Poprawienie klawisza Backspace. - 0.52 (2002-05-27): autoconf, poprawki Grzegorza Goławskiego (grzegol%pld-linux.org), poprawne działanie na maszynach bigendianowych. - 0.51 (1999-10-17): Stabilna wersja 0.5, które nigdy nie wyszło poza wersję rozwojową. - 0.5 (1999-08-17): Wersja rozwojowa. Spora reorganizacja kodu; pozbycie się SLanga. - 0.4 (1998-xx-xx): Dawno temu i nieprawda. ydpdict-1.0.2+1.0.3/autoclean.sh000077500000000000000000000003661225140023200161130ustar00rootroot00000000000000#!/bin/sh rm -rf config.* autom4te.cache Makefile.in Makefile INSTALL aclocal.m4 depcomp install-sh missing stamp* configure confdefs.h src/.deps src/.libs src/*.o src/Makefile.in src/Makefile src/config.h install-sh ltmain.sh compile libtool *~ ydpdict-1.0.2+1.0.3/autogen.sh000077500000000000000000000005121225140023200155730ustar00rootroot00000000000000#!/bin/sh echo "aclocal" aclocal -I m4 || exit 1 echo "autoheader" autoheader || exit 1 echo "libtoolize" libtoolize -c -f || exit 1 echo "gettextize" cp /usr/share/gettext/config.rpath . || exit 1 echo "automake" automake -a -c -f --foreign || exit 1 echo "autoconf" autoconf || exit 1 test x$NOCONFIGURE = x && ./configure $* ydpdict-1.0.2+1.0.3/config.rpath000077500000000000000000000440121225140023200161050ustar00rootroot00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2010 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case $cc_basename in xlc*) wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux* | k*bsd*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case $cc_basename in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) library_names_spec='$libname.a' ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd1*) ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; nto-qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < header file.]) AC_MSG_RESULT([yes]) LIBS="$LIBS -lncursesw" else if test "x$have_curses_h" = "xyes" ; then AC_DEFINE([HAVE_CURSES_H], [], [Define to 1 if you have the header file.]) AC_MSG_RESULT([maybe]) LIBS="$LIBS -lncursesw" AC_MSG_WARN([ not found, but some Linux distributions provide unicode-away , so let's try]) ncurses_warning=yes else AC_MSG_ERROR([no]) fi fi else AC_MSG_ERROR([no]) fi export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig" PKG_CHECK_MODULES([YDPDICT], [libydpdict >= 0.99.3]) AC_SUBST([YDPDICT_CFLAGS]) AC_SUBST([YDPDICT_LIBS]) AC_ARG_WITH(dictdir, [ --with-dictdir=DIR Databases are in DIR]) if test "x$with_dictdir" != "x"; then dictdir="$with_dictdir" else # Substitute ${datarootdir}, ${prefix} etc. dictdir="${datadir}/ydpdict" save_prefix="$prefix" if test "X$prefix" = "XNONE"; then prefix="$ac_default_prefix" fi eval dictdir="$dictdir" eval dictdir="$dictdir" eval dictdir="$dictdir" eval dictdir="$dictdir" prefix="$save_prefix" fi AC_SUBST([dictdir]) AC_ARG_WITH(libao, [ --without-libao Compile without libao]) if test "x$with_libao" != "xno"; then PKG_CHECK_MODULES([AO], [ao], [AC_DEFINE(HAVE_LIBAO, [], [Define to 1 if libao is available.])], [:]) fi AC_SUBST([AO_CFLAGS]) AC_SUBST([AO_LIBS]) AC_SUBST([HAVE_LIBAO]) CFLAGS="$CFLAGS -DHAVE_CONFIG_H" AC_SUBST([VERSION]) AC_OUTPUT([Makefile src/Makefile contrib/Makefile ydpdict.conf po/Makefile.in]) if test "x$ncurses_warning" = "xyes" ; then AC_MSG_WARN([Build may fail because of ncurses headers ambiguity in some Linux distributions.]) fi ydpdict-1.0.2+1.0.3/contrib/000077500000000000000000000000001225140023200152345ustar00rootroot00000000000000ydpdict-1.0.2+1.0.3/contrib/Makefile.am000066400000000000000000000000471225140023200172710ustar00rootroot00000000000000EXTRA_DIST = wav2mp3 zwieksz zmniejsz ydpdict-1.0.2+1.0.3/contrib/wav2mp3000077500000000000000000000005561225140023200164670ustar00rootroot00000000000000#!/bin/sh # Konwertuje pliki w formacie WAV do formatu MP3 # i wymaga programów sox oraz lame. find -depth -type d -exec sh -c 'cd {} ; \ for file in *.wav ; do file="`echo ${file} | sed 's/.wav//'`" ; \ sox ${file}.wav ${file}.cdr ; \ chmod u+w ${file}.wav ; rm ${file}.wav ; \ lame -b 64 ${file}.cdr ${file}.mp3 ; rm ${file}.cdr ; \ done' \; ydpdict-1.0.2+1.0.3/contrib/zmniejsz000077500000000000000000000002701225140023200170320ustar00rootroot00000000000000#!/bin/sh # Zmienia nazwy plików na pisane małymi literami. find $1 -depth -type d -exec sh -c 'cd {}; \ for i in *; do mv $i `echo $i | tr [:upper:] [:lower:]`; \ done' \; ydpdict-1.0.2+1.0.3/contrib/zwieksz000077500000000000000000000002701225140023200166670ustar00rootroot00000000000000#!/bin/sh # Zmienia nazwy plików na pisane dużymi literami. find $1 -depth -type d -exec sh -c 'cd {}; \ for i in *; do mv $i `echo $i | tr [:lower:] [:upper:]`; \ done' \; ydpdict-1.0.2+1.0.3/m4/000077500000000000000000000000001225140023200141145ustar00rootroot00000000000000ydpdict-1.0.2+1.0.3/m4/codeset.m4000066400000000000000000000013511225140023200160040ustar00rootroot00000000000000# codeset.m4 serial AM1 (gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) ydpdict-1.0.2+1.0.3/m4/gettext.m4000066400000000000000000000516671225140023200160610ustar00rootroot00000000000000# gettext.m4 serial 37 (gettext-0.14.4) dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], [no], [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AM_NLS ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. dnl Add a version number to the cache macros. define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) dnl Now see whether libintl exists and depends on libiconv. if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include ]ifelse([$2], [need-formatstring-macros], [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ], [])[extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext_libintl=yes ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext_libintl" = "yes"; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATOBJEXT) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST(INTLOBJS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST(INTLLIBS) dnl Make all documented variables known to autoconf. AC_SUBST(LIBINTL) AC_SUBST(LTLIBINTL) AC_SUBST(POSUB) ]) dnl Checks for all prerequisites of the intl subdirectory, dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. AC_DEFUN([AM_INTL_SUBDIR], [ AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([gt_GLIBC2])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([bh_C_SIGNED])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl AC_REQUIRE([gt_TYPE_WCHAR_T])dnl AC_REQUIRE([gt_TYPE_WINT_T])dnl AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_REQUIRE([gt_TYPE_INTMAX_T]) AC_REQUIRE([gt_PRINTF_POSIX]) AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([gl_GLIBC21])dnl AC_REQUIRE([gt_INTDIV0])dnl AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl AC_REQUIRE([gt_INTTYPES_PRI])dnl AC_REQUIRE([gl_XSIZE])dnl AC_REQUIRE([gt_INTL_MACOSX])dnl AC_CHECK_TYPE([ptrdiff_t], , [AC_DEFINE([ptrdiff_t], [long], [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) ]) AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ __fsetlocking]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). gt_CHECK_DECL(_snprintf, [#include ]) gt_CHECK_DECL(_snwprintf, [#include ]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built dnl on Solaris 2.5.1 to run on Solaris 2.6). dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. gt_CHECK_DECL(feof_unlocked, [#include ]) gt_CHECK_DECL(fgets_unlocked, [#include ]) gt_CHECK_DECL(getc_unlocked, [#include ]) case $gt_cv_func_printf_posix in *yes) HAVE_POSIX_PRINTF=1 ;; *) HAVE_POSIX_PRINTF=0 ;; esac AC_SUBST([HAVE_POSIX_PRINTF]) if test "$ac_cv_func_asprintf" = yes; then HAVE_ASPRINTF=1 else HAVE_ASPRINTF=0 fi AC_SUBST([HAVE_ASPRINTF]) if test "$ac_cv_func_snprintf" = yes; then HAVE_SNPRINTF=1 else HAVE_SNPRINTF=0 fi AC_SUBST([HAVE_SNPRINTF]) if test "$ac_cv_func_wprintf" = yes; then HAVE_WPRINTF=1 else HAVE_WPRINTF=0 fi AC_SUBST([HAVE_WPRINTF]) AM_ICONV AM_LANGINFO_CODESET if test $ac_cv_header_locale_h = yes; then gt_LC_MESSAGES fi if test -n "$INTL_MACOSX_LIBS"; then CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi ]) dnl Checks for special options needed on MacOS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in MacOS X 10.2. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], gt_cv_func_CFPreferencesCopyAppValue, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" AC_TRY_LINK([#include ], [CFPreferencesCopyAppValue(NULL, NULL)], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) dnl gt_CHECK_DECL(FUNC, INCLUDES) dnl Check whether a function is declared. AC_DEFUN([gt_CHECK_DECL], [ AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, [AC_TRY_COMPILE([$2], [ #ifndef $1 char *p = (char *) $1; #endif ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) if test $ac_cv_have_decl_$1 = yes; then gt_value=1 else gt_value=0 fi AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) ydpdict-1.0.2+1.0.3/m4/glibc2.m4000066400000000000000000000013541225140023200155230ustar00rootroot00000000000000# glibc2.m4 serial 1 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.0 or newer. # From Bruno Haible. AC_DEFUN([gt_GLIBC2], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, ac_cv_gnu_library_2, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2=yes, ac_cv_gnu_library_2=no) ] ) AC_SUBST(GLIBC2) GLIBC2="$ac_cv_gnu_library_2" ] ) ydpdict-1.0.2+1.0.3/m4/glibc21.m4000066400000000000000000000014451225140023200156050ustar00rootroot00000000000000# glibc21.m4 serial 3 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([gl_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) ydpdict-1.0.2+1.0.3/m4/iconv.m4000066400000000000000000000064261225140023200155040ustar00rootroot00000000000000# iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) ydpdict-1.0.2+1.0.3/m4/intdiv0.m4000066400000000000000000000033401225140023200157330ustar00rootroot00000000000000# intdiv0.m4 serial 1 (gettext-0.11.3) dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ AC_TRY_RUN([ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac ]) ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) ydpdict-1.0.2+1.0.3/m4/intmax.m4000066400000000000000000000017461225140023200156660ustar00rootroot00000000000000# intmax.m4 serial 2 (gettext-0.14.2) dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the system has the 'intmax_t' type, but don't attempt to dnl find a replacement if it is lacking. AC_DEFUN([gt_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, [AC_TRY_COMPILE([ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) fi ]) ydpdict-1.0.2+1.0.3/m4/inttypes-pri.m4000066400000000000000000000020021225140023200170170ustar00rootroot00000000000000# inttypes-pri.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_REQUIRE([gt_HEADER_INTTYPES_H]) if test $gt_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) fi ]) ydpdict-1.0.2+1.0.3/m4/inttypes.m4000066400000000000000000000014721225140023200162410ustar00rootroot00000000000000# inttypes.m4 serial 1 (gettext-0.11.4) dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H if exists and doesn't clash with # . AC_DEFUN([gt_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, [ AC_TRY_COMPILE( [#include #include ], [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) ]) if test $gt_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, [Define if exists and doesn't clash with .]) fi ]) ydpdict-1.0.2+1.0.3/m4/inttypes_h.m4000066400000000000000000000016231225140023200165460ustar00rootroot00000000000000# inttypes_h.m4 serial 6 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) ydpdict-1.0.2+1.0.3/m4/isc-posix.m4000066400000000000000000000017061225140023200163000ustar00rootroot00000000000000# isc-posix.m4 serial 2 (gettext-0.11.2) dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # This file is not needed with autoconf-2.53 and newer. Remove it in 2005. # This test replaces the one in autoconf. # Currently this macro should have the same name as the autoconf macro # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ] ) ydpdict-1.0.2+1.0.3/m4/lcmessage.m4000066400000000000000000000024041225140023200163210ustar00rootroot00000000000000# lcmessage.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995. # Check whether LC_MESSAGES is available in . AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) if test $gt_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi ]) ydpdict-1.0.2+1.0.3/m4/lib-ld.m4000066400000000000000000000065311225140023200155260ustar00rootroot00000000000000# lib-ld.m4 serial 3 (gettext-0.13) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) ydpdict-1.0.2+1.0.3/m4/lib-link.m4000066400000000000000000000554261225140023200160730ustar00rootroot00000000000000# lib-link.m4 serial 6 (gettext-0.14.3) dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.50) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, dnl hardcode_direct, hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" libext="$acl_cv_libext" shlibext="$acl_cv_shlibext" hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" hardcode_direct="$acl_cv_hardcode_direct" hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib$1-prefix], [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib$1-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= if test $use_additional = yes; then if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then found_dir="$additional_libdir" found_so="$additional_libdir/lib$name.$shlibext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi else if test -f "$additional_libdir/lib$name.$libext"; then found_dir="$additional_libdir" found_a="$additional_libdir/lib$name.$libext" if test -f "$additional_libdir/lib$name.la"; then found_la="$additional_libdir/lib$name.la" fi fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then found_dir="$dir" found_so="$dir/lib$name.$shlibext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi else if test -f "$dir/lib$name.$libext"; then found_dir="$dir" found_a="$dir/lib$name.$libext" if test -f "$dir/lib$name.la"; then found_la="$dir/lib$name.la" fi fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) ydpdict-1.0.2+1.0.3/m4/lib-prefix.m4000066400000000000000000000123101225140023200164140ustar00rootroot00000000000000# lib-prefix.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/lib" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/lib"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/lib"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) ydpdict-1.0.2+1.0.3/m4/longdouble.m4000066400000000000000000000020531225140023200165100ustar00rootroot00000000000000# longdouble.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the compiler supports the 'long double' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_LONGDOUBLE], [ AC_CACHE_CHECK([for long double], gt_cv_c_long_double, [if test "$GCC" = yes; then gt_cv_c_long_double=yes else AC_TRY_COMPILE([ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; ], , gt_cv_c_long_double=yes, gt_cv_c_long_double=no) fi]) if test $gt_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) fi ]) ydpdict-1.0.2+1.0.3/m4/longlong.m4000066400000000000000000000014161225140023200161770ustar00rootroot00000000000000# longlong.m4 serial 5 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG if 'long long' works. AC_DEFUN([gl_AC_TYPE_LONG_LONG], [ AC_CACHE_CHECK([for long long], ac_cv_type_long_long, [AC_TRY_LINK([long long ll = 1LL; int i = 63;], [long long llmax = (long long) -1; return ll << i | ll >> i | llmax / ll | llmax % ll;], ac_cv_type_long_long=yes, ac_cv_type_long_long=no)]) if test $ac_cv_type_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the 'long long' type.]) fi ]) ydpdict-1.0.2+1.0.3/m4/nls.m4000066400000000000000000000035301225140023200151530ustar00rootroot00000000000000# nls.m4 serial 2 (gettext-0.14.3) dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) ]) AC_DEFUN([AM_MKINSTALLDIRS], [ dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])]) dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate it. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then case "$ac_aux_dir" in /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; esac fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) ]) ydpdict-1.0.2+1.0.3/m4/po.m4000066400000000000000000000436431225140023200150060ustar00rootroot00000000000000# po.m4 serial 7 (gettext-0.14.3) dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ(2.50) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl AC_REQUIRE([AM_NLS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU msgfmt. if test "$GMSGFMT" != ":"; then dnl If it is no GNU msgfmt we define it as : so that the dnl Makefiles still can work. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` AC_MSG_RESULT( [found $GMSGFMT program is not GNU msgfmt; ignore it]) GMSGFMT=":" fi fi dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po fi AC_OUTPUT_COMMANDS([ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" < #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, [ AC_EGREP_CPP(notposix, [ #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif ], gt_cv_func_printf_posix="guessing no", gt_cv_func_printf_posix="guessing yes") ]) ]) case $gt_cv_func_printf_posix in *yes) AC_DEFINE(HAVE_POSIX_PRINTF, 1, [Define if your printf() function supports format strings with positions.]) ;; esac ]) ydpdict-1.0.2+1.0.3/m4/progtest.m4000066400000000000000000000055501225140023200162320ustar00rootroot00000000000000# progtest.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. AC_PREREQ(2.50) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) ydpdict-1.0.2+1.0.3/m4/signed.m4000066400000000000000000000011541225140023200156300ustar00rootroot00000000000000# signed.m4 serial 1 (gettext-0.10.40) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([bh_C_SIGNED], [ AC_CACHE_CHECK([for signed], bh_cv_c_signed, [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) if test $bh_cv_c_signed = no; then AC_DEFINE(signed, , [Define to empty if the C compiler doesn't support this keyword.]) fi ]) ydpdict-1.0.2+1.0.3/m4/size_max.m4000066400000000000000000000036451225140023200162050ustar00rootroot00000000000000# size_max.m4 serial 2 dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS(stdint.h) dnl First test whether the system already has SIZE_MAX. AC_MSG_CHECKING([for SIZE_MAX]) result= AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], result=yes) if test -z "$result"; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', dnl which is guaranteed to work from LONG_MIN to LONG_MAX. _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, [#include ], result=?) _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, [#include ], result=?) _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, [#include ], result=?) if test "$fits_in_uint" = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_TRY_COMPILE([#include extern size_t foo; extern unsigned long foo; ], [], fits_in_uint=0) fi if test -z "$result"; then if test "$fits_in_uint" = 1; then result="$res_hi$res_lo"U else result="$res_hi$res_lo"UL fi else dnl Shouldn't happen, but who knows... result='~(size_t)0' fi fi AC_MSG_RESULT([$result]) if test "$result" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi ]) ydpdict-1.0.2+1.0.3/m4/stdint_h.m4000066400000000000000000000015731225140023200162000ustar00rootroot00000000000000# stdint_h.m4 serial 5 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) ydpdict-1.0.2+1.0.3/m4/uintmax_t.m4000066400000000000000000000020761225140023200163730ustar00rootroot00000000000000# uintmax_t.m4 serial 9 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. AC_PREREQ(2.13) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) else AC_DEFINE(HAVE_UINTMAX_T, 1, [Define if you have the 'uintmax_t' type in or .]) fi ]) ydpdict-1.0.2+1.0.3/m4/ulonglong.m4000066400000000000000000000016151225140023200163650ustar00rootroot00000000000000# ulonglong.m4 serial 4 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], [ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], [unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull;], ac_cv_type_unsigned_long_long=yes, ac_cv_type_unsigned_long_long=no)]) if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, [Define if you have the 'unsigned long long' type.]) fi ]) ydpdict-1.0.2+1.0.3/m4/wchar_t.m4000066400000000000000000000013261225140023200160070ustar00rootroot00000000000000# wchar_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wchar_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, [AC_TRY_COMPILE([#include wchar_t foo = (wchar_t)'\0';], , gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) fi ]) ydpdict-1.0.2+1.0.3/m4/wint_t.m4000066400000000000000000000013041225140023200156600ustar00rootroot00000000000000# wint_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, [AC_TRY_COMPILE([#include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) fi ]) ydpdict-1.0.2+1.0.3/m4/xsize.m4000066400000000000000000000006451225140023200155250ustar00rootroot00000000000000# xsize.m4 serial 3 dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS(stdint.h) ]) ydpdict-1.0.2+1.0.3/mkinstalldirs000077500000000000000000000067221225140023200164110ustar00rootroot00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ydpdict-1.0.2+1.0.3/po/000077500000000000000000000000001225140023200142125ustar00rootroot00000000000000ydpdict-1.0.2+1.0.3/po/LINGUAS000066400000000000000000000000031225140023200152300ustar00rootroot00000000000000pl ydpdict-1.0.2+1.0.3/po/Makefile.in.in000066400000000000000000000317071225140023200166740ustar00rootroot00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2005 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.14.4 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ydpdict-1.0.2+1.0.3/po/Makevars000066400000000000000000000034251225140023200157120ustar00rootroot00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Wojtek Kaniewski # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = wojtekka@toxygen.net # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = ydpdict-1.0.2+1.0.3/po/POTFILES.in000066400000000000000000000001661225140023200157720ustar00rootroot00000000000000# List of source files which contain translatable strings. src/xmalloc.c src/ydpconfig.c src/ydpdict.c src/ydpsound.c ydpdict-1.0.2+1.0.3/po/Rules-quot000066400000000000000000000033761225140023200162260ustar00rootroot00000000000000# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header ydpdict-1.0.2+1.0.3/po/boldquot.sed000066400000000000000000000003311225140023200165350ustar00rootroot00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g ydpdict-1.0.2+1.0.3/po/en@boldquot.header000066400000000000000000000024711225140023200176440ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # ydpdict-1.0.2+1.0.3/po/en@quot.header000066400000000000000000000022631225140023200170020ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # ydpdict-1.0.2+1.0.3/po/insert-header.sin000066400000000000000000000012401225140023200174540ustar00rootroot00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } ydpdict-1.0.2+1.0.3/po/pl.po000066400000000000000000000223471225140023200151750ustar00rootroot00000000000000# Polish translations for ydpdict package # Polskie tłumaczenia dla pakietu ydpdict. # Copyright (C) 2006 Free Software Foundation, Inc. # This file is distributed under the same license as the ydpdict package. # Wojtek Kaniewski , 2006. # msgid "" msgstr "" "Project-Id-Version: ydpdict 0.99.0\n" "Report-Msgid-Bugs-To: wojtekka@toxygen.net\n" "POT-Creation-Date: 2011-05-10 19:49+0200\n" "PO-Revision-Date: 2006-04-18 00:38+0200\n" "Last-Translator: Wojtek Kaniewski \n" "Language-Team: Polish \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" #: src/xmalloc.c:52 src/xmalloc.c:69 src/xmalloc.c:100 src/xmalloc.c:120 #: src/ydpdict.c:305 msgid "Out of memory" msgstr "Brak pamięci" #: src/ydpconfig.c:89 #, c-format msgid "" "Usage: %s [OPTIONS]\n" " -e, --eng start with English-Polish dictionary (default)\n" " -p, --pol start with Polish-English dictionary\n" " -g, --ger-pol start with German-Polish dictionary\n" " -o, --pol-ger start with Polish-German dictionary\n" " -f, --path=PATH set database path\n" " -c, --cdpath=PATH set CD-ROM path\n" " -P, --player=PATH set sound player path\n" " -w, --word=WORD start with selected WORD's definition\n" " -A, --audio=DEVICE set default audio device\n" " -V, --version print program version\n" " -h, --help print this message\n" "\n" msgstr "" "Użycie: %s [OPCJE]\n" " -e, --eng włącza słownik angielsko-polski (domyślnie)\n" " -p, --pol włącza słownik polsko-angielski\n" " -g, --ger-pol włącza słownik niemiecko-polski\n" " -o, --pol-ger włącza słownik polsko-niemiecki\n" " -f, --path=ŚCIEŻKA określa ścieżkę bazy danych\n" " -c, --cdpath=ŚCIEŻKA określa ścieżkę napędu CD\n" " -P, --player=ŚCIEŻKA określa ścieżkę do otwarzacza plików dźwiękowych\n" " -w, --word=SŁOWO rozpoczyna pracę od definicji danego słowa\n" " -A, --audio=URZĄDZENIE określa domyślne urządzenie dźwiękowe\n" " -V, --version wyświetla wersję programu\n" " -h, --help wyświetla tą informację\n" "\n" #: src/ydpconfig.c:246 #, c-format msgid "Error in config file, line %d: %s\n" msgstr "Błąd w pliku konfiguracyjnym, linia %d: %s\n" #: src/ydpdict.c:115 msgid "{\\b Grammatical qualifiers}{\\par\\pard}" msgstr "{\\b Kwalifikatory gramatyczne}{\\par\\pard}" #: src/ydpdict.c:119 msgid "abbreviation" msgstr "skrót" #: src/ydpdict.c:120 msgid "accusative" msgstr "biernik" #: src/ydpdict.c:121 msgid "adjective" msgstr "przymiotnik" #: src/ydpdict.c:122 msgid "adverb" msgstr "przysłówek" #: src/ydpdict.c:123 msgid "article" msgstr "przedimek" #: src/ydpdict.c:124 msgid "attribute" msgstr "przydawka" #: src/ydpdict.c:125 msgid "auxiliary" msgstr "posiłkowy" #: src/ydpdict.c:126 msgid "comparative degree" msgstr "stopień wyższy" #: src/ydpdict.c:127 msgid "complement" msgstr "dopełnienie" #: src/ydpdict.c:128 msgid "conjunction" msgstr "spójnik" #: src/ydpdict.c:129 msgid "compound" msgstr "złożony" #: src/ydpdict.c:130 msgid "dative" msgstr "celownik" #: src/ydpdict.c:131 msgid "definite" msgstr "określony" #: src/ydpdict.c:132 msgid "declined" msgstr "odmieniany" #: src/ydpdict.c:133 msgid "diminutive" msgstr "zdrobnienie" #: src/ydpdict.c:134 msgid "exclamation" msgstr "wykrzyknik" #: src/ydpdict.c:135 msgid "feminine" msgstr "rodzaj żeński" #: src/ydpdict.c:136 msgid "figurative" msgstr "przenośny" #: src/ydpdict.c:137 msgid "formal" msgstr "oficjalny" #: src/ydpdict.c:138 msgid "fused" msgstr "złożony" #: src/ydpdict.c:139 msgid "genitive" msgstr "dopełniacz" #: src/ydpdict.c:140 src/ydpdict.c:141 msgid "imperfective" msgstr "niedokonany" #: src/ydpdict.c:142 msgid "impersonal" msgstr "bezosobowy" #: src/ydpdict.c:143 msgid "indefinite" msgstr "nieokreślony" #: src/ydpdict.c:144 src/ydpdict.c:168 msgid "informal" msgstr "potoczny" #: src/ydpdict.c:145 msgid "infinitive" msgstr "bezokolicznik" #: src/ydpdict.c:146 msgid "instrumental" msgstr "narzędnik" #: src/ydpdict.c:147 msgid "invariable" msgstr "nieodmienny" #: src/ydpdict.c:148 msgid "irregular" msgstr "nieregularny" #: src/ydpdict.c:149 src/ydpdict.c:150 msgid "literary" msgstr "książkowy" #: src/ydpdict.c:151 msgid "locative" msgstr "miejscownik" #: src/ydpdict.c:152 msgid "masculine" msgstr "rodzaj męski" #: src/ydpdict.c:153 msgid "modal" msgstr "modalny" #: src/ydpdict.c:154 msgid "noun" msgstr "rzeczownik" #: src/ydpdict.c:155 msgid "nominative" msgstr "mianownik" #: src/ydpdict.c:156 msgid "noun plural" msgstr "rzeczownik mnogi" #: src/ydpdict.c:157 msgid "neuter" msgstr "rodzaj nijaki" #: src/ydpdict.c:158 msgid "numeral" msgstr "liczebnik" #: src/ydpdict.c:159 msgid "non-virile gender" msgstr "rodzaj niemęskoosobowy" #: src/ydpdict.c:160 msgid "old" msgstr "dawny" #: src/ydpdict.c:161 msgid "particle" msgstr "partykuła" #: src/ydpdict.c:162 msgid "pejorative" msgstr "pejoratywny" #: src/ydpdict.c:163 msgid "perfective" msgstr "dokonany" #: src/ydpdict.c:164 msgid "plural" msgstr "liczba mnoga" #: src/ydpdict.c:165 msgid "polite" msgstr "uprzejmy" #: src/ydpdict.c:166 msgid "possesive" msgstr "dzierżawczy" #: src/ydpdict.c:167 msgid "postposition" msgstr "postpozycja" #: src/ydpdict.c:169 msgid "past participle" msgstr "imiesłów bierny" #: src/ydpdict.c:170 msgid "prefix" msgstr "przedrostek" #: src/ydpdict.c:171 msgid "predicate" msgstr "orzeczenie" #: src/ydpdict.c:172 msgid "preposition" msgstr "przyimek" #: src/ydpdict.c:173 msgid "pronoun" msgstr "zaimek" #: src/ydpdict.c:174 msgid "past simple" msgstr "czas przeszły prosty" #: src/ydpdict.c:175 msgid "singular" msgstr "liczba pojedyncza" #: src/ydpdict.c:176 msgid "suffix" msgstr "przyrostek" #: src/ydpdict.c:177 msgid "superlative degree" msgstr "stopień najwyższy" #: src/ydpdict.c:178 msgid "verb" msgstr "czasownik" #: src/ydpdict.c:179 msgid "intransitive verb" msgstr "czasownik nieprzechodni" #: src/ydpdict.c:180 msgid "virile gender" msgstr "rodzaj męskoosobowy" #: src/ydpdict.c:181 msgid "vocative" msgstr "wołacz" #: src/ydpdict.c:182 msgid "reflexive verb" msgstr "czasownik zwrotny" #: src/ydpdict.c:183 msgid "transitive verb" msgstr "czasownik przechodni" #: src/ydpdict.c:190 msgid "{\\b Help}{\\pard\\pard}" msgstr "{\\b Pomoc}{\\par\\pard}" #: src/ydpdict.c:191 msgid "{\\cf2 F1} or {\\cf2 ?} - this help" msgstr "{\\cf2 F1} lub {\\cf2 ?} - wyświetl pomoc" #: src/ydpdict.c:192 msgid "{\\line{\\cf2 Tab} - change focus}" msgstr "{\\line{\\cf2 Tab} - przełącz panel}" #: src/ydpdict.c:193 msgid "{\\line{\\cf2 Up} and {\\cf2 Down} - scroll up and down}" msgstr "{\\line{\\cf2 Up} i {\\cf2 Down} - przewiń w górę i w dół}" #: src/ydpdict.c:194 msgid "{\\line{\\cf2 Page Up} and {\\cf2 Page Down} - scroll page up and down}" msgstr "{\\line{\\cf2 Page Up} i {\\cf2 Page Down} - przewiń stronę}" #: src/ydpdict.c:195 msgid "{\\line{\\cf2 F2} or {\\cf2 `} - play pronunciation sample}" msgstr "{\\line{\\cf2 F2} lub {\\cf2 `} - odtwórz próbkę wymowy}" #: src/ydpdict.c:196 msgid "{\\line{\\cf2 F3} or {\\cf2 <} - English-Polish dictionary}" msgstr "{\\line{\\cf2 F3} lub {\\cf2 <} - słownik angielsko-polski}" #: src/ydpdict.c:197 msgid "{\\line{\\cf2 F4} or {\\cf2 >} - Polish-English dictionary}" msgstr "{\\line{\\cf2 F4} lub {\\cf2 >} - słownik polsko-angielski}" #: src/ydpdict.c:198 msgid "{\\line{\\cf2 F5} or {\\cf2 [} - German-Polish dictionary}" msgstr "{\\line{\\cf2 F5} lub {\\cf2 [} - słownik niemiecko-polski}" #: src/ydpdict.c:199 msgid "{\\line{\\cf2 F6} or {\\cf2 ]} - Polish-German dictionary}" msgstr "{\\line{\\cf2 F6} lub {\\cf2 ]} - słownik polsko-niemiecki}" #: src/ydpdict.c:200 msgid "{\\line{\\cf2 F7} or {\\cf2 !} - grammatical qualifiers}" msgstr "{\\line{\\cf2 F7} lub {\\cf2 !} - kwalifikatory gramatyczne}" #: src/ydpdict.c:201 msgid "{\\line{\\cf2 Esc} - go back}" msgstr "{\\line{\\cf2 Esc} - cofnij}" #: src/ydpdict.c:202 msgid "{\\line{\\cf2 Ctrl-U} or {\\cf2 Ctrl-W} - clear input field}" msgstr "{\\line{\\cf2 Ctrl-U} lub {\\cf2 Ctrl-W} - wyczyść pole tekstowe}" #: src/ydpdict.c:203 msgid "{\\line{\\cf2 Ctrl-L} - refresh display}" msgstr "{\\line{\\cf2 Ctrl-L} - odśwież ekran}" #: src/ydpdict.c:204 msgid "{\\line{\\cf2 Ctrl-C} or {\\cf2 Ctrl-X} - quit program}" msgstr "{\\line{\\cf2 Ctrl-C} lub {\\cf2 Ctrl-X} - zakończ program}" #: src/ydpdict.c:207 #, c-format msgid "" "{\\par\\pard}Contact: {\\b %s}. Current version is always available at {\\b " "%s}" msgstr "" "{\\par\\pard}Kontakt: {\\b %s}. Aktualna wersja dostępna pod adresem {\\b %s}" #: src/ydpdict.c:731 msgid "Please wait, loading the dictionary..." msgstr "Proszę czekać, trwa ładowanie..." #: src/ydpdict.c:757 msgid "Invalid file format" msgstr "Niepoprawny format pliku" #: src/ydpdict.c:761 #, c-format msgid "" "{\\cf2 Error!}\\par\\pard{Unable to open dictionary: %s. Press {\\cf2 F1} or " "{\\cf2 ?} for help.}" msgstr "" "{\\cf2 Błąd!}\\par\\pard{Nie można otworzyć słownika: %s. Pomoc dostępna pod " "klawiszami {\\cf2 F1} lub {\\cf2 ?}.}" ydpdict-1.0.2+1.0.3/po/quot.sed000066400000000000000000000002311225140023200156730ustar00rootroot00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g ydpdict-1.0.2+1.0.3/po/remove-potcdate.sed000066400000000000000000000000721225140023200200040ustar00rootroot00000000000000/^"POT-Creation-Date: .*"$/{ x s/P/P/ ta g d bb :a x :b } ydpdict-1.0.2+1.0.3/po/remove-potcdate.sin000066400000000000000000000006601225140023200200250ustar00rootroot00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } ydpdict-1.0.2+1.0.3/src/000077500000000000000000000000001225140023200143635ustar00rootroot00000000000000ydpdict-1.0.2+1.0.3/src/Makefile.am000066400000000000000000000004401225140023200164150ustar00rootroot00000000000000bin_PROGRAMS = ydpdict ydpdict_SOURCES = ydpconfig.c ydpconfig.h ydpsound.c ydpsound.h ydpdict.c xmalloc.c xmalloc.h adpcm.c adpcm.h ydpdict_CFLAGS = -Wall @CFLAGS@ @YDPDICT_CFLAGS@ @AO_CFLAGS@ -DSYSCONFDIR=\"@sysconfdir@\" ydpdict_LDADD = -lm @LIBS@ @YDPDICT_LIBS@ @AO_LIBS@ @LTLIBINTL@ ydpdict-1.0.2+1.0.3/src/adpcm.c000066400000000000000000000347141225140023200156240ustar00rootroot00000000000000/* * adpcm.c codex functions for MS_ADPCM data * (hopefully) provides interoperability with * Microsoft's ADPCM format, but, as usual, * see LACK-OF-WARRANTY information below. * * Copyright (C) 1999 Stanley J. Brooks * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ /* * November 22, 1999 * specs I've seen are unclear about ADPCM supporting more than 2 channels, * but these routines support more channels in a manner which looks (IMHO) * like the most natural extension. * * Remark: code still turbulent, encoding very new. * */ #include #include #include // Modifications by Wojtek Kaniewski below: //#include "stconfig.h" // End of modifications #include "adpcm.h" typedef struct MsState { st_sample_t step; /* step size */ short iCoef[2]; } MsState_t; #define lsbshortldi(x,p) { (x)=((short)((int)(p)[0] + ((int)(p)[1]<<8))); (p) += 2; } /* * Lookup tables for MS ADPCM format */ /* these are step-size adjust factors, where * 1.0 is scaled to 0x100 */ static const st_sample_t stepAdjustTable[] = { 230, 230, 230, 230, 307, 409, 512, 614, 768, 614, 512, 409, 307, 230, 230, 230 }; /* TODO : The first 7 iCoef sets are always hardcoded and must appear in the actual WAVE file. They should be read in in case a sound program added extras to the list. */ const short iCoef[7][2] = { { 256, 0}, { 512,-256}, { 0, 0}, { 192, 64}, { 240, 0}, { 460,-208}, { 392,-232} }; inline st_sample_t AdpcmDecode(st_sample_t c, MsState_t *state, st_sample_t sample1, st_sample_t sample2) { st_sample_t vlin; st_sample_t sample; st_sample_t step; /** Compute next step value **/ step = state->step; { st_sample_t nstep; nstep = (stepAdjustTable[c] * step) >> 8; state->step = (nstep < 16)? 16:nstep; } /** make linear prediction for next sample **/ vlin = ((sample1 * state->iCoef[0]) + (sample2 * state->iCoef[1])) >> 8; /** then add the code*step adjustment **/ c -= (c & 0x08) << 1; sample = (c * step) + vlin; if (sample > 0x7fff) sample = 0x7fff; else if (sample < -0x8000) sample = -0x8000; return (sample); } /* AdpcmBlockExpandI() outputs interleaved samples into one output buffer */ const char *AdpcmBlockExpandI( int chans, /* total channels */ int nCoef, const short *iCoef, const unsigned char *ibuff,/* input buffer[blockAlign] */ SAMPL *obuff, /* output samples, n*chans */ int n /* samples to decode PER channel */ ) { const unsigned char *ip; int ch; const char *errmsg = NULL; MsState_t state[4]; /* One decompressor state for each channel */ /* Read the four-byte header for each channel */ ip = ibuff; for (ch = 0; ch < chans; ch++) { unsigned char bpred = *ip++; if (bpred >= nCoef) { errmsg = "MSADPCM bpred >= nCoef, arbitrarily using 0\n"; bpred = 0; } state[ch].iCoef[0] = iCoef[(int)bpred*2+0]; state[ch].iCoef[1] = iCoef[(int)bpred*2+1]; } for (ch = 0; ch < chans; ch++) lsbshortldi(state[ch].step, ip); /* sample1's directly into obuff */ for (ch = 0; ch < chans; ch++) lsbshortldi(obuff[chans+ch], ip); /* sample2's directly into obuff */ for (ch = 0; ch < chans; ch++) lsbshortldi(obuff[ch], ip); { int ch; unsigned char b; short *op, *top, *tmp; /* already have 1st 2 samples from block-header */ op = obuff + 2*chans; top = obuff + n*chans; ch = 0; while (op < top) { b = *ip++; tmp = op; *op++ = AdpcmDecode(b >> 4, state+ch, tmp[-chans], tmp[-2*chans]); if (++ch == chans) ch = 0; /* ch = ++ch % chans; */ tmp = op; *op++ = AdpcmDecode(b&0x0f, state+ch, tmp[-chans], tmp[-2*chans]); if (++ch == chans) ch = 0; /* ch = ++ch % chans; */ } } return errmsg; } static int AdpcmMashS( int ch, /* channel number to encode, REQUIRE 0 <= ch < chans */ int chans, /* total channels */ SAMPL v[2], /* values to use as starting 2 */ const short iCoef[2],/* lin predictor coeffs */ const SAMPL *ibuff, /* ibuff[] is interleaved input samples */ int n, /* samples to encode PER channel */ int *iostep, /* input/output step, REQUIRE 16 <= *st <= 0x7fff */ unsigned char *obuff, /* output buffer[blockAlign], or NULL for no output */ int sho /* nonzero for debug printout */ ) { const SAMPL *ip, *itop; unsigned char *op; int ox = 0; /* */ int i, d, v0, v1, step; double d2; /* long long is okay also, speed abt the same */ ip = ibuff + ch; /* point ip to 1st input sample for this channel */ itop = ibuff + n*chans; v0 = v[0]; v1 = v[1]; d = *ip - v1; ip += chans; /* 1st input sample for this channel */ d2 = d*d; /* d2 will be sum of squares of errors, given input v0 and *st */ d = *ip - v0; ip += chans; /* 2nd input sample for this channel */ d2 += d*d; step = *iostep; op = obuff; /* output pointer (or NULL) */ if (op) { /* NULL means don't output, just compute the rms error */ op += chans; /* skip bpred indices */ op += 2*ch; /* channel's stepsize */ op[0] = step; op[1] = step>>8; op += 2*chans; /* skip to v0 */ op[0] = v0; op[1] = v0>>8; op += 2*chans; /* skip to v1 */ op[0] = v1; op[1] = v1>>8; op = obuff+7*chans; /* point to base of output nibbles */ ox = 4*ch; } for (i = 0; ip < itop; ip+=chans) { int vlin,d,dp,c; /* make linear prediction for next sample */ vlin = (v0 * iCoef[0] + v1 * iCoef[1]) >> 8; d = *ip - vlin; /* difference between linear prediction and current sample */ dp = d + (step<<3) + (step>>1); c = 0; if (dp>0) { c = dp/step; if (c>15) c = 15; } c -= 8; dp = c * step; /* quantized estimate of samp - vlin */ c &= 0x0f; /* mask to 4 bits */ v1 = v0; /* shift history */ v0 = vlin + dp; if (v0<-0x8000) v0 = -0x8000; else if (v0>0x7fff) v0 = 0x7fff; d = *ip - v0; d2 += d*d; /* update square-error */ if (op) { /* if we want output, put it in proper place */ /* FIXME: does c<<0 work properly? */ op[ox>>3] |= (ox&4)? c:(c<<4); ox += 4*chans; /* if (sho) fprintf(stderr,"%.1x",c); */ } /* Update the step for the next sample */ step = (stepAdjustTable[c] * step) >> 8; if (step < 16) step = 16; } /* if (sho && op) fprintf(stderr,"\n");*/ d2 /= n; /* be sure it's non-negative */ #ifdef DEBUG if (sho) { fprintf(stderr, "ch%d: st %d->%d, d %.1f\n", ch, *iostep, step, sqrt(d2)); fflush(stderr); } #endif *iostep = step; return (int) sqrt(d2); } #if 0 static long AvgDelta(int ch, int chans, const SAMPL *ibuff, int n) { const SAMPL *ip, *itop; long v0; long d1; ip = ibuff + ch; itop = ip + n*chans; d1 = 0; v0 = *ip; ip += chans; for ( ; ip < itop; ip+=chans) { long v1; v1 = *ip; d1 = abs(v1-v0); v0 = v1; } return (d1/(n-1)); } static long ReAvgDelta(int ch, int chans, const SAMPL *ibuff, int n, int step) { const SAMPL *ip, *itop; long v0; long d1; ip = ibuff + ch; itop = ip + n*chans; d1 = 0; v0 = *ip; ip += chans; for ( ; ip < itop; ip+=chans) { long v1, c; v1 = *ip; c = abs(v1-v0); if (step && c>2*step) c=2*step; d1 += c; v0 = v1; } return (d1/(n-1)); } #endif inline void AdpcmMashChannel( int ch, /* channel number to encode, REQUIRE 0 <= ch < chans */ int chans, /* total channels */ const SAMPL *ip, /* ip[] is interleaved input samples */ int n, /* samples to encode PER channel, REQUIRE */ int *st, /* input/output steps, 16<=st[i] */ unsigned char *obuff, /* output buffer[blockAlign] */ int opt /* non-zero allows some cpu-intensive code to improve output */ ) { SAMPL v[2]; int n0,s0,s1,ss,smin; int d,dmin,k,kmin; n0 = n/2; if (n0>32) n0=32; #if 0 s0=ReAvgDelta(ch, chans, ip, n, 0); s1=ReAvgDelta(ch, chans, ip, n, s0); fprintf(stderr, "ReAvg%d: %d->%d (%d)\n", ch, s0,s1,*st); fflush(stderr); #endif if (*st<16) *st = 16; v[1] = ip[ch]; v[0] = ip[ch+chans]; dmin = 0; kmin = 0; smin = 0; /* for each of 7 standard coeff sets, we try compression * beginning with last step-value, and with slightly * forward-adjusted step-value, taking best of the 14 */ for (k=0; k<7; k++) { int d0,d1; ss = s0 = *st; d0=AdpcmMashS(ch, chans, v, iCoef[k], ip, n, &ss, NULL, 0); /* with step s0 */ s1 = s0; AdpcmMashS(ch, chans, v, iCoef[k], ip, n0, &s1, NULL, 0); /* fprintf(stderr," s32 %d\n",s1); */ ss = s1 = (3*s0+s1)/4; d1=AdpcmMashS(ch, chans, v, iCoef[k], ip, n, &ss, NULL, 0); /* with step s1 */ if (!k || d0= 7*chans + chans*(n-2)/2.0 */ int opt /* non-zero allows some cpu-intensive code to improve output */ ) { int ch; unsigned char *p; /*fprintf(stderr,"AdpcmMashI(chans %d, ip %p, n %d, st %p, obuff %p, bA %d)\n", chans, ip, n, st, obuff, blockAlign);*/ for (p=obuff+7*chans; p= 7*chans) { m -= 7*chans; /* bytes beyond block-header */ m = (2*m)/chans + 2; /* nibbles/chans + 2 in header */ if (samplesPerBlock && m > samplesPerBlock) m = samplesPerBlock; n += m; } return n; /* wSamplesPerBlock = 2*(wBlockAlign - 7*wChannels)/wChannels + 2; */ } st_size_t AdpcmBytesPerBlock( unsigned short chans, unsigned short samplesPerBlock ) { st_size_t n; n = 7*chans; /* header */ if (samplesPerBlock > 2) n += (((st_size_t)samplesPerBlock-2)*chans + 1)/2; return n; } ydpdict-1.0.2+1.0.3/src/adpcm.h000066400000000000000000000037461225140023200156320ustar00rootroot00000000000000/* * adpcm.h */ // Modifications by Wojtek Kaniewski below: //#include "st.h" #include typedef int32_t st_sample_t; typedef uint32_t st_size_t; typedef int32_t st_ssize_t; typedef uint32_t st_rate_t; // End of modifications #ifndef SAMPL #define SAMPL short #endif /* default coef sets */ extern const short iCoef[7][2]; /* AdpcmBlockExpandI() outputs interleaved samples into one output buffer */ extern const char *AdpcmBlockExpandI( int chans, /* total channels */ int nCoef, const short *iCoef, const unsigned char *ibuff,/* input buffer[blockAlign] */ SAMPL *obuff, /* output samples, n*chans */ int n /* samples to decode PER channel, REQUIRE n % 8 == 1 */ ); extern void AdpcmBlockMashI( int chans, /* total channels */ const SAMPL *ip, /* ip[n*chans] is interleaved input samples */ int n, /* samples to encode PER channel, REQUIRE */ int *st, /* input/output steps, 16<=st[i] */ unsigned char *obuff, /* output buffer[blockAlign] */ int blockAlign, /* >= 7*chans + n/2 */ int opt /* non-zero allows some cpu-intensive code to improve output */ ); /* Some helper functions for computing samples/block and blockalign */ /* * AdpcmSamplesIn(dataLen, chans, blockAlign, samplesPerBlock) * returns the number of samples/channel which would be * in the dataLen, given the other parameters ... * if input samplesPerBlock is 0, then returns the max * samplesPerBlock which would go into a block of size blockAlign * Yes, it is confusing usage. */ extern st_size_t AdpcmSamplesIn( st_size_t dataLen, unsigned short chans, unsigned short blockAlign, unsigned short samplesPerBlock ); /* * st_size_t AdpcmBytesPerBlock(chans, samplesPerBlock) * return minimum blocksize which would be required * to encode number of chans with given samplesPerBlock */ extern st_size_t AdpcmBytesPerBlock( unsigned short chans, unsigned short samplesPerBlock ); ydpdict-1.0.2+1.0.3/src/config.h.in000066400000000000000000000001161225140023200164040ustar00rootroot00000000000000#undef WORDS_BIGENDIAN #undef HAVE_LINUX_SOUNDCARD_H #undef HAVE_GETOPT_LONG ydpdict-1.0.2+1.0.3/src/xmalloc.c000066400000000000000000000043211225140023200161660ustar00rootroot00000000000000/* * ydpdict * (C) Copyright 2001-2007 Wojtek Kaniewski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #ifdef ENABLE_NLS #include #define _(x) gettext(x) #else #define _(x) x #endif extern int show_error(const char *msg); /** * \bried calloc() with error handling * * \param nmemb member count * \param size member size * * \return Allocated buffer */ void *xcalloc(size_t nmemb, size_t size) { void *tmp = calloc(nmemb, size); if (!tmp) show_error(_("Out of memory")); return tmp; } /** * \bried malloc() with error handling and zeroing * * \param size buffer size * * \return Allocated buffer */ void *xmalloc(size_t size) { void *tmp = malloc(size); if (!tmp) show_error(_("Out of memory")); memset(tmp, 0, size); return tmp; } /** * \brief free() with error handling * * \param ptr pointer to be freed */ void xfree(void *ptr) { if (ptr) free(ptr); } /** * \brief realloc() with error handling * * \param ptr pointer to be reallocated * \param size new size * * \return Allocated buffer */ void *xrealloc(void *ptr, size_t size) { void *tmp = realloc(ptr, size); if (!tmp) show_error(_("Out of memory")); return tmp; } /** * \brief strdup() with error handling * * \param s string to be duplicated * * \return Allocated buffer */ char *xstrdup(const char *s) { char *tmp; if (!s) return NULL; if (!(tmp = strdup(s))) show_error(_("Out of memory")); return tmp; } ydpdict-1.0.2+1.0.3/src/xmalloc.h000066400000000000000000000017331225140023200161770ustar00rootroot00000000000000/* * ydpdict * (C) Copyright 2001-2007 Wojtek Kaniewski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __XMALLOC_H #define __XMALLOC_H #include void *xcalloc(size_t nmemb, size_t size); void *xmalloc(size_t size); void xfree(void *ptr); void *xrealloc(void *ptr, size_t size); char *xstrdup(const char *s); #endif /* __XMALLOC_H */ ydpdict-1.0.2+1.0.3/src/ydpconfig.c000066400000000000000000000165111225140023200165150ustar00rootroot00000000000000/* * ydpdict * (C) Copyright 1998-2007 Wojtek Kaniewski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #define _XOPEN_SOURCE_EXTENDED #ifdef HAVE_NCURSESW_NCURSES_H # include #else # ifdef HAVE_CURSES_H # include # endif #endif #include #ifdef HAVE_GETOPT_LONG #include #endif #include #include #include #include #include "ydpconfig.h" #include "xmalloc.h" #ifdef ENABLE_NLS #include #define _(x) gettext(x) #else #define _(x) x #endif char *config_path = NULL; char *config_cdpath = NULL; char *config_player = NULL; char *config_word = NULL; int config_dict = 0; int config_color = 1; int config_transparent = 0; int config_text = COLOR_WHITE; int config_cf1 = COLOR_CYAN | A_BOLD; int config_cf2 = COLOR_GREEN | A_BOLD; #ifdef HAVE_GETOPT_LONG static struct option const longopts[] = { { "help", no_argument, 0, 'h' }, { "version", no_argument, 0, 'V' }, { "eng", no_argument, 0, 'e' }, { "pol", no_argument, 0, 'p' }, { "pol-ger", no_argument, 0, 'o' }, { "ger-pol", no_argument, 0, 'g' }, { "path", required_argument, 0, 'f' }, { "cdpath", required_argument, 0, 'c' }, { "player", required_argument, 0, 'P' }, { "word", required_argument, 0, 'w'}, { "audio", required_argument, 0, 'A'}, { 0, 0, 0, 0 } }; #endif /* HAVE_GETOPT_LONG */ /** * \brief Prints usage instructions * * \param argv0 argv[0] from main() */ void usage(const char *argv0) { printf(_( "Usage: %s [OPTIONS]\n" " -e, --eng start with English-Polish dictionary (default)\n" " -p, --pol start with Polish-English dictionary\n" " -g, --ger-pol start with German-Polish dictionary\n" " -o, --pol-ger start with Polish-German dictionary\n" " -f, --path=PATH set database path\n" " -c, --cdpath=PATH set CD-ROM path\n" " -P, --player=PATH set sound player path\n" " -w, --word=WORD start with selected WORD's definition\n" " -A, --audio=DEVICE set default audio device\n" " -V, --version print program version\n" " -h, --help print this message\n" "\n"), argv0); } enum config_entry_type { ENTRY_COLOR = 1, ENTRY_BOOL, ENTRY_STRING, ENTRY_INT }; struct config_entry { int type; const char *label; void *ptr; } entries[] = { { ENTRY_COLOR, "Color", &config_text }, { ENTRY_COLOR, "DefinitionColor", &config_cf1 }, { ENTRY_COLOR, "InformationColor", &config_cf2 }, { ENTRY_BOOL, "UseColor", &config_color }, { ENTRY_STRING, "Path", &config_path }, { ENTRY_STRING, "CDPath", &config_cdpath }, { ENTRY_STRING, "Player", &config_player }, { ENTRY_STRING, "AudioDevice", &config_audio }, { ENTRY_INT, "DefaultDictionary", &config_dict }, { ENTRY_BOOL, "UseTransparent", &config_transparent }, { 0, NULL, NULL } }; struct color_entry { const char *name; int value; } colors[] = { { "Black", COLOR_BLACK }, { "Red", COLOR_RED }, { "Greed", COLOR_GREEN }, { "Brown", COLOR_YELLOW }, { "Blue", COLOR_BLUE }, { "Magenta", COLOR_MAGENTA }, { "Cyan", COLOR_CYAN }, { "White", COLOR_WHITE }, { "Gray", COLOR_WHITE | A_DIM }, { "LightRed", COLOR_RED }, { "LightGreed", COLOR_GREEN | A_BOLD }, { "Yellow", COLOR_YELLOW | A_BOLD }, { "LightBlue", COLOR_BLUE | A_BOLD }, { "LightMagenta", COLOR_MAGENTA | A_BOLD }, { "LightCyan", COLOR_CYAN | A_BOLD }, { "LightWhite", COLOR_WHITE | A_BOLD }, { NULL, 0 } }; /** * \brief Reads configuration from file, then handles program arguments * * \param argc argc passed from main() * \param argv argv passed from main() * * \return 0 on success, -1 on failure */ int read_config(int argc, char **argv) { char buf[4096], *home; int line = 0, optc; FILE *f = NULL; /* Check if any of the config files exist */ home = getenv("HOME"); if (home) { snprintf(buf, sizeof(buf), "%s/%s", home, CONFIGFILE_CWD1); f = fopen(buf, "r"); if (!f) { snprintf(buf, sizeof(buf), "%s/%s", home, CONFIGFILE_CWD2); f = fopen(buf, "r"); } } if (!f) f = fopen(CONFIGFILE_GLOBAL, "r"); if (!f) return -1; /* Parse every line */ while (fgets(buf, sizeof(buf), f)) { int len, i; line++; len = strlen(buf); if (len && buf[len - 1] == '\n') buf[--len] = 0; if (len && buf[len - 1] == '\r') buf[--len] = 0; if (!len || buf[0] == '#') continue; for (i = 0; entries[i].label; i++) { const char *value; len = strlen(entries[i].label); if (strncasecmp(buf, entries[i].label, len) || !buf[len]) continue; value = buf + len + 1; switch (entries[i].type) { case ENTRY_COLOR: { int j; for (j = 0; colors[j].name; j++) { if (!strcasecmp(value, colors[j].name)) *(int*)(entries[i].ptr) = colors[j].value; } break; } case ENTRY_BOOL: if (!strncasecmp(value, "on", 2)) *(int*)(entries[i].ptr) = 1; if (!strncasecmp(value, "off", 2)) *(int*)(entries[i].ptr) = 0; break; case ENTRY_STRING: if (*(char**)(entries[i].ptr)) xfree(*(char**)entries[i].ptr); *(char**)(entries[i].ptr) = xstrdup(value); break; case ENTRY_INT: *(int*)(entries[i].ptr) = atoi(value); break; } break; } if (!entries[i].label) { fprintf(stderr, _("Error in config file, line %d: %s\n"), line, buf); exit(1); } } fclose(f); #ifdef HAVE_GETOPT_LONG while ((optc = getopt_long(argc, argv, "hvVpeogf:c:w:A:", longopts, (int*) 0)) != -1) { #else while ((optc = getopt(argc, argv, "hvVpeogf:c:w:A:")) != -1) { #endif switch(optc) { case 'h': usage(argv[0]); exit(0); case 'v': case 'V': printf("ydpdict-" VERSION "\n"); exit(0); case 'e': config_dict = 0; break; case 'p': config_dict = 1; break; case 'g': config_dict = 2; break; case 'o': config_dict = 3; break; case 'f': if (config_path) xfree(config_path); config_path = xstrdup(optarg); break; case 'c': if (config_cdpath) xfree(config_cdpath); config_cdpath = xstrdup(optarg); break; case 'P': if (config_path) xfree(config_path); config_path = xstrdup(optarg); break; case 'w': if (config_word) xfree(config_word); config_word = xstrdup(optarg); break; case 'A': if (config_audio) xfree(config_audio); config_audio = xstrdup(optarg); break; default: usage(argv[0]); exit(1); } } if (!config_path) config_path = xstrdup(DEFAULT_PATH); if (!config_cdpath) config_cdpath = xstrdup(DEFAULT_CDPATH); #ifdef DEFAULT_AUDIO if (!config_audio) config_audio = xstrdup(DEFAULT_AUDIO); #endif return 0; } ydpdict-1.0.2+1.0.3/src/ydpconfig.h000066400000000000000000000036301225140023200165200ustar00rootroot00000000000000/* * ydpdict * (C) Copyright 1998-2008 Wojtek Kaniewski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __YDPCONFIG_H #define __YDPCONFIG_H #ifdef HAVE_CONFIG_H #include "config.h" #endif #define HEADER_NAME "ydpdict-" VERSION #define HEADER_COPYRIGHT "(C) Copyright 1998-2011 Wojtek Kaniewski" #define HELP_EMAIL "wojtekka@toxygen.net" #define HELP_WEBSITE "http://toxygen.net/ydpdict/" #define CONFIGFILE_GLOBAL SYSCONFDIR "/ydpdict.conf" #define CONFIGFILE_CWD1 "ydpdict.conf" #define CONFIGFILE_CWD2 ".ydpdictrc" #define DEFAULT_PATH "." #define DEFAULT_CDPATH "/media/cdrom" #ifndef HAVE_LIBAO #define DEFAULT_AUDIO "/dev/dsp" #endif #define DEFAULT_DAT_AP "dict100.dat" #define DEFAULT_IDX_AP "dict100.idx" #define DEFAULT_DAT_PA "dict101.dat" #define DEFAULT_IDX_PA "dict101.idx" #define DEFAULT_DAT_DP "dict200.dat" #define DEFAULT_IDX_DP "dict200.idx" #define DEFAULT_DAT_PD "dict201.dat" #define DEFAULT_IDX_PD "dict201.idx" #define INPUT_LEN 17 char *config_path; char *config_cdpath; char *config_player; char *config_word; char *config_audio; int config_dict; int config_color; int config_transparent; int config_text; int config_cf1; int config_cf2; int read_config(int argc, char **argv); #endif /* __YDPCONFIG_H */ ydpdict-1.0.2+1.0.3/src/ydpdict.c000066400000000000000000000703301225140023200161720ustar00rootroot00000000000000/* * ydpdict * (C) Copyright 1998-2011 Wojtek Kaniewski * Piotr Domagalski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #define _XOPEN_SOURCE_EXTENDED #ifdef HAVE_NCURSESW_NCURSES_H # include #else # ifdef HAVE_CURSES_H # include # endif #endif #include #include #include #include #include #include #include #include #include #include #ifdef ENABLE_NLS #include #define _(x) gettext(x) #else #define _(x) x #endif #define N_(x) x #ifdef HAVE_LOCALE_H #include #endif #ifdef HAVE_LIBAO #include #endif #include "ydpconfig.h" #include "ydpsound.h" #include "xmalloc.h" #if defined(YDPDICT_VERSION) && defined(YDPDICT_MAKE_VERSION) #if YDPDICT_VERSION >= YDPDICT_MAKE_VERSION(1,0,3) #define YDPDICT_HAS_SUPERSCRIPT #endif #endif #ifndef COLOR_DEFAULT #define COLOR_DEFAULT (-1) #endif ydpdict_t *dict; ///< Dictionary handle int word_count; ///< Dictionary word count wchar_t input[INPUT_LEN + 1]; ///< Input word int input_index; ///< Input word cursor index int input_exact = 1; ///< Input word Exact match flag int list_index; ///< Word list scroll line index int list_page; ///< Word list scroll page int focus; ///< Current focus (0 - word list, 1 - word definition, 2 - help screen) int saved_focus; ///< focus stored while showing help etc. char *def; ///< Current definition int def_encoding; ///< Definition encoding int def_index; ///< Definition scroll line index int def_saved_index; ///< def_index stored while showing help etc. int def_height; ///< Definition height in lines int def_update; ///< Definition update flag int def_raw_rtf; ///< Display raw RTF flag int screen_width; ///< Screen width int screen_height; ///< Screen height int resized_term; ///< Terminal resize flag WINDOW *window_word; ///< Wordlist window WINDOW *window_def; ///< Definition window WINDOW *window_header; ///< Header window WINDOW *window_sep; ///< Separator window WINDOW *window_arrows; ///< Arrows window #define ATTR_HIDE 0x10000 ///< Private attribute to indicate hidden text #define ATTR_SUPER 0x20000 ///< Private attribute to indicate superscript #define ATTR_MASK 0x30000 int color_text; int color_cf1; int color_cf2; const char *qualifiers_header = N_("{\\b Grammatical qualifiers}{\\par\\pard}"); const char *qualifiers[][2] = { { "abbr", N_("abbreviation") }, { "acc", N_("accusative") }, { "adj", N_("adjective") }, { "adv", N_("adverb") }, { "art", N_("article") }, { "attr", N_("attribute") }, { "aux", N_("auxiliary") }, { "comp", N_("comparative degree") }, { "compl.", N_("complement") }, { "conj", N_("conjunction") }, { "cpd", N_("compound") }, { "dat", N_("dative") }, { "def", N_("definite") }, { "decl", N_("declined") }, { "dimin", N_("diminutive") }, { "excl", N_("exclamation") }, { "f", N_("feminine") }, { "fig", N_("figurative") }, { "fml", N_("formal") }, { "fus", N_("fused") }, { "gen", N_("genitive") }, { "imp", N_("imperfective") }, { "imperf", N_("imperfective") }, { "impers", N_("impersonal") }, { "indef", N_("indefinite") }, { "inf", N_("informal") }, { "infin", N_("infinitive") }, { "instr", N_("instrumental") }, { "inv", N_("invariable") }, { "irreg", N_("irregular") }, { "ksi", N_("literary") }, { "liter.", N_("literary") }, { "loc", N_("locative") }, { "m", N_("masculine") }, { "modal", N_("modal") }, { "n", N_("noun") }, { "nom", N_("nominative") }, { "npl", N_("noun plural") }, { "nt", N_("neuter") }, { "num", N_("numeral") }, { "nvir", N_("non-virile gender") }, { "old", N_("old") }, { "part", N_("particle") }, { "pej", N_("pejorative") }, { "perf", N_("perfective") }, { "pl", N_("plural") }, { "polite", N_("polite") }, { "poss.", N_("possesive") }, { "post", N_("postposition") }, { "pot", N_("informal") }, { "pp", N_("past participle") }, { "pref", N_("prefix") }, { "pred", N_("predicate") }, { "prep", N_("preposition") }, { "pron", N_("pronoun") }, { "pt", N_("past simple") }, { "sg", N_("singular") }, { "suff", N_("suffix") }, { "superl", N_("superlative degree") }, { "vb", N_("verb") }, { "vi", N_("intransitive verb") }, { "vir", N_("virile gender") }, { "voc", N_("vocative") }, { "vr", N_("reflexive verb") }, { "vt", N_("transitive verb") }, }; const char *qualifiers_format = "{\\line{\\cf2 %s} {%s}}"; const char *help[] = { N_("{\\b Help}{\\pard\\pard}"), N_("{\\cf2 F1} or {\\cf2 ?} - this help"), N_("{\\line{\\cf2 Tab} - change focus}"), N_("{\\line{\\cf2 Up} and {\\cf2 Down} - scroll up and down}"), N_("{\\line{\\cf2 Page Up} and {\\cf2 Page Down} - scroll page up and down}"), N_("{\\line{\\cf2 F2} or {\\cf2 `} - play pronunciation sample}"), N_("{\\line{\\cf2 F3} or {\\cf2 <} - English-Polish dictionary}"), N_("{\\line{\\cf2 F4} or {\\cf2 >} - Polish-English dictionary}"), N_("{\\line{\\cf2 F5} or {\\cf2 [} - German-Polish dictionary}"), N_("{\\line{\\cf2 F6} or {\\cf2 ]} - Polish-German dictionary}"), N_("{\\line{\\cf2 F7} or {\\cf2 !} - grammatical qualifiers}"), N_("{\\line{\\cf2 Esc} - go back}"), N_("{\\line{\\cf2 Ctrl-U} or {\\cf2 Ctrl-W} - clear input field}"), N_("{\\line{\\cf2 Ctrl-L} - refresh display}"), N_("{\\line{\\cf2 Ctrl-C} or {\\cf2 Ctrl-X} - quit program}"), }; const char *help_footer = N_("{\\par\\pard}Contact: {\\b %s}. Current version is always available at {\\b %s}"); /** * \brief Exits program * * \param msg Error message or NULL if there is no error condition * * Cleans up a bit. */ void show_error(const char *msg) { if (window_word) delwin(window_word); if (window_header) delwin(window_header); if (window_sep) delwin(window_sep); if (window_def) delwin(window_def); if (window_arrows) delwin(window_arrows); werase(stdscr); wrefresh(stdscr); endwin(); if (dict) { ydpdict_close(dict); dict = NULL; } xfree(def); if (msg) fprintf(stderr, "%s\n\n", msg); #ifdef HAVE_LIBAO ao_shutdown(); #endif exit(msg ? 1 : 0); } /** * \brief SIGTERM handler. */ static void sigterm(int sig) { show_error(NULL); } /** * \brief Updates and redraws all ncurses windows */ void update_all(void) { wnoutrefresh(window_header); wnoutrefresh(window_sep); wnoutrefresh(window_def); wnoutrefresh(window_arrows); wnoutrefresh(window_word); doupdate(); } /** * \brief Creates and configures ncurses windows * * Configuration also means filling the header and separator window */ void create_windows(void) { int i; /* Destroy windows */ if (window_word) delwin(window_word); if (window_def) delwin(window_def); if (window_header) delwin(window_header); if (window_sep) delwin(window_sep); if (window_arrows) delwin(window_arrows); /* Create windows */ window_word = newwin(screen_height - 3, 20, 2, 2); window_def = newwin(screen_height - 3, screen_width - 29, 2, 27); window_header = newwin(1, screen_width, 0, 0); window_sep = newwin(screen_height - 1, 4, 1, 23); window_arrows = newwin(screen_height - 1, 1, 1, screen_width - 1); if (!window_word || !window_def || !window_header || !window_sep) show_error(_("Out of memory")); /* Configure windows */ keypad(window_word, TRUE); halfdelay(100); erase(); /* Draw vertical bar */ for (i = 0; i < screen_height; i++) mvwaddch(window_sep, i, 1, ACS_VLINE); /* Draw screen header */ wattrset(window_header, A_REVERSE); for (i = 0; i < screen_width; i++) waddch(window_header, ' '); mvwaddstr(window_header, 0, 1, HEADER_NAME); if (screen_width - strlen(HEADER_COPYRIGHT) - 1 > strlen(HEADER_NAME) + 2); mvwaddstr(window_header, 0, screen_width - strlen(HEADER_COPYRIGHT) - 1, HEADER_COPYRIGHT); } /** * \brief SIGWINCH handler */ void sigwinch(int sig) { resized_term = 1; } /** * \brief Checks and adjusts word list selection to match the new window size */ void check_size(void) { int newx, newy, fake = 0, diff; newx = stdscr->_maxx + 1; newy = stdscr->_maxy + 1; /* Minimum size */ if (newx < 29) fake = newx = 29; if (newy < 4) fake = newy = 4; if (fake) resizeterm(newy, newx); screen_width = newx; screen_height = newy; diff = list_page + (screen_height - 4) - word_count; if (diff > 0) { list_page -= diff; list_index += diff; } diff = list_index - (screen_height - 5); if (diff > 0) { list_page += diff; list_index -= diff; } } /** * \brief Handles terminal resize */ void resize(void) { endwin(); refresh(); check_size(); create_windows(); resized_term = 0; } #define is_visible(x) ((ypos >= first && ypos < (screen_height - 3) + first) ? x : "") /** * \brief Prints the definition * * \param def Definition RTF source * \param first First line visible on the screen * * \return Total number of lines */ int def_print(char *def, int first) { int attr = color_text, attrs[16], level = 0, lastsp = 1, xpos = 0; int phon = 0, lp = 0, dispword, newline_, newattr, lastnl = 0; int ypos = 0, margin = 0, tp, newphon; char token[64], line[80]; if (!def) return 1; werase(window_def); if (def_raw_rtf) { wattrset(window_def, A_NORMAL); waddstr(window_def, def); return 1; } while (def && *def) { dispword = 0; newline_ = 0; newattr = attr; newphon = phon; switch(*def) { case '{': if (level < 16) attrs[level++] = attr; dispword = 1; break; case '\\': def++; tp = 0; while ((*def >= 'a' && *def <= 'z') || (*def >= '0' && *def <= '9')) token[tp++] = *def++; token[tp] = 0; if (*def == ' ') def++; if (!lastnl) { if (!strcmp(token, "par") || !strcmp(token, "line")) newline_ = 1; margin = 0; } if (!strcmp(token, "pard")) { newline_ = 1; margin = 0; } if (!strncmp(token, "sa", 2)) { margin = 1; waddstr(window_def, is_visible(" ")); xpos = 3; } if (!strcmp(token, "b")) newattr |= A_BOLD; if (!strcmp(token, "cf0")) newattr = color_text; if (!strcmp(token, "cf1")) newattr = color_cf1; if (!strcmp(token, "cf2")) newattr = color_cf2; if (!strcmp(token, "cf5")) newattr = color_text; if (token[0] == 'f') newphon = 0; if (!strcmp(token, "f1")) newphon = 1; if (!strcmp(token, "qc")) newattr |= ATTR_HIDE; if (!strcmp(token, "super")) { #ifndef YDPDICT_HAS_SUPERSCRIPT line[lp++] = '^'; line[lp] = 0; #endif newattr |= ATTR_SUPER; } def--; dispword = 1; break; case '}': if (!level) break; newattr = attrs[--level]; dispword = 1; newphon = 0; break; default: if (attr & ATTR_HIDE) break; #ifdef YDPDICT_HAS_SUPERSCRIPT if ((attr & ATTR_SUPER) && isdigit(*def)) *def -= '0'; #endif wattrset(window_def, attr & ~ATTR_MASK); lastnl = 0; switch (*def) { case ' ': if (lastsp) break; dispword = 1; lastsp = 1; if (!lp) { line[0] = ' '; line[1] = 0; lp = 1; lastsp = 0; } break; default: if (*def == 0x7f) (*def)--; line[lp++] = *def; line[lp] = 0; lastsp = 0; } } def++; if (dispword && lp) { if (50 - xpos < lp) { waddstr(window_def, is_visible("\n")); ypos++; if (margin) waddstr(window_def, is_visible(" ")); xpos = ((margin) ? 3 : 0) + strlen(line); } else { xpos += strlen(line); } if (def_encoding == YDPDICT_ENCODING_UTF8) { waddstr(window_def, is_visible(line)); } else { if (phon) { char *tmp = ydpdict_phonetic_to_utf8(is_visible(line)); waddstr(window_def, tmp); xfree(tmp); } else { #ifndef YDPDICT_HAS_SUPERSCRIPT char *tmp = ydpdict_windows1250_to_utf8(is_visible(line)); #else char *tmp = ydpdict_windows1250_super_to_utf8(is_visible(line)); #endif waddstr(window_def, tmp); xfree(tmp); } } if (lastsp && xpos != 50) { waddstr(window_def, is_visible(" ")); xpos++; } lp = 0; } if (newline_ && !(attr & ATTR_HIDE)) { waddstr(window_def, is_visible("\n")); ypos++; xpos = (margin) ? 3 : 0; if (margin) waddstr(window_def, is_visible(" ")); lastsp = 1; lastnl = 1; } attr = newattr; phon = newphon; } if (lp) { if (50 - xpos < lp) { waddstr(window_def, is_visible("\n")); ypos++; } if (def_encoding == YDPDICT_ENCODING_UTF8) { waddstr(window_def, is_visible(line)); } else { if (phon) { char *tmp = ydpdict_phonetic_to_utf8(is_visible(line)); waddstr(window_def, tmp); xfree(tmp); } else { char *tmp = ydpdict_windows1250_to_utf8(is_visible(line)); waddstr(window_def, tmp); xfree(tmp); } } } ypos++; return ypos; } /** * \brief Looks up current input word in the dictionary */ void input_find(void) { char dest[64]; wchar_t src_buf[64]; const wchar_t *src; int idx; int i; if (!dict) return; input_exact = 1; for (i = wcslen(input); i > 0; i--) { wcsncpy(src_buf, input, i); src_buf[i] = 0; src = src_buf; wcsrtombs(dest, &src, sizeof(dest), NULL); idx = ydpdict_find_word(dict, dest); if (idx != -1) { list_page = idx; list_index = 0; if (list_page > word_count - (screen_height - 4)) { list_page = word_count - (screen_height - 4); list_index = idx - list_page; } break; } input_exact = 0; } } /** * \brief Redraws word list */ void list_redraw(void) { int y; werase(window_word); if (dict) { for (y = 0; y < (screen_height - 4); y++) { wattrset(window_word, (y == list_index) ? A_REVERSE : A_NORMAL); mvwaddstr(window_word, y + 1, 0, " "); if (list_page + y >= word_count) continue; mvwaddstr(window_word, y + 1, 1, ydpdict_get_word(dict, list_page + y)); } } wattrset(window_word, input_exact ? A_BOLD : A_NORMAL); mvwaddstr(window_word, 0, 0, "[__________________]"); mvwaddwstr(window_word, 0, 1, input); wattrset(window_word, A_NORMAL); wmove(window_word, 0, input_index + 1); } /** * \brief Redraws the definition */ void def_redraw(void) { if (def_update && dict) { xfree(def); def = (char*) ydpdict_read_rtf(dict, list_page + list_index); def_encoding = YDPDICT_ENCODING_WINDOWS1250; def_update = 0; } list_redraw(); def_height = def_print(def, def_index); curs_set((focus) ? 0 : 1); wattrset(window_sep, A_BOLD); if (focus) { mvwaddch(window_sep, screen_height / 2, 0, ACS_HLINE); mvwaddch(window_sep, screen_height / 2, 1, ACS_HLINE); mvwaddch(window_sep, screen_height / 2, 2, ACS_RARROW); } else { mvwaddch(window_sep, screen_height / 2, 0, ACS_LARROW); mvwaddch(window_sep, screen_height / 2, 1, ACS_HLINE); mvwaddch(window_sep, screen_height / 2, 2, ACS_HLINE); } wattrset(window_arrows, A_DIM); mvwaddch(window_arrows, 1, 0, (def_index > 0) ? ACS_UARROW : ' '); mvwaddch(window_arrows, screen_height - 3, 0, (def_index < def_height - (screen_height - 3)) ? ACS_DARROW : ' '); update_all(); } void switch_dict(int new_dict) { const char *idx[4] = { DEFAULT_IDX_AP, DEFAULT_IDX_PA, DEFAULT_IDX_DP, DEFAULT_IDX_PD }; const char *dat[4] = { DEFAULT_DAT_AP, DEFAULT_DAT_PA, DEFAULT_DAT_DP, DEFAULT_DAT_PD }; char *full_idx = NULL, *full_dat = NULL; struct dirent *de; DIR *dh; if (new_dict < 0 || new_dict > 3) return; if (dict) { ydpdict_close(dict); dict = NULL; } curs_set(0); wattrset(window_def, A_NORMAL); werase(window_def); waddstr(window_def, _("Please wait, loading the dictionary...")); update_all(); errno = ENOENT; if (config_path && (dh = opendir(config_path))) { while ((de = readdir(dh))) { if (strcasecmp(de->d_name, idx[new_dict]) == 0 && full_idx == NULL) { full_idx = xmalloc(strlen(config_path) + 1 + strlen(de->d_name) + 1); sprintf(full_idx, "%s/%s", config_path, de->d_name); } if (strcasecmp(de->d_name, dat[new_dict]) == 0 && full_dat == NULL) { full_dat = xmalloc(strlen(config_path) + 1 + strlen(de->d_name) + 1); sprintf(full_dat, "%s/%s", config_path, de->d_name); } } closedir(dh); } if (full_idx == NULL || full_dat == NULL || !(dict = ydpdict_open(full_dat, full_idx, YDPDICT_ENCODING_UTF8))) { const char *tmp, *err; /* errno is set to ENOENT above for missing dictionary files */ if (!errno) err = _("Invalid file format"); else err = strerror(errno); tmp = _("{\\cf2 Error!}\\par\\pard{Unable to open dictionary: %s. Press {\\cf2 F1} or {\\cf2 ?} for help.}"); xfree(def); def = xmalloc(strlen(tmp) + strlen(err)); sprintf(def, tmp, err); def_encoding = YDPDICT_ENCODING_UTF8; def_index = 0; word_count = 0; } else { word_count = ydpdict_get_count(dict); def_update = 1; } xfree(full_idx); xfree(full_dat); config_dict = new_dict; def_index = 0; input_index = 0; list_index = 0; list_page = 0; if (wcslen(input)) { input_index = wcslen(input); input_find(); } curs_set(1); update_all(); } int main(int argc, char **argv) { MEVENT m_event; int bg; #ifdef HAVE_LOCALE_H setlocale(LC_ALL, ""); textdomain("ydpdict"); #endif #ifdef HAVE_LIBAO ao_initialize(); #endif #ifdef SIGWINCH signal(SIGWINCH, sigwinch); #endif signal(SIGTERM, sigterm); signal(SIGINT, sigterm); signal(SIGHUP, sigterm); read_config(argc, argv); initscr(); noecho(); cbreak(); if (config_transparent) { bg = COLOR_DEFAULT; use_default_colors(); } else bg = COLOR_BLACK; /* Prepare colors */ if (config_color && has_colors()) { start_color(); init_pair(1, config_text & 127, bg); init_pair(2, config_cf1 & 127, bg); init_pair(3, config_cf2 & 127, bg); color_text = COLOR_PAIR(1) | (config_text & A_BOLD); color_cf1 = COLOR_PAIR(2) | (config_cf1 & A_BOLD); color_cf2 = COLOR_PAIR(3) | (config_cf2 & A_BOLD); } else { color_text = A_NORMAL; color_cf1 = A_NORMAL; color_cf2 = A_NORMAL; } memset(input, 0, sizeof(input)); /* Prepare UI */ check_size(); create_windows(); /* Load the dictionary */ switch_dict(config_dict); mousemask(BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED, NULL); if (config_word) { const char *src = config_word; mbsrtowcs(input, &src, INPUT_LEN, NULL); input_find(); input_index = wcslen(input); } for (;;) { int ch; if (resized_term) resize(); def_redraw(); ch = wgetch(window_word); switch (ch) { #define __MOUSE_IN(window, event, correct1, correct2, correct3, correct4) (\ event.y > (window->_begy + correct1) && event.y < (window->_begy + window->_maxy + correct2) &&\ event.x > (window->_begx + correct3) && event.x < (window->_begx + window->_maxx + correct4)) case KEY_MOUSE: if (getmouse(&m_event) == OK) { /* Double-click points to the word */ if (m_event.bstate & BUTTON1_DOUBLE_CLICKED && __MOUSE_IN(window_def, m_event, -2, 1, -3, 2)) { wchar_t ch, buf[INPUT_LEN + 1]; cchar_t cc; int i = 0, x = m_event.x - 27; mvwin_wch(window_def, m_event.y - 2, x, &cc); ch = cc.chars[0]; if (!(iswalpha(ch) || ch == L'-')) break; /* Look for first non-letter */ do { x--; mvwin_wch(window_def, m_event.y - 2, x, &cc); ch = cc.chars[0]; } while ((iswalpha(ch) || ch == L'-') && x >= 0); /* And collect characters on the right */ do { x++; mvwin_wch(window_def, m_event.y - 2, x, &cc); ch = cc.chars[0]; buf[i++] = ch; } while ((iswalpha(ch) || ch == L'-') && x < window_def->_maxx); buf[--i] = L'\0'; /* Did we find anything? */ if (wcslen(buf)) { wcsncpy(input, buf, INPUT_LEN); input[INPUT_LEN] = 0; input_index = wcslen(input); input_find(); def_update = 1; } break; } if (m_event.bstate & BUTTON1_CLICKED || m_event.bstate & BUTTON1_DOUBLE_CLICKED) { /* Clicked on the word list */ if (__MOUSE_IN(window_word, m_event, -2, 1, -1, 1) && m_event.y > 2) { list_index = m_event.y - 3; memset(input, 0, sizeof(input)); input_index = 0; def_index = 0; def_update = 1; } /* Header */ if (m_event.y == 0) { ungetch(KEY_F(1)); break; } /* Scrolling */ if (m_event.y == screen_height - 1) { ungetch(KEY_NPAGE); break; } if (m_event.y <= 1) { ungetch(KEY_PPAGE); break; } } if (m_event.bstate & BUTTON1_CLICKED) { /* Change of the active window */ if (__MOUSE_IN(window_word, m_event, -2, 1, -3, 2) && focus) { if (focus == 2) def_update = 1; focus = 0; } if (__MOUSE_IN(window_def, m_event, -2, 1, -3, 2) && !focus) focus = 1; } } break; #undef isalpha_pl_PL #undef __MOUSE_IN case 10: /* Enter */ if (focus) { if (def_index < def_height - (screen_height - 3)) def_index++; } else { wchar_t *c = input + wcslen(input) - 1; while (wcslen(input) > 1 && *c == L' ') *c-- = 0; input_index = wcslen(input); input_find(); def_update = 1; } break; case 27: /* ESC */ if (focus == 2) { focus = saved_focus; def_update = 1; def_index = def_saved_index; } else if (focus == 1) { focus = 0; } else { memset(&input, 0, sizeof(input)); list_index = 0; list_page = 0; input_index = 0; def_index = 0; def_update = 1; } break; case 24: /* Ctrl-X */ show_error(NULL); break; #ifdef KEY_RESIZE case KEY_RESIZE: resized_term = 1; break; #endif case 9: /* TAB */ if (focus == 2) { def_update = 1; def_index = 0; } focus = (focus) ? 0 : 1; break; case KEY_F(2): case '`': if (config_dict == 0 || config_dict == 2) play_sample(config_dict, list_page + list_index); break; case KEY_F(1): case '?': { unsigned int len = 0; int i; for (i = 0; i < sizeof(help) / sizeof(help[0]); i++) len += strlen(gettext(help[i])); len += strlen(gettext(help_footer)); xfree(def); def = xmalloc(len + strlen(HELP_EMAIL) + strlen(HELP_WEBSITE) + 1); def[0] = 0; for (i = 0; i < sizeof(help) / sizeof(help[0]); i++) strcat(def, gettext(help[i])); sprintf(def + strlen(def), gettext(help_footer), HELP_EMAIL, HELP_WEBSITE); def_saved_index = def_index; def_index = 0; def_encoding = YDPDICT_ENCODING_UTF8; saved_focus = focus; focus = 2; break; } case KEY_F(3): case '<': if (config_dict != 0) switch_dict(0); break; case KEY_F(4): case '>': if (config_dict != 1) switch_dict(1); break; case KEY_F(5): case '[': if (config_dict != 2) switch_dict(2); break; case KEY_F(6): case ']': if (config_dict != 3) switch_dict(3); break; case KEY_F(7): case '!': { unsigned int len = 0; int i; len += strlen(gettext(qualifiers_header)); for (i = 0; i < sizeof(qualifiers) / sizeof(qualifiers[0]); i++) { len += strlen(qualifiers_format); len += strlen(qualifiers[i][0]); len += strlen(gettext(qualifiers[i][1])); } xfree(def); def = xmalloc(len); strcpy(def, gettext(qualifiers_header)); for (i = 0; i < sizeof(qualifiers) / sizeof(qualifiers[0]); i++) sprintf(def + strlen(def), qualifiers_format, qualifiers[i][0], gettext(qualifiers[i][1])); def_saved_index = def_index; def_index = 0; def_encoding = YDPDICT_ENCODING_UTF8; saved_focus = focus; focus = 2; break; } case KEY_UP: if (focus) { if (def_index > 0) def_index--; } else { if (list_index > 0) list_index--; else if (list_page > 0) list_page--; def_index = 0; def_update = 1; } break; case KEY_PPAGE: if (focus) { if (def_index > screen_height - 4) def_index -= screen_height - 3; else def_index = 0; } else { if (list_index > 0) list_index = 0; else if (list_page > screen_height - 5) list_page -= screen_height - 4; else list_page = 0; def_index = 0; def_update = 1; } break; case KEY_DOWN: if (focus) { if (def_index < def_height - (screen_height - 3)) def_index++; } else { if (list_index < screen_height - 5 && (list_index + 1 < word_count)) list_index++; else if (list_page < word_count - (screen_height - 4)) list_page++; def_index = 0; def_update = 1; } break; case KEY_NPAGE: if (focus) { if (def_index < def_height - (screen_height - 3) * 2 - 1) def_index += screen_height - 3; else def_index = def_height - (screen_height - 3); } else { if (list_index < screen_height - 5) list_index = screen_height - 5; else if (list_page < word_count - (screen_height - 4) * 2 - 1) list_page += screen_height - 4; else list_page = word_count - (screen_height - 4); def_index = 0; def_update = 1; } break; case KEY_F(9): def_raw_rtf = !def_raw_rtf; break; case KEY_DC: if (!focus) { if (input_index < wcslen(input)) { memmove(input + input_index, input + input_index + 1, (wcslen(input) - input_index + 1) * sizeof(wchar_t)); input_find(); def_update = 1; } else beep(); } break; case KEY_BACKSPACE: case 127: case 8: if (focus) { if (def_index > 0) def_index--; break; } else { if (input_index) { memmove(input + input_index - 1, input + input_index, (wcslen(input) - input_index + 1) * sizeof(wchar_t)); input_index--; input_find(); def_update = 1; } else beep(); } break; case 12: /* Ctrl-L */ resized_term = 1; break; case 21: /* Ctrl-U */ case 23: /* Ctrl-W */ memset(&input, 0, sizeof(input)); list_index = 0; list_page = 0; input_index = 0; def_index = 0; def_update = 1; focus = 0; break; case KEY_HOME: case KEY_FIND: input_index = 0; break; case KEY_END: case KEY_SELECT: input_index = wcslen(input); break; case KEY_LEFT: if (!input_index || focus) beep(); else input_index--; break; case KEY_RIGHT: if (input_index >= wcslen(input) || focus) beep(); else input_index++; break; default: { static char mb[5]; static int mblen = 0, mbofs = 0; int len; wchar_t wc; if (ch < ' ' || ch > 255) break; if ((ch & 0xe0) == 0xc0) { mb[0] = ch; mblen = 2; mbofs = 1; break; } if ((ch & 0xf0) == 0xe0) { mb[0] = ch; mblen = 3; mbofs = 1; break; } if ((ch & 0xf8) == 0xf0) { mb[0] = ch; mblen = 4; mbofs = 1; break; } if ((ch & 0xc0) == 0x80) { if (!mblen) break; mb[mbofs++] = ch; if (mbofs == mblen) { mb[mbofs] = 0; mbrtowc(&wc, mb, strlen(mb), NULL); } else break; } else { wc = ch; } if (focus) { memset(input, 0, sizeof(input)); input_index = 0; } if (wcslen(input) > INPUT_LEN) break; if (input_index < wcslen(input)) memmove(input + input_index + 1, input + input_index, (wcslen(input) - input_index + 1) * sizeof(wchar_t)); input[input_index++] = wc; len = wcslen(input); if (len >= 2 && !wcscmp(input + len - 2, L":q")) show_error(NULL); if (len >= 3 && !wcscmp(input + len - 3, L":wq")) show_error(NULL); if (len >= 2 && !wcscmp(input + len - 2, L":x")) show_error(NULL); input_find(); def_update = 1; focus = 0; def_index = 0; break; } } } show_error(NULL); return 0; } ydpdict-1.0.2+1.0.3/src/ydpsound.c000066400000000000000000000234501225140023200164000ustar00rootroot00000000000000/* * ydpdict * (c) Copyright 1998-2009 Wojtek Kaniewski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "ydpconfig.h" #include "ydpsound.h" #include "xmalloc.h" #include "adpcm.h" #ifdef HAVE_LINUX_SOUNDCARD_H #include #include #include #endif #ifdef HAVE_LIBAO #include #endif #ifdef ENABLE_NLS #include #define _(x) gettext(x) #else #define _(x) x #endif /** * \brief Convert 32-bit value from little-endian to machine-endian * * \param value little-endian value * * \return machine-endian value */ static inline void fix32(uint32_t *value) { #ifdef WORDS_BIGENDIAN *value = (uint32_t) (((*value & (uint32_t) 0x000000ffU) << 24) | ((*value & (uint32_t) 0x0000ff00U) << 8) | ((*value & (uint32_t) 0x00ff0000U) >> 8) | ((*value & (uint32_t) 0xff000000U) >> 24)); #endif } /** * \brief Convert 16-bit value from little-endian to machine-endian * * \param value little-endian value * * \return machine-endian value */ static inline void fix16(uint16_t *value) { #ifdef WORDS_BIGENDIAN *value = (uint16_t) (((*value & (uint16_t) 0x00ffU) << 8) | ((*value & (uint16_t) 0xff00U) >> 8)); #endif } #ifdef HAVE_LIBAO /** * \brief Play sample using libao * * \param sample Sample data * \param size Sample size in bytes * \param freq Sampling frequency * \param bits Bits per sample * \param chans Channels * * \return 0 on success, -1 on error */ static int play_libao(char *sample, int size, int freq, int bits, int chans) { ao_device *device; ao_sample_format format; int driver; if (!config_audio) driver = ao_default_driver_id(); else driver = ao_driver_id(config_audio); if (driver == -1) return -1; memset(&format, 0, sizeof(format)); format.bits = bits; format.channels = chans; format.rate = freq; format.byte_format = AO_FMT_NATIVE; if (!(device = ao_open_live(driver, &format, NULL))) return -1; ao_play(device, sample, size); ao_close(device); return 0; } #else /* HAVE_LIBAO */ #ifdef HAVE_LINUX_SOUNDCARD_H /** * \brief Play sample using Linux OSS interface * * \param sample Sample data * \param size Sample size in bytes * \param freq Sampling frequency * \param bits Bits per sample * \param chans Channels * * \return 0 on success, -1 on error */ static int play_linux(char *sample, int size, int freq, int bits, int chans) { int fd; if (!config_audio) return -1; if ((fd = open(config_audio, O_WRONLY)) == -1) return -1; if (ioctl(fd, SNDCTL_DSP_SPEED, &freq) == -1) { close(fd); return -1; } if (ioctl(fd, SNDCTL_DSP_SAMPLESIZE, &bits) == -1) { close(fd); return -1; } if (ioctl(fd, SNDCTL_DSP_CHANNELS, &chans) == -1) { close(fd); return -1; } while (size > 0) { int res; if ((res = write(fd, sample, size)) == -1) { close(fd); return -1; } size -= res; sample += res; } close(fd); return 0; } #endif /* HAVE_LINUX_SOUNDCARD_H */ #endif /* HAVE_LIBAO */ /** * \brief Plays sample for pronunciation * * \param dict Dictionary type * \param def Word index * * \return 0 on success, -1 on invalid file format, -2 on invalid file codec, -3 on playback error */ int play_sample(int dict, int def) { char *exts[] = { "WAV", "wav", "MP3", "mp3", "OGG", "ogg", NULL }; struct riff_header_type riff_header; struct riff_block_type riff_block; struct wave_fmt_type wave_fmt; struct wave_adpcm_type wave_adpcm; int i, fd = -1, rd, result; char path[4096], *sample = NULL; int bytesPerBlock; short *coefs = NULL; for (i = 0; exts[i]; i++) { if (dict == 0) { snprintf(path, sizeof(path), "%s/en/S%.3d/%.6d.%s", config_cdpath, (def + 1) / 1000, def + 1, exts[i]); if (!access(path, R_OK)) break; snprintf(path, sizeof(path), "%s/en/s%.3d/%.6d.%s", config_cdpath, (def + 1) / 1000, def + 1, exts[i]); if (!access(path, R_OK)) break; } if (dict == 2) { snprintf(path, sizeof(path), "%s/de/sg%.3d/sg%.6d.%s", config_cdpath, (def + 1) / 1000, def + 1, exts[i]); if (!access(path, R_OK)) break; snprintf(path, sizeof(path), "%s/de/SG%.3d/SG%.6d.%s", config_cdpath, (def + 1) / 1000, def + 1, exts[i]); if (!access(path, R_OK)) break; } snprintf(path, sizeof(path), "%s/S%.3d/%.6d.%s", config_cdpath, (def + 1) / 1000, def + 1, exts[i]); if (!access(path, R_OK)) break; snprintf(path, sizeof(path), "%s/s%.3d/%.6d.%s", config_cdpath, (def + 1) / 1000, def + 1, exts[i]); if (!access(path, R_OK)) break; snprintf(path, sizeof(path), "%s/sg%.3d/sg%.6d.%s", config_cdpath, (def + 1) / 1000, def + 1, exts[i]); if (!access(path, R_OK)) break; snprintf(path, sizeof(path), "%s/SG%.3d/SG%.6d.%s", config_cdpath, (def + 1) / 1000, def + 1, exts[i]); if (!access(path, R_OK)) break; } if (!exts[i]) return 0; if (config_player) { char command[4096]; snprintf(command, sizeof(command), "%s %s 2> /dev/null", config_player, path); return system(command); } if ((fd = open(path, O_RDONLY)) == -1) { result = 0; goto failure; } if (read(fd, &riff_header, sizeof(riff_header)) < sizeof(riff_header)) { result = -1; goto failure; } fix32(&riff_header.size); if (strncmp(riff_header.id, "RIFF", sizeof(riff_header.id))) { result = -1; goto failure; } if (strncmp(riff_header.format, "WAVE", sizeof(riff_header.format))) { result = -1; goto failure; } for (;;) { if (read(fd, &riff_block, sizeof(riff_block)) < sizeof(riff_block)) { result = -1; goto failure; } fix32(&riff_block.size); rd = lseek(fd, 0, SEEK_CUR); if (!strncmp(riff_block.id, "fmt ", sizeof(riff_block.id))) { if (read(fd, &wave_fmt, sizeof(wave_fmt)) < sizeof(wave_fmt)) { result = -1; goto failure; } fix16(&wave_fmt.wFormatTag); fix16(&wave_fmt.wChannels); fix32(&wave_fmt.dwSamplesPerSec); fix32(&wave_fmt.dwAvgBytesPerSec); fix16(&wave_fmt.wBlockAlign); fix16(&wave_fmt.wBitsPerSample); switch (wave_fmt.wFormatTag) { case WAVE_FORMAT_PCM: lseek(fd, riff_block.size - sizeof(wave_fmt), SEEK_CUR); break; case WAVE_FORMAT_ADPCM: if (riff_block.size < sizeof(wave_fmt) + sizeof(wave_adpcm)) { result = -1; goto failure; } if (read(fd, &wave_adpcm, sizeof(wave_adpcm)) < sizeof(wave_adpcm)) { result = -1; goto failure; } fix16(&wave_adpcm.wExtSize); fix16(&wave_adpcm.wSamplesPerBlock); fix16(&wave_adpcm.wCoefs); bytesPerBlock = 7 * wave_fmt.wChannels; if (wave_adpcm.wSamplesPerBlock > 2) bytesPerBlock += ((wave_adpcm.wSamplesPerBlock - 2) * wave_fmt.wChannels + 1) / 2; if (riff_block.size < sizeof(wave_fmt) + sizeof(wave_adpcm) + wave_adpcm.wCoefs * 4) { result = -1; goto failure; } coefs = xmalloc(wave_adpcm.wCoefs * 2 * sizeof(short)); if (read(fd, coefs, wave_adpcm.wCoefs * 2 * sizeof(short)) != wave_adpcm.wCoefs * 2 * sizeof(short)) { result = -1; goto failure; } for (i = 0; i < wave_adpcm.wCoefs; i++) fix16((unsigned short*) &coefs[i]); lseek(fd, riff_block.size - sizeof(wave_fmt) - sizeof(wave_adpcm) - 4 * wave_adpcm.wCoefs, SEEK_CUR); break; default: result = -2; goto failure; } continue; } if (!strncmp(riff_block.id, "data", 4)) { int bits = wave_fmt.wBitsPerSample; switch (wave_fmt.wFormatTag) { case WAVE_FORMAT_PCM: { sample = xmalloc(riff_block.size); rd = read(fd, sample, riff_block.size); break; } case WAVE_FORMAT_ADPCM: { int res, count, bytes; char *packet; short *samples; packet = xmalloc(wave_fmt.wBlockAlign); samples = xmalloc(wave_adpcm.wSamplesPerBlock * sizeof(short)); bits = 16; bytes = 0; sample = NULL; rd = 0; while (bytes < riff_block.size) { res = read(fd, packet, wave_fmt.wBlockAlign); if (res < 1) { result = -2; goto failure; } bytes += res; count = wave_adpcm.wSamplesPerBlock; if (res < wave_fmt.wBlockAlign) { if (!(count = AdpcmSamplesIn(0, wave_fmt.wChannels, res, 0))) { result = -2; goto failure; } } sample = xrealloc(sample, rd + count * sizeof(short)); AdpcmBlockExpandI(wave_fmt.wChannels, wave_adpcm.wCoefs, coefs, (unsigned char*) packet, (short*) (sample + rd), count); rd += count * sizeof(short); } xfree(packet); xfree(samples); break; } } close(fd); #ifdef HAVE_LIBAO if (play_libao(sample, rd, wave_fmt.dwSamplesPerSec, bits, wave_fmt.wChannels) == -1) { result = -3; goto failure; } #else #ifdef HAVE_LINUX_SOUNDCARD_H if (play_linux(sample, rd, wave_fmt.dwSamplesPerSec, bits, wave_fmt.wChannels) == -1) { result = -3; goto failure; } #endif /* HAVE_LINUX_SOUNDCARD_H */ #endif /* HAVE_LIBAO */ xfree(sample); break; } lseek(fd, riff_block.size, SEEK_CUR); } return 0; failure: xfree(sample); xfree(coefs); if (fd != -1) close(fd); return result; } ydpdict-1.0.2+1.0.3/src/ydpsound.h000066400000000000000000000027541225140023200164110ustar00rootroot00000000000000/* * ydpdict * (C) Copyright 1998-2009 Wojtek Kaniewski * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __YDPSOUND_H #define __YDPSOUND_H #include struct riff_header_type { char id[4]; uint32_t size; char format[4]; } __attribute__ ((packed)); struct riff_block_type { char id[4]; uint32_t size; } __attribute__ ((packed)); enum wave_fmt_type_type { WAVE_FORMAT_PCM = 0x0001, WAVE_FORMAT_ADPCM = 0x0002 }; struct wave_fmt_type { uint16_t wFormatTag; uint16_t wChannels; uint32_t dwSamplesPerSec; uint32_t dwAvgBytesPerSec; uint16_t wBlockAlign; uint16_t wBitsPerSample; } __attribute__ ((packed)); struct wave_adpcm_type { uint16_t wExtSize; uint16_t wSamplesPerBlock; uint16_t wCoefs; } __attribute__ ((packed)); int play_sample(int dict, int def); #endif /* __YDPSOUND_H */ ydpdict-1.0.2+1.0.3/ydpdict.1000066400000000000000000000026541225140023200153250ustar00rootroot00000000000000.TH YDPDICT 1 "July 1, 2007" .SH NAME ydpdict \- an interface for Collins and Langenscheidt dictionaries .SH SYNOPSIS .B ydpdict [ .BI options .B ] .SH DESCRIPTION .B ydpdict is an ncurses interface for English-Polish and Polish-English Collins dictionaries, as well as German-Polish and Polish-German Langenscheidt dictionaries, which are distributed by Young Digital Planet. .PP .B ydpdict tries to load the configuration file from the following locations (reads only the first one found): .TP 1) .BI ~/ydpdict.conf .TP 2) .BI ~/.ydpdictrc .TP 3) .BI /etc/ydpdict.conf .SH OPTIONS .TP .BI \-e\ [\-\-eng] Starts the English-Polish dictionary (default). .TP .BI \-p\ [\-\-pol] Starts the Polish-English dictionary. .TP .BI \-g\ [\-\-ger-pol] Starts the German-Polish dictionary. .TP .BI \-o\ [\-\-pol-ger] Starts the Polish-German dictionary. .TP .BI \-f\ [\-\-path=PATH] Sets the path to data files. .TP .BI \-c\ [\-\-cdpath=PATH] Sets the path to the CD. (For audio sample files). .TP .BI \-P\ [\-\-player=PATH] Sets the path to the WAV file player. .TP .BI \-w\ [\-\-word=WORD] Starts the dictionary and translates the specified word. .TP .BI \-A\ [\-\-audio=DEVICE] Sets the default audio device. .TP .BI \-\-version Displays the version of the program. .TP .BI \-h\ [\-\-help] Shows command line options. .SH AUTHOR .B ydpdict was written by Wojtek Kaniewski . Latest version can be found at .I http://toxygen.net/ydpdict/ ydpdict-1.0.2+1.0.3/ydpdict.conf.in000066400000000000000000000016471225140023200165200ustar00rootroot00000000000000# Path to dictionary files (*.dat and *.idx). Filenames within the directory # MUST be written using lowercase letters. Path @dictdir@ # Path to pronuciation samples. CDPath /media/cdrom # Path to external sound player. If unset, internal playback routines are # used. #Player play #Player mpg321 #Player ogg123 # Default dictionary (0 - English-Polish, 1 - Polish-English, # 2 - German-Polish, 3 - Polish-German) DefaultDictionary 0 # Color support is autodetected, but color display can be forced with this # option. UseColor On # Terminal transparency UseTransparent On # Colors used to display definitions can be set to one of the following: # Black, Red, Green, Brown, Blue, Magenta, Cyan, White, Gray, Yellow, # LightRed, LightGreen, LightBlue, LightMagenta, LightCyan, LightWhite. # Note: for colors with "Light" prefix, emphasis will be invisible. Color White DefinitionColor LightCyan InformationColor LightGreen ydpdict-1.0.2+1.0.3/ydpdict.pl.1000066400000000000000000000027741225140023200157420ustar00rootroot00000000000000.TH YDPDICT 1 "1 sierpnia 2007" .SH NAZWA ydpdict \- interfejs słowników Collinsa i Langenscheidt .SH SKŁADNIA .B ydpdict [ .BI opcje .B ] .SH OPIS .B ydpdict jest korzystającym z biblioteki ncurses interfejsem służącym do obsługi multimedialnych słowników: angielsko-polskiego, polsko-angielskiego Collinsa, oraz niemiecko-polskiego i polsko-niemieckiego Langenscheidt, wydanych przez Young Digital Planet. .PP .B ydpdict szuka pliku konfiguracyjnego w następujących miejscach (czytany jest tylko pierwszy znaleziony plik): .TP 1) .BI ~/ydpdict.conf .TP 2) .BI ~/.ydpdictrc .TP 3) .BI /etc/ydpdict.conf .SH OPCJE .TP .BI \-e\ [\-\-eng] Uruchamia słownik angielsko-polski (domyślne). .TP .BI \-p\ [\-\-pol] Uruchamia słownik polsko-angielski. .TP .BI \-g\ [\-\-ger-pol] Uruchamia słownik niemiecko-polski. .TP .BI \-o\ [\-\-pol-ger] Uruchamia słownik polsko-niemiecki. .TP .BI \-f\ [\-\-path=ŚCIEŻKA] Podaje ścieżkę do plików danych. .TP .BI \-c\ [\-\-cdpath=ŚCIEŻKA] Podaje ścieżkę do płyty CD. .TP .BI \-P\ [\-\-player=ŚCIEŻKA] Podaje ścieżkę do odtwarzacza plików WAV. .TP .BI \-w\ [\-\-word=SŁOWO] Uruchamia słownik i tłumaczy podane słowo. .TP .BI \-A\ [\-\-audio=URZĄDZENIE] Określa domyślne urządzenie dźwiękowe. .TP .BI \-\-version Wyświetla wersję programu. .TP .BI \-h\ [\-\-help] Wyświetla tekst pomocy. .SH AUTOR .B ydpdict został napisany przez Wojtka Kaniewskiego . Najnowszą wersję można znaleźć pod adresem .I http://toxygen.net/ydpdict/