microdc2-0.15.6/0040755000076500007500000000000010543546055013364 5ustar chugunovmicrodcmicrodc2-0.15.6/CVS/0040755000076500007500000000000010543546105014013 5ustar chugunovmicrodcmicrodc2-0.15.6/CVS/Root0100644000076500007500000000003610527341042014650 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/CVS/Repository0100644000076500007500000000001010527341042016074 0ustar chugunovmicrodcmicrodc microdc2-0.15.6/CVS/Entries0100644000076500007500000000173010543546105015345 0ustar chugunovmicrodc/ABOUT-NLS/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /AUTHORS/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /COPYING/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /ChangeLog/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /INSTALL/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /Makefile.am/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /NEWS/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /README/1.2/Tue Nov 14 09:54:29 2006//Tmicrodc2_0_13_1_locale /config.h.in/1.4/Thu Nov 16 11:24:50 2006//Tmicrodc2_0_13_1_locale D/build-aux//// D/debian//// D/doc//// D/lib//// D/m4//// D/po//// D/rpm//// D/slackware//// D/src//// /aclocal.m4/1.1.1.1/Tue Nov 28 19:07:00 2006//Tmicrodc2_0_13_1_locale /Makefile.in/1.4/Sun Dec 24 18:44:54 2006//Tmicrodc2_0_13_1_locale /configure/1.8.2.8/Sun Dec 24 18:45:07 2006//Tmicrodc2_0_13_1_locale /configure.ac/1.8.2.8/Sun Dec 24 18:43:36 2006//Tmicrodc2_0_13_1_locale microdc2-0.15.6/CVS/Tag0100644000076500007500000000003010527341104014431 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/ABOUT-NLS0100644000076500007500000020610510516626545014617 0ustar chugunovmicrodc1 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. 1.1 Quick configuration advice ============================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. 1.2 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the included GNU `gettext' library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will, respectively, bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might not be desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.3 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your country by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.4 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skill are praised more than programming skill, here. 1.5 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of May 2005. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB +-------------------------------------------------+ GNUnet | | a2ps | [] [] [] [] [] | aegis | () | ant-phone | () | anubis | [] | ap-utils | | aspell | [] [] [] [] | bash | [] [] | batchelor | [] | bfd | | bibshelf | [] | binutils | [] | bison | [] [] | bluez-pin | [] [] [] [] | clisp | [] [] | console-tools | [] [] | coreutils | [] [] [] [] | cpio | | cpplib | [] [] [] | darkstat | [] () [] | dialog | [] [] [] [] [] [] | diffutils | [] [] [] [] [] | doodle | [] | e2fsprogs | [] [] | enscript | [] [] [] [] | error | [] [] [] [] | fetchmail | [] [] () [] | fileutils | [] [] | findutils | [] [] [] | flex | [] [] [] | fslint | [] | gas | | gawk | [] [] [] | gbiff | [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] | gimp-print | [] [] [] [] | gip | | gliv | [] | glunarclock | | gmult | [] [] | gnubiff | () | gnucash | [] () () [] | gnucash-glossary | [] () | gpe-aerial | [] [] | gpe-beam | [] [] | gpe-calendar | [] [] | gpe-clock | [] [] | gpe-conf | [] [] | gpe-contacts | | gpe-edit | [] | gpe-go | [] | gpe-login | [] [] | gpe-ownerinfo | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] | gpe-taskmanager | [] [] | gpe-timesheet | [] | gpe-today | [] [] | gpe-todo | [] [] | gphoto2 | [] [] [] [] | gprof | [] [] | gpsdrive | () () | gramadoir | [] [] | grep | [] [] [] [] [] [] | gretl | | gsasl | [] | gss | | gst-plugins | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] () | gtkspell | [] [] [] | hello | [] [] [] [] | id-utils | [] [] | impost | | indent | [] [] | iso_3166 | | iso_3166_1 | [] [] [] [] [] | iso_3166_2 | | iso_3166_3 | [] | iso_4217 | | iso_639 | | jpilot | [] | jtag | | jwhois | | kbd | [] [] [] [] | latrine | () | ld | [] | libc | [] [] [] [] [] | libextractor | | libgpewidget | [] [] [] | libgphoto2 | [] | libgphoto2_port | [] | libgsasl | | libiconv | [] [] [] [] [] | libidn | | lifelines | [] () | lilypond | [] | lingoteach | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailutils | [] | make | [] [] | man-db | [] () [] [] | minicom | [] [] | mysecretdiary | [] [] | nano | [] () [] | nano_1_0 | [] () [] [] | opcodes | [] | parted | [] [] [] [] | psmisc | | ptx | [] [] [] | pwdutils | | python | | radius | [] | recode | [] [] [] [] [] | rpm | [] [] | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] | sh-utils | [] [] | shared-mime-info | [] [] | sharutils | [] [] [] [] [] | silky | | skencil | [] () | sketch | [] () | solfege | [] | soundtracker | [] [] | sp | [] | stardict | [] | tar | | texinfo | [] [] | textutils | [] [] [] | tin | () () | tp-robot | [] | tuxpaint | [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] [] | vorbis-tools | [] [] [] [] | wastesedge | () | wdiff | [] [] [] [] | wget | | xchat | [] [] [] [] [] | xkeyboard-config | | xpad | | +-------------------------------------------------+ af am ar az be bg bs ca cs cy da de el en en_GB 10 0 0 2 7 5 0 40 43 2 51 91 19 1 14 eo es et eu fa fi fr ga gl he hi hr hu id is +-----------------------------------------------+ GNUnet | | a2ps | [] [] [] | aegis | | ant-phone | [] | anubis | [] | ap-utils | [] | aspell | [] [] | bash | [] [] [] [] | batchelor | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] | clisp | [] [] | console-tools | | coreutils | [] [] [] [] [] | cpio | [] [] | cpplib | [] [] | darkstat | [] () [] [] [] | dialog | [] [] [] [] [] [] [] | diffutils | [] [] [] [] [] [] [] [] [] | doodle | [] | e2fsprogs | [] [] | enscript | [] [] | error | [] [] [] [] [] | fetchmail | [] | fileutils | [] [] [] [] [] | findutils | [] [] [] [] | flex | [] [] [] | fslint | [] | gas | [] [] | gawk | [] [] [] [] | gbiff | [] | gcal | [] [] | gcc | [] | gettext-examples | [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] | gimp-print | [] [] | gip | [] [] [] | gliv | () | glunarclock | [] [] [] | gmult | [] [] | gnubiff | () | gnucash | [] () | gnucash-glossary | [] | gpe-aerial | [] [] | gpe-beam | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] | gpe-conf | [] | gpe-contacts | [] | gpe-edit | [] [] | gpe-go | [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] | gpe-taskmanager | [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] [] [] | gprof | [] [] [] | gpsdrive | () () [] | gramadoir | [] [] | grep | [] [] [] [] [] [] [] [] [] [] [] | gretl | [] [] | gsasl | [] [] [] | gss | [] | gst-plugins | [] [] | gstreamer | | gtick | [] [] [] [] | gtkspell | [] [] [] [] [] | hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] | impost | [] [] | indent | [] [] [] [] [] [] [] [] [] [] | iso_3166 | [] [] [] | iso_3166_1 | [] [] [] [] [] [] [] | iso_3166_2 | [] | iso_3166_3 | [] | iso_4217 | [] [] [] | iso_639 | [] [] [] [] | jpilot | [] [] | jtag | [] | jwhois | [] [] [] [] | kbd | [] [] | latrine | [] [] | ld | [] [] | libc | [] [] [] [] [] | libextractor | | libgpewidget | [] [] [] [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] | libgsasl | [] [] | libiconv | [] [] [] [] [] [] [] [] [] [] | libidn | [] [] | lifelines | () | lilypond | | lingoteach | [] [] | lynx | [] [] | m4 | [] [] [] [] | mailutils | [] [] | make | [] [] [] [] [] [] [] | man-db | () | minicom | [] [] [] [] | mysecretdiary | [] [] [] | nano | [] [] () [] | nano_1_0 | [] [] [] [] | opcodes | [] [] [] | parted | [] [] [] | psmisc | [] | ptx | [] [] [] [] [] [] [] [] [] | pwdutils | | python | | radius | [] [] | recode | [] [] [] [] [] [] [] | rpm | [] | screem | | scrollkeeper | [] [] [] | sed | [] [] [] [] [] [] | sh-utils | [] [] [] [] [] [] | shared-mime-info | [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] | silky | [] | skencil | [] [] | sketch | [] [] | solfege | | soundtracker | [] [] | sp | [] | stardict | [] | tar | [] [] [] [] | texinfo | [] [] [] | textutils | [] [] [] [] [] | tin | [] () | tp-robot | [] [] | tuxpaint | [] [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux | [] [] [] [] [] | vorbis-tools | [] [] | wastesedge | () | wdiff | [] [] [] [] [] [] [] | wget | [] [] [] [] | xchat | [] [] [] [] [] | xkeyboard-config | | xpad | [] [] [] | +-----------------------------------------------+ eo es et eu fa fi fr ga gl he hi hr hu id is 15 85 21 15 2 35 115 45 16 8 1 6 40 27 1 it ja ko ku lg lt lv mk mn ms mt nb nl nn no nso +--------------------------------------------------+ GNUnet | | a2ps | () () [] [] () | aegis | () | ant-phone | [] | anubis | [] [] [] | ap-utils | | aspell | [] [] | bash | [] | batchelor | [] | bfd | | bibshelf | [] | binutils | | bison | [] [] [] [] | bluez-pin | [] [] | clisp | [] | console-tools | | coreutils | [] [] | cpio | | cpplib | [] | darkstat | [] [] | dialog | [] [] | diffutils | [] [] [] [] | doodle | [] | e2fsprogs | [] | enscript | [] | error | [] | fetchmail | [] [] | fileutils | [] [] [] | findutils | [] [] | flex | [] [] | fslint | [] | gas | | gawk | [] [] | gbiff | [] | gcal | | gcc | | gettext-examples | [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] [] | gimp-print | [] [] | gip | [] | gliv | [] | glunarclock | [] [] | gmult | [] [] | gnubiff | () | gnucash | [] () () [] | gnucash-glossary | [] [] | gpe-aerial | [] | gpe-beam | [] | gpe-calendar | [] | gpe-clock | [] | gpe-conf | [] | gpe-contacts | | gpe-edit | [] | gpe-go | [] | gpe-login | [] | gpe-ownerinfo | [] | gpe-sketchbook | [] | gpe-su | [] | gpe-taskmanager | [] [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | [] | gphoto2 | [] [] [] | gprof | | gpsdrive | () () () () | gramadoir | () | grep | [] [] [] [] | gretl | [] | gsasl | [] | gss | | gst-plugins | [] [] | gstreamer | [] [] | gtick | [] [] | gtkspell | [] [] [] | hello | [] [] [] [] [] [] [] [] [] | id-utils | [] [] | impost | | indent | [] [] [] | iso_3166 | [] | iso_3166_1 | [] [] | iso_3166_2 | [] | iso_3166_3 | [] | iso_4217 | [] [] [] | iso_639 | [] [] [] | jpilot | () () () | jtag | | jwhois | [] [] | kbd | [] | latrine | [] [] | ld | | libc | [] [] [] [] [] | libextractor | | libgpewidget | [] | libgphoto2 | [] [] | libgphoto2_port | [] [] | libgsasl | [] | libiconv | [] [] | libidn | [] | lifelines | [] | lilypond | | lingoteach | [] [] | lynx | [] [] [] | m4 | [] [] | mailutils | | make | [] [] [] | man-db | () | minicom | [] | mysecretdiary | [] | nano | [] [] [] | nano_1_0 | [] [] [] [] | opcodes | [] | parted | [] [] [] [] | psmisc | [] [] [] | ptx | [] [] [] | pwdutils | | python | | radius | | recode | [] [] | rpm | [] [] | screem | [] | scrollkeeper | [] [] [] | sed | [] [] | sh-utils | [] [] [] | shared-mime-info | [] [] [] [] | sharutils | [] [] [] | silky | [] | skencil | | sketch | | solfege | [] [] [] | soundtracker | [] | sp | () | stardict | [] [] | tar | [] [] [] | texinfo | [] [] [] | textutils | [] [] [] | tin | | tp-robot | [] | tuxpaint | [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] | vorbis-tools | [] | wastesedge | [] | wdiff | [] [] [] | wget | [] | xchat | [] [] [] [] [] | xkeyboard-config | [] | xpad | [] | +--------------------------------------------------+ it ja ko ku lg lt lv mk mn ms mt nb nl nn no nso 46 35 11 2 1 1 2 2 3 11 0 15 96 7 5 0 or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv +----------------------------------------------+ GNUnet | | a2ps | () [] [] [] [] [] [] | aegis | () () | ant-phone | [] | anubis | [] [] [] | ap-utils | () | aspell | [] [] | bash | [] [] [] | batchelor | [] | bfd | | bibshelf | | binutils | [] [] | bison | [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | clisp | [] | console-tools | [] | coreutils | [] [] [] [] | cpio | [] [] | cpplib | | darkstat | [] [] [] [] [] [] | dialog | [] [] [] [] [] [] [] | diffutils | [] [] [] [] [] [] | doodle | [] | e2fsprogs | [] [] | enscript | [] [] [] [] | error | [] [] [] | fetchmail | [] [] [] [] | fileutils | [] [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] [] [] | fslint | [] [] [] | gas | | gawk | [] [] [] [] | gbiff | [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] [] | gimp-print | [] [] | gip | [] [] [] | gliv | [] [] [] | glunarclock | [] [] [] [] [] [] | gmult | [] [] [] [] | gnubiff | () [] | gnucash | () [] [] [] [] | gnucash-glossary | [] [] [] | gpe-aerial | [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] | gpe-calendar | [] [] [] [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] [] [] [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] [] [] [] | gphoto2 | [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] | grep | [] [] [] [] [] [] [] | gretl | [] | gsasl | [] [] [] [] [] | gss | [] [] [] | gst-plugins | [] [] [] [] | gstreamer | [] [] [] [] | gtick | [] [] [] | gtkspell | [] [] [] [] [] [] | hello | [] [] [] [] [] [] [] | id-utils | [] [] [] [] | impost | | indent | [] [] [] [] [] [] | iso_3166 | [] [] [] [] [] | iso_3166_1 | [] [] [] [] | iso_3166_2 | | iso_3166_3 | [] [] [] | iso_4217 | [] [] | iso_639 | [] [] [] | jpilot | | jtag | [] | jwhois | [] [] [] () () | kbd | [] [] [] | latrine | [] [] | ld | [] | libc | [] [] [] [] [] | libextractor | [] | libgpewidget | [] [] [] [] [] [] | libgphoto2 | [] [] | libgphoto2_port | [] | libgsasl | [] [] [] | libiconv | [] [] [] [] [] [] [] [] [] [] | libidn | [] () | lifelines | [] [] | lilypond | | lingoteach | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailutils | [] [] [] | make | [] [] [] [] | man-db | [] [] | minicom | [] [] [] [] | mysecretdiary | [] [] [] [] | nano | [] [] [] | nano_1_0 | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | psmisc | [] [] | ptx | [] [] [] [] [] [] | pwdutils | [] | python | | radius | [] [] | recode | [] [] [] [] [] [] | rpm | [] [] [] [] | screem | | scrollkeeper | [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] | sh-utils | [] [] [] | shared-mime-info | [] [] [] [] [] [] | sharutils | [] [] [] | silky | [] | skencil | [] [] [] | sketch | [] [] [] | solfege | | soundtracker | [] [] | sp | | stardict | [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | textutils | [] [] [] | tin | | tp-robot | [] | tuxpaint | [] [] [] [] [] [] [] [] | unicode-han-tra... | | unicode-transla... | | util-linux | [] [] [] | vorbis-tools | [] [] | wastesedge | | wdiff | [] [] [] [] [] [] | wget | | xchat | [] [] [] [] [] [] [] | xkeyboard-config | | xpad | | +----------------------------------------------+ or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv 1 3 47 29 57 6 78 73 5 44 12 12 50 85 ta tg th tk tr uk ven vi wa xh zh_CN zh_TW zu +-----------------------------------------------+ GNUnet | | 0 a2ps | [] [] [] | 19 aegis | | 0 ant-phone | [] [] | 5 anubis | [] [] [] | 11 ap-utils | () [] | 2 aspell | [] [] [] | 13 bash | [] | 11 batchelor | [] [] | 7 bfd | | 1 bibshelf | [] | 5 binutils | [] | 6 bison | [] [] | 18 bluez-pin | [] [] [] [] [] | 25 clisp | | 7 console-tools | [] [] | 5 coreutils | [] [] | 17 cpio | [] [] [] | 7 cpplib | [] [] | 8 darkstat | [] () () | 15 dialog | [] [] [] | 25 diffutils | [] [] [] [] | 28 doodle | [] | 5 e2fsprogs | [] | 8 enscript | [] | 12 error | [] [] [] | 16 fetchmail | [] | 12 fileutils | [] [] [] | 18 findutils | [] [] | 17 flex | [] [] | 15 fslint | [] | 7 gas | [] | 3 gawk | [] | 14 gbiff | [] | 5 gcal | [] | 5 gcc | [] [] | 4 gettext-examples | [] [] [] [] [] | 21 gettext-runtime | [] [] [] [] [] | 25 gettext-tools | [] [] [] [] [] | 19 gimp-print | [] | 11 gip | [] | 8 gliv | [] [] | 7 glunarclock | [] [] | 13 gmult | [] [] [] | 13 gnubiff | [] | 3 gnucash | () [] | 10 gnucash-glossary | [] [] | 9 gpe-aerial | [] [] | 13 gpe-beam | [] [] | 13 gpe-calendar | [] [] [] [] | 18 gpe-clock | [] [] [] [] | 17 gpe-conf | [] [] | 12 gpe-contacts | [] [] | 7 gpe-edit | [] [] [] [] | 15 gpe-go | [] [] | 11 gpe-login | [] [] [] [] [] | 18 gpe-ownerinfo | [] [] [] [] | 19 gpe-sketchbook | [] [] | 14 gpe-su | [] [] [] | 16 gpe-taskmanager | [] [] [] | 17 gpe-timesheet | [] [] [] [] | 17 gpe-today | [] [] [] [] [] | 19 gpe-todo | [] [] [] | 17 gphoto2 | [] [] [] | 18 gprof | [] [] | 10 gpsdrive | | 3 gramadoir | [] | 6 grep | [] [] [] [] | 32 gretl | | 4 gsasl | [] [] | 12 gss | [] | 5 gst-plugins | [] [] [] | 17 gstreamer | [] [] [] [] | 15 gtick | [] | 11 gtkspell | [] [] [] [] | 21 hello | [] [] [] [] | 37 id-utils | [] [] | 13 impost | [] | 3 indent | [] [] [] [] | 25 iso_3166 | [] [] [] | 12 iso_3166_1 | [] [] | 20 iso_3166_2 | | 2 iso_3166_3 | [] [] | 8 iso_4217 | [] [] | 10 iso_639 | [] [] | 12 jpilot | [] [] [] | 6 jtag | | 2 jwhois | [] [] [] | 12 kbd | [] [] | 12 latrine | [] [] | 8 ld | [] | 5 libc | [] [] | 22 libextractor | | 1 libgpewidget | [] [] | 17 libgphoto2 | [] | 9 libgphoto2_port | | 5 libgsasl | [] | 7 libiconv | [] [] [] [] [] | 32 libidn | [] [] | 6 lifelines | | 4 lilypond | | 1 lingoteach | [] | 6 lynx | [] [] [] | 15 m4 | [] [] | 17 mailutils | [] | 7 make | [] [] | 18 man-db | | 5 minicom | | 11 mysecretdiary | [] [] | 12 nano | [] [] | 13 nano_1_0 | [] [] [] | 18 opcodes | [] [] | 9 parted | [] [] [] | 18 psmisc | [] | 7 ptx | [] [] | 23 pwdutils | | 1 python | | 0 radius | [] | 6 recode | [] [] | 22 rpm | [] [] | 11 screem | | 1 scrollkeeper | [] [] [] | 24 sed | [] [] [] | 21 sh-utils | [] | 15 shared-mime-info | [] [] [] | 21 sharutils | [] [] [] | 20 silky | | 3 skencil | | 6 sketch | | 6 solfege | | 4 soundtracker | [] | 8 sp | [] | 3 stardict | [] [] [] [] | 10 tar | [] [] [] [] | 15 texinfo | [] [] | 14 textutils | [] [] [] | 17 tin | | 1 tp-robot | [] [] [] | 8 tuxpaint | [] [] [] [] | 34 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux | [] [] [] | 18 vorbis-tools | [] | 10 wastesedge | | 1 wdiff | [] [] | 22 wget | [] [] | 7 xchat | [] [] [] [] | 26 xkeyboard-config | [] | 2 xpad | [] | 5 +-----------------------------------------------+ 73 teams ta tg th tk tr uk ven vi wa xh zh_CN zh_TW zu 149 domains 0 0 0 1 77 30 0 92 16 0 42 32 0 1746 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If May 2005 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. 1.6 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `translation@iro.umontreal.ca' to make the `.pot' files available to the translation teams. microdc2-0.15.6/AUTHORS0100644000076500007500000000046410516626545014440 0ustar chugunovmicrodcAuthors ======= Oskar Liljeblad Contributors ============ Jakub Jankowski - bug fix patches - Slackware support - Polish translation - Polish manual page Tiago Cogumbreiro - patch for fake address Mark Lee - emote and verbosity patch - bug reports Kanedaaa - Slackware support microdc2-0.15.6/COPYING0100644000076500007500000004312210516626545014421 0ustar chugunovmicrodc GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. microdc2-0.15.6/ChangeLog0100644000076500007500000000000010516626545015124 0ustar chugunovmicrodcmicrodc2-0.15.6/INSTALL0100644000076500007500000002243210516626545014420 0ustar chugunovmicrodcInstallation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Here is a another example: /bin/bash ./configure CONFIG_SHELL=/bin/bash Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent configuration-related scripts to be executed by `/bin/bash'. `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. microdc2-0.15.6/Makefile.am0100644000076500007500000000165610516626545015430 0ustar chugunovmicrodcACLOCAL_AMFLAGS = -I m4 SUBDIRS = po lib src EXTRA_DIST = \ doc/INTERNALS \ doc/MANIFEST.sources \ doc/TODO \ debian/changelog \ debian/control \ debian/copyright \ debian/rules \ m4/gnulib-cache.m4 .PHONY: debian rpm slackware update-gnulib debian: cd $(srcdir) && dpkg-buildpackage -rfakeroot -us -uc -sd -b rpm: rpm/@PACKAGE@.spec fakeroot rpmbuild --clean -bb rpm/@PACKAGE@.spec slackware: slackware/@PACKAGE@.SlackBuild fakeroot ./slackware/@PACKAGE@.SlackBuild clean-local: -rm -f build-stamp configure-stamp stamp-h1 -rm -f debian/compat debian/files debian/@PACKAGE@.substvars -rm -f debian/stamp-* -rm -rf debian/@PACKAGE@ # This macro is useful until gnulib-tool is incorporated into autoreconf. # Unfortunately the ./configure script is first run if configure.ac is # modified, so it is probably more useful to run the command below # manually instead. update-gnulib: gnulib-tool --import --symlink microdc2-0.15.6/Makefile.in0100644000076500007500000005532610543545246015442 0ustar chugunovmicrodc# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure $(top_srcdir)/rpm/microdc.spec.in \ $(top_srcdir)/slackware/microdc.SlackBuild.in ABOUT-NLS \ AUTHORS COPYING ChangeLog INSTALL NEWS build-aux/config.guess \ build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/missing build-aux/mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/ac_lib_readline.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/alloca.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/free.m4 \ $(top_srcdir)/m4/getaddrinfo.m4 $(top_srcdir)/m4/getdelim.m4 \ $(top_srcdir)/m4/gethostname.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/human.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconvme.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes.m4 \ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memmem.m4 $(top_srcdir)/m4/minmax.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/sig2str.m4 \ $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stdbool.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strtoimax.m4 \ $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoll.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strtoull.m4 \ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtol.m4 $(top_srcdir)/m4/xstrtoumax.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = rpm/microdc.spec slackware/microdc.SlackBuild SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FNMATCH_H = @FNMATCH_H@ GETOPT_H = @GETOPT_H@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ HAVE_LONG_64BIT = @HAVE_LONG_64BIT@ HAVE_LONG_LONG_64BIT = @HAVE_LONG_LONG_64BIT@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LOCALEDIR = @LOCALEDIR@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TR = @TR@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XML_CONFIG = @XML_CONFIG@ ac_ct_CC = @ac_ct_CC@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = po lib src EXTRA_DIST = \ doc/INTERNALS \ doc/MANIFEST.sources \ doc/TODO \ debian/changelog \ debian/control \ debian/copyright \ debian/rules \ m4/gnulib-cache.m4 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 rpm/microdc.spec: $(top_builddir)/config.status $(top_srcdir)/rpm/microdc.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ slackware/microdc.SlackBuild: $(top_builddir)/config.status $(top_srcdir)/slackware/microdc.SlackBuild.in cd $(top_builddir) && $(SHELL) ./config.status $@ uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/build-aux $(distdir)/debian $(distdir)/doc $(distdir)/m4 $(distdir)/po $(distdir)/rpm $(distdir)/slackware @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-local clean-recursive ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-recursive distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-info-am .PHONY: debian rpm slackware update-gnulib debian: cd $(srcdir) && dpkg-buildpackage -rfakeroot -us -uc -sd -b rpm: rpm/@PACKAGE@.spec fakeroot rpmbuild --clean -bb rpm/@PACKAGE@.spec slackware: slackware/@PACKAGE@.SlackBuild fakeroot ./slackware/@PACKAGE@.SlackBuild clean-local: -rm -f build-stamp configure-stamp stamp-h1 -rm -f debian/compat debian/files debian/@PACKAGE@.substvars -rm -f debian/stamp-* -rm -rf debian/@PACKAGE@ # This macro is useful until gnulib-tool is incorporated into autoreconf. # Unfortunately the ./configure script is first run if configure.ac is # modified, so it is probably more useful to run the command below # manually instead. update-gnulib: gnulib-tool --import --symlink # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: microdc2-0.15.6/NEWS0100644000076500007500000004301610516626545014067 0ustar chugunovmicrodc2005-10-18: microdc 0.11.0 released. Uploaded/download completed messages now contain time elapsed and final transfer rate. Support extended protocol for hubs - NoGetINFO and NoHello extensions are supported. Support character set conversion through the new variable charset. Messages received and sent to hub and users are now converted according to charset (unless unset). (Feature suggested by Vlad Safronov.) Display many data sizes in human readable form. Display reason why uploads failed. Link with LIBINTL for proper portability. Revamped communication between main and user processes, to reduce possible latency in the main process. Revamped user process termination handling, cleaning up messages related to that. Fixed display of private messages - now displays source user properly. User connections will now be closed after 180 seconds of inactivity. Added --config (-c) option to specify a different configuration script to load on startup. Updated manual page and added new section "Files". Add gnulib module getaddrinfo for improved portability. Add gnulib modules human, iconv, iconvme. Added lookup command to look up host IP addresses. All host name lookups are done in the background (currently only for lookup and connect commands). Parsing of downloaded file lists is now done in the background (by a separate process). Fixed bug: User connection communication is now printed in debug display (set display +debug). Added References section to web page and README. Somewhat cleaned up hub connection and disconnection messages. Improved the way user connections are named before they're identified fully. Allow localization of some strings that previously weren't localized. Fix potential bugs when reconnecting to a hub - some local values weren't cleared. Fix potential bug when GetINFO would be sent twice for a user. Oops. Send proper tag in MyINFO. Unescape certain escaped sequences (such as &) in chat text. Fix bug when an invalid $GetINFO command would be sent to the hub. Changed state in README from beta to late beta. 2005-09-17: microdc 0.10.0 released. Improve sorting for completion results. Fixed possible portability bugs in IPC code. Partial downloads are now resumed automaticly. The get command now matches complete directories even if the file name was specified with trailing slash(es). Cleaned up download and upload code, hopefully fixing a few bugs and adding some improvements. Don't open a file to upload before checking if there's a free upload slot. Cleaned up download and upload messages a bit. Fix segmentation fault when completion for cd, ls and find when file list was not received yet. The queue command now accepts zero arguments to list users we have queued files for. Fix segmentation fault when browsing oneself twice. The grantslot can now be used to displays a list of users with granted slots, and to remove granted slot for a user. The ls, find, and cd commands now accepts wildcards like get. Fixed some minor completion issues when completing file names with wildcards. The find command now accepts multiple file arguments. Improved queueing system, to pave way for automatic download support in upcoming versions. Completed downloads as well as failed ones are now kept in the queue, marked appropriately. Fix completion for unqueue command (now same as queue command). The commands get . and get .. now work properly. Fix upload slots bug: Don't grant slots to arbitrary users! (oops). Don't overwrite files when renaming after complete download. Added retry command to try to connect and download files from user. The status command now includes total bytes received and sent. 2005-09-06: Added missing package files. Added missing Slackware and Slamd64 package files. 2005-09-02: microdc 0.9.0 released. Search strings are now all required, not just one of them! (reported by Megizo Pet). The shell command can now be run without arguments to run the current shell in the foreground. Implemented completion natively. The completion support in GNU readline is no longer used, but the microdc implementation tries to mimic GNU readline. The following improvements have been made: Complete partially quoted words (e.g. /ho"me"). Add closing quote only when expected (cannot control this properly with GNU readline). Improved completion with wildcards - will no longer escape wildcards if there are many matches. Probably some other fixes as well. No longer accept c-style escapes (\n, \t etc), but still accepts octal escape sequences (\012, \011 etc). Sort file name completion results. Display files starting with dot in completion results only if completion file name starts with a dot. Implemented wildcard support for completion of local and remote files and directories. A wildcard can be disabled if escaped with backslash or if put inside double quotes (e.g. "*"). The get command now accepts wildcards. Fixed a bug: Could get stuck reading the startup script on some systems. Fix raw command - don't escape the data for HTML display like it is done with msg and say. Fix msg command - could potentially send nothing or garbage due to freeing memory before using it. Escape the message properly as well. Fixed parsing of boolean values (for active variable currently only) - true was considered negative and false positive. Also allow for flexible translation (suggested by Jakub Jankowski). Added completion for boolean values (for set active). Fix compilation problems on FreeBSD: Include "strnlen.h" where strnlen was being used. Add Gnulib modules memmem, getline, progname. Add tempfailure.h. Add Gnulib module fnmatch-gnu for wildcard support. 2005-08-13: microdc 0.8.0 released. Add a help command. Document all commands. Improve commands by accepting multiple arguments: alias, cancel, unalias, get, queue, results, unsearch, who. Fix Ctrl+C again (register signal handler for SIGINT and other signals in user processes). Add -n, --no-config command line option for preventing config files to be read and executed on startup. Improve error handling for shell command. Improve error messages for terminated user processes. Improve portability by only assigning struct sigaction.sa_restorer when available (patch submitted by Jochen Friedrich for another project). Updated FSF address in copyright and license messages. Update documentation in README, fix some typos. Fix a bunch of compilation warnings when using gcc 4.0. Build Slackware and Slamd64 packages of microdc (thanks Jakub Jankowski and Kanedaaa). Also add slackware target to Makefile.am. Add Gnulib modules sig2str. Put scripts from autoconf and automake needed for building build-aux, move the rpm spec file into rpm, the slackbuild file into slackware, and some documentation into doc. Fixed description for Slackware package (from Jakub Jankowski). Always build slackware packages with -O2 (from Jakub Jankowski). RPM packages now contain locale files as well. 2005-07-02: microdc 0.7.0 released. Created a mailing list microdc-devel@nongnu.org which is open to everyone. Add shell command for executing system commands. Fix bug in code setting non-blocking mode on file descriptors. The fd wasn't set in non-blocking mode! I can't believe everything worked well before this fix. Now microdc should be more fluid. The ls command now lists files with small size properly in long mode (-l). Fix segfault when pressing tab and no completor is expected (reported by Mark Lee). Add alias and unalias commands. Don't quote say messages sent to hub. Get rid of Invalid $MyINFO message: Unknown user .., ignoring message (reported by Gheorghe Pula). Fix small memory leak when using cd without arguments. The grantslot command now allows multiple user arguments. Change way arguments for commands are parsed - microdc now handles arguments much like the shell. This means that if you want to put double quote ("), backslash (\), semicolon (;) or number sign (#) in public or private messages (say or msg), you have to escape those characters like this: say Debian GNU/Linux 3.1 \"sarge\" is out now\; that's good. Allow commands to be separated with semicolon, like this: set downloaddir . ; set listingdir . Support comments starting with the number sign (#). Number signs inside words are not treated as comment introducers though, just like with bash. Rewrote screen handling code - fixing some display bugs such as Ctrl+C messing up the screen. Don't start when unrecognized options are encountered on command line. Correctly log warnings and other messages printed on screen if logging is enabled. The executables in the RPM packages now links with ncurses to prevent problems on Red Hat and Fedora systems. Fix many error messages: Print trailing newline. Add support for building Slackware packages (from Jakub Jankowski and Kanedaaa, thanks). The listingdir and listenaddr variables can now be set correctly. Add Gnulib modules quote, quotearg, argp, and stpcpy. Complete correctly for set log. Improved ls command: Allow multiple arguments and options (-l) anywhere. Complete directory names with trailing backslash even if completing inside a word. Send correct nick to remove users in user connections. Internal code changes: Add optparser, tempdir and tmap modules. Remove inline.h. Internal code changes: Prepare for future POSIX thread support by adding ACX_PTHREAD and removing static variables in user.c. Compile on systems where fopencookie is not available. Allow translation of more strings. Get rid of year ranges in copyright (as recommended by the FSF). 2005-06-01: microdc 0.6.0 released. Add set command, remove many commands for setting and displaying variables. Add status command for displaying various status information. The cd command now accepts - for previous directory (just like bash). Do not add already added result to searches. Wrap public and private chat messages better (when they contain newlines). The results command now displays the search pattern. Accept comma separated list of ranges for unqueue command. Display outgoing UDP search results in if debug display flag is set. Handle incomplete search results from NeoModus DirectConnect 2.20 clients. Quote strings printed (to prevent non-printable characters from being displayed). Quote strings generated as completion results. Use locale settings even if compiled without localization support. Completion for queue command now generates users with queued files only. Improved completion for set display command - check if flag starts with `-' or `+'. The unqueue and queue commands only work when connected (queues are unfortunately cleared on disconnect). Implement logging to file through set logfile and set log commands. Add connections display flag, for displaying normal user connection events. Fix bug in search handling, causing all incoming search results to be discarded (bug reported by Tomas Hallenberg). Parse $OpList hub message correcly, now issues $GetINFO for all ops. Reply to $GetNetInfo message from hubs (is this bad?). Update MANIFEST.sources (forgot to do this for 0.5.0 release). Added new Gnulib module quotearg, update some other modules Gnulib. Some internal code changes - merge ipc_private.h into ipc.c, hmap_internal.h into hmap.c, remove collections.h, common.h, substrcmp, replace intparse with intutil, add range, comparison.h, quoting, swap.h, minmaxonce.h, bksearch, tempdir, substrcmp, clean up common code. Fix handling of files starting with dots - cd .foo would not change to .foo. Corrected use of quotes in some messages ('foo' => `foo'). Add replacement for GNU Libc's comparison_fn_t. Rewrite quoting functions. Speed up file listing operations by accessing directory children map properly. 2005-05-16: microdc 0.5.0 released. Fixed copyright year for microdc manual page. rpm make target is now a .PHONY makefile target. Mention more projects in copyright section in the README. Set locale and bind to the right message domain in microdc. Otherwise localization won't work. Doh! Display emotes (patch submitted by Mark Lee). Fixed typo in manual page (patch submitted by Jakub Jankowski). Added Polish translation and Polish manual page, also from Jakub Jankowski. Fix some translation messages (especially regarding plurals). Improve detection of readline library - the configure script will fail if it is not available. GNU Readline is required - libedit or libeditline will not do. Fix memory leak in file completion code. Add display command for controlling what's displayed on screen. Remove debug command in favor of display command. Fix parsing of ranges in unqueue command, would cause crash (sooner or later). Print Invalid $Quit message only when debug enabled, some hubs send this message for users never joined. Use a more secure way to resolve and check local path of file to upload. The results command now displays whether new results are accepted for a search or not. Refuse to handle empty search patterns, both those sent by remote and those made locally. The search command will now properly issue searches that haven't been made before instead of reissuing some other search. The search command will only work when connected to a hub. Handle downloading of zero size files properly (bug reported by Jakub Jankowski). Fixed release date for 0.4.0 release. Oops! 2005-05-03: microdc 0.4.0 released. Fixed various typos in the README document. Fix debian building: target in Makefile.am is now PHONY. Add command-line options --help and --version. Add very basic manual page. Support localization. Add swedish translation. Improve some error messages and error handling in signal routines. Add newline to some error messages missing it. Improve way to determine temporary directory. Clean up common code - remove memory.h. Fix crash in share directory scanning code (crashed when file status could not be retried). Make it possible to browse ourselves. Added MANIFEST.sources file. Don't add search results to old searches (more than 60 seconds old at the moment). Create RPM packages for microdc. Rename Known bugs section and add info about lack of support for multiple share directories. Make it possible to "fake" address listening on using listenaddr command. This is useful if you are behind a router. Patch submitted by Tiago Cogumbreiro. Don't add empty lines to readline history. 2005-04-30: microdc 0.3.0 released. microdc is now hosted on Savannah. The home page has been redesigned. Better prompt - displays browsing user and current directory. Automaticly browses users when file list downloaded. Add command find to list recursively. Improve file name completion - now completes file names with spaces correctly. Improve completion for say command - now adds colon (":") when a single match is found. Fix certain error messages missing newline at end. Fix completion for transfer command. Display more information with who command. Fix bug in cd command - change to root directory now works. No longer creates full absolute path for downloaded files in the download directory. The ls command now prints file sizes in megabytes. The ls command now sorts files. The who command now sorts users by name. The who command doesn't wrap lines. Better readline check - only link with termcap and/or ncurses if necessary. Fix _rl_mark_modified_lines compilation bug (reported by Spoiala Cristian). Check max number of connections to user before sending them $RevConnectToMe. Add more error messages: "No more connections allowed...". Fix a potential bug with connections being identified for a certain user despite the fact that no more connections to that user are allowed. This should fix this error: microdc: user.c:1000: user_disconnect: Assertion `c != uc->info->conn_count' failed. Display who sent private messages (oops). Download files as ".part" and rename when completed. 2005-04-22: microdc 0.2.2 released. Use autoconf, automake and gnulib. Fix compilation warnings/errors on 64-bit platforms. Added patch to fix listenport problem (from Jakub Jankowski, thanks). The msg command no longer sends text into public... Oops! Updated README (various additions and modifications). 2004-08-21: microdc 0.2.1 released. Fixed crash on some (many) search requests. Fixed crash when disabling active mode. Fixed compile and link problems with readline on some systems (reported by Ludvig Holmström). Added a new document INTERNALS. Use user name completion for queue, unqueue and say commands for now. If file is already queued on get, retry immediately instead of doing nothing. Detection and handling of user active/passive state has been improved. TTH searches are now recognized and ignored. Print only outgoing search information when debug is enabled. Fixed minor memory leak when reusing searches (issuing same search). Internal changes: Implemented a better IPC mechanism. Better status reporting, improving latency of transfers command. Improved code looking up user connections. 2004-08-13: microdc 0.2.0 released. Alpha 2 release. Added support for searching. New commands: search, results, unsearch. Improved completion of local symbolic links (to match bash behavior). Some minor bugs that I have forgotten about were probably fixed. 2004-08-11: microdc 0.1.0 released. First release (alpha 1). microdc2-0.15.6/README0100644000076500007500000002531410526311125014233 0ustar chugunovmicrodcmicrodc2 - Introduction ====================== microdc is a command-line based Direct Connect client that uses the GNU Readline library for user interaction. It was developed from ground up and does not depend on any other program. Despite the command-line user interface, microdc was designed to be user friendly and simple to use. microdc is currently in late beta state - there may be many bugs not yet discovered. It also lacks some features that other clients support, such as file hashing, multiple hub connections, and hub list support. microdc is free software - it is licensed under the terms of the GNU General Public License (GPL). It is written in C by Oskar Liljeblad, and is designed to compile and run on modern POSIX compatible systems such as Linux. Features ======== The features of microdc include: * Nearly full support of the original Direct Connect protocol. * GNU Readline support. * Sensible tab-completion of commands, user names, local files, remote files, connection names and many other things. * One process per connection for optimal transfer rates. * Small memory footprint (I think). There are many features that I would like to implement. See the TODO document in the source code tarball for details. If you would like to develop or contribute to microdc, you are more than welcome. Please contact me - see the Feedback section below for contact information. Copyright and License ===================== microdc is copyright (C) 2004, 2005 Oskar Liljeblad 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The source code of this project may contain files from other projects, and files generated by other projects, including: * GNU Autoconf (http://www.gnu.org/software/autoconf/) * GNU Automake (http://sources.redhat.com/automake/) * GNU gettext (http://www.gnu.org/software/gettext/) * Gnulib (http://www.gnu.org/software/gnulib/) * Autoconf Macro Archive (http://ac-archive.sourceforge.net/) Such files are licensed under the terms of the GNU General Public License or a license compatible with the GNU GPL (as listed on http://www.gnu.org/licenses/license-list.html). See each file for copyright details. The translations in the po directory may contain translations from other projects, including: * GNU C Library (http://www.gnu.org/software/libc/libc.html) * GNU Core Utilities (http://www.gnu.org/software/coreutils/) See the specific message file (PO file) for copyright of those messages. Requirements ============ The following programs are required to build microdc: * GNU C Compiler (gcc), version 3.0 or later microdc makes use of some gcc 3.x features such as declarations in the middle of a block and always inlined functions. The GNU C Compiler is part of the GNU Compiler Collection which can be downloaded from http://gcc.gnu.org/. In Debian and many other distributions the package is called gcc. * make, a modern implementation The make program is required to build microdc. microdc uses Makefiles generated by GNU Automake. The recommended make is GNU Make which can be downloaded from http://www.gnu.org/software/make/. In Debian and many other distributions the package is called make. The following libraries are required to run microdc: * GNU Readline Library, version 4.0 or later microdc uses Readline for user input. GNU Readline can be downloaded from http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html. Libraries such as libedit and libeditline do not support the necessary completion features of GNU Readline, and can as such not be used with microdc. In Debian woody the required package is libreadline4 (libreadline4-dev during build). In testing and later, the recommended package is libreadline5 (and libreadline5-dev when building). Building ======== To build the microdc executable, simply run ./configure make If you want to install microdc on your system, run make install. This will copy the executable, manual page and locale files to the appropriate directories. For more information regarding configure and make, see the INSTALL document. Usage and Customization ======================= microdc is usually started like this: microdc (Some command line options are available - run microdc --help to get a list.) Once started, a prompt is displayed and microdc is ready for your command. You can get a list of commands by pressing tab on the empty prompt or by issuing the help command. The help command can also be used to get information on a specific command: help exit The first thing you would do is setting share and download directory: set sharedir /path/to/files/i/want/to/share set downloaddir /path/where/i/want/downloaded/files/saved If you are not behind a firewall that prevents you from receiving connections from the outside world, you can use the set active command to enable active mode. Set the desired port to listen on client connections on using listenport, then enable active mode: set listenport 10101 set active 1 If you omit the set listenport command, a random free port will be picked for you. There are many commands to change your settings, some of them are: set nick my_neat_nickname set description "I have nothing to share" set email i.m.living@off.the.example.net set speed 56Kbps Next you must connect to a hub. Use the connect command to do this: connect my.favorite.hub.example.com:43912 The port part (":43912") is optional. Once connected, you can chat a little: say "Hello all, I'm using this new DC client called microdc!" msg some_operator "Please don't ban me, microdc is still in development!" Note that the double quotes aren't strictly necessary in this case, but if you don't use them all consecutive whitespace will be translated to a single space (e.g. "foo bar" becomes "foo bar"). Semicolon (;) and number sign (#) will also have special meanings, just like in the shell. Semicolon is used to separate multiple commands on one line, and number sign as the first character of a word will introduce comments.

You can get a list of users online: who Or you can browse other people's files: browse some_user The first time you issue the browse command, the user's file list will be downloaded and saved to the listing directory, which is usually /tmp/microdc.PID. This can be changed with the set listingdir command. The listing files will be removed when you exit microdc. Note that the prompt will change when the file list has been downloaded and processed. The following commands are available when browsing: cd some/dir pwd ls some/dir/or/file ls -l some/dir/or/file get some/dir/or/file The cd command changes directory, pwd prints the current directory, ls lists files and get downloads or queues files for download. (Tab completion is supported for remote file listings when browsing, so I recommend using that.) Once finished browsing the user, enter browse with no arguments to stop browsing that user: browse Downloads will start as soon as you enter the get command. A list of user connections can be retrieved using the transfers command: transfers This command will list all connections along with their names and current status. You can disconnect a connection using the cancel command: cancel my_friend|UL Use the search command to search for files: search favorite open source program The names of the files returned will contain all of the words specified with the search command. At the moment it is not possible to specify file type, or minimum or maximum size. The review the results of a search operation, use the results command: results 1 If you omit the search index to the results command, it will list all issued searches. Once finished playing around with microdc, quit with exit: exit If you want to execute some commands on start up (such as setting your nickname or active setting), you can place them in .microdc/config in your home directory. This directory also holds the history file (.microdc/history). One last thing: If your find that microdc is being banned from hubs, try change the client tag with the tag command, e.g.: set tag ++ V:0.401 References ========== Note that this list of references is not complete. Protocol references: * Direct Connect protocol reference (http://www.lwave.ca/shasta/protocol.html) * Direct Connect protocol reference (alternate version) (http://wza.digitalbrains.com/DC/doc/Introduction.html) * DC++ Wiki (http://dcplusplus.sourceforge.net/wiki/) * DC++ $UserIp2 extension (http://dc.ade.se/userip/) Homepage ======== Web site and file area for microdc is hosted on Savannah: http://www.nongnu.org/microdc/ The latest version of microdc should always be available on this site. Feedback ======== Please send bug reports, suggestions, ideas or comments in general to the mailing list: microdc-devel@nongnu.org (http://lists.nongnu.org/mailman/listinfo/microdc-devel) The author of microdc and this document, Oskar Liljeblad, can be contacted by e-mail on the following address: oskar@osk.mine.nu (mailto:oskar@osk.mine.nu) If you would like to get involved with this project, please don't hesitate to write to the mailing list or the author (me)! All contributions are welcomed. Known bugs and missing features =============================== There is no support for multiple share directories at this time, but microdc will follow symbolic links when scanning for files to share. This way you can share files on multiple drives and have full control of the share directory layout. You might get this error when connected and logging in to a hub: Cannot send to hub - Connection reset by peer This means that the hub has disconnected you, and that microdc did not yet receive the reason. This happens on some hubs with bots that can disconnect you. When there are more than a screen-full of completion matches, readline will display a question "Display all N possibilities? (y or n)". No hub input can be processed until this question is answered due to the internal design of microdc. Weird things may happen to the prompt when resizing the window. I am currently investigating this problem. Things to do ============ Please see the TODO document. - microdc2-0.15.6/aclocal.m40100644000076500007500000010300010533104324015177 0ustar chugunovmicrodc# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='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. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ac_define_dir.m4]) m4_include([m4/ac_lib_readline.m4]) m4_include([m4/acx_pthread.m4]) m4_include([m4/alloca.m4]) m4_include([m4/dirname.m4]) m4_include([m4/dos.m4]) m4_include([m4/eoverflow.m4]) m4_include([m4/error.m4]) m4_include([m4/exitfail.m4]) m4_include([m4/extensions.m4]) m4_include([m4/fnmatch.m4]) m4_include([m4/free.m4]) m4_include([m4/getaddrinfo.m4]) m4_include([m4/getdelim.m4]) m4_include([m4/gethostname.m4]) m4_include([m4/getline.m4]) m4_include([m4/getopt.m4]) m4_include([m4/gettext.m4]) m4_include([m4/gnulib-comp.m4]) m4_include([m4/human.m4]) m4_include([m4/iconv.m4]) m4_include([m4/iconvme.m4]) m4_include([m4/intmax_t.m4]) m4_include([m4/inttypes.m4]) m4_include([m4/inttypes_h.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/longdouble.m4]) m4_include([m4/longlong.m4]) m4_include([m4/mbrtowc.m4]) m4_include([m4/mbstate_t.m4]) m4_include([m4/memmem.m4]) m4_include([m4/minmax.m4]) m4_include([m4/nls.m4]) m4_include([m4/onceonly_2_57.m4]) m4_include([m4/po.m4]) m4_include([m4/progtest.m4]) m4_include([m4/quote.m4]) m4_include([m4/quotearg.m4]) m4_include([m4/restrict.m4]) m4_include([m4/safe-read.m4]) m4_include([m4/safe-write.m4]) m4_include([m4/sig2str.m4]) m4_include([m4/signed.m4]) m4_include([m4/size_max.m4]) m4_include([m4/socklen.m4]) m4_include([m4/sockpfaf.m4]) m4_include([m4/ssize_t.m4]) m4_include([m4/stdbool.m4]) m4_include([m4/stdint.m4]) m4_include([m4/stdint_h.m4]) m4_include([m4/stpcpy.m4]) m4_include([m4/strdup.m4]) m4_include([m4/strftime.m4]) m4_include([m4/strndup.m4]) m4_include([m4/strnlen.m4]) m4_include([m4/strtoimax.m4]) m4_include([m4/strtol.m4]) m4_include([m4/strtoll.m4]) m4_include([m4/strtoul.m4]) m4_include([m4/strtoull.m4]) m4_include([m4/strtoumax.m4]) m4_include([m4/time_r.m4]) m4_include([m4/tm_gmtoff.m4]) m4_include([m4/uintmax_t.m4]) m4_include([m4/ulonglong.m4]) m4_include([m4/vasnprintf.m4]) m4_include([m4/vasprintf.m4]) m4_include([m4/wchar_t.m4]) m4_include([m4/wint_t.m4]) m4_include([m4/xalloc.m4]) m4_include([m4/xsize.m4]) m4_include([m4/xstrndup.m4]) m4_include([m4/xstrtol.m4]) m4_include([m4/xstrtoumax.m4]) microdc2-0.15.6/config.h.in0100644000076500007500000003520510527045202015377 0ustar chugunovmicrodc/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define as good substitute value for EOVERFLOW. */ #undef EOVERFLOW /* Define on systems for which file names may have a so-called `drive letter' prefix, define this to compute the length of that prefix, including the colon. */ #undef FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX /* Define if the backslash character may also serve as a file name component separator. */ #undef FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR #if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX # define FILE_SYSTEM_PREFIX_LEN(Filename) \ ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) #else # define FILE_SYSTEM_PREFIX_LEN(Filename) 0 #endif /* Define to 1 if you have `alloca' after including , a header that may be supplied by this distribution. */ #undef HAVE_ALLOCA /* Define HAVE_ALLOCA_H for backward compatibility with older code that includes only if HAVE_ALLOCA_H is defined. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `btowc' function. */ #undef HAVE_BTOWC /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define to 1 if the system has the type `comparison_fn_t'. */ #undef HAVE_COMPARISON_FN_T /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `freeaddrinfo', and to 0 if you don't. */ #undef HAVE_DECL_FREEADDRINFO /* Define to 1 if you have the declaration of `gai_strerror', and to 0 if you don't. */ #undef HAVE_DECL_GAI_STRERROR /* Define to 1 if you have the declaration of `getaddrinfo', and to 0 if you don't. */ #undef HAVE_DECL_GETADDRINFO /* Define to 1 if you have the declaration of `getdelim', and to 0 if you don't. */ #undef HAVE_DECL_GETDELIM /* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. */ #undef HAVE_DECL_GETENV /* Define to 1 if you have the declaration of `getline', and to 0 if you don't. */ #undef HAVE_DECL_GETLINE /* Define to 1 if you have the declaration of `memmem', and to 0 if you don't. */ #undef HAVE_DECL_MEMMEM /* Define to 1 if you have the declaration of `strdup', and to 0 if you don't. */ #undef HAVE_DECL_STRDUP /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the declaration of `strnlen', and to 0 if you don't. */ #undef HAVE_DECL_STRNLEN /* Define to 1 if you have the declaration of `strtoimax', and to 0 if you don't. */ #undef HAVE_DECL_STRTOIMAX /* Define to 1 if you have the declaration of `strtoll', and to 0 if you don't. */ #undef HAVE_DECL_STRTOLL /* Define to 1 if you have the declaration of `strtoull', and to 0 if you don't. */ #undef HAVE_DECL_STRTOULL /* Define to 1 if you have the declaration of `strtoumax', and to 0 if you don't. */ #undef HAVE_DECL_STRTOUMAX /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME /* Define to 1 if you have the `flockfile' function. */ #undef HAVE_FLOCKFILE /* Define to 1 if you have the `funlockfile' function. */ #undef HAVE_FUNLOCKFILE /* Define to 1 if you have the `gai_strerror' function. */ #undef HAVE_GAI_STRERROR /* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `getdelim' function. */ #undef HAVE_GETDELIM /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_HISTORY_H /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define if you have the 'intmax_t' type in or . */ #undef HAVE_INTMAX_T /* Define if exists and doesn't clash with . */ #undef HAVE_INTTYPES_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_INTTYPES_H_WITH_UINTMAX /* Define to 1 if defines AF_INET. */ #undef HAVE_IPV4 /* Define to 1 if defines AF_INET6. */ #undef HAVE_IPV6 /* Define to 1 if you have the `isascii' function. */ #undef HAVE_ISASCII /* Define to 1 if you have the `iswprint' function. */ #undef HAVE_ISWPRINT /* Define if you have a readline compatible library */ #undef HAVE_LIBREADLINE /* Define if libxml2 is installed */ #undef HAVE_LIBXML2 /* Define if you have the 'long double' type. */ #undef HAVE_LONG_DOUBLE /* Define if you have the 'long long' type. */ #undef HAVE_LONG_LONG /* Define to 1 if you have the `mblen' function. */ #undef HAVE_MBLEN /* Define to 1 if you have the `mbrlen' function. */ #undef HAVE_MBRLEN /* Define to 1 if mbrtowc and mbstate_t are properly declared. */ #undef HAVE_MBRTOWC /* Define to 1 if you have the `mbsinit' function. */ #undef HAVE_MBSINIT /* Define to 1 if you have the `mbsrtowcs' function. */ #undef HAVE_MBSRTOWCS /* Define to 1 if declares mbstate_t. */ #undef HAVE_MBSTATE_T /* Define to 1 if you have the `memmem' function. */ #undef HAVE_MEMMEM /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mempcpy' function. */ #undef HAVE_MEMPCPY /* Define to 1 if defines the MIN and MAX macros. */ #undef HAVE_MINMAX_IN_LIMITS_H /* Define to 1 if defines the MIN and MAX macros. */ #undef HAVE_MINMAX_IN_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if the system has the type `ptrdiff_t'. */ #undef HAVE_PTRDIFF_T /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_H /* Define if your readline library has `add_history' */ #undef HAVE_READLINE_HISTORY /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define to 1 if you have the `sig2str' function. */ #undef HAVE_SIG2STR /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define if exists, doesn't clash with , and declares uintmax_t. */ #undef HAVE_STDINT_H_WITH_UINTMAX /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `stpcpy' function. */ #undef HAVE_STPCPY /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strtoimax' function. */ #undef HAVE_STRTOIMAX /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the `strtoull' function. */ #undef HAVE_STRTOULL /* Define to 1 if you have the `strtoumax' function. */ #undef HAVE_STRTOUMAX /* Define to 1 if the system has the type `struct addrinfo'. */ #undef HAVE_STRUCT_ADDRINFO /* Define to 1 if `sa_restorer' is member of `struct sigaction'. */ #undef HAVE_STRUCT_SIGACTION_SA_RESTORER /* Define to 1 if `tm_zone' is member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* Define to 1 if you have the header file. */ #undef HAVE_SYS_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if localtime_r, etc. have the type signatures that POSIX requires. */ #undef HAVE_TIME_R_POSIX /* Define if struct tm has the tm_gmtoff member. */ #undef HAVE_TM_GMTOFF /* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use `HAVE_STRUCT_TM_TM_ZONE' instead. */ #undef HAVE_TM_ZONE /* Define to 1 if you don't have `tm_zone' but do have the external array `tzname'. */ #undef HAVE_TZNAME /* Define to 1 if you have the `tzset' function. */ #undef HAVE_TZSET /* Define if you have the 'uintmax_t' type in or . */ #undef HAVE_UINTMAX_T /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define if you have the 'unsigned long long' type. */ #undef HAVE_UNSIGNED_LONG_LONG /* Define to 1 if you have the `vasnprintf' function. */ #undef HAVE_VASNPRINTF /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define if you have the 'wchar_t' type. */ #undef HAVE_WCHAR_T /* Define to 1 if you have the `wcslen' function. */ #undef HAVE_WCSLEN /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define if you have the 'wint_t' type. */ #undef HAVE_WINT_T /* Define to 1 if you have the `wmemchr' function. */ #undef HAVE_WMEMCHR /* Define to 1 if you have the `wmemcpy' function. */ #undef HAVE_WMEMCPY /* Define to 1 if you have the `wmempcpy' function. */ #undef HAVE_WMEMPCPY /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define if _rl_mark_modified_lines exists in -lreadline. */ #undef HAVE__RL_MARK_MODIFIED_LINES /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST #if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR # define ISSLASH(C) ((C) == '/' || (C) == '\\') #else # define ISSLASH(C) ((C) == '/') #endif /* Directory where gettext translations are kept. */ #undef LOCALEDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the maximum value of type 'size_t', if the system doesn't define it. */ #undef SIZE_MAX /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* The libxml2 version 2.6.16 has no such option defined in the library headers */ #undef XML_SAVE_FORMAT /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Enable extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Define to rpl_ if the getopt replacement functions and variables should be used. */ #undef __GETOPT_PREFIX /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to a replacement function name for fnmatch(). */ #undef fnmatch /* Define to rpl_free if the replacement function should be used. */ #undef free /* Define to a replacement function name for getline(). */ #undef getline /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to long or long long if and don't define. */ #undef intmax_t /* Define to a type if does not define. */ #undef mbstate_t /* Define to the name of the strftime replacement function. */ #undef my_strftime /* Define to equivalent of C99 restrict keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ #undef restrict /* Define to empty if the C compiler doesn't support this keyword. */ #undef signed /* Define to `unsigned int' if does not define. */ #undef size_t /* Map `socklen_t' to `int' if it is missing. */ #undef socklen_t /* Define as a signed type of the same size as size_t. */ #undef ssize_t /* Define to rpl_strnlen if the replacement function should be used. */ #undef strnlen /* Define to unsigned long or unsigned long long if and don't define. */ #undef uintmax_t microdc2-0.15.6/configure0100755000076500007500000236024010543545263015277 0ustar chugunovmicrodc#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.60 for microdc2 0.15.6. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # Find out whether ``test -x'' works. 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 as_executable_p="test -x" else as_executable_p=: fi rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='microdc2' PACKAGE_TARNAME='microdc2' PACKAGE_VERSION='0.15.6' PACKAGE_STRING='microdc2 0.15.6' PACKAGE_BUGREPORT='vladch@k804.mainet.msk.su' ac_unique_file="src/microdc.h" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #endif #if HAVE_STDINT_H # include #endif #if HAVE_UNISTD_H # include #endif" gl_header_list= gl_func_list= ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar LOCALEDIR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP GREP EGREP ALLOCA ALLOCA_H LIBOBJS FNMATCH_H GETOPT_H STDBOOL_H HAVE__BOOL build build_cpu build_vendor build_os host host_cpu host_vendor host_os LIBICONV LTLIBICONV HAVE_LONG_64BIT HAVE_LONG_LONG_64BIT STDINT_H EOVERFLOW MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE INTL_MACOSX_LIBS INTLLIBS LIBINTL LTLIBINTL POSUB RANLIB READLINE_LIBS XML_CONFIG TR LIBXML2_LIBS LIBXML2_CFLAGS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures microdc2 0.15.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/microdc2] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of microdc2 0.15.6:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-rpath do not hardcode runtime library paths --disable-nls do not use Native Language Support --disable-largefile omit support for large files Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF microdc2 configure 0.15.6 generated by GNU Autoconf 2.60 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by microdc2 $as_me 0.15.6, which was generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gl_header_list="$gl_header_list netinet/in.h" gl_header_list="$gl_header_list wchar.h" gl_header_list="$gl_header_list wctype.h" gl_func_list="$gl_func_list iswprint" gl_func_list="$gl_func_list mbsinit" gl_header_list="$gl_header_list sys/types.h" gl_header_list="$gl_header_list sys/socket.h" gl_func_list="$gl_func_list mblen" gl_func_list="$gl_func_list mbrlen" gl_func_list="$gl_func_list mempcpy" gl_func_list="$gl_func_list tzset" gl_header_list="$gl_header_list sys/time.h" gl_func_list="$gl_func_list isascii" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" case m4 in [\\/]* | ?:[\\/]* ) ac_macro_dir=m4 ;; *) ac_macro_dir=$srcdir/m4 ;; esac test -d "$ac_macro_dir" || { { echo "$as_me:$LINENO: error: cannot find macro directory \`m4'" >&5 echo "$as_me: error: cannot find macro directory \`m4'" >&2;} { (exit 1); exit 1; }; } # doesn't seem to have any effect at the moment ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&5 echo "$as_me: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='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. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='microdc2' VERSION='0.15.6' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Initialize config.h cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix eval ac_define_dir="\"$datadir/locale\"" eval ac_define_dir="\"$ac_define_dir\"" LOCALEDIR="$ac_define_dir" cat >>confdefs.h <<_ACEOF #define LOCALEDIR "$ac_define_dir" _ACEOF test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE # Enable maintainer mode { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Gnulib DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f conftest* { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_minix_config_h+set}" = set; then { echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking minix/config.h usability" >&5 echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking minix/config.h presence" >&5 echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to vladch@k804.mainet.msk.su ## ## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } fi if test $ac_cv_header_minix_config_h = yes; then MINIX=yes else MINIX= fi if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF fi cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF { echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi { echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 echo $ECHO_N "checking whether system is Windows or MSDOS... $ECHO_C" >&6; } if test "${ac_cv_win_or_dos+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__ neither MSDOS nor Windows #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_win_or_dos=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_win_or_dos=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 echo "${ECHO_T}$ac_cv_win_or_dos" >&6; } if test x"$ac_cv_win_or_dos" = xyes; then ac_fs_accepts_drive_letter_prefix=1 ac_fs_backslash_is_file_name_separator=1 else ac_fs_accepts_drive_letter_prefix=0 ac_fs_backslash_is_file_name_separator=0 fi cat >>confdefs.h <<_ACEOF #define FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix _ACEOF cat >>confdefs.h <<_ACEOF #define FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator _ACEOF { echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strerror_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strerror_r char *p = (char *) strerror_r; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strerror_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strerror_r=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6; } if test $ac_cv_have_decl_strerror_r = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 0 _ACEOF fi for ac_func in strerror_r do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6; } if test "${ac_cv_func_strerror_r_char_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); return !p || x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); return ! isalpha (x); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then cat >>confdefs.h <<\_ACEOF #define STRERROR_R_CHAR_P 1 _ACEOF fi { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !x[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi { echo "$as_me:$LINENO: checking for mbstate_t" >&5 echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6; } if test "${ac_cv_type_mbstate_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default # include int main () { mbstate_t x; return sizeof x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mbstate_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mbstate_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6; } if test $ac_cv_type_mbstate_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MBSTATE_T 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define mbstate_t int _ACEOF fi { echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6; } if test "${gl_cv_c_restrict+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gl_cv_c_restrict=no # Try the official restrict keyword, then gcc's __restrict, and # the less common variants. for ac_kw in restrict __restrict __restrict__ _Restrict; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ float * $ac_kw x; _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_c_restrict=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done fi { echo "$as_me:$LINENO: result: $gl_cv_c_restrict" >&5 echo "${ECHO_T}$gl_cv_c_restrict" >&6; } case $gl_cv_c_restrict in restrict) ;; no) cat >>confdefs.h <<\_ACEOF #define restrict _ACEOF ;; *) cat >>confdefs.h <<_ACEOF #define restrict $gl_cv_c_restrict _ACEOF ;; esac { echo "$as_me:$LINENO: checking for IPv4 sockets" >&5 echo $ECHO_N "checking for IPv4 sockets... $ECHO_C" >&6; } if test "${gl_cv_socket_ipv4+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { int x = AF_INET; struct in_addr y; struct sockaddr_in z; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_socket_ipv4=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_socket_ipv4=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_socket_ipv4" >&5 echo "${ECHO_T}$gl_cv_socket_ipv4" >&6; } if test $gl_cv_socket_ipv4 = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_IPV4 1 _ACEOF fi { echo "$as_me:$LINENO: checking for IPv6 sockets" >&5 echo $ECHO_N "checking for IPv6 sockets... $ECHO_C" >&6; } if test "${gl_cv_socket_ipv6+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_socket_ipv6=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_socket_ipv6=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_socket_ipv6" >&5 echo "${ECHO_T}$gl_cv_socket_ipv6" >&6; } if test $gl_cv_socket_ipv6 = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_IPV6 1 _ACEOF fi { echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac for ac_header in $gl_header_list do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to vladch@k804.mainet.msk.su ## ## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether getdelim is declared" >&5 echo $ECHO_N "checking whether getdelim is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getdelim+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef getdelim char *p = (char *) getdelim; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getdelim=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getdelim=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_getdelim" >&5 echo "${ECHO_T}$ac_cv_have_decl_getdelim" >&6; } if test $ac_cv_have_decl_getdelim = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETDELIM 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETDELIM 0 _ACEOF fi if test -z "$GETOPT_H"; then for ac_header in getopt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to vladch@k804.mainet.msk.su ## ## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else GETOPT_H=getopt.h fi done fi if test -z "$GETOPT_H"; then for ac_func in getopt_long_only do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else GETOPT_H=getopt.h fi done fi if test -z "$GETOPT_H"; then { echo "$as_me:$LINENO: checking whether optreset is declared" >&5 echo $ECHO_N "checking whether optreset is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_optreset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef optreset char *p = (char *) optreset; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_optreset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_optreset=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5 echo "${ECHO_T}$ac_cv_have_decl_optreset" >&6; } if test $ac_cv_have_decl_optreset = yes; then GETOPT_H=getopt.h fi fi if test -z "$GETOPT_H"; then { echo "$as_me:$LINENO: checking for working GNU getopt function" >&5 echo $ECHO_N "checking for working GNU getopt function... $ECHO_C" >&6; } if test "${gl_cv_func_gnu_getopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then { echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5 echo $ECHO_N "checking whether getopt_clip is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getopt_clip+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef getopt_clip char *p = (char *) getopt_clip; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getopt_clip=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getopt_clip=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5 echo "${ECHO_T}$ac_cv_have_decl_getopt_clip" >&6; } if test $ac_cv_have_decl_getopt_clip = yes; then gl_cv_func_gnu_getopt=no else gl_cv_func_gnu_getopt=yes fi else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *myargv[3]; myargv[0] = "conftest"; myargv[1] = "-+"; myargv[2] = 0; return getopt (2, myargv, "+a") != '?'; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_gnu_getopt=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gl_cv_func_gnu_getopt=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5 echo "${ECHO_T}$gl_cv_func_gnu_getopt" >&6; } if test "$gl_cv_func_gnu_getopt" = "no"; then GETOPT_H=getopt.h fi fi { echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) -0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) -0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; int main () { return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l + !m + !n + !o + !p); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } { echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef _Bool ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6; } if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi # Define two additional variables used in the Makefile substitution. if test "$ac_cv_header_stdbool_h" = yes; then STDBOOL_H='' else STDBOOL_H='stdbool.h' fi if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 else HAVE__BOOL=0 fi { echo "$as_me:$LINENO: checking for inttypes.h" >&5 echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } if test "${gl_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_inttypes_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5 echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6; } if test $gl_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H_WITH_UINTMAX 1 _ACEOF fi { echo "$as_me:$LINENO: checking for stdint.h" >&5 echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } if test "${gl_cv_header_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { uintmax_t i = (uintmax_t) -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_header_stdint_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_stdint_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 echo "${ECHO_T}$gl_cv_header_stdint_h" >&6; } if test $gl_cv_header_stdint_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H_WITH_UINTMAX 1 _ACEOF fi { echo "$as_me:$LINENO: checking for unsigned long long" >&5 echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ unsigned long long ull = 1ULL; int i = 63; int main () { unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_unsigned_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_unsigned_long_long=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; } if test $ac_cv_type_unsigned_long_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_LONG_LONG 1 _ACEOF fi if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' cat >>confdefs.h <<_ACEOF #define uintmax_t $ac_type _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_UINTMAX_T 1 _ACEOF fi 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" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # 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 ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } 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 { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 fi LD="$acl_cv_path_LD" if test -n "$LD"; then { echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 fi { echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 echo "${ECHO_T}$acl_cv_rpath" >&6; } 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" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBICONV= LTLIBICONV= INCICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' 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" 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" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else 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 $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" 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 LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else 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 if test "$hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" 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 haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then 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 $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" 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 INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; 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 $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" 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 LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" 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 LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then 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 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*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi { echo "$as_me:$LINENO: checking whether memmem is declared" >&5 echo $ECHO_N "checking whether memmem is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_memmem+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef memmem char *p = (char *) memmem; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_memmem=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_memmem=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_memmem" >&5 echo "${ECHO_T}$ac_cv_have_decl_memmem" >&6; } if test $ac_cv_have_decl_memmem = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MEMMEM 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MEMMEM 0 _ACEOF fi { echo "$as_me:$LINENO: checking whether defines MIN and MAX" >&5 echo $ECHO_N "checking whether defines MIN and MAX... $ECHO_C" >&6; } if test "${gl_cv_minmax_in_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int x = MIN (42, 17); int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_minmax_in_limits_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_minmax_in_limits_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_minmax_in_limits_h" >&5 echo "${ECHO_T}$gl_cv_minmax_in_limits_h" >&6; } if test $gl_cv_minmax_in_limits_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MINMAX_IN_LIMITS_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether defines MIN and MAX" >&5 echo $ECHO_N "checking whether defines MIN and MAX... $ECHO_C" >&6; } if test "${gl_cv_minmax_in_sys_param_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int x = MIN (42, 17); int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_minmax_in_sys_param_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_minmax_in_sys_param_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_minmax_in_sys_param_h" >&5 echo "${ECHO_T}$gl_cv_minmax_in_sys_param_h" >&6; } if test $gl_cv_minmax_in_sys_param_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MINMAX_IN_SYS_PARAM_H 1 _ACEOF fi for ac_func in $gl_func_list do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } if test "${gt_cv_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int x = sizeof (ssize_t *) + sizeof (ssize_t); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_ssize_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 echo "${ECHO_T}$gt_cv_ssize_t" >&6; } if test $gt_cv_ssize_t = no; then cat >>confdefs.h <<\_ACEOF #define ssize_t int _ACEOF fi { echo "$as_me:$LINENO: checking for inttypes.h" >&5 echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6; } if test "${gt_cv_header_inttypes_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_header_inttypes_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_header_inttypes_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_header_inttypes_h" >&5 echo "${ECHO_T}$gt_cv_header_inttypes_h" >&6; } if test $gt_cv_header_inttypes_h = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether strdup is declared" >&5 echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strdup+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strdup char *p = (char *) strdup; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strdup=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strdup=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5 echo "${ECHO_T}$ac_cv_have_decl_strdup" >&6; } if test $ac_cv_have_decl_strdup = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRDUP 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRDUP 0 _ACEOF fi for ac_func in strftime do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_strftime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strftime (); int main () { return strftime (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_intl_strftime=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_strftime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6; } if test $ac_cv_lib_intl_strftime = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRFTIME 1 _ACEOF LIBS="-lintl $LIBS" fi fi done { echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct tm *tp; tp->tm_sec; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_cv_struct_tm> int main () { static struct tm ac_aggr; if (ac_aggr.tm_zone) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_zone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_cv_struct_tm> int main () { static struct tm ac_aggr; if (sizeof ac_aggr.tm_zone) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_zone=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } if test $ac_cv_member_struct_tm_tm_zone = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 _ACEOF fi if test "$ac_cv_member_struct_tm_tm_zone" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TM_ZONE 1 _ACEOF else { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef tzname char *p = (char *) tzname; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_tzname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } if test $ac_cv_have_decl_tzname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 0 _ACEOF fi { echo "$as_me:$LINENO: checking for tzname" >&5 echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } if test "${ac_cv_var_tzname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if !HAVE_DECL_TZNAME extern char *tzname[]; #endif int main () { return tzname[0][0]; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_var_tzname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 echo "${ECHO_T}$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TZNAME 1 _ACEOF fi fi { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5 echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6; } if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct tm ac_aggr; if (sizeof ac_aggr.tm_gmtoff) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_tm_tm_gmtoff=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_gmtoff=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5 echo "${ECHO_T}$ac_cv_member_struct_tm_tm_gmtoff" >&6; } if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TM_GMTOFF 1 _ACEOF fi case " $LIBOBJS " in *" strftime.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strftime.$ac_objext" ;; esac # strftime.c uses the underyling system strftime if it exists. # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. : : cat >>confdefs.h <<\_ACEOF #define my_strftime nstrftime _ACEOF { echo "$as_me:$LINENO: checking whether strnlen is declared" >&5 echo $ECHO_N "checking whether strnlen is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strnlen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strnlen char *p = (char *) strnlen; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strnlen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strnlen=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strnlen" >&5 echo "${ECHO_T}$ac_cv_have_decl_strnlen" >&6; } if test $ac_cv_have_decl_strnlen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNLEN 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNLEN 0 _ACEOF fi { echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6; } if test "${ac_cv_type_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ long long ll = 1LL; int i = 63; int main () { long long llmax = (long long) -1; return ll << i | ll >> i | llmax / ll | llmax % ll; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long_long=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 echo "${ECHO_T}$ac_cv_type_long_long" >&6; } if test $ac_cv_type_long_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_LONG 1 _ACEOF fi { echo "$as_me:$LINENO: checking for EOVERFLOW" >&5 echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6; } if test "${ac_cv_decl_EOVERFLOW+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef EOVERFLOW yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then have_eoverflow=1 fi rm -f conftest* if test -n "$have_eoverflow"; then ac_cv_decl_EOVERFLOW=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef EOVERFLOW yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then have_eoverflow=1 fi rm -f conftest* if test -n "$have_eoverflow"; then if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include int main () { static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_decl_EOVERFLOW=$ac_lo;; '') ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include static long int longval () { return EOVERFLOW; } static unsigned long int ulongval () { return EOVERFLOW; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((EOVERFLOW) < 0) { long int i = longval (); if (i != (EOVERFLOW)) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != (EOVERFLOW)) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_decl_EOVERFLOW=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val else ac_cv_decl_EOVERFLOW=E2BIG fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5 echo "${ECHO_T}$ac_cv_decl_EOVERFLOW" >&6; } if test "$ac_cv_decl_EOVERFLOW" != yes; then cat >>confdefs.h <<_ACEOF #define EOVERFLOW $ac_cv_decl_EOVERFLOW _ACEOF EOVERFLOW="$ac_cv_decl_EOVERFLOW" fi { echo "$as_me:$LINENO: checking for signed" >&5 echo $ECHO_N "checking for signed... $ECHO_C" >&6; } if test "${bh_cv_c_signed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { signed char x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then bh_cv_c_signed=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 bh_cv_c_signed=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $bh_cv_c_signed" >&5 echo "${ECHO_T}$bh_cv_c_signed" >&6; } if test $bh_cv_c_signed = no; then cat >>confdefs.h <<\_ACEOF #define signed _ACEOF fi { echo "$as_me:$LINENO: checking for long double" >&5 echo $ECHO_N "checking for long double... $ECHO_C" >&6; } if test "${gt_cv_c_long_double+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$GCC" = yes; then gt_cv_c_long_double=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_long_double=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_long_double=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5 echo "${ECHO_T}$gt_cv_c_long_double" >&6; } if test $gt_cv_c_long_double = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONG_DOUBLE 1 _ACEOF fi { echo "$as_me:$LINENO: checking for wchar_t" >&5 echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } if test "${gt_cv_c_wchar_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include wchar_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_wchar_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wchar_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5 echo "${ECHO_T}$gt_cv_c_wchar_t" >&6; } if test $gt_cv_c_wchar_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WCHAR_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking for wint_t" >&5 echo $ECHO_N "checking for wint_t... $ECHO_C" >&6; } if test "${gt_cv_c_wint_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include wint_t foo = (wchar_t)'\0'; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_wint_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_wint_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5 echo "${ECHO_T}$gt_cv_c_wint_t" >&6; } if test $gt_cv_c_wint_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_WINT_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for intmax_t" >&5 echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6; } if test "${gt_cv_c_intmax_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif int main () { intmax_t x = -1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_c_intmax_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_c_intmax_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5 echo "${ECHO_T}$gt_cv_c_intmax_t" >&6; } if test $gt_cv_c_intmax_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_INTMAX_T 1 _ACEOF else test $ac_cv_type_long_long = yes \ && ac_type='long long' \ || ac_type='long' cat >>confdefs.h <<_ACEOF #define intmax_t $ac_type _ACEOF fi : { echo "$as_me:$LINENO: checking whether strtoimax is declared" >&5 echo $ECHO_N "checking whether strtoimax is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strtoimax+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strtoimax char *p = (char *) strtoimax; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strtoimax=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strtoimax=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoimax" >&5 echo "${ECHO_T}$ac_cv_have_decl_strtoimax" >&6; } if test $ac_cv_have_decl_strtoimax = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOIMAX 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOIMAX 0 _ACEOF fi { echo "$as_me:$LINENO: checking whether strtoumax is declared" >&5 echo $ECHO_N "checking whether strtoumax is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strtoumax+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strtoumax char *p = (char *) strtoumax; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strtoumax=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strtoumax=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoumax" >&5 echo "${ECHO_T}$ac_cv_have_decl_strtoumax" >&6; } if test $ac_cv_have_decl_strtoumax = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOUMAX 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOUMAX 0 _ACEOF fi if test $ac_cv_func_alloca_works = no; then : fi # Define an additional variable used in the Makefile substitution. if test $ac_cv_working_alloca_h = yes; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined __GNUC__ || defined _AIX || defined _MSC_VER Need own alloca #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Need own alloca" >/dev/null 2>&1; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF ALLOCA_H=alloca.h else ALLOCA_H= fi rm -f conftest* else ALLOCA_H=alloca.h fi cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF case " $LIBOBJS " in *" dirname.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS dirname.$ac_objext" ;; esac { echo "$as_me:$LINENO: checking for error_at_line" >&5 echo $ECHO_N "checking for error_at_line... $ECHO_C" >&6; } if test "${ac_cv_lib_error_at_line+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { error_at_line (0, 0, "", 0, ""); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_error_at_line=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_error_at_line=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS error.$ac_objext" ;; esac fi : case " $LIBOBJS " in *" exitfail.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS exitfail.$ac_objext" ;; esac : # No macro. You should also use one of fnmatch-posix or fnmatch-gnu. FNMATCH_H= { echo "$as_me:$LINENO: checking for working GNU fnmatch" >&5 echo $ECHO_N "checking for working GNU fnmatch... $ECHO_C" >&6; } if test "${ac_cv_func_fnmatch_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_fnmatch_gnu=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # define y(a, b, c) (fnmatch (a, b, c) == 0) # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) static int fnm (char const *pattern, char const *string, int flags) { return fnmatch (pattern, string, flags); } int main () { exit (!((fnm ? fnm : fnmatch) ("a*", "", 0) == FNM_NOMATCH && y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) && n ("a\\\\bc", "abc", FNM_NOESCAPE) && y ("*x", ".x", 0) && n ("*x", ".x", FNM_PERIOD) && y ("xxXX", "xXxX", FNM_CASEFOLD) && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH) && n ("d*/*1", "d/s/1", FNM_FILE_NAME) && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR) && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR) && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR))); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fnmatch_gnu=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_fnmatch_gnu=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_fnmatch_gnu" >&5 echo "${ECHO_T}$ac_cv_func_fnmatch_gnu" >&6; } if test $ac_cv_func_fnmatch_gnu = yes; then rm -f lib/fnmatch.h else { echo "$as_me:$LINENO: checking whether getenv is declared" >&5 echo $ECHO_N "checking whether getenv is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getenv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef getenv char *p = (char *) getenv; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getenv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getenv=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5 echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6; } if test $ac_cv_have_decl_getenv = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETENV 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETENV 0 _ACEOF fi for ac_func in btowc mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in wchar.h wctype.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to vladch@k804.mainet.msk.su ## ## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done case " $LIBOBJS " in *" fnmatch.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS fnmatch.$ac_objext" ;; esac FNMATCH_H=fnmatch.h fi if test $ac_cv_func_fnmatch_gnu != yes; then cat >>confdefs.h <<\_ACEOF #define fnmatch gnu_fnmatch _ACEOF fi { echo "$as_me:$LINENO: checking whether free (NULL) is known to work" >&5 echo $ECHO_N "checking whether free (NULL) is known to work... $ECHO_C" >&6; } if test "${gl_cv_func_free+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #if _POSIX_VERSION < 199009L && \ (defined unix || defined _unix || defined _unix_ \ || defined __unix || defined __unix__) #error "'free (NULL)' is not known to work" #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_free=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_func_free=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_func_free" >&5 echo "${ECHO_T}$gl_cv_func_free" >&6; } if test $gl_cv_func_free = no; then case " $LIBOBJS " in *" free.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS free.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define free rpl_free _ACEOF fi { echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5 echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6; } if test "${ac_cv_search_getaddrinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getaddrinfo (); int main () { return getaddrinfo (); ; return 0; } _ACEOF for ac_lib in '' nsl socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_getaddrinfo=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_getaddrinfo+set}" = set; then break fi done if test "${ac_cv_search_getaddrinfo+set}" = set; then : else ac_cv_search_getaddrinfo=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5 echo "${ECHO_T}$ac_cv_search_getaddrinfo" >&6; } ac_res=$ac_cv_search_getaddrinfo if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_search_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF for ac_lib in '' inet nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_gethostbyname=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_gethostbyname+set}" = set; then break fi done if test "${ac_cv_search_gethostbyname+set}" = set; then : else ac_cv_search_gethostbyname=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; } ac_res=$ac_cv_search_gethostbyname if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { echo "$as_me:$LINENO: checking for library containing getservbyname" >&5 echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6; } if test "${ac_cv_search_getservbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getservbyname (); int main () { return getservbyname (); ; return 0; } _ACEOF for ac_lib in '' inet nsl socket xnet; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_getservbyname=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_getservbyname+set}" = set; then break fi done if test "${ac_cv_search_getservbyname+set}" = set; then : else ac_cv_search_getservbyname=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5 echo "${ECHO_T}$ac_cv_search_getservbyname" >&6; } ac_res=$ac_cv_search_getservbyname if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_func in getaddrinfo gai_strerror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done : { echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5 echo $ECHO_N "checking whether getaddrinfo is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getaddrinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ #include #include #include int main () { #ifndef getaddrinfo char *p = (char *) getaddrinfo; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getaddrinfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getaddrinfo=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_getaddrinfo" >&5 echo "${ECHO_T}$ac_cv_have_decl_getaddrinfo" >&6; } if test $ac_cv_have_decl_getaddrinfo = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETADDRINFO 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETADDRINFO 0 _ACEOF fi { echo "$as_me:$LINENO: checking whether freeaddrinfo is declared" >&5 echo $ECHO_N "checking whether freeaddrinfo is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_freeaddrinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ #include #include #include int main () { #ifndef freeaddrinfo char *p = (char *) freeaddrinfo; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_freeaddrinfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_freeaddrinfo=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_freeaddrinfo" >&5 echo "${ECHO_T}$ac_cv_have_decl_freeaddrinfo" >&6; } if test $ac_cv_have_decl_freeaddrinfo = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FREEADDRINFO 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FREEADDRINFO 0 _ACEOF fi { echo "$as_me:$LINENO: checking whether gai_strerror is declared" >&5 echo $ECHO_N "checking whether gai_strerror is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_gai_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ #include #include #include int main () { #ifndef gai_strerror char *p = (char *) gai_strerror; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_gai_strerror=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_gai_strerror=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_gai_strerror" >&5 echo "${ECHO_T}$ac_cv_have_decl_gai_strerror" >&6; } if test $ac_cv_have_decl_gai_strerror = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GAI_STRERROR 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GAI_STRERROR 0 _ACEOF fi { echo "$as_me:$LINENO: checking for struct addrinfo" >&5 echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6; } if test "${ac_cv_type_struct_addrinfo+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include typedef struct addrinfo ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_struct_addrinfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_struct_addrinfo=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5 echo "${ECHO_T}$ac_cv_type_struct_addrinfo" >&6; } if test $ac_cv_type_struct_addrinfo = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_ADDRINFO 1 _ACEOF fi for ac_func in getdelim do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done : if test $ac_cv_func_getdelim = no; then for ac_func in flockfile funlockfile do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi for ac_func in gethostname do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_gethostname = no; then for ac_func in uname do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi { echo "$as_me:$LINENO: checking whether getline is declared" >&5 echo $ECHO_N "checking whether getline is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_getline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef getline char *p = (char *) getline; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_getline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_getline=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_getline" >&5 echo "${ECHO_T}$ac_cv_have_decl_getline" >&6; } if test $ac_cv_have_decl_getline = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETLINE 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GETLINE 0 _ACEOF fi gl_getline_needs_run_time_check=no { echo "$as_me:$LINENO: checking for getline" >&5 echo $ECHO_N "checking for getline... $ECHO_C" >&6; } if test "${ac_cv_func_getline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define getline to an innocuous variant, in case declares getline. For example, HP-UX 11i declares gettimeofday. */ #define getline innocuous_getline /* System header to define __stub macros and hopefully few prototypes, which can conflict with char getline (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef getline /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getline (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_getline || defined __stub___getline choke me #endif int main () { return getline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_getline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_getline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_getline" >&5 echo "${ECHO_T}$ac_cv_func_getline" >&6; } if test $ac_cv_func_getline = yes; then gl_getline_needs_run_time_check=yes else am_cv_func_working_getline=no fi if test $gl_getline_needs_run_time_check = yes; then { echo "$as_me:$LINENO: checking for working getline function" >&5 echo $ECHO_N "checking for working getline function... $ECHO_C" >&6; } if test "${am_cv_func_working_getline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo fooN |tr -d '\012'|tr N '\012' > conftest.data if test "$cross_compiling" = yes; then am_cv_func_working_getline=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ # include # include # include int main () { /* Based on a test program from Karl Heuer. */ char *line = NULL; size_t siz = 0; int len; FILE *in = fopen ("./conftest.data", "r"); if (!in) return 1; len = getline (&line, &siz, in); exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1); } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_working_getline=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) am_cv_func_working_getline=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $am_cv_func_working_getline" >&5 echo "${ECHO_T}$am_cv_func_working_getline" >&6; } fi if test $am_cv_func_working_getline = no; then cat >>confdefs.h <<\_ACEOF #define getline gnu_getline _ACEOF case " $LIBOBJS " in *" getline.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getline.$ac_objext" ;; esac for ac_func in getdelim do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done : if test $ac_cv_func_getdelim = no; then for ac_func in flockfile funlockfile do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi fi if test -n "$GETOPT_H"; then case " $LIBOBJS " in *" getopt.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getopt.$ac_objext" ;; esac case " $LIBOBJS " in *" getopt1.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS getopt1.$ac_objext" ;; esac GETOPT_H=getopt.h cat >>confdefs.h <<\_ACEOF #define __GETOPT_PREFIX rpl_ _ACEOF : fi case " $LIBOBJS " in *" human.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS human.$ac_objext" ;; esac : am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBICONV" >&5 echo "${ECHO_T}$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { echo "$as_me:$LINENO: checking for iconv declaration" >&5 echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6; } if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #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 int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi for ac_func in memmem do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done : : case " $LIBOBJS " in *" quote.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS quote.$ac_objext" ;; esac case " $LIBOBJS " in *" quotearg.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS quotearg.$ac_objext" ;; esac : : { echo "$as_me:$LINENO: checking for mbstate_t" >&5 echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6; } if test "${ac_cv_type_mbstate_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default # include int main () { mbstate_t x; return sizeof x; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mbstate_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mbstate_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5 echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6; } if test $ac_cv_type_mbstate_t = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MBSTATE_T 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define mbstate_t int _ACEOF fi { echo "$as_me:$LINENO: checking whether mbrtowc and mbstate_t are properly declared" >&5 echo $ECHO_N "checking whether mbrtowc and mbstate_t are properly declared... $ECHO_C" >&6; } if test "${gl_cv_func_mbrtowc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { wchar_t wc; char const s[] = ""; size_t n = 1; mbstate_t state; return ! (sizeof state && (mbrtowc) (&wc, s, n, &state)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_func_mbrtowc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_func_mbrtowc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_func_mbrtowc" >&5 echo "${ECHO_T}$gl_cv_func_mbrtowc" >&6; } if test $gl_cv_func_mbrtowc = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MBRTOWC 1 _ACEOF fi { echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5 echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6; } if test "${gl_cv_c_restrict+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gl_cv_c_restrict=no # Try the official restrict keyword, then gcc's __restrict, and # the less common variants. for ac_kw in restrict __restrict __restrict__ _Restrict; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ float * $ac_kw x; _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_c_restrict=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done fi { echo "$as_me:$LINENO: result: $gl_cv_c_restrict" >&5 echo "${ECHO_T}$gl_cv_c_restrict" >&6; } case $gl_cv_c_restrict in restrict) ;; no) cat >>confdefs.h <<\_ACEOF #define restrict _ACEOF ;; *) cat >>confdefs.h <<_ACEOF #define restrict $gl_cv_c_restrict _ACEOF ;; esac case " $LIBOBJS " in *" safe-read.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS safe-read.$ac_objext" ;; esac case " $LIBOBJS " in *" safe-write.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS safe-write.$ac_objext" ;; esac for ac_func in sig2str do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_sig2str = no; then : fi for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to vladch@k804.mainet.msk.su ## ## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for SIZE_MAX" >&5 echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6; } result= cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Found it" >/dev/null 2>&1; then result=yes fi rm -f conftest* if test -z "$result"; then if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 / 10) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 / 10) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 / 10) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 / 10) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 / 10) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) res_hi=$ac_lo;; '') result=? ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static long int longval () { return (size_t)~(size_t)0 / 10; } static unsigned long int ulongval () { return (size_t)~(size_t)0 / 10; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((size_t)~(size_t)0 / 10) < 0) { long int i = longval (); if (i != ((size_t)~(size_t)0 / 10)) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((size_t)~(size_t)0 / 10)) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then res_hi=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) result=? fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 % 10) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 % 10) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 % 10) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 % 10) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !(((size_t)~(size_t)0 % 10) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) res_lo=$ac_lo;; '') result=? ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static long int longval () { return (size_t)~(size_t)0 % 10; } static unsigned long int ulongval () { return (size_t)~(size_t)0 % 10; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((size_t)~(size_t)0 % 10) < 0) { long int i = longval (); if (i != ((size_t)~(size_t)0 % 10)) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((size_t)~(size_t)0 % 10)) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then res_lo=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) result=? fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) fits_in_uint=$ac_lo;; '') result=? ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include static long int longval () { return sizeof (size_t) <= sizeof (unsigned int); } static unsigned long int ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if ((sizeof (size_t) <= sizeof (unsigned int)) < 0) { long int i = longval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != (sizeof (size_t) <= sizeof (unsigned int))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fits_in_uint=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) result=? fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val if test "$fits_in_uint" = 1; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern size_t foo; extern unsigned long foo; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then fits_in_uint=0 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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 result='((size_t)~(size_t)0)' fi fi { echo "$as_me:$LINENO: result: $result" >&5 echo "${ECHO_T}$result" >&6; } if test "$result" != yes; then cat >>confdefs.h <<_ACEOF #define SIZE_MAX $result _ACEOF fi : { echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif) typedef socklen_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } if test $ac_cv_type_socklen_t = yes; then : else cat >>confdefs.h <<\_ACEOF #define socklen_t int _ACEOF fi { echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } if test "${gt_cv_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { int x = sizeof (ssize_t *) + sizeof (ssize_t); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_ssize_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_ssize_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_ssize_t" >&5 echo "${ECHO_T}$gt_cv_ssize_t" >&6; } if test $gt_cv_ssize_t = no; then cat >>confdefs.h <<\_ACEOF #define ssize_t int _ACEOF fi # Define two additional variables used in the Makefile substitution. if test "$ac_cv_header_stdbool_h" = yes; then STDBOOL_H='' else STDBOOL_H='stdbool.h' fi if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 else HAVE__BOOL=0 fi for ac_header in sys/inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to vladch@k804.mainet.msk.su ## ## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking for stdint.h" >&5 echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6; } if test "${gl_cv_header_stdint_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_header_stdint_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_header_stdint_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5 echo "${ECHO_T}$gl_cv_header_stdint_h" >&6; } if test $gl_cv_header_stdint_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDINT_H 1 _ACEOF STDINT_H='' else STDINT_H='stdint.h' { echo "$as_me:$LINENO: checking whether 'long' is 64 bit wide" >&5 echo $ECHO_N "checking whether 'long' is 64 bit wide... $ECHO_C" >&6; } if test "${gl_cv_long_bitsize_64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define POW63 ((((((long) 1 << 15) << 15) << 15) << 15) << 3) #define POW64 ((((((long) 1 << 15) << 15) << 15) << 15) << 4) typedef int array [2 * (POW63 != 0 && POW64 == 0) - 1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_long_bitsize_64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_long_bitsize_64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_long_bitsize_64" >&5 echo "${ECHO_T}$gl_cv_long_bitsize_64" >&6; } if test $gl_cv_long_bitsize_64 = yes; then HAVE_LONG_64BIT=1 else HAVE_LONG_64BIT=0 fi { echo "$as_me:$LINENO: checking whether 'long long' is 64 bit wide" >&5 echo $ECHO_N "checking whether 'long long' is 64 bit wide... $ECHO_C" >&6; } if test "${gl_cv_longlong_bitsize_64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define POW63 ((((((long long) 1 << 15) << 15) << 15) << 15) << 3) #define POW64 ((((((long long) 1 << 15) << 15) << 15) << 15) << 4) typedef int array [2 * (POW63 != 0 && POW64 == 0) - 1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_longlong_bitsize_64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_longlong_bitsize_64=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_longlong_bitsize_64" >&5 echo "${ECHO_T}$gl_cv_longlong_bitsize_64" >&6; } if test $gl_cv_longlong_bitsize_64 = yes; then HAVE_LONG_LONG_64BIT=1 else HAVE_LONG_LONG_64BIT=0 fi fi for ac_func in stpcpy do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_stpcpy = no; then : fi for ac_func in strdup do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done : : for ac_func in strndup do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_strndup = no; then : fi { echo "$as_me:$LINENO: checking for working strnlen" >&5 echo $ECHO_N "checking for working strnlen... $ECHO_C" >&6; } if test "${ac_cv_func_strnlen_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_strnlen_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #define S "foobar" #define S_LEN (sizeof S - 1) /* At least one implementation is buggy: that of AIX 4.3 would give strnlen (S, 1) == 3. */ int i; for (i = 0; i < S_LEN + 1; ++i) { int expected = i <= S_LEN ? i : S_LEN; if (strnlen (S, i) != expected) return 1; } return 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strnlen_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_strnlen_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_strnlen_working" >&5 echo "${ECHO_T}$ac_cv_func_strnlen_working" >&6; } test $ac_cv_func_strnlen_working = no && case " $LIBOBJS " in *" strnlen.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strnlen.$ac_objext" ;; esac if test $ac_cv_func_strnlen_working = no; then # This is necessary because automake-1.6.1 doens't understand # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. #AC_LIBOBJ(strnlen) cat >>confdefs.h <<\_ACEOF #define strnlen rpl_strnlen _ACEOF : fi { echo "$as_me:$LINENO: checking whether defines strtoimax as a macro" >&5 echo $ECHO_N "checking whether defines strtoimax as a macro... $ECHO_C" >&6; } if test "${jm_cv_func_strtoimax_macro+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef strtoimax inttypes_h_defines_strtoimax #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "inttypes_h_defines_strtoimax" >/dev/null 2>&1; then jm_cv_func_strtoimax_macro=yes else jm_cv_func_strtoimax_macro=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $jm_cv_func_strtoimax_macro" >&5 echo "${ECHO_T}$jm_cv_func_strtoimax_macro" >&6; } if test "$jm_cv_func_strtoimax_macro" != yes; then for ac_func in strtoimax do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_strtoimax = no; then if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then test $ac_cv_type_long_long = yes \ && ac_type='long long' \ || ac_type='long' cat >>confdefs.h <<_ACEOF #define intmax_t $ac_type _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_INTMAX_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether strtoll is declared" >&5 echo $ECHO_N "checking whether strtoll is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strtoll+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strtoll char *p = (char *) strtoll; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strtoll=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strtoll=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoll" >&5 echo "${ECHO_T}$ac_cv_have_decl_strtoll" >&6; } if test $ac_cv_have_decl_strtoll = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOLL 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOLL 0 _ACEOF fi fi fi for ac_func in strtol do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_strtol = no; then : fi if test "$ac_cv_type_long_long" = yes; then for ac_func in strtoll do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_strtoll = no; then : fi fi for ac_func in strtoul do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_strtoul = no; then : fi if test "$ac_cv_type_unsigned_long_long" = yes; then for ac_func in strtoull do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_strtoull = no; then : fi fi { echo "$as_me:$LINENO: checking whether defines strtoumax as a macro" >&5 echo $ECHO_N "checking whether defines strtoumax as a macro... $ECHO_C" >&6; } if test "${jm_cv_func_strtoumax_macro+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef strtoumax inttypes_h_defines_strtoumax #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "inttypes_h_defines_strtoumax" >/dev/null 2>&1; then jm_cv_func_strtoumax_macro=yes else jm_cv_func_strtoumax_macro=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $jm_cv_func_strtoumax_macro" >&5 echo "${ECHO_T}$jm_cv_func_strtoumax_macro" >&6; } if test "$jm_cv_func_strtoumax_macro" != yes; then for ac_func in strtoumax do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_strtoumax = no; then if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' cat >>confdefs.h <<_ACEOF #define uintmax_t $ac_type _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_UINTMAX_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether strtoull is declared" >&5 echo $ECHO_N "checking whether strtoull is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_strtoull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { #ifndef strtoull char *p = (char *) strtoull; return !p; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strtoull=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_strtoull=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_strtoull" >&5 echo "${ECHO_T}$ac_cv_have_decl_strtoull" >&6; } if test $ac_cv_have_decl_strtoull = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOULL 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRTOULL 0 _ACEOF fi fi fi { echo "$as_me:$LINENO: checking whether localtime_r is compatible with its POSIX signature" >&5 echo $ECHO_N "checking whether localtime_r is compatible with its POSIX signature... $ECHO_C" >&6; } if test "${gl_cv_time_r_posix+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { /* We don't need to append 'restrict's to the argument types, even though the POSIX signature has the 'restrict's, since C99 says they can't affect type compatibility. */ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gl_cv_time_r_posix=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gl_cv_time_r_posix=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gl_cv_time_r_posix" >&5 echo "${ECHO_T}$gl_cv_time_r_posix" >&6; } if test $gl_cv_time_r_posix = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TIME_R_POSIX 1 _ACEOF else case " $LIBOBJS " in *" time_r.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS time_r.$ac_objext" ;; esac : fi for ac_func in vasnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_vasnprintf = no; then case " $LIBOBJS " in *" printf-args.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS printf-args.$ac_objext" ;; esac case " $LIBOBJS " in *" printf-parse.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS printf-parse.$ac_objext" ;; esac case " $LIBOBJS " in *" asnprintf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS asnprintf.$ac_objext" ;; esac { echo "$as_me:$LINENO: checking for ptrdiff_t" >&5 echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6; } if test "${ac_cv_type_ptrdiff_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef ptrdiff_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_ptrdiff_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ptrdiff_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5 echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6; } if test $ac_cv_type_ptrdiff_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_PTRDIFF_T 1 _ACEOF fi for ac_func in snprintf wcslen do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi for ac_func in vasprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else case " $LIBOBJS " in *" $ac_func.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;; esac fi done if test $ac_cv_func_vasprintf = no; then case " $LIBOBJS " in *" asprintf.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS asprintf.$ac_objext" ;; esac fi case " $LIBOBJS " in *" xmalloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS xmalloc.$ac_objext" ;; esac : : for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to vladch@k804.mainet.msk.su ## ## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done : case " $LIBOBJS " in *" xstrtol.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS xstrtol.$ac_objext" ;; esac case " $LIBOBJS " in *" xstrtoul.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS xstrtoul.$ac_objext" ;; esac # Gettext 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 { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } # 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 "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; 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..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 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); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # 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 "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; 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..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 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); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f messages.po # 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 "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; 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..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 echo "${ECHO_T}$MSGMERGE" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$GMSGFMT" != ":"; then 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,^.*/,,'` { echo "$as_me:$LINENO: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 echo "${ECHO_T}found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } GMSGFMT=":" fi fi if test "$XGETTEXT" != ":"; then 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 { echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi rm -f messages.po fi ac_config_commands="$ac_config_commands default-1" { echo "$as_me:$LINENO: checking for CFPreferencesCopyAppValue" >&5 echo $ECHO_N "checking for CFPreferencesCopyAppValue... $ECHO_C" >&6; } if test "${gt_cv_func_CFPreferencesCopyAppValue+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_CFPreferencesCopyAppValue=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 echo "${ECHO_T}$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFPREFERENCESCOPYAPPVALUE 1 _ACEOF fi { echo "$as_me:$LINENO: checking for CFLocaleCopyCurrent" >&5 echo $ECHO_N "checking for CFLocaleCopyCurrent... $ECHO_C" >&6; } if test "${gt_cv_func_CFLocaleCopyCurrent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" gt_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreFoundation" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_CFLocaleCopyCurrent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 echo "${ECHO_T}$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CFLOCALECOPYCURRENT 1 _ACEOF 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 { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } LIBINTL= LTLIBINTL= POSUB= if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } if test "${gt_cv_func_gnugettext1_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_gnugettext1_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libc" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6; } if test "$gt_cv_func_gnugettext1_libc" != "yes"; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBICONV" >&5 echo "${ECHO_T}$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBINTL= LTLIBINTL= INCINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' 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" 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" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else 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 $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" 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 LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else 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 if test "$hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" 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 haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then 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 $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" 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 INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; 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 $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" 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 LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" 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 LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then 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 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*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } if test "${gt_cv_func_gnugettext1_libintl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_gnugettext1_libintl=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" gt_cv_func_gnugettext1_libintl=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi { echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext1_libintl" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext1_libintl" >&6; } fi if test "$gt_cv_func_gnugettext1_libc" = "yes" \ || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then 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 cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF else USE_NLS=no fi fi { echo "$as_me:$LINENO: checking whether to use NLS" >&5 echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { echo "$as_me:$LINENO: result: $gt_source" >&5 echo "${ECHO_T}$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then { echo "$as_me:$LINENO: checking how to link with libintl" >&5 echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBINTL" >&5 echo "${ECHO_T}$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi POSUB=po fi INTLLIBS="$LIBINTL" # This is commented out, because with it, 'autoreconf -is' in autogen.sh will # try to overwrite files in m4 from the gettext distribution. Unfortunately, # at least in my case, gnulib provides newer files than the gettext distribution # does. # AM_GNU_GETTEXT_VERSION(0.14.3) # Checks for programs ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Checks for libraries #ACX_PTHREAD #ACX_PTHREAD([], [AC_MSG_ERROR([POSIX Threads is required to build and run this project.])]) { echo "$as_me:$LINENO: checking for the GNU Readline library" >&5 echo $ECHO_N "checking for the GNU Readline library... $ECHO_C" >&6; } ORIG_LIBS="$LIBS" for readline_lib in readline; do for termcap_lib in "" termcap curses ncurses; do if test -z "$termcap_lib"; then TRY_LIB="-l$readline_lib" else TRY_LIB="-l$readline_lib -l$termcap_lib" fi LIBS="$ORIG_LIBS $TRY_LIB" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ol_cv_lib_readline="$TRY_LIB" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -n "$ol_cv_lib_readline"; then break fi done if test -n "$ol_cv_lib_readline"; then break fi done if test -z "$ol_cv_lib_readline"; then { echo "$as_me:$LINENO: result: not found" >&5 echo "${ECHO_T}not found" >&6; } READLINE_LIBS="" { { echo "$as_me:$LINENO: error: GNU Readline is required to build and run this project." >&5 echo "$as_me: error: GNU Readline is required to build and run this project." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: result: found" >&5 echo "${ECHO_T}found" >&6; } READLINE_LIBS="$ol_cv_lib_readline" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF for ac_header in readline.h readline/readline.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to vladch@k804.mainet.msk.su ## ## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ol_cv_lib_readline_history="no" { echo "$as_me:$LINENO: checking whether readline supports history" >&5 echo $ECHO_N "checking whether readline supports history... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char add_history (); int main () { return add_history (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_READLINE_HISTORY 1 _ACEOF for ac_header in history.h readline/history.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------------- ## ## Report this to vladch@k804.mainet.msk.su ## ## ---------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi LIBS="$ORIG_LIBS" ### FIXME: move these to _rl_mark_modified_lines OLD_LIBS="$LIBS" LIBS="$LIBS $READLINE_LIBS" { echo "$as_me:$LINENO: checking for _rl_mark_modified_lines" >&5 echo $ECHO_N "checking for _rl_mark_modified_lines... $ECHO_C" >&6; } if test "${ac_cv_func__rl_mark_modified_lines+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define _rl_mark_modified_lines to an innocuous variant, in case declares _rl_mark_modified_lines. For example, HP-UX 11i declares gettimeofday. */ #define _rl_mark_modified_lines innocuous__rl_mark_modified_lines /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _rl_mark_modified_lines (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef _rl_mark_modified_lines /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _rl_mark_modified_lines (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub__rl_mark_modified_lines || defined __stub____rl_mark_modified_lines choke me #endif int main () { return _rl_mark_modified_lines (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__rl_mark_modified_lines=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func__rl_mark_modified_lines=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func__rl_mark_modified_lines" >&5 echo "${ECHO_T}$ac_cv_func__rl_mark_modified_lines" >&6; } if test $ac_cv_func__rl_mark_modified_lines = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE__RL_MARK_MODIFIED_LINES 1 _ACEOF fi LIBS="$OLD_LIBS" #AH_TEMPLATE([XML_SAVE_FORMAT], [1], [Define if libxml2 has no such option for xmlSave- functions]) # Extract the first word of "xml2-config", so it can be a program name with args. set dummy xml2-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XML_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $XML_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_XML_CONFIG="$XML_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XML_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XML_CONFIG=$ac_cv_path_XML_CONFIG if test -n "$XML_CONFIG"; then { echo "$as_me:$LINENO: result: $XML_CONFIG" >&5 echo "${ECHO_T}$XML_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "tr", so it can be a program name with args. set dummy tr; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_TR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $TR in [\\/]* | ?:[\\/]*) ac_cv_path_TR="$TR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_TR="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi TR=$ac_cv_path_TR if test -n "$TR"; then { echo "$as_me:$LINENO: result: $TR" >&5 echo "${ECHO_T}$TR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -n "$XML_CONFIG" && test -n "$TR"; then LIBXML2_VERSION=`$XML_CONFIG --version | $TR -d "."` if test $LIBXML2_VERSION -eq 2616; then cat >>confdefs.h <<\_ACEOF #define XML_SAVE_FORMAT 1 _ACEOF fi if test $LIBXML2_VERSION -ge 2616; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBXML2 1 _ACEOF LIBXML2_LIBS="`$XML_CONFIG --libs`" LIBXML2_CFLAGS="`$XML_CONFIG --cflags`" # LIBS="$LIBS $LIBXML2_LIBS" # CFLAGS="$CFLAGS $LIBXML2_CFLAGS" else { echo "$as_me:$LINENO: WARNING: XML libxml2 library version 2.6.16 or later is required to support XML filelists" >&5 echo "$as_me: WARNING: XML libxml2 library version 2.6.16 or later is required to support XML filelists" >&2;} fi fi # Checks for header files # Checks for typedefs, structures, and compiler characteristics # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } if test "$ac_cv_sys_file_offset_bits" != no; then cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF fi rm -f conftest* { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } if test "$ac_cv_sys_large_files" != no; then cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF fi rm -f conftest* fi { echo "$as_me:$LINENO: checking for comparison_fn_t" >&5 echo $ECHO_N "checking for comparison_fn_t... $ECHO_C" >&6; } if test "${ac_cv_type_comparison_fn_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef comparison_fn_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_comparison_fn_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_comparison_fn_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_comparison_fn_t" >&5 echo "${ECHO_T}$ac_cv_type_comparison_fn_t" >&6; } if test $ac_cv_type_comparison_fn_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_COMPARISON_FN_T 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct sigaction.sa_restorer" >&5 echo $ECHO_N "checking for struct sigaction.sa_restorer... $ECHO_C" >&6; } if test "${ac_cv_member_struct_sigaction_sa_restorer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct sigaction ac_aggr; if (ac_aggr.sa_restorer) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_sigaction_sa_restorer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { static struct sigaction ac_aggr; if (sizeof ac_aggr.sa_restorer) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_member_struct_sigaction_sa_restorer=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_sigaction_sa_restorer=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_sigaction_sa_restorer" >&5 echo "${ECHO_T}$ac_cv_member_struct_sigaction_sa_restorer" >&6; } if test $ac_cv_member_struct_sigaction_sa_restorer = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_SIGACTION_SA_RESTORER 1 _ACEOF fi # Checks for library functions # Output generation ac_config_files="$ac_config_files Makefile po/Makefile.in lib/Makefile src/Makefile src/common/Makefile src/bzip2/Makefile src/tth/Makefile rpm/microdc.spec" ac_config_files="$ac_config_files slackware/microdc.SlackBuild" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # Find out whether ``test -x'' works. 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 as_executable_p="test -x" else as_executable_p=: fi rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by microdc2 $as_me 0.15.6, which was generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ microdc2 config.status 0.15.6 configured by $0, generated by GNU Autoconf 2.60, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # 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%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/common/Makefile") CONFIG_FILES="$CONFIG_FILES src/common/Makefile" ;; "src/bzip2/Makefile") CONFIG_FILES="$CONFIG_FILES src/bzip2/Makefile" ;; "src/tth/Makefile") CONFIG_FILES="$CONFIG_FILES src/tth/Makefile" ;; "rpm/microdc.spec") CONFIG_FILES="$CONFIG_FILES rpm/microdc.spec" ;; "slackware/microdc.SlackBuild") CONFIG_FILES="$CONFIG_FILES slackware/microdc.SlackBuild" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim LOCALEDIR!$LOCALEDIR$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim ALLOCA!$ALLOCA$ac_delim ALLOCA_H!$ALLOCA_H$ac_delim LIBOBJS!$LIBOBJS$ac_delim FNMATCH_H!$FNMATCH_H$ac_delim GETOPT_H!$GETOPT_H$ac_delim STDBOOL_H!$STDBOOL_H$ac_delim HAVE__BOOL!$HAVE__BOOL$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim LIBICONV!$LIBICONV$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF LTLIBICONV!$LTLIBICONV$ac_delim HAVE_LONG_64BIT!$HAVE_LONG_64BIT$ac_delim HAVE_LONG_LONG_64BIT!$HAVE_LONG_LONG_64BIT$ac_delim STDINT_H!$STDINT_H$ac_delim EOVERFLOW!$EOVERFLOW$ac_delim MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim USE_NLS!$USE_NLS$ac_delim MSGFMT!$MSGFMT$ac_delim GMSGFMT!$GMSGFMT$ac_delim XGETTEXT!$XGETTEXT$ac_delim MSGMERGE!$MSGMERGE$ac_delim INTL_MACOSX_LIBS!$INTL_MACOSX_LIBS$ac_delim INTLLIBS!$INTLLIBS$ac_delim LIBINTL!$LIBINTL$ac_delim LTLIBINTL!$LTLIBINTL$ac_delim POSUB!$POSUB$ac_delim RANLIB!$RANLIB$ac_delim READLINE_LIBS!$READLINE_LIBS$ac_delim XML_CONFIG!$XML_CONFIG$ac_delim TR!$TR$ac_delim LIBXML2_LIBS!$LIBXML2_LIBS$ac_delim LIBXML2_CFLAGS!$LIBXML2_CFLAGS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 23; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "default-1":C) 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 ;; "slackware/microdc.SlackBuild":F) chmod +x slackware/microdc.SlackBuild ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi microdc2-0.15.6/configure.ac0100664000076500007500000000555210543545130015651 0ustar chugunovmicrodc# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # Initialization AC_PREREQ(2.59) AC_INIT(microdc2, 0.15.6, [vladch@k804.mainet.msk.su]) AC_CONFIG_SRCDIR([src/microdc.h]) AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([m4]) # doesn't seem to have any effect at the moment AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE # Initialize config.h AC_GNU_SOURCE AC_DEFINE_DIR(LOCALEDIR, datadir/locale, [Directory where gettext translations are kept.]) # Enable maintainer mode AM_MAINTAINER_MODE # Gnulib gl_EARLY gl_INIT # Gettext AM_GNU_GETTEXT([external]) # This is commented out, because with it, 'autoreconf -is' in autogen.sh will # try to overwrite files in m4 from the gettext distribution. Unfortunately, # at least in my case, gnulib provides newer files than the gettext distribution # does. # AM_GNU_GETTEXT_VERSION(0.14.3) # Checks for programs AC_PROG_CC AC_PROG_RANLIB # Checks for libraries #ACX_PTHREAD #ACX_PTHREAD([], [AC_MSG_ERROR([POSIX Threads is required to build and run this project.])]) AC_LIB_READLINE([], [AC_MSG_ERROR([GNU Readline is required to build and run this project.])]) ### FIXME: move these to _rl_mark_modified_lines AH_TEMPLATE([HAVE__RL_MARK_MODIFIED_LINES], [Define if _rl_mark_modified_lines exists in -lreadline.]) OLD_LIBS="$LIBS" LIBS="$LIBS $READLINE_LIBS" AC_CHECK_FUNC(_rl_mark_modified_lines, [AC_DEFINE([HAVE__RL_MARK_MODIFIED_LINES])]) LIBS="$OLD_LIBS" AH_TEMPLATE([HAVE_LIBXML2], [Define if libxml2 is installed]) #AH_TEMPLATE([XML_SAVE_FORMAT], [1], [Define if libxml2 has no such option for xmlSave- functions]) AC_PATH_PROG(XML_CONFIG, xml2-config) AC_PATH_PROG(TR, tr) if test -n "$XML_CONFIG" && test -n "$TR"; then LIBXML2_VERSION=`$XML_CONFIG --version | $TR -d "."` if test $LIBXML2_VERSION -eq 2616; then AC_DEFINE([XML_SAVE_FORMAT], [1], [The libxml2 version 2.6.16 has no such option defined in the library headers]) fi if test $LIBXML2_VERSION -ge 2616; then AC_DEFINE([HAVE_LIBXML2]) LIBXML2_LIBS="`$XML_CONFIG --libs`" LIBXML2_CFLAGS="`$XML_CONFIG --cflags`" AC_SUBST(LIBXML2_LIBS) AC_SUBST(LIBXML2_CFLAGS) # LIBS="$LIBS $LIBXML2_LIBS" # CFLAGS="$CFLAGS $LIBXML2_CFLAGS" else AC_MSG_WARN([XML libxml2 library version 2.6.16 or later is required to support XML filelists]) fi fi # Checks for header files # Checks for typedefs, structures, and compiler characteristics AC_SYS_LARGEFILE AC_CHECK_TYPES([comparison_fn_t]) AC_CHECK_MEMBERS(struct sigaction.sa_restorer,,,[#include ]) # Checks for library functions # Output generation AC_CONFIG_FILES([Makefile po/Makefile.in lib/Makefile src/Makefile src/common/Makefile src/bzip2/Makefile src/tth/Makefile rpm/microdc.spec]) AC_CONFIG_FILES([slackware/microdc.SlackBuild], [chmod +x slackware/microdc.SlackBuild]) AC_OUTPUT microdc2-0.15.6/build-aux/0040755000076500007500000000000010527341104015244 5ustar chugunovmicrodcmicrodc2-0.15.6/build-aux/CVS/0040755000076500007500000000000010527341104015677 5ustar chugunovmicrodcmicrodc2-0.15.6/build-aux/CVS/Root0100644000076500007500000000003610527341104016541 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/build-aux/CVS/Repository0100644000076500007500000000002210527341104017770 0ustar chugunovmicrodcmicrodc/build-aux microdc2-0.15.6/build-aux/CVS/Entries0100644000076500007500000000075510527341104017237 0ustar chugunovmicrodc/config.guess/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /config.rpath/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /config.sub/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /depcomp/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /install-sh/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /missing/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /mkinstalldirs/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/build-aux/CVS/Tag0100644000076500007500000000003010527341104016323 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/build-aux/config.guess0100755000076500007500000012475310516626545017612 0ustar chugunovmicrodc#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-08-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: microdc2-0.15.6/build-aux/config.rpath0100755000076500007500000003502510516626545017573 0ustar chugunovmicrodc#! /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-2005 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 M$VC, # 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/'` cc_basename=`echo "$CC" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_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* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux*) case $cc_basename in icc* | ecc*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; sco3.2v5*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) wl='-Wl,' ;; sysv4*MP*) ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # 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 ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # 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*) # 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 ;; netbsd*) ;; solaris* | sysv5*) 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 ;; sunos4*) hardcode_direct=yes ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then # 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' 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 ;; aix4* | aix5*) 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].*|aix5*) 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 hardcode_direct=yes 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*) # 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* | kfreebsd*-gnu | 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* | hpux11*) if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) 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 ;; 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*) 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 ;; 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=: ;; sco3.2v5*) ;; 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.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' case "$host_os" in aix3*) ;; aix4* | aix5*) ;; amigaos*) ;; beos*) ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) shrext=.dylib ;; dgux*) ;; freebsd1*) ;; kfreebsd*-gnu) ;; freebsd*) ;; gnu*) ;; hpux9* | hpux10* | hpux11*) case "$host_cpu" in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac ;; irix5* | irix6* | nonstopux*) 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*) ;; knetbsd*-gnu) ;; netbsd*) ;; newsos6) ;; nto-qnx*) ;; openbsd*) ;; os2*) libname_spec='$name' shrext=.dll ;; osf3* | osf4* | osf5*) ;; sco3.2v5*) ;; solaris*) ;; sunos4*) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ;; sysv4*MP*) ;; uts4*) ;; 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_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=/' <. Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ms1 \ | msp430 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m32c) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | ms1-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; m32c-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: microdc2-0.15.6/build-aux/depcomp0100755000076500007500000003710010516626545016634 0ustar chugunovmicrodc#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # 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-end: "$" # End: microdc2-0.15.6/build-aux/install-sh0100755000076500007500000002202110516626545017257 0ustar chugunovmicrodc#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: microdc2-0.15.6/build-aux/missing0100755000076500007500000002540610516626545016664 0ustar chugunovmicrodc#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: microdc2-0.15.6/build-aux/mkinstalldirs0100755000076500007500000000653510516626545020075 0ustar chugunovmicrodc#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2004-02-15.20 # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . 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 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit 0 ;; --) # 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 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr 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-end: "$" # End: microdc2-0.15.6/debian/0040755000076500007500000000000010527341104014574 5ustar chugunovmicrodcmicrodc2-0.15.6/debian/CVS/0040755000076500007500000000000010527341104015227 5ustar chugunovmicrodcmicrodc2-0.15.6/debian/CVS/Root0100644000076500007500000000003610527341104016071 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/debian/CVS/Repository0100644000076500007500000000001710527341104017324 0ustar chugunovmicrodcmicrodc/debian microdc2-0.15.6/debian/CVS/Entries0100644000076500007500000000042010527341104016554 0ustar chugunovmicrodc/changelog/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /control/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /copyright/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /rules/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/debian/CVS/Tag0100644000076500007500000000003010527341104015653 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/debian/changelog0100644000076500007500000000237210516626545016464 0ustar chugunovmicrodcmicrodc (0.11.0-1) unstable; urgency=low * New upstream release. -- Oskar Liljeblad Tue, 18 Oct 2005 20:00:00 +0200 microdc (0.10.0-1) unstable; urgency=low * New upstream release. -- Oskar Liljeblad Sat, 17 Sep 2005 12:52:00 +0200 microdc (0.9.0-1) unstable; urgency=low * New upstream release. -- Oskar Liljeblad Fri, 2 Sep 2005 15:09:11 +0200 microdc (0.8.0-1) unstable; urgency=low * New upstream release. -- Oskar Liljeblad Sat, 13 Aug 2005 09:38:12 +0200 microdc (0.7.0-1) unstable; urgency=low * New upstream release. -- Oskar Liljeblad Sat, 2 Jul 2005 11:13:31 +0200 microdc (0.6.0-1) unstable; urgency=low * New upstream release. -- Oskar Liljeblad Wed, 1 Jun 2005 18:39:49 +0200 microdc (0.5.0-1) unstable; urgency=low * New upstream release. -- Oskar Liljeblad Mon, 16 May 2005 09:20:37 +0200 microdc (0.4.0-1) unstable; urgency=low * New upstream release. -- Oskar Liljeblad Tue, 3 May 2005 23:21:35 +0200 microdc (0.3.0-1) unstable; urgency=low * Initial Release. -- Oskar Liljeblad Sat, 30 Apr 2005 09:00:00 +0200 microdc2-0.15.6/debian/control0100644000076500007500000000142410516626545016212 0ustar chugunovmicrodcSource: microdc Section: utils Priority: optional Maintainer: Oskar Liljeblad Build-Depends: cdbs, debhelper (>> 4.1.0) Standards-Version: 3.6.1.1 Package: microdc Architecture: any Depends: ${shlibs:Depends} Description: A command-line based Direct Connect client microdc is a command-line based Direct Connect client that uses the GNU Readline library for user interaction. It was developed from ground up and does not depend on any other program. Despite the command-line user interface, microdc was designed to be user friendly and simple to use. . microdc is currently in beta state - there may be many bugs not yet discovered. It also lacks some features that other clients support, such as file hashing, multiple hub connections, and hub list support. microdc2-0.15.6/debian/copyright0100644000076500007500000000215310516626545016542 0ustar chugunovmicrodcThis package was debianized by Oskar Liljeblad on Sat, 30 Apr 2005 09:00:00 +0200. It was downloaded from http://www.nongnu.org/mirodc/ Upstream Author: Oskar Liljeblad . Copyright: microdc is copyright (C) 2004, 2005 Oskar Liljeblad. 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 On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. microdc2-0.15.6/debian/rules0100755000076500007500000000023710516626545015670 0ustar chugunovmicrodc#! /usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk DEB_INSTALL_DOCS_ALL += doc/INTERNALS doc/TODO microdc2-0.15.6/doc/0040755000076500007500000000000010527341104014117 5ustar chugunovmicrodcmicrodc2-0.15.6/doc/CVS/0040755000076500007500000000000010527341104014552 5ustar chugunovmicrodcmicrodc2-0.15.6/doc/CVS/Root0100644000076500007500000000003610527341104015414 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/doc/CVS/Repository0100644000076500007500000000001410527341104016644 0ustar chugunovmicrodcmicrodc/doc microdc2-0.15.6/doc/CVS/Entries0100644000076500007500000000032310527341104016101 0ustar chugunovmicrodc/INTERNALS/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /MANIFEST.sources/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /TODO/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/doc/CVS/Tag0100644000076500007500000000003010527341104015176 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/doc/INTERNALS0100644000076500007500000001555510516626545015426 0ustar chugunovmicrodcThis document contains various technical information geared towards developers of microdc. === User connection identification improvements: There are four possible cases to consider: We initiating | They initiating ================================================= !+RCTM (we passive) | %+RCTM => we initiating CTM %+CTM (we active) | -CTM (R)CTM = (Rev)ConnectToMe - = We cannot antipicate !+ = We can anticipate by pending_userinfo and we_connected=true %+ = We can anticipate by pending_userinfo and we_connected=false Current implementation has pending_userinfo. To be more accurate, we should split this map into pending_userinfo_{in,out}. validate_nick need to be modified to check based on uc->we_connected. RevConnectToMe vs ConnectToMe considerations: 1) Security consideration: We don't want to connect to other users. It's the one that connects that starts sending data. The remote user could make us connect and send data ($MyNick+$Lock) to anyone on the net, which is bad. 2) Some users may think they are active, but they are not. The following is only relevant for active microdc users: These two considerations gives that it is better to be connected to than connect to, i.e. it is better to send ConnectToMe's and receive RevConnectToMe's rather than to send RevConnectToMe's and receive ConnectToMe's. So here's one an improved scheme for response to remote connection initiations. 1. Receive ConnectToMe from remote. 2. Ignore ConnectToMe from remote, and send ConnectToMe to remote. 3.1. If remote is not running microdc, remote will now connect to us. 3.2. If remote is running microdc, remote will send ConnectToMe to us again. 4.2. We connect to the remote. Problems: * Hubs may block repeated ConnectToMe's. * Clients' behavior on receiving ConnectToMe right after sending ConnectToMe could be unexpected. * This scheme is unfair to other clients not implementing this scheme. User active/passive state transition At the moment, there are four values for DCActiveState (DCUserInfo.active_state). Initial state is UNKNOWN. Note. KNOWN_ACTIVE only means that the user states that he is active. It means that the user's client has active enabled. But the client may be misconfigured, or the user's firewall may be. Note. RECEIVED_PASSIVE doesn't mean that the user states that he is passive. It only means that the user sent us $RevConnectToMe. It is unclear whether the client is forbidden to send $RevConnectToMe in active mode. UNKNOWN set on SENT_ACTIVE in main.c:DC_MSG_VALIDATE_NICK:ok # make way for future ConnectToMe KNOWN_ACTIVE set on SENT_PASSIVE in main.c:DC_MSG_VALIDATE_NICK:ok # logically! RECEIVED_PASSIVE set on * in hub.c:hub_handle_command:$RevConnectToMe # naturally! tested for in hub.c:hub_handle_command:$RevConnectToMe:!is_active # do we need to send back $RevConnectToMe? tested for in hub.c:hub_connect_user:!is_active # user also passive SENT_PASSIVE tested for in hub.c:hub_handle_command:$RevConnectToMe:!is_active # cannot communicate? tested for in hub.c:hub_connect_user:!is_active # waiting - RevConnectToMe already sent set on !RECEIVED_PASSIVE in hub.c:hub_connect_user:!is_active SENT_ACTIVE tested for in hub.c:hub_connect_user:is_active # waiting - ConnectToMe already sent set on * in hub.c:hub_connect_user:is_active When passive: UNKNOWN => SENT_PASSIVE => RECEIVED_PASSIVE [DC++ clients] UNKNOWN => SENT_PASSIVE [non-DC++ clients] UNKNOWN => SENT_PASSIVE => KNOWN_ACTIVE => SENT_PASSIVE => .. UNKNOWN => RECEIVED_PASSIVE When active: UNKNOWN => RECEIVED_PASSIVE => SENT_ACTIVE => UNKNOWN => .. UNKNOWN => SENT_ACTIVE => UNKNOWN => .. When user sends new $MyINFO RECEIVED_PASSIVE => UNKNOWN KNOWN_ACTIVE => UNKNOWN SENT_PASSIVE unchanged - technically we could try resending this. XXX? SENT_ACTIVE unchanged - will always work Problem: Loss of KNOWN_ACTIVE state We lose KNOWN_ACTIVE knowledge if 1) we are passive (!is_active) 2) we have connected to remote user, and state has become KNOWN_ACTIVE 3) we try to connect to remote user again by sending $RevConnectToMe State becomes SENT_PASSIVE. Problem: Loss of RECEIVED_PASSIVE state Assume we are passive. State for some user is RECEIVED_PASSIVE. We then become active (setting changed). RECEIVED_PASSIVE information is when we try to connect to user next time. Since passive DC++ clients only sends RevConnectToMe back once in reply to $RevConnectToMe, it means we might get stuck in SENT_PASSIVE state. This is not a problem though. Relevant states in microdc active mode: all but SENT_ACTIVE Relevant states in microdc passive mode: all but SEND_PASSIVE When changing from active to passive, we must only consider SENT_ACTIVE state. OK : SENT_ACTIVE tested for in hub.c:hub_connect_user:is_active -- is_active is false! When changing from passive to active, we must only consider SENT_PASSIVE state. OK : SENT_PASSIVE tested for in hub.c:hub_connect_user:!is_active -- is_active is true! OK : SENT_PASSIVE tested for in hub.c:hub_handle_command:$RevConnectToMe:!is_active -- cannot communicate? OK : KNOWN_ACTIVE set on SENT_PASSIVE in main.c:DC_MSG_VALIDATE_NICK:ok -- this is still true. === Coding notes: Error management: Assume ((x)v)asprintf only fails due to memory exhaustion (assuming format appears to be OK) or if it fails, just abort() Handle memory exhaustion errors by dying immediately Handle every other error that can occur! === User commands: $MyNick s MYNICK $Direction s i DIRECTION $Error s... * $FileLength i FILE_LENGTH $GetListLen - * $ListLen i * sent as a reply to $GetListLen $Get s$i GET $GetTestZBlock ? * $GetZBlock ? * $UGetZBlock ? * $UGetBlock ? * $Key s... KEY $Lock s... LOCK $Send - SEND $Sending [i] FILE_LENGTH $MaxedOut - FILE_LENGTH $Supports s... * Hub commands: $ValidateNick s $Key s... $Version s... $GetNickList - $MyPass s... $GetINFO s < s> s... $ConnectToMe s s:i $To: s From: s $s $Supports s... $RevConnectToMe s s $OpForceMove $Who:s$Where:s$Msg:s $Search ? $MyINFO ? $Quit ? $SR ? $HubName s... $Supports ? $UserCommand ? $Lock s Pk=s $Hello s $ForceMove ? $HubIsFull ? $ValidateDenide - $UserIP ? $NickList s{$$s} $OpList [s{$$s}] $GetPass - $BadPass - $LogedIn - $Kick ? $Capabilities [s{$s}] dchub:YES dc++:NO === curses client microdc2-0.15.6/doc/MANIFEST.sources0100644000076500007500000001543210516626545016751 0ustar chugunovmicrodc# This file specifies the origin of each file in the source code file # archive of this project. It is best viewed with a tab width of 28 or # greater. Note that files marked as "generated" have been generated from # other files in to this project, files which themselves may have come # from another project (if marked so in this document). Files marked with # "this" come from this project. # ABOUT-NLS GNU gettext AUTHORS this COPYING GNU Automake ChangeLog this INSTALL GNU Automake Makefile.am this Makefile.in generated GNU Automake NEWS this README this aclocal.m4 generated GNU Automake config.h.in generated GNU Autoconf configure generated GNU Autoconf configure.ac this build-aux/config.guess GNU Automake build-aux/config.rpath Gnulib build-aux/config.sub GNU Automake build-aux/depcomp GNU Automake build-aux/install-sh GNU Automake build-aux/missing GNU Automake build-aux/mkinstalldirs GNU gettext debian/changelog this debian/control this debian/copyright this debian/rules this doc/INTERNALS this doc/MANIFEST.sources this doc/TODO this lib/Makefile.am generated Gnulib lib/Makefile.in generated GNU Automake lib/alloca.c Gnulib lib/alloca_.h Gnulib lib/argmatch.c Gnulib lib/argmatch.h Gnulib lib/asnprintf.c Gnulib lib/asprintf.c Gnulib lib/basename.c Gnulib lib/dirname.c Gnulib lib/dirname.h Gnulib lib/error.c Gnulib lib/error.h Gnulib lib/exit.h Gnulib lib/exitfail.c Gnulib lib/exitfail.h Gnulib lib/fnmatch.c Gnulib lib/fnmatch_.h Gnulib lib/fnmatch_loop.c Gnulib lib/free.c Gnulib lib/full-read.c Gnulib lib/full-read.h Gnulib lib/full-write.c Gnulib lib/full-write.h Gnulib lib/gai_strerror.c Gnulib lib/getaddrinfo.c Gnulib lib/getaddrinfo.h Gnulib lib/getdelim.c Gnulib lib/getdelim.h Gnulib lib/gethostname.c Gnulib lib/getline.c Gnulib lib/getline.h Gnulib lib/getopt.c Gnulib lib/getopt1.c Gnulib lib/getopt_.h Gnulib lib/getopt_int.h Gnulib lib/gettext.h Gnulib lib/human.c Gnulib lib/human.h Gnulib lib/iconvme.c Gnulib lib/iconvme.h Gnulib lib/intprops.h Gnulib lib/memmem.c Gnulib lib/memmem.h Gnulib lib/minmax.h Gnulib lib/printf-args.c Gnulib lib/printf-args.h Gnulib lib/printf-parse.c Gnulib lib/printf-parse.h Gnulib lib/progname.c Gnulib lib/progname.h Gnulib lib/quote.c Gnulib lib/quote.h Gnulib lib/quotearg.c Gnulib lib/quotearg.h Gnulib lib/safe-read.c Gnulib lib/safe-read.h Gnulib lib/safe-write.c Gnulib lib/safe-write.h Gnulib lib/sig2str.c Gnulib lib/sig2str.h Gnulib lib/size_max.h Gnulib lib/stdbool_.h Gnulib lib/stdint_.h Gnulib lib/stpcpy.c Gnulib lib/stpcpy.h Gnulib lib/strdup.c Gnulib lib/strdup.h Gnulib lib/strftime.c Gnulib lib/strftime.h Gnulib lib/stripslash.c Gnulib lib/strndup.c Gnulib lib/strndup.h Gnulib lib/strnlen.c Gnulib lib/strnlen.h Gnulib lib/strtoimax.c Gnulib lib/strtol.c Gnulib lib/strtoll.c Gnulib lib/strtoul.c Gnulib lib/strtoull.c Gnulib lib/strtoumax.c Gnulib lib/time_r.c Gnulib lib/time_r.h Gnulib lib/vasnprintf.c Gnulib lib/vasnprintf.h Gnulib lib/vasprintf.c Gnulib lib/vasprintf.h Gnulib lib/verify.h Gnulib lib/version-etc.c Gnulib lib/version-etc.h Gnulib lib/xalloc-die.c Gnulib lib/xalloc.h Gnulib lib/xasprintf.c Gnulib lib/xgethostname.c Gnulib lib/xgethostname.h Gnulib lib/xmalloc.c Gnulib lib/xsize.h Gnulib lib/xstrndup.c Gnulib lib/xstrndup.h Gnulib lib/xstrtol.c Gnulib lib/xstrtol.h Gnulib lib/xstrtoul.c Gnulib lib/xstrtoumax.c Gnulib lib/xvasprintf.c Gnulib lib/xvasprintf.h Gnulib m4/ac_define_dir.m4 Autoconf Macro Archive m4/ac_lib_readline.m4 this m4/acx_pthread.m4 this m4/alloca.m4 Gnulib m4/dirname.m4 Gnulib m4/dos.m4 Gnulib m4/eoverflow.m4 Gnulib m4/error.m4 Gnulib m4/exitfail.m4 Gnulib m4/extensions.m4 Gnulib m4/fnmatch.m4 Gnulib m4/free.m4 Gnulib m4/getaddrinfo.m4 Gnulib m4/getdelim.m4 Gnulib m4/gethostname.m4 Gnulib m4/getline.m4 Gnulib m4/getopt.m4 Gnulib m4/gettext.m4 Gnulib m4/gnulib-cache.m4 generated Gnulib m4/gnulib-comp.m4 generated Gnulib m4/human.m4 Gnulib m4/iconv.m4 Gnulib m4/iconvme.m4 Gnulib m4/intmax_t.m4 Gnulib m4/inttypes.m4 Gnulib m4/inttypes_h.m4 Gnulib m4/lib-ld.m4 Gnulib m4/lib-link.m4 Gnulib m4/lib-prefix.m4 Gnulib m4/longdouble.m4 Gnulib m4/longlong.m4 Gnulib m4/mbrtowc.m4 Gnulib m4/mbstate_t.m4 Gnulib m4/memmem.m4 Gnulib m4/minmax.m4 Gnulib m4/nls.m4 Gnulib m4/onceonly_2_57.m4 Gnulib m4/po.m4 Gnulib m4/progtest.m4 Gnulib m4/quote.m4 Gnulib m4/quotearg.m4 Gnulib m4/restrict.m4 Gnulib m4/safe-read.m4 Gnulib m4/safe-write.m4 Gnulib m4/sig2str.m4 Gnulib m4/signed.m4 Gnulib m4/size_max.m4 Gnulib m4/socklen.m4 Gnulib m4/sockpfaf.m4 Gnulib m4/ssize_t.m4 Gnulib m4/stdbool.m4 Gnulib m4/stdint.m4 Gnulib m4/stdint_h.m4 Gnulib m4/stpcpy.m4 Gnulib m4/strdup.m4 Gnulib m4/strftime.m4 Gnulib m4/strndup.m4 Gnulib m4/strnlen.m4 Gnulib m4/strtoimax.m4 Gnulib m4/strtol.m4 Gnulib m4/strtoll.m4 Gnulib m4/strtoul.m4 Gnulib m4/strtoull.m4 Gnulib m4/strtoumax.m4 Gnulib m4/time_r.m4 Gnulib m4/tm_gmtoff.m4 Gnulib m4/uintmax_t.m4 Gnulib m4/ulonglong.m4 Gnulib m4/vasnprintf.m4 Gnulib m4/vasprintf.m4 Gnulib m4/wchar_t.m4 Gnulib m4/wint_t.m4 Gnulib m4/xalloc.m4 Gnulib m4/xsize.m4 Gnulib m4/xstrndup.m4 Gnulib m4/xstrtol.m4 Gnulib m4/xstrtoumax.m4 Gnulib po/ChangeLog generated GNU gettext po/LINGUAS this po/Makefile.in.in GNU gettext po/Makevars this po/POTFILES.in this po/Rules-quot GNU gettext po/boldquot.sed GNU gettext po/en@boldquot.header GNU gettext po/en@quot.header GNU gettext po/insert-header.sin GNU gettext po/microdc.pot generated GNU gettext po/pl.gmo generated GNU gettext po/pl.po this po/quot.sed GNU gettext po/remove-potcdate.sin GNU gettext po/stamp-po GNU gettext po/sv.gmo generated GNU gettext po/sv.po this rpm/microdc.spec.in this slackware/microdc.SlackBuild.in this src/Makefile.am this src/Makefile.in generated GNU Automake src/command.c this src/connection.c this src/filelist-in.c this src/fs.c this src/hub.c this src/huffman.c this src/lookup.c this src/main.c this src/microdc.1 this src/microdc.h this src/microdc.pl.1 this src/screen.c this src/search.c this src/user.c this src/util.c this src/variables.c this src/common/Makefile.am this src/common/Makefile.in generated GNU Automake src/common/bksearch.c this src/common/bksearch.h this src/common/byteq.c this src/common/byteq.h this src/common/comparison.h this src/common/error.c this src/common/error.h this src/common/hmap.c this src/common/hmap.h this src/common/intutil.c this src/common/intutil.h this src/common/minmaxonce.h this src/common/msgq.c this src/common/msgq.h this src/common/optparser.c this src/common/optparser.h this src/common/ptrv.c this src/common/ptrv.h this src/common/quoting.c this src/common/quoting.h this src/common/range.c this src/common/range.h this src/common/strbuf.c this src/common/strbuf.h this src/common/strleftcmp.c this src/common/strleftcmp.h this src/common/substrcmp.c this src/common/substrcmp.h this src/common/swap.h this src/common/tempdir.c this src/common/tempdir.h this src/common/tempfailure.h this src/common/tmap.c this src/common/tmap.h this microdc2-0.15.6/doc/TODO0100644000076500007500000005450710516626545014634 0ustar chugunovmicrodcin hub&user, replace strncmp with strleftcmp automatic hub reconnects in case of disconnection. what is needed? hub into data structure - please multiple hub connections. rethink design about receiving user connections and detecting nick. connect: refuse to connect to a hub already connected to. without args, connects to current disconnected hub. disconnect: optionally takes hub address-spec or index hub: change between hubs, index, "-" (for last), or address-spec (addr[:port]) need a command to remove a hub connection entirely share file metadata caching ("sharecache") controlled by separate process entirely ("sharelist" process) kept in .microdc/sharecache loaded on startup or "sharecache load" saved when completely updated or "sharecache save" caches info on dirs and files stores info on ALL files once shared, including mtime, size, and possibly checksums cleanup modes: check if entries in cache have been modified. rescan&reread if so. ("sharecache update") zero cache entirely. ("sharecache clear") other commands "sharecache show" hourly or automatic rescanning/update of share list recreate file list automaticly when there's new files? need to monitor files somehow. user DC++ extended protocol: needs bzip2 support DC++ features for file lists help for variables! how? 'set help foo' or 'help set bar' (then 'help ls find' wouldn't work). perhaps 'help variable foo' [test] run through valgrind [test] PRIVATE msg again [test] hub disconnection and connection in various stages, error messages timeout outgoing revconnecttome/connecttome messages [research] non-blocking and search socket in main.c? [style] revamp error messages in hub, as if there were multiple hub connections? [intstyle] rename DCUserConn put_mq,get_mq to result_mq,request_mq? replace select loop! better lookup etc. automated functions? call the mainloop replacement "eventsys"? get rid of select(FD_SETSIZE, use maxfd+1 instead add 'raw -u CONNECTION' argument to raw. optparser must be modified to allow returning of all remaining args. or add userraw queue USER should display 'processing'/'downloading n%' when downloading complete error messages in queue (e.g. for rename failed, including errstr). would need queue -v for more info plus updated QueuedFile structure. decide which completion is case sensitive and which is not! [is completion for username case sensitive?] really use display comparison for files? better input (but must NOT be quoted..)? [move quoting to fixup_..., not before. ptrv_sort on input before quoting input entries] alias completion. think how it should be done. de-html-entity *input* msg & say? add exec/script/load/run/whatever to execute a script of commands need even more detailed error message passed to end_download/end_upload serialization for queues, grantslot. [implement download queue saving (Jan Hata)] bug: ctrl+r - cannot ctrl+c out resume control: get --resume=auto/no/yes (or global option) free may clobber errno! check errstr as well. (don't worry about quotearg or quote) cleanup: put quoter function in DCCompletionInfo and get rid of DCCompletionEntry.quoted? completion: implement alias completion clean up quoting functions. document how quoting works (\a,\g,..\001,.. etc?) fix set command, so that it accepts a single argument. set command should use format set active=0 downloaddir=... log=? implement 'unget' *WILD* - match wild against queue, not file system improve help for tabled/formatted output ("Example:", "Options:") save config automaticly? or `save' command. or `config -s' for next version: move screen into separate process main.main: screen_init, register ipc handling screen.screen_init: set up ipc, fork, return ipc, child pid screen.ipc message to suspend: end readline, don't read anything from stdin screen.ipc message to print on screen: if suspended, enqueue message (maybe with a maxlimit) screen.ipc message to wakeup: print queued messages on screen, clear queue, start readline clean up screen: merge finish/prepare/suspend/clear etc to a single function? screen_set_state. rename states add support for filtering results in results command: "results 1 foo" or maybe second arg is display range? maybe: add pipe support, e.g. `results 1|grep ...'? better search management: how to handle `search "foo bar" baz'? later: make inet_aton module for Gnulib, using glibc reformat private messages ($To) so that [nick] part isn't visible? need to check if coming from right user! Known problem: Cannot easily complete inside an octal sequence Known feature: Bash completes wildcards inside double quotes, but don't expand them in double quotes. microdc does not expand or complete wildcards inside double quotes. Known problem: Make note that this won't work: sya don't try this at home; shell exec rm -rf /. It would execute 'shell exec rm -rf /' unless microdc will fail on first invalid command! in transfers, see more info on users (how much each is sharing etc) GET RID OF ALL `Usage: stuff' in command.c - refer to "help %s",cmd instead! CLEAN up error messages: "foo: No such alias" vs "No such alias `foo'" DESIGN all commands: multiple arguments? e.g. unalias implement ! and different major modes: set commandintroducer "/" chat-mode: !shell /cmd or /!shell /cmd ? is alias lls "!ls -l" possible? or must we use alias lls "shell ls -l"? try to reduce the number of printed messages when a client quits (main should only print unexpected client shutdown) make list of standard references, POSIX.1 etc use gnulib human readable sizes for 'ls'? perhaps '-h' option? also check http://www.neo-modus.com/?page=News Tiger Tree Hash (http://open-content.net/specs/draft-jchapweske-thex-02.html) automaticly find other sources for a file in queue, based on TTH data verification when saving to disk for TTH ZLib - GetZBlock, GetTestZBlock handle word wrap in hub/user say output? considering screen width. implement word wrap somehow. problem: don't wrap quoted text. so we need to quotearg and wrap at the same time...! call quotearg for each word. for each word in line. quotearg. does the word fit in current line? push to current line. next. does the word fit in new line? write current line. push to current line. next. otherwise, fit as many characters as possible, but count escaped characters as one. (for each char, quotearg, if fits, then print). new status info: number of ops on hub total number of shared files, size of listing file what happens to queues when disconnected? they're gone! solution: serialize to ~/.microdc/queues on exit (set queues-save 0/1) allows queue management (queue + unqueue + browse + get + unget) when offline? requires: support for automatic queue retrying. requires timer framework download fails - .part file is still there?!?! resume? overwrite? fail? requires: queue retrying move stuff from command.c to queue.c? move to thread design? question: is select() appropriate? new commands: wait filelist # wait until local filelist has been generated (must be able to ctrl+c) wait browse # wait until file list downloaded and browsed (must be able to ctrl+c) wait download # wait until downloads finished (what about failed?) wait upload # wait until uploads finished (should close slots automaticly, but how!?) exit wait # exit when fully downloaded and uploaded try to print less in user process - why though? add more verbosity flags user connection events now: DC_DF_CONNECTIONS incoming searches now: DC_DF_DEBUG outgoing searches now: DC_DF_DEBUG outgoing search results now: DC_DF_DEBUG get file.. -t timespec Retry time -o file Download file/dir -C no resume, skip -c continue (resume), default -f force overwrite (never default) -r recursive (default) unget file.. -r recursive ls user:file [file].. -l long -h human readable -H human readable --si -s field sorting queue user -R range limit to range -r display recursively, showing contents of dirs unqueue [user] range cd [user:]path backlog publicchat|private set backlogsize=n feature: listen on demand. listen only when remote wants to connect. one port per client sending $RevConnectToMe. PRO: hub identify? CON: code + coding + security? results: extra argument for user name? command to display search results for a certain user? assume '.' is current user? same for unqueue. there's resizing window weirdness? better searching (file types, etc) better ls sorting (order?) better who sorting (order?) 'get' wildcards, file completion wildcards (wow) multiple share directories get from search results: "get " color scheme for regular output? put in .po file. "clear" command (implement by shell) Ctrl+X hub switching? apply iconv to search results as well? and file lists? in search, use locale to determine what's a-z (not to replace with $). See vlad mail debug print IPC? debug levels for IPC? what happens if we download and local file already exists? can change active while connected! this shouldn't affect user states. improve {set,enable,disable}_{active,search} to perfection! test thorougly initial passive : we_initiate => active initial passive : we_initiate => passive initial passive : they_initiate (active) => us (passive) initial passive : they_initiate (passive) => us (passive) initial active : we_initiate => active initial active : we_initiate => passive initial active : they_initiate (active) => us (active) initial active : they_initiate (passive) => us (active) add "get user:/" support on request to download, must check the download file versus our file list first? not 100% necessary - but would decrease the number of weird local file stats. unsure if keeping connections in UserInfo is good? esp code in user_info_new sending user status too often. call time to check? at 10 MB per second we would repeat approx 160 times per second. move over to gnu99 standard? DC++ 0.401 doesn't seem to send search results to passive clients! what's wrong? some search results to passive clients are discarded. must be the hub. search like DC++ does: return hit on file if directory name matches? put listen_port into local_addr? name it listen_addr instead? cleanup after forking child? get rid of hub_last_* -- know implicitly in read function! get rid of my_share_size in favour of our_filelist? must make sure our_filelist is not NULL! debug more with valgrind --tool=memcheck --log-socket=127.0.0.1 --show-reachable=yes --leak-check=no --suppressions=/home/usel/supr microdc translation of bad local filenames! rethink reporting, must happen with *no* latency! clean up listen-port mess forced ip to send in listen? if extreme, we could get rid of user_running and use returns of bool instead remember IP-address for users? "Disconnected from user [process]" is printed twice (first from user, then main) used_slots management: decrease when remote downloading finishes. increase when remote downloading starts. decrease when user disconnects, iff remote was downloading for best compatibility, don't attempt to download empty dirs (naturally - can't) empty files (check!) fix tag x/y/z line (H:?) total number of users calculation 'who -l' and normal 'who' better error messages (reasons) in debug 0 mode support reusing idle download connections download to X.part first, then rename to X. on TERM, remove .part create state overview in user and hub. what states translates to other states? what global variables are valid in a state? better characters in filename ends (@=symlink etc) for local completion add optional argument to transfers improve status messages and status management when there's an error on a user in main.c, prefix error message with uc->name? exec or ! for subshell support get_node_type_char in fs.c allow user argument to be passed along completors in command.c, merging {remote,local}_*_completion_generators quoting in completion+dequoting by backslash in command input when to redownload user list? option to browse to force it (-f)? who: parsing of tag, to show active/passive, slots etc who: sortable who human readable sizes everywhere - in who etc wildcard download with get, cd with cd etc filename completion (always needs completion for \n and such) hub aliases just like lftp remoting interface (unix socket, ...) put close download file code in separate function retink handling of file_name/*DL*/ in user.c. when to free? on all fatal errors too? download queue remembering document all functions figure out what in MyINFO we can change besides sharesize. tag details? support level? if active/passive is changed of remote user, then every time we receive a MyINFO for such a user we need reset active_state to DC_ACTIVE_UNKNOWN. improve queuing: QueueItem NORMAL NORMAL RESUME ? automaticly resume? USER_LIST USER_LIST BROWSED (browse) ? ZLIST (.bz2 compressed) BZLIST XML_BZLIST XML_BZLIST DIRECTORY_DOWNLOAD (recursive) expand on get? EMPTY_DIRECTORY? CLIENT_VIEW (viewed in GUI) ? SOURCE_UTF8 (filename in UTF-8) ? FLAG_EXISTS (insert in front of queue because file exists on HDD) FLAG_MATCH_QUEUE look into other DC++ features to implement bz2 support from ground up look into DC++ blocking, $Sending, $GetBlock etc better prompt improve huffman error messages - check dctc datatype clean up: use LList for user_conns instead of PtrV? fs.c: filelist_scan_dir return failure? user.c: in open_upload_file, use file_name instead of filename. to remember. make sure to free! whenever printing user nicks, quote them propertly! look for %s send MyINFO on our update? recursive download. download to closes name, do not include all parent directories. improved completion: users, local files, remote files verbosity management uc->main_socket should be non-blocking? sort listing with ls make sure child processes die when main does! timers in DC++: ConnectionManager, DownloadManager, QueueManager timers in microdc: main: time out pending_userinfo, user: [DONE] time out idle=dead connections main: when user is MaxedOut, timer for reconnects main: [DONE] time out searches (when last viewed results and last received results) clean up: don't use active_read_fds, force setting prior instead. separate main global data into structure data type fix up: determine datatype for each PtrV better user termination detection in main transfer management, cancelling hub: support GetInfo/MyInfo or whatever, for more info on users remove files in listing_dir on end option: -d, --dummy : console/daemon mode (no readline, better command output) log FILE command improved search command -m minsize -M maxsize -t type (n or any|audio|compressed|documents|executables|pictures|video|folders) TTH support: http://www.open-content.net/specs/draft-jchapweske-thex-02.html Queuing errors and retry intervals: a was downloading but lost connection due to TCP error b was downloading but lost connection due to EOF (remote could have closed in purpose) b was connected but remote is maxed out c was connected but lost connection due to communication logic error c failed to connect to remote $ConnectToMe c remote ignored my $ConnectToMe c remote ignored my $RevConnectToMe c remote is also passive (RECEIVED_PASSIVE) c was downloading but lost connection due to file I/O error (bad/full disk?) a=retry immediately or 5 sec (temporary error) b=retry in 5-15 mins (remote terminated OR MaxedOut) c=retry never (FATAL) Retry count for same user: max 20 with exception of fatal errors verbosity/debug levels verbosity: user messaging private MESSAGE_PRIVATE privmsg public MESSAGE_PUBLIC pubmsg kicking? searching my searches requests SEARCH_REQUESTS_OUT srchreqsout results SEARCH_RESULTS_IN srchresin search_results_in_threshold (# results or time?) remote searches requests SEARCH_REQUESTS_IN srchreqsin results SEARCH_RESULTS_OUT srchresout transfers uploads completed UPLOAD_COMPLETE uldone progress UPLOAD_PROGRESS ulprog upload_progress_threshold failed/abandoned UPLOAD_FAILED ulfail downloads completed DOWNLOAD_COMPLETE dldone progress DOWNLOAD_PROGRESS dlprog download_progress_threshold failed/abandoned DOWNLOAD_FAILED dlfail user connections connection USER_CONNECTED ucconn incoming outgoing direction validation USER_DIRECTION_VALIDATED ucdir nick validated USER_NICK_VALIDATED ucnick closed USER_CLOSED ucclose errors USER_ERROR ucerror hub user activity join HUB_ACTIVITY_JOIN join part HUB_ACTIVITY_PART part errors HUB_ERROR huberror connected HUB_CONNECTED hcnew closed HUB_CLOSED hcclose debug: user-hub ipc i/o IPC_IO ipcio debug: user i/o USER_IO userio debug: hub i/o HUB_IO hubio multiprocess solution main process lookup process communication => char hostname[], 0 <= struct LookupRequest signal receiver for main, lookup process <= int signal hubs communication DC protocol user input, screen readline (custom interface) user connection TCP port listener accept, user connection forker lookup process gethostbyname execution user connection process user communication, file download DC protocol main process communication commands => get client nick <= client nick: STR => get connection user info <= user info: UserInfo => has other user connections <= bool => get next queued file <= remote filename, local filename <= ask status => close connection => cancel transfer events <- file downloaded completely <- i'm terminating (with reason) -> has new file queued/queue modified variables global active bool fake/force/manual listen ip ip listen ip ip listen devices set listen ports same bool user listen port range str -- if unset, port picked at random search listen port range str -- if unset, port picked at random current user listen ip ip (RO) current user listen port uint16 (RO) current search listen ip (RO) current search listen port ignore private address space connections (rfc1918) nick description email speed away flag server flag fast/speedy/speed/fireball flag send tag bool software tag hub password download slots upload slots rate throttling logic timeouts hub reconnect max hub reconnect timeout share dir share size share file count share directory count download dir listing dir keep listings ui display messages hub name (RO) follow redirection away message? curses: Upper Area Search Query Search Results Browser Help About Settings Hub List Search Spy Debug Messages Private Chat Public Chat User List File Browser Queue Browser Lower Area Connections/Transfers/Downloads/Uploads Searches Download/Upload Log Queue Overview Window Operations Increase Window Size F4 Decrease Window Size S+F4 Toggle Window Maximize/Normal F3 Switch Window F2 Next View (Lower Area) Previous View (Lower Area) keys: user array nick queued item array nick, index transferred item index search array generated: query file list nick user connection array generated: nick, direction -or- unknown index (ip, port) deletes: user automatic: on join, part queued item automatic: on completed transferred item automatic: on new transferred item search unsure file list never user connection automatic: on disconnection key management allocate a string on return. it is up to the application to free or keep. hub connection retries user connection retries hub logic timeout? user logic timeout? same user management: trying to identify whether two users are the same is irrelevant. mode 1. download queue tries all users on all hubs. first on original hub. mode 2. download queue always tries on a single hub. which one is simpler to implement? 2 is. we will start with that. // NOTE: just because the structure uses much space, doesn't mean we need to // send over that much space or allocate it permanently! user nick DCTC: 62 DC++: 35 NMDC: 35 user description DCTC: 63 DC++: 35+tag NMDB: 45 <++ V:0.vvv,M:A,X:nn/nn/nn,X:nn,X:nnnn> = ~40 user email DCTC: 63 DC++: unlimited NMDC: 35 user speed DCTC: 14 DC++: 9 (from list) NMDC: (from list) User struct: // Implementation Private UserActiveState active_state; QueuedItem struct: //XXXbool downloading; status - downloading or reason for not downloading? Hub connections are identified by key addr+index Hub reconnection methodology: There's no way to determine if you have been disconnected on purpose. EOF happens when remote closes legally. if we get an error, try reconnect up to some EOF is legal disconnection - never try to reconnect. error is temporary error - retry immediately until some count reached. when is counter reset? when manually connecting again. #Yes, do reconnect up to some limit on temporary failure. #That limit should usually be 2. #Is it reasonable to have two connections to the same hub? */ //XXX how to tell it to attempt to connect to user //XXX how to set our settings, such as active etc? // XXX: create a new engine? // true if there was a complete event, false else User reconnection methodology: Yes, do reconnect immediately on temporary failure (errno error), until some count reached. Users are identified by their nickname // XXX: are a person X on hub Y1 considered to be the same as user X on hub Y2? // Answer: partially. Transferred items are identified by index. The transferred items are kept in a circular array. When the array is full, new items are put at the beginning of the array. uint64_t item_count; // total number of items in or out of list TransferredItem items[TRANSFERRED_ITEMS_ARRAY_SIZE]; // Searches are identified by some key // searches go out to all hubs. // assume /* User connections are also identified by key, nick| or unknown */ // XXX Problem: two connections at same time to user. pick at random: one upload, one download. // Implementation private flags UF_INFO_QUERIED, // void set_connection_max_rate(char *key, int32_t max_rate) searchquery match limit // <65535 according to DC++ StringSearch.h //SearchSizeConstraintType size_constraint_type; //uint64_t size; microdc2-0.15.6/lib/0040755000076500007500000000000010543546024014126 5ustar chugunovmicrodcmicrodc2-0.15.6/lib/CVS/0040755000076500007500000000000010543546031014557 5ustar chugunovmicrodcmicrodc2-0.15.6/lib/CVS/Root0100644000076500007500000000003610527341104015415 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/lib/CVS/Repository0100644000076500007500000000001410527341104016645 0ustar chugunovmicrodcmicrodc/lib microdc2-0.15.6/lib/CVS/Entries0100644000076500007500000001626110543546031016116 0ustar chugunovmicrodc/Makefile.am/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /alloca.c/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /alloca_.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /argmatch.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /argmatch.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /asnprintf.c/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /asprintf.c/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /basename.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /dirname.c/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /dirname.h/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /error.c/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /error.h/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /exit.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /exitfail.c/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /exitfail.h/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /fnmatch.c/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /fnmatch_.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /fnmatch_loop.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /free.c/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /full-read.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /full-read.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /full-write.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /full-write.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /gai_strerror.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getaddrinfo.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getaddrinfo.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getdelim.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getdelim.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /gethostname.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getline.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getline.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getopt.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getopt1.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getopt_.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /getopt_int.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /gettext.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /human.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /human.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /iconvme.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /intprops.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /memmem.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /memmem.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /minmax.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /printf-args.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /printf-args.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /printf-parse.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /printf-parse.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /progname.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /progname.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /quote.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /quote.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /quotearg.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /quotearg.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /safe-read.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /safe-read.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /safe-write.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /safe-write.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /sig2str.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /sig2str.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /size_max.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /stdbool_.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /stdint_.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /stpcpy.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /stpcpy.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strdup.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strdup.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strftime.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strftime.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /stripslash.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strndup.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strnlen.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strnlen.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strtoimax.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strtol.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strtoll.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strtoul.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strtoull.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strtoumax.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /time_r.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /time_r.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /vasnprintf.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /vasnprintf.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /vasprintf.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /vasprintf.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /verify.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /version-etc.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /version-etc.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xalloc-die.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xalloc.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xasprintf.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xgethostname.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xgethostname.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xmalloc.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xsize.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xstrndup.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xstrndup.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xstrtol.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xstrtol.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xstrtoul.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xstrtoumax.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xvasprintf.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /xvasprintf.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /iconvme.c/1.2/Fri Nov 17 20:08:47 2006//Tmicrodc2_0_13_1_locale /strndup.c/1.1.1.1/Fri Nov 17 21:25:57 2006//Tmicrodc2_0_13_1_locale /Makefile.in/1.4/Sun Dec 24 18:44:45 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/lib/CVS/Tag0100644000076500007500000000003010527341105015200 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/lib/Makefile.am0100644000076500007500000001303410516626545016167 0ustar chugunovmicrodc## Process this file with automake to produce Makefile.in. # Copyright (C) 2004 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Automake, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --aux-dir=build-aux --macro-prefix=gl dirname fnmatch-gnu free full-read full-write getaddrinfo getline getopt gettext human iconv iconvme memmem minmax progname quote quotearg sig2str stdbool stdint stpcpy strftime strnlen version-etc xalloc xalloc-die xgethostname xstrndup xvasprintf AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies noinst_LIBRARIES = libgnu.a libgnu_a_SOURCES = libgnu_a_LIBADD = @LIBOBJS@ EXTRA_DIST = BUILT_SOURCES = SUFFIXES = MOSTLYCLEANFILES = CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = ## begin gnulib module alloca libgnu_a_LIBADD += @ALLOCA@ ## end gnulib module alloca ## begin gnulib module alloca-opt BUILT_SOURCES += $(ALLOCA_H) EXTRA_DIST += alloca_.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. alloca.h: alloca_.h cp $(srcdir)/alloca_.h $@-t mv $@-t $@ MOSTLYCLEANFILES += alloca.h alloca.h-t ## end gnulib module alloca-opt ## begin gnulib module argmatch libgnu_a_SOURCES += argmatch.h argmatch.c ## end gnulib module argmatch ## begin gnulib module dirname libgnu_a_SOURCES += basename.c stripslash.c ## end gnulib module dirname ## begin gnulib module exit libgnu_a_SOURCES += exit.h ## end gnulib module exit ## begin gnulib module fnmatch BUILT_SOURCES += $(FNMATCH_H) EXTRA_DIST += fnmatch_.h fnmatch_loop.c # We need the following in order to create when the system # doesn't have one that supports the required API. fnmatch.h: fnmatch_.h cp $(srcdir)/fnmatch_.h $@-t mv $@-t $@ MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t ## end gnulib module fnmatch ## begin gnulib module full-read libgnu_a_SOURCES += full-read.h full-read.c ## end gnulib module full-read ## begin gnulib module full-write libgnu_a_SOURCES += full-write.h full-write.c ## end gnulib module full-write ## begin gnulib module getaddrinfo libgnu_a_SOURCES += getaddrinfo.h ## end gnulib module getaddrinfo ## begin gnulib module getopt BUILT_SOURCES += $(GETOPT_H) EXTRA_DIST += getopt_.h getopt_int.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. getopt.h: getopt_.h cp $(srcdir)/getopt_.h $@-t mv $@-t $@ MOSTLYCLEANFILES += getopt.h getopt.h-t ## end gnulib module getopt ## begin gnulib module gettext-h libgnu_a_SOURCES += gettext.h ## end gnulib module gettext-h ## begin gnulib module iconvme libgnu_a_SOURCES += iconvme.h iconvme.c libgnu_a_LIBADD += $(LTLIBICONV) ## end gnulib module iconvme ## begin gnulib module memmem libgnu_a_SOURCES += memmem.h ## end gnulib module memmem ## begin gnulib module minmax libgnu_a_SOURCES += minmax.h ## end gnulib module minmax ## begin gnulib module progname libgnu_a_SOURCES += progname.h progname.c ## end gnulib module progname ## begin gnulib module size_max libgnu_a_SOURCES += size_max.h ## end gnulib module size_max ## begin gnulib module stdbool BUILT_SOURCES += $(STDBOOL_H) EXTRA_DIST += stdbool_.h # We need the following in order to create when the system # doesn't have one that works. stdbool.h: stdbool_.h sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdbool.h stdbool.h-t ## end gnulib module stdbool ## begin gnulib module stdint BUILT_SOURCES += $(STDINT_H) EXTRA_DIST += stdint_.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. stdint.h: stdint_.h sed -e 's/@''HAVE_LONG_64BIT''@/$(HAVE_LONG_64BIT)/g;s/@''HAVE_LONG_LONG_64BIT@/$(HAVE_LONG_LONG_64BIT)/g' < $(srcdir)/stdint_.h > $@-t mv $@-t $@ MOSTLYCLEANFILES += stdint.h stdint.h-t ## end gnulib module stdint ## begin gnulib module stpcpy libgnu_a_SOURCES += stpcpy.h ## end gnulib module stpcpy ## begin gnulib module time_r libgnu_a_SOURCES += time_r.h ## end gnulib module time_r ## begin gnulib module vasnprintf libgnu_a_SOURCES += printf-args.h printf-parse.h vasnprintf.h ## end gnulib module vasnprintf ## begin gnulib module vasprintf libgnu_a_SOURCES += vasprintf.h ## end gnulib module vasprintf ## begin gnulib module verify libgnu_a_SOURCES += verify.h ## end gnulib module verify ## begin gnulib module version-etc libgnu_a_SOURCES += version-etc.h version-etc.c ## end gnulib module version-etc ## begin gnulib module xalloc-die libgnu_a_SOURCES += xalloc-die.c ## end gnulib module xalloc-die ## begin gnulib module xgethostname libgnu_a_SOURCES += xgethostname.h xgethostname.c ## end gnulib module xgethostname ## begin gnulib module xsize libgnu_a_SOURCES += xsize.h ## end gnulib module xsize ## begin gnulib module xstrndup libgnu_a_SOURCES += xstrndup.h xstrndup.c ## end gnulib module xstrndup ## begin gnulib module xstrtoumax libgnu_a_SOURCES += xstrtoumax.c ## end gnulib module xstrtoumax ## begin gnulib module xvasprintf libgnu_a_SOURCES += xvasprintf.h xvasprintf.c xasprintf.c ## end gnulib module xvasprintf # Makefile.am ends here microdc2-0.15.6/lib/Makefile.in0100644000076500007500000004320610543545235016200 0ustar chugunovmicrodc# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2004 Free Software Foundation, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Automake, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --aux-dir=build-aux --macro-prefix=gl dirname fnmatch-gnu free full-read full-write getaddrinfo getline getopt gettext human iconv iconvme memmem minmax progname quote quotearg sig2str stdbool stdint stpcpy strftime strnlen version-etc xalloc xalloc-die xgethostname xstrndup xvasprintf srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in alloca.c \ asnprintf.c asprintf.c dirname.c dirname.h error.c error.h \ exitfail.c exitfail.h fnmatch.c free.c gai_strerror.c \ getaddrinfo.c getdelim.c getdelim.h gethostname.c getline.c \ getline.h getopt.c getopt1.c human.c human.h intprops.h \ memmem.c printf-args.c printf-parse.c quote.c quote.h \ quotearg.c quotearg.h safe-read.c safe-read.h safe-write.c \ safe-write.h sig2str.c sig2str.h stpcpy.c strdup.c strdup.h \ strftime.c strftime.h strndup.c strndup.h strnlen.c strnlen.h \ strtoimax.c strtol.c strtoll.c strtoul.c strtoull.c \ strtoumax.c time_r.c vasnprintf.c vasprintf.c xalloc.h \ xmalloc.c xstrtol.c xstrtol.h xstrtoul.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/ac_lib_readline.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/alloca.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/free.m4 \ $(top_srcdir)/m4/getaddrinfo.m4 $(top_srcdir)/m4/getdelim.m4 \ $(top_srcdir)/m4/gethostname.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/human.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconvme.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes.m4 \ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memmem.m4 $(top_srcdir)/m4/minmax.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/sig2str.m4 \ $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stdbool.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strtoimax.m4 \ $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoll.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strtoull.m4 \ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtol.m4 $(top_srcdir)/m4/xstrtoumax.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libgnu_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = libgnu_a_DEPENDENCIES = @LIBOBJS@ @ALLOCA@ $(am__DEPENDENCIES_1) am_libgnu_a_OBJECTS = argmatch.$(OBJEXT) basename.$(OBJEXT) \ stripslash.$(OBJEXT) full-read.$(OBJEXT) full-write.$(OBJEXT) \ iconvme.$(OBJEXT) progname.$(OBJEXT) version-etc.$(OBJEXT) \ xalloc-die.$(OBJEXT) xgethostname.$(OBJEXT) xstrndup.$(OBJEXT) \ xstrtoumax.$(OBJEXT) xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT) libgnu_a_OBJECTS = $(am_libgnu_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libgnu_a_SOURCES) DIST_SOURCES = $(libgnu_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FNMATCH_H = @FNMATCH_H@ GETOPT_H = @GETOPT_H@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ HAVE_LONG_64BIT = @HAVE_LONG_64BIT@ HAVE_LONG_LONG_64BIT = @HAVE_LONG_LONG_64BIT@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LOCALEDIR = @LOCALEDIR@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TR = @TR@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XML_CONFIG = @XML_CONFIG@ ac_ct_CC = @ac_ct_CC@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies noinst_LIBRARIES = libgnu.a libgnu_a_SOURCES = argmatch.h argmatch.c basename.c stripslash.c \ exit.h full-read.h full-read.c full-write.h full-write.c \ getaddrinfo.h gettext.h iconvme.h iconvme.c memmem.h minmax.h \ progname.h progname.c size_max.h stpcpy.h time_r.h \ printf-args.h printf-parse.h vasnprintf.h vasprintf.h verify.h \ version-etc.h version-etc.c xalloc-die.c xgethostname.h \ xgethostname.c xsize.h xstrndup.h xstrndup.c xstrtoumax.c \ xvasprintf.h xvasprintf.c xasprintf.c libgnu_a_LIBADD = @LIBOBJS@ @ALLOCA@ $(LTLIBICONV) EXTRA_DIST = alloca_.h fnmatch_.h fnmatch_loop.c getopt_.h \ getopt_int.h stdbool_.h stdint_.h BUILT_SOURCES = $(ALLOCA_H) $(FNMATCH_H) $(GETOPT_H) $(STDBOOL_H) \ $(STDINT_H) SUFFIXES = MOSTLYCLEANFILES = alloca.h alloca.h-t fnmatch.h fnmatch.h-t getopt.h \ getopt.h-t stdbool.h stdbool.h-t stdint.h stdint.h-t CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnits lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libgnu.a: $(libgnu_a_OBJECTS) $(libgnu_a_DEPENDENCIES) -rm -f libgnu.a $(libgnu_a_AR) libgnu.a $(libgnu_a_OBJECTS) $(libgnu_a_LIBADD) $(RANLIB) libgnu.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(COMPILE) -c $< .c.obj: $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # We need the following in order to create when the system # doesn't have one that works with the given compiler. alloca.h: alloca_.h cp $(srcdir)/alloca_.h $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that supports the required API. fnmatch.h: fnmatch_.h cp $(srcdir)/fnmatch_.h $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. getopt.h: getopt_.h cp $(srcdir)/getopt_.h $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works. stdbool.h: stdbool_.h sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h > $@-t mv $@-t $@ # We need the following in order to create when the system # doesn't have one that works with the given compiler. stdint.h: stdint_.h sed -e 's/@''HAVE_LONG_64BIT''@/$(HAVE_LONG_64BIT)/g;s/@''HAVE_LONG_LONG_64BIT@/$(HAVE_LONG_LONG_64BIT)/g' < $(srcdir)/stdint_.h > $@-t mv $@-t $@ # Makefile.am ends here # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: microdc2-0.15.6/lib/alloca.c0100644000076500007500000003324110516626545015534 0ustar chugunovmicrodc/* alloca.c -- allocate automatically reclaimed memory (Mostly) portable public-domain implementation -- D A Gwyn This implementation of the PWB library alloca function, which is used to allocate space off the run-time stack so that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. J.Otto Tennant contributed the Cray support. There are some preprocessor constants that can be defined when compiling for your specific system, for improved efficiency; however, the defaults should be okay. The general concept of this implementation is to keep track of all alloca-allocated blocks, and reclaim any that are found to be deeper in the stack than the current invocation. This heuristic does not reclaim storage as soon as it becomes invalid, but it will do so eventually. As a special case, alloca(0) reclaims storage without allocating any. It is a good idea to use alloca(0) in your main control loop, etc. to force garbage collection. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #ifdef emacs # include "lisp.h" # include "blockinput.h" # ifdef EMACS_FREE # undef free # define free EMACS_FREE # endif #else # define memory_full() abort () #endif /* If compiling with GCC 2, this file's not needed. */ #if !defined (__GNUC__) || __GNUC__ < 2 /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ # ifndef alloca # ifdef emacs # ifdef static /* actually, only want this if static is defined as "" -- this is for usg, in which emacs must undefine static in order to make unexec workable */ # ifndef STACK_DIRECTION you lose -- must know STACK_DIRECTION at compile-time /* Using #error here is not wise since this file should work for old and obscure compilers. */ # endif /* STACK_DIRECTION undefined */ # endif /* static */ # endif /* emacs */ /* If your stack is a linked list of frames, you have to provide an "address metric" ADDRESS_FUNCTION macro. */ # if defined (CRAY) && defined (CRAY_STACKSEG_END) long i00afunc (); # define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) # else # define ADDRESS_FUNCTION(arg) &(arg) # endif /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ # ifndef STACK_DIRECTION # define STACK_DIRECTION 0 /* Direction unknown. */ # endif # if STACK_DIRECTION != 0 # define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ # else /* STACK_DIRECTION == 0; need run-time code. */ static int stack_dir; /* 1 or -1 once known. */ # define STACK_DIR stack_dir static void find_stack_direction (void) { static char *addr = NULL; /* Address of first `dummy', once known. */ auto char dummy; /* To get stack address. */ if (addr == NULL) { /* Initial entry. */ addr = ADDRESS_FUNCTION (dummy); find_stack_direction (); /* Recurse once. */ } else { /* Second entry. */ if (ADDRESS_FUNCTION (dummy) > addr) stack_dir = 1; /* Stack grew upward. */ else stack_dir = -1; /* Stack grew downward. */ } } # endif /* STACK_DIRECTION == 0 */ /* An "alloca header" is used to: (a) chain together all alloca'ed blocks; (b) keep track of stack depth. It is very important that sizeof(header) agree with malloc alignment chunk size. The following default should work okay. */ # ifndef ALIGN_SIZE # define ALIGN_SIZE sizeof(double) # endif typedef union hdr { char align[ALIGN_SIZE]; /* To force sizeof(header). */ struct { union hdr *next; /* For chaining headers. */ char *deep; /* For stack depth measure. */ } h; } header; static header *last_alloca_header = NULL; /* -> last alloca header. */ /* Return a pointer to at least SIZE bytes of storage, which will be automatically reclaimed upon exit from the procedure that called alloca. Originally, this space was supposed to be taken from the current stack frame of the caller, but that method cannot be made to work for some implementations of C, for example under Gould's UTX/32. */ void * alloca (size_t size) { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); # if STACK_DIRECTION == 0 if (STACK_DIR == 0) /* Unknown growth direction. */ find_stack_direction (); # endif /* Reclaim garbage, defined as all alloca'd storage that was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ # ifdef emacs BLOCK_INPUT; # endif for (hp = last_alloca_header; hp != NULL;) if ((STACK_DIR > 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) { register header *np = hp->h.next; free (hp); /* Collect garbage. */ hp = np; /* -> next header. */ } else break; /* Rest are not deeper. */ last_alloca_header = hp; /* -> last valid storage. */ # ifdef emacs UNBLOCK_INPUT; # endif } if (size == 0) return NULL; /* No allocation required. */ /* Allocate combined header + user data storage. */ { /* Address of header. */ register header *new; size_t combined_size = sizeof (header) + size; if (combined_size < sizeof (header)) memory_full (); new = malloc (combined_size); if (! new) memory_full (); new->h.next = last_alloca_header; new->h.deep = depth; last_alloca_header = new; /* User storage begins just after header. */ return (void *) (new + 1); } } # if defined (CRAY) && defined (CRAY_STACKSEG_END) # ifdef DEBUG_I00AFUNC # include # endif # ifndef CRAY_STACK # define CRAY_STACK # ifndef CRAY2 /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ struct stack_control_header { long shgrow:32; /* Number of times stack has grown. */ long shaseg:32; /* Size of increments to stack. */ long shhwm:32; /* High water mark of stack. */ long shsize:32; /* Current size of stack (all segments). */ }; /* The stack segment linkage control information occurs at the high-address end of a stack segment. (The stack grows from low addresses to high addresses.) The initial part of the stack segment linkage control information is 0200 (octal) words. This provides for register storage for the routine which overflows the stack. */ struct stack_segment_linkage { long ss[0200]; /* 0200 overflow words. */ long sssize:32; /* Number of words in this segment. */ long ssbase:32; /* Offset to stack base. */ long:32; long sspseg:32; /* Offset to linkage control of previous segment of stack. */ long:32; long sstcpt:32; /* Pointer to task common address block. */ long sscsnm; /* Private control structure number for microtasking. */ long ssusr1; /* Reserved for user. */ long ssusr2; /* Reserved for user. */ long sstpid; /* Process ID for pid based multi-tasking. */ long ssgvup; /* Pointer to multitasking thread giveup. */ long sscray[7]; /* Reserved for Cray Research. */ long ssa0; long ssa1; long ssa2; long ssa3; long ssa4; long ssa5; long ssa6; long ssa7; long sss0; long sss1; long sss2; long sss3; long sss4; long sss5; long sss6; long sss7; }; # else /* CRAY2 */ /* The following structure defines the vector of words returned by the STKSTAT library routine. */ struct stk_stat { long now; /* Current total stack size. */ long maxc; /* Amount of contiguous space which would be required to satisfy the maximum stack demand to date. */ long high_water; /* Stack high-water mark. */ long overflows; /* Number of stack overflow ($STKOFEN) calls. */ long hits; /* Number of internal buffer hits. */ long extends; /* Number of block extensions. */ long stko_mallocs; /* Block allocations by $STKOFEN. */ long underflows; /* Number of stack underflow calls ($STKRETN). */ long stko_free; /* Number of deallocations by $STKRETN. */ long stkm_free; /* Number of deallocations by $STKMRET. */ long segments; /* Current number of stack segments. */ long maxs; /* Maximum number of stack segments so far. */ long pad_size; /* Stack pad size. */ long current_address; /* Current stack segment address. */ long current_size; /* Current stack segment size. This number is actually corrupted by STKSTAT to include the fifteen word trailer area. */ long initial_address; /* Address of initial segment. */ long initial_size; /* Size of initial segment. */ }; /* The following structure describes the data structure which trails any stack segment. I think that the description in 'asdef' is out of date. I only describe the parts that I am sure about. */ struct stk_trailer { long this_address; /* Address of this block. */ long this_size; /* Size of this block (does not include this trailer). */ long unknown2; long unknown3; long link; /* Address of trailer block of previous segment. */ long unknown5; long unknown6; long unknown7; long unknown8; long unknown9; long unknown10; long unknown11; long unknown12; long unknown13; long unknown14; }; # endif /* CRAY2 */ # endif /* not CRAY_STACK */ # ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. I doubt that "lint" will like this much. */ static long i00afunc (long *address) { struct stk_stat status; struct stk_trailer *trailer; long *block, size; long result = 0; /* We want to iterate through all of the segments. The first step is to get the stack status structure. We could do this more quickly and more directly, perhaps, by referencing the $LM00 common block, but I know that this works. */ STKSTAT (&status); /* Set up the iteration. */ trailer = (struct stk_trailer *) (status.current_address + status.current_size - 15); /* There must be at least one stack segment. Therefore it is a fatal error if "trailer" is null. */ if (trailer == 0) abort (); /* Discard segments that do not contain our argument address. */ while (trailer != 0) { block = (long *) trailer->this_address; size = trailer->this_size; if (block == 0 || size == 0) abort (); trailer = (struct stk_trailer *) trailer->link; if ((block <= address) && (address < (block + size))) break; } /* Set the result to the offset in this segment and add the sizes of all predecessor segments. */ result = address - block; if (trailer == 0) { return result; } do { if (trailer->this_size <= 0) abort (); result += trailer->this_size; trailer = (struct stk_trailer *) trailer->link; } while (trailer != 0); /* We are done. Note that if you present a bogus address (one not in any segment), you will get a different number back, formed from subtracting the address of the first block. This is probably not what you want. */ return (result); } # else /* not CRAY2 */ /* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. Determine the number of the cell within the stack, given the address of the cell. The purpose of this routine is to linearize, in some sense, stack addresses for alloca. */ static long i00afunc (long address) { long stkl = 0; long size, pseg, this_segment, stack; long result = 0; struct stack_segment_linkage *ssptr; /* Register B67 contains the address of the end of the current stack segment. If you (as a subprogram) store your registers on the stack and find that you are past the contents of B67, you have overflowed the segment. B67 also points to the stack segment linkage control area, which is what we are really interested in. */ stkl = CRAY_STACKSEG_END (); ssptr = (struct stack_segment_linkage *) stkl; /* If one subtracts 'size' from the end of the segment, one has the address of the first word of the segment. If this is not the first segment, 'pseg' will be nonzero. */ pseg = ssptr->sspseg; size = ssptr->sssize; this_segment = stkl - size; /* It is possible that calling this routine itself caused a stack overflow. Discard stack segments which do not contain the target address. */ while (!(this_segment <= address && address <= stkl)) { # ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); # endif if (pseg == 0) break; stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; this_segment = stkl - size; } result = address - this_segment; /* If you subtract pseg from the current end of the stack, you get the address of the previous stack segment's end. This seems a little convoluted to me, but I'll bet you save a cycle somewhere. */ while (pseg != 0) { # ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o\n", pseg, size); # endif stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; result += size; } return (result); } # endif /* not CRAY2 */ # endif /* CRAY */ # endif /* no alloca */ #endif /* not GCC version 2 */ microdc2-0.15.6/lib/alloca_.h0100644000076500007500000000342610516626546015703 0ustar chugunovmicrodc/* Memory allocation on the stack. Copyright (C) 1995, 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H means there is a real alloca function. */ #ifndef _GNULIB_ALLOCA_H # define _GNULIB_ALLOCA_H /* alloca (N) returns a pointer to N bytes of memory allocated on the stack, which will last until the function returns. Use of alloca should be avoided: - inside arguments of function calls - undefined behaviour, - in inline functions - the allocation may actually last until the calling function returns, - for huge N (say, N >= 65536) - you never know how large (or small) the stack is, and when the stack cannot fulfill the memory allocation request, the program just crashes. */ #ifdef __GNUC__ # define alloca __builtin_alloca #elif defined _AIX # define alloca __alloca #elif defined _MSC_VER # include # define alloca _alloca #else # include # ifdef __cplusplus extern "C" # endif void *alloca (size_t); #endif #endif /* _GNULIB_ALLOCA_H */ microdc2-0.15.6/lib/argmatch.c0100644000076500007500000001651110516626546016071 0ustar chugunovmicrodc/* argmatch.c -- find a match for a string in an array Copyright (C) 1990, 1998, 1999, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by David MacKenzie Modified by Akim Demaille */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "argmatch.h" #include #include #include #include #include "gettext.h" #define _(msgid) gettext (msgid) #include "error.h" #include "exit.h" #include "quotearg.h" #include "quote.h" #if USE_UNLOCKED_IO # include "unlocked-io.h" #endif /* When reporting an invalid argument, show nonprinting characters by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use literal_quoting_style. */ #ifndef ARGMATCH_QUOTING_STYLE # define ARGMATCH_QUOTING_STYLE locale_quoting_style #endif /* Non failing version of argmatch call this function after failing. */ #ifndef ARGMATCH_DIE # include "exitfail.h" # define ARGMATCH_DIE exit (exit_failure) #endif #ifdef ARGMATCH_DIE_DECL ARGMATCH_DIE_DECL; #endif static void __argmatch_die (void) { ARGMATCH_DIE; } /* Used by XARGMATCH and XARGCASEMATCH. See description in argmatch.h. Default to __argmatch_die, but allow caller to change this at run-time. */ argmatch_exit_fn argmatch_die = __argmatch_die; /* If ARG is an unambiguous match for an element of the NULL-terminated array ARGLIST, return the index in ARGLIST of the matched element, else -1 if it does not match any element or -2 if it is ambiguous (is a prefix of more than one element). If VALLIST is none null, use it to resolve ambiguities limited to synonyms, i.e., for "yes", "yop" -> 0 "no", "nope" -> 1 "y" is a valid argument, for `0', and "n" for `1'. */ ptrdiff_t argmatch (const char *arg, const char *const *arglist, const char *vallist, size_t valsize) { size_t i; /* Temporary index in ARGLIST. */ size_t arglen; /* Length of ARG. */ ptrdiff_t matchind = -1; /* Index of first nonexact match. */ bool ambiguous = false; /* If true, multiple nonexact match(es). */ arglen = strlen (arg); /* Test all elements for either exact match or abbreviated matches. */ for (i = 0; arglist[i]; i++) { if (!strncmp (arglist[i], arg, arglen)) { if (strlen (arglist[i]) == arglen) /* Exact match found. */ return i; else if (matchind == -1) /* First nonexact match found. */ matchind = i; else { /* Second nonexact match found. */ if (vallist == NULL || memcmp (vallist + valsize * matchind, vallist + valsize * i, valsize)) { /* There is a real ambiguity, or we could not disambiguate. */ ambiguous = true; } } } } if (ambiguous) return -2; else return matchind; } /* Error reporting for argmatch. CONTEXT is a description of the type of entity that was being matched. VALUE is the invalid value that was given. PROBLEM is the return value from argmatch. */ void argmatch_invalid (const char *context, const char *value, ptrdiff_t problem) { char const *format = (problem == -1 ? _("invalid argument %s for %s") : _("ambiguous argument %s for %s")); error (0, 0, format, quotearg_n_style (0, ARGMATCH_QUOTING_STYLE, value), quote_n (1, context)); } /* List the valid arguments for argmatch. ARGLIST is the same as in argmatch. VALLIST is a pointer to an array of values. VALSIZE is the size of the elements of VALLIST */ void argmatch_valid (const char *const *arglist, const char *vallist, size_t valsize) { size_t i; const char *last_val = NULL; /* We try to put synonyms on the same line. The assumption is that synonyms follow each other */ fprintf (stderr, _("Valid arguments are:")); for (i = 0; arglist[i]; i++) if ((i == 0) || memcmp (last_val, vallist + valsize * i, valsize)) { fprintf (stderr, "\n - `%s'", arglist[i]); last_val = vallist + valsize * i; } else { fprintf (stderr, ", `%s'", arglist[i]); } putc ('\n', stderr); } /* Never failing versions of the previous functions. CONTEXT is the context for which argmatch is called (e.g., "--version-control", or "$VERSION_CONTROL" etc.). Upon failure, calls the (supposed never to return) function EXIT_FN. */ ptrdiff_t __xargmatch_internal (const char *context, const char *arg, const char *const *arglist, const char *vallist, size_t valsize, argmatch_exit_fn exit_fn) { ptrdiff_t res = argmatch (arg, arglist, vallist, valsize); if (res >= 0) /* Success. */ return res; /* We failed. Explain why. */ argmatch_invalid (context, arg, res); argmatch_valid (arglist, vallist, valsize); (*exit_fn) (); return -1; /* To please the compilers. */ } /* Look for VALUE in VALLIST, an array of objects of size VALSIZE and return the first corresponding argument in ARGLIST */ const char * argmatch_to_argument (const char *value, const char *const *arglist, const char *vallist, size_t valsize) { size_t i; for (i = 0; arglist[i]; i++) if (!memcmp (value, vallist + valsize * i, valsize)) return arglist[i]; return NULL; } #ifdef TEST /* * Based on "getversion.c" by David MacKenzie */ char *program_name; /* When to make backup files. */ enum backup_type { /* Never make backups. */ no_backups, /* Make simple backups of every file. */ simple_backups, /* Make numbered backups of files that already have numbered backups, and simple backups of the others. */ numbered_existing_backups, /* Make numbered backups of every file. */ numbered_backups }; /* Two tables describing arguments (keys) and their corresponding values */ static const char *const backup_args[] = { "no", "none", "off", "simple", "never", "existing", "nil", "numbered", "t", 0 }; static const enum backup_type backup_vals[] = { no_backups, no_backups, no_backups, simple_backups, simple_backups, numbered_existing_backups, numbered_existing_backups, numbered_backups, numbered_backups }; int main (int argc, const char *const *argv) { const char *cp; enum backup_type backup_type = no_backups; program_name = (char *) argv[0]; if (argc > 2) { fprintf (stderr, "Usage: %s [VERSION_CONTROL]\n", program_name); exit (1); } if ((cp = getenv ("VERSION_CONTROL"))) backup_type = XARGMATCH ("$VERSION_CONTROL", cp, backup_args, backup_vals); if (argc == 2) backup_type = XARGMATCH (program_name, argv[1], backup_args, backup_vals); printf ("The version control is `%s'\n", ARGMATCH_TO_ARGUMENT (backup_type, backup_args, backup_vals)); return 0; } #endif microdc2-0.15.6/lib/argmatch.h0100644000076500007500000000704510516626546016100 0ustar chugunovmicrodc/* argmatch.h -- definitions and prototypes for argmatch.c Copyright (C) 1990, 1998, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by David MacKenzie Modified by Akim Demaille */ #ifndef ARGMATCH_H_ # define ARGMATCH_H_ 1 # include # include "verify.h" # define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) /* Assert there are as many real arguments as there are values (argument list ends with a NULL guard). */ # define ARGMATCH_VERIFY(Arglist, Vallist) \ verify (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1) /* Return the index of the element of ARGLIST (NULL terminated) that matches with ARG. If VALLIST is not NULL, then use it to resolve false ambiguities (i.e., different matches of ARG but corresponding to the same values in VALLIST). */ ptrdiff_t argmatch (char const *arg, char const *const *arglist, char const *vallist, size_t valsize); # define ARGMATCH(Arg, Arglist, Vallist) \ argmatch (Arg, Arglist, (char const *) (Vallist), sizeof *(Vallist)) /* xargmatch calls this function when it fails. This function should not return. By default, this is a function that calls ARGMATCH_DIE which in turn defaults to `exit (exit_failure)'. */ typedef void (*argmatch_exit_fn) (void); extern argmatch_exit_fn argmatch_die; /* Report on stderr why argmatch failed. Report correct values. */ void argmatch_invalid (char const *context, char const *value, ptrdiff_t problem); /* Left for compatibility with the old name invalid_arg */ # define invalid_arg(Context, Value, Problem) \ argmatch_invalid (Context, Value, Problem) /* Report on stderr the list of possible arguments. */ void argmatch_valid (char const *const *arglist, char const *vallist, size_t valsize); # define ARGMATCH_VALID(Arglist, Vallist) \ argmatch_valid (Arglist, (char const *) (Vallist), sizeof *(Vallist)) /* Same as argmatch, but upon failure, reports a explanation on the failure, and exits using the function EXIT_FN. */ ptrdiff_t __xargmatch_internal (char const *context, char const *arg, char const *const *arglist, char const *vallist, size_t valsize, argmatch_exit_fn exit_fn); /* Programmer friendly interface to __xargmatch_internal. */ # define XARGMATCH(Context, Arg, Arglist, Vallist) \ ((Vallist) [__xargmatch_internal (Context, Arg, Arglist, \ (char const *) (Vallist), \ sizeof *(Vallist), \ argmatch_die)]) /* Convert a value into a corresponding argument. */ char const *argmatch_to_argument (char const *value, char const *const *arglist, char const *vallist, size_t valsize); # define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \ argmatch_to_argument (Value, Arglist, \ (char const *) (Vallist), sizeof *(Vallist)) #endif /* ARGMATCH_H_ */ microdc2-0.15.6/lib/asnprintf.c0100644000076500007500000000217310516626545016305 0ustar chugunovmicrodc/* Formatted output to strings. Copyright (C) 1999, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "vasnprintf.h" #include char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) { va_list args; char *result; va_start (args, format); result = vasnprintf (resultbuf, lengthp, format, args); va_end (args); return result; } microdc2-0.15.6/lib/asprintf.c0100644000076500007500000000212610516626545016125 0ustar chugunovmicrodc/* Formatted output to strings. Copyright (C) 1999, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "vasprintf.h" #include int asprintf (char **resultp, const char *format, ...) { va_list args; int result; va_start (args, format); result = vasprintf (resultp, format, args); va_end (args); return result; } microdc2-0.15.6/lib/basename.c0100644000076500007500000000434510516626546016060 0ustar chugunovmicrodc/* basename.c -- return the last element in a file name Copyright (C) 1990, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "dirname.h" #include /* In general, we can't use the builtin `basename' function if available, since it has different meanings in different environments. In some environments the builtin `basename' modifies its argument. Return the address of the last file name component of NAME. If NAME has no file name components because it is all slashes, return NAME if it is empty, the address of its last slash otherwise. */ char * base_name (char const *name) { char const *base = name + FILE_SYSTEM_PREFIX_LEN (name); char const *p; for (p = base; *p; p++) { if (ISSLASH (*p)) { /* Treat multiple adjacent slashes like a single slash. */ do p++; while (ISSLASH (*p)); /* If the file name ends in slash, use the trailing slash as the basename if no non-slashes have been found. */ if (! *p) { if (ISSLASH (*base)) base = p - 1; break; } /* *P is a non-slash preceded by a slash. */ base = p; } } return (char *) base; } /* Return the length of of the basename NAME. Typically NAME is the value returned by base_name. Act like strlen (NAME), except omit redundant trailing slashes. */ size_t base_len (char const *name) { size_t len; for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--) continue; return len; } microdc2-0.15.6/lib/dirname.c0100644000076500007500000000616110516626545015721 0ustar chugunovmicrodc/* dirname.c -- return all but the last element in a file name Copyright (C) 1990, 1998, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "dirname.h" #include #include "xalloc.h" /* Return the length of `dirname (FILE)', or zero if FILE is in the working directory. Works properly even if there are trailing slashes (by effectively ignoring them). */ size_t dir_len (char const *file) { size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file); size_t length; /* Strip the basename and any redundant slashes before it. */ for (length = base_name (file) - file; prefix_length < length; length--) if (! ISSLASH (file[length - 1])) return length; /* But don't strip the only slash from "/". */ return prefix_length + ISSLASH (file[prefix_length]); } /* Return the leading directories part of FILE, allocated with xmalloc. Works properly even if there are trailing slashes (by effectively ignoring them). */ char * dir_name (char const *file) { size_t length = dir_len (file); bool append_dot = (length == FILE_SYSTEM_PREFIX_LEN (file)); char *dir = xmalloc (length + append_dot + 1); memcpy (dir, file, length); if (append_dot) dir[length++] = '.'; dir[length] = 0; return dir; } #ifdef TEST_DIRNAME /* Run the test like this (expect no output): gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall \ basename.c dirname.c xmalloc.c error.c sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out If it's been built on a DOS or Windows platforms, run another test like this (again, expect no output): sed -n '/^BEGIN-DOS-DATA$/,/^END-DOS-DATA$/p' dirname.c|grep -v DATA|./a.out BEGIN-DATA foo//// . bar/foo//// bar foo/ . / / . . a . END-DATA BEGIN-DOS-DATA c:///// c:/ c:/ c:/ c:/. c:/ c:foo c:. c:foo/bar c:foo END-DOS-DATA */ # define MAX_BUFF_LEN 1024 # include char *program_name; int main (int argc, char *argv[]) { char buff[MAX_BUFF_LEN + 1]; program_name = argv[0]; buff[MAX_BUFF_LEN] = 0; while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0]) { char file[MAX_BUFF_LEN]; char expected_result[MAX_BUFF_LEN]; char const *result; sscanf (buff, "%s %s", file, expected_result); result = dir_name (file); if (strcmp (result, expected_result)) printf ("%s: got %s, expected %s\n", file, result, expected_result); } return 0; } #endif microdc2-0.15.6/lib/dirname.h0100644000076500007500000000277010516626545015730 0ustar chugunovmicrodc/* Take file names apart into directory and base names. Copyright (C) 1998, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DIRNAME_H_ # define DIRNAME_H_ 1 # include # include # ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' # endif # ifndef ISSLASH # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) # endif # ifndef FILE_SYSTEM_PREFIX_LEN # define FILE_SYSTEM_PREFIX_LEN(File_name) 0 # endif # define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)]) # define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F)) char *base_name (char const *file); char *dir_name (char const *file); size_t base_len (char const *file); size_t dir_len (char const *file); bool strip_trailing_slashes (char *file); #endif /* not DIRNAME_H_ */ microdc2-0.15.6/lib/error.c0100644000076500007500000001656110516626545015440 0ustar chugunovmicrodc/* Error handler for noninteractive utilities Copyright (C) 1990-1998, 2000-2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by David MacKenzie . */ #ifdef HAVE_CONFIG_H # include #endif #include "error.h" #include #include #include #include #if !_LIBC && ENABLE_NLS # include "gettext.h" #endif #ifdef _LIBC # include # define mbsrtowcs __mbsrtowcs #endif #if USE_UNLOCKED_IO # include "unlocked-io.h" #endif #ifndef _ # define _(String) String #endif /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ void (*error_print_progname) (void); /* This variable is incremented each time `error' is called. */ unsigned int error_message_count; #ifdef _LIBC /* In the GNU C library, there is a predefined variable for this. */ # define program_name program_invocation_name # include # include /* In GNU libc we want do not want to use the common name `error' directly. Instead make it a weak alias. */ extern void __error (int status, int errnum, const char *message, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern void __error_at_line (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, ...) __attribute__ ((__format__ (__printf__, 5, 6)));; # define error __error # define error_at_line __error_at_line # include # define fflush(s) INTUSE(_IO_fflush) (s) # undef putc # define putc(c, fp) INTUSE(_IO_putc) (c, fp) # include #else /* not _LIBC */ # if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P # ifndef HAVE_DECL_STRERROR_R "this configure-time declaration test was not run" # endif char *strerror_r (); # endif # ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) # endif /* The calling program should define program_name and set it to the name of the executing program. */ extern char *program_name; # if HAVE_STRERROR_R || defined strerror_r # define __strerror_r strerror_r # endif #endif /* not _LIBC */ static void print_errno_message (int errnum) { char const *s = NULL; #if defined HAVE_STRERROR_R || _LIBC char errbuf[1024]; # if STRERROR_R_CHAR_P || _LIBC s = __strerror_r (errnum, errbuf, sizeof errbuf); # else if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) s = errbuf; # endif #endif #if !_LIBC if (! s && ! (s = strerror (errnum))) s = _("Unknown system error"); #endif #if _LIBC if (_IO_fwide (stderr, 0) > 0) { __fwprintf (stderr, L": %s", s); return; } #endif fprintf (stderr, ": %s", s); } static void error_tail (int status, int errnum, const char *message, va_list args) { #if _LIBC if (_IO_fwide (stderr, 0) > 0) { # define ALLOCA_LIMIT 2000 size_t len = strlen (message) + 1; const wchar_t *wmessage = L"out of memory"; wchar_t *wbuf = (len < ALLOCA_LIMIT ? alloca (len * sizeof *wbuf) : len <= SIZE_MAX / sizeof *wbuf ? malloc (len * sizeof *wbuf) : NULL); if (wbuf) { size_t res; mbstate_t st; const char *tmp = message; memset (&st, '\0', sizeof (st)); res = mbsrtowcs (wbuf, &tmp, len, &st); wmessage = res == (size_t) -1 ? L"???" : wbuf; } __vfwprintf (stderr, wmessage, args); if (! (len < ALLOCA_LIMIT)) free (wbuf); } else #endif vfprintf (stderr, message, args); va_end (args); ++error_message_count; if (errnum) print_errno_message (errnum); #if _LIBC if (_IO_fwide (stderr, 0) > 0) putwc (L'\n', stderr); else #endif putc ('\n', stderr); fflush (stderr); if (status) exit (status); } /* Print the program name and error message MESSAGE, which is a printf-style format string with optional args. If ERRNUM is nonzero, print its corresponding system error message. Exit with status STATUS if it is nonzero. */ void error (int status, int errnum, const char *message, ...) { va_list args; #if defined _LIBC && defined __libc_ptf_call /* We do not want this call to be cut short by a thread cancellation. Therefore disable cancellation for now. */ int state = PTHREAD_CANCEL_ENABLE; __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), 0); #endif fflush (stdout); #ifdef _LIBC _IO_flockfile (stderr); #endif if (error_print_progname) (*error_print_progname) (); else { #if _LIBC if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s: ", program_name); else #endif fprintf (stderr, "%s: ", program_name); } va_start (args, message); error_tail (status, errnum, message, args); #ifdef _LIBC _IO_funlockfile (stderr); # ifdef __libc_ptf_call __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); # endif #endif } /* Sometimes we want to have at most one error per line. This variable controls whether this mode is selected or not. */ int error_one_per_line; void error_at_line (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, ...) { va_list args; if (error_one_per_line) { static const char *old_file_name; static unsigned int old_line_number; if (old_line_number == line_number && (file_name == old_file_name || strcmp (old_file_name, file_name) == 0)) /* Simply return and print nothing. */ return; old_file_name = file_name; old_line_number = line_number; } #if defined _LIBC && defined __libc_ptf_call /* We do not want this call to be cut short by a thread cancellation. Therefore disable cancellation for now. */ int state = PTHREAD_CANCEL_ENABLE; __libc_ptf_call (pthread_setcancelstate, (PTHREAD_CANCEL_DISABLE, &state), 0); #endif fflush (stdout); #ifdef _LIBC _IO_flockfile (stderr); #endif if (error_print_progname) (*error_print_progname) (); else { #if _LIBC if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s: ", program_name); else #endif fprintf (stderr, "%s:", program_name); } if (file_name != NULL) { #if _LIBC if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s:%d: ", file_name, line_number); else #endif fprintf (stderr, "%s:%d: ", file_name, line_number); } va_start (args, message); error_tail (status, errnum, message, args); #ifdef _LIBC _IO_funlockfile (stderr); # ifdef __libc_ptf_call __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0); # endif #endif } #ifdef _LIBC /* Make the weak alias. */ # undef error # undef error_at_line weak_alias (__error, error) weak_alias (__error_at_line, error_at_line) #endif microdc2-0.15.6/lib/error.h0100644000076500007500000000462610516626545015444 0ustar chugunovmicrodc/* Declaration for error-reporting function Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _ERROR_H #define _ERROR_H 1 #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Print a message with `fprintf (stderr, FORMAT, ...)'; if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ extern void error (int __status, int __errnum, const char *__format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern void error_at_line (int __status, int __errnum, const char *__fname, unsigned int __lineno, const char *__format, ...) __attribute__ ((__format__ (__printf__, 5, 6))); /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ extern void (*error_print_progname) (void); /* This variable is incremented each time `error' is called. */ extern unsigned int error_message_count; /* Sometimes we want to have at most one error per line. This variable controls whether this mode is selected or not. */ extern int error_one_per_line; #ifdef __cplusplus } #endif #endif /* error.h */ microdc2-0.15.6/lib/exit.h0100644000076500007500000000204510516626546015256 0ustar chugunovmicrodc/* exit() function. Copyright (C) 1995, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _EXIT_H #define _EXIT_H /* Get exit() declaration. */ #include /* Some systems do not define EXIT_*, even with STDC_HEADERS. */ #ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 #endif #ifndef EXIT_FAILURE # define EXIT_FAILURE 1 #endif #endif /* _EXIT_H */ microdc2-0.15.6/lib/exitfail.c0100644000076500007500000000165410516626545016111 0ustar chugunovmicrodc/* Failure exit status Copyright (C) 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "exitfail.h" #include "exit.h" int volatile exit_failure = EXIT_FAILURE; microdc2-0.15.6/lib/exitfail.h0100644000076500007500000000150310516626545016107 0ustar chugunovmicrodc/* Failure exit status Copyright (C) 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ extern int volatile exit_failure; microdc2-0.15.6/lib/fnmatch.c0100644000076500007500000002674610516626545015735 0ustar chugunovmicrodc/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Enable GNU extensions in fnmatch.h. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #if ! defined __builtin_expect && __GNUC__ < 3 # define __builtin_expect(expr, expected) (expr) #endif #include #include #include #include #include #include #include #include #include #define WIDE_CHAR_SUPPORT \ (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC \ && HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY)) /* For platform which support the ISO C amendement 1 functionality we support user defined character classes. */ #if defined _LIBC || WIDE_CHAR_SUPPORT /* Solaris 2.5 has a bug: must be included before . */ # include # include #endif /* We need some of the locale data (the collation sequence information) but there is no interface to get this information in general. Therefore we support a correct implementation only in glibc. */ #ifdef _LIBC # include "../locale/localeinfo.h" # include "../locale/elem-hash.h" # include "../locale/coll-lookup.h" # include # define CONCAT(a,b) __CONCAT(a,b) # define mbsrtowcs __mbsrtowcs # define fnmatch __fnmatch extern int fnmatch (const char *pattern, const char *string, int flags); #endif #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif /* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set. */ #define NO_LEADING_PERIOD(flags) \ ((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD)) /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself, and have not detected a bug in the library. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU # if defined STDC_HEADERS || !defined isascii # define ISASCII(c) 1 # else # define ISASCII(c) isascii(c) # endif # ifdef isblank # define ISBLANK(c) (ISASCII (c) && isblank (c)) # else # define ISBLANK(c) ((c) == ' ' || (c) == '\t') # endif # ifdef isgraph # define ISGRAPH(c) (ISASCII (c) && isgraph (c)) # else # define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c)) # endif # define ISPRINT(c) (ISASCII (c) && isprint (c)) # define ISDIGIT(c) (ISASCII (c) && isdigit (c)) # define ISALNUM(c) (ISASCII (c) && isalnum (c)) # define ISALPHA(c) (ISASCII (c) && isalpha (c)) # define ISCNTRL(c) (ISASCII (c) && iscntrl (c)) # define ISLOWER(c) (ISASCII (c) && islower (c)) # define ISPUNCT(c) (ISASCII (c) && ispunct (c)) # define ISSPACE(c) (ISASCII (c) && isspace (c)) # define ISUPPER(c) (ISASCII (c) && isupper (c)) # define ISXDIGIT(c) (ISASCII (c) && isxdigit (c)) # define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) # if defined _LIBC || WIDE_CHAR_SUPPORT /* The GNU C library provides support for user-defined character classes and the functions from ISO C amendement 1. */ # ifdef CHARCLASS_NAME_MAX # define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX # else /* This shouldn't happen but some implementation might still have this problem. Use a reasonable default value. */ # define CHAR_CLASS_MAX_LENGTH 256 # endif # ifdef _LIBC # define IS_CHAR_CLASS(string) __wctype (string) # else # define IS_CHAR_CLASS(string) wctype (string) # endif # ifdef _LIBC # define ISWCTYPE(WC, WT) __iswctype (WC, WT) # else # define ISWCTYPE(WC, WT) iswctype (WC, WT) # endif # if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC /* In this case we are implementing the multibyte character handling. */ # define HANDLE_MULTIBYTE 1 # endif # else # define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ # define IS_CHAR_CLASS(string) \ (STREQ (string, "alpha") || STREQ (string, "upper") \ || STREQ (string, "lower") || STREQ (string, "digit") \ || STREQ (string, "alnum") || STREQ (string, "xdigit") \ || STREQ (string, "space") || STREQ (string, "print") \ || STREQ (string, "punct") || STREQ (string, "graph") \ || STREQ (string, "cntrl") || STREQ (string, "blank")) # endif /* Avoid depending on library functions or files whose names are inconsistent. */ /* Global variable. */ static int posixly_correct; # ifndef internal_function /* Inside GNU libc we mark some function in a special way. In other environments simply ignore the marking. */ # define internal_function # endif /* Note that this evaluates C many times. */ # ifdef _LIBC # define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c)) # else # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) # endif # define CHAR char # define UCHAR unsigned char # define INT int # define FCT internal_fnmatch # define EXT ext_match # define END end_pattern # define L(CS) CS # ifdef _LIBC # define BTOWC(C) __btowc (C) # else # define BTOWC(C) btowc (C) # endif # define STRLEN(S) strlen (S) # define STRCAT(D, S) strcat (D, S) # ifdef _LIBC # define MEMPCPY(D, S, N) __mempcpy (D, S, N) # else # if HAVE_MEMPCPY # define MEMPCPY(D, S, N) mempcpy (D, S, N) # else # define MEMPCPY(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) # endif # endif # define MEMCHR(S, C, N) memchr (S, C, N) # define STRCOLL(S1, S2) strcoll (S1, S2) # include "fnmatch_loop.c" # if HANDLE_MULTIBYTE # define FOLD(c) ((flags & FNM_CASEFOLD) ? towlower (c) : (c)) # define CHAR wchar_t # define UCHAR wint_t # define INT wint_t # define FCT internal_fnwmatch # define EXT ext_wmatch # define END end_wpattern # define L(CS) L##CS # define BTOWC(C) (C) # ifdef _LIBC # define STRLEN(S) __wcslen (S) # define STRCAT(D, S) __wcscat (D, S) # define MEMPCPY(D, S, N) __wmempcpy (D, S, N) # else # define STRLEN(S) wcslen (S) # define STRCAT(D, S) wcscat (D, S) # if HAVE_WMEMPCPY # define MEMPCPY(D, S, N) wmempcpy (D, S, N) # else # define MEMPCPY(D, S, N) (wmemcpy (D, S, N) + (N)) # endif # endif # define MEMCHR(S, C, N) wmemchr (S, C, N) # define STRCOLL(S1, S2) wcscoll (S1, S2) # define WIDE_CHAR_VERSION 1 # undef IS_CHAR_CLASS /* We have to convert the wide character string in a multibyte string. But we know that the character class names consist of alphanumeric characters from the portable character set, and since the wide character encoding for a member of the portable character set is the same code point as its single-byte encoding, we can use a simplified method to convert the string to a multibyte character string. */ static wctype_t is_char_class (const wchar_t *wcs) { char s[CHAR_CLASS_MAX_LENGTH + 1]; char *cp = s; do { /* Test for a printable character from the portable character set. */ # ifdef _LIBC if (*wcs < 0x20 || *wcs > 0x7e || *wcs == 0x24 || *wcs == 0x40 || *wcs == 0x60) return (wctype_t) 0; # else switch (*wcs) { case L' ': case L'!': case L'"': case L'#': case L'%': case L'&': case L'\'': case L'(': case L')': case L'*': case L'+': case L',': case L'-': case L'.': case L'/': case L'0': case L'1': case L'2': case L'3': case L'4': case L'5': case L'6': case L'7': case L'8': case L'9': case L':': case L';': case L'<': case L'=': case L'>': case L'?': case L'A': case L'B': case L'C': case L'D': case L'E': case L'F': case L'G': case L'H': case L'I': case L'J': case L'K': case L'L': case L'M': case L'N': case L'O': case L'P': case L'Q': case L'R': case L'S': case L'T': case L'U': case L'V': case L'W': case L'X': case L'Y': case L'Z': case L'[': case L'\\': case L']': case L'^': case L'_': case L'a': case L'b': case L'c': case L'd': case L'e': case L'f': case L'g': case L'h': case L'i': case L'j': case L'k': case L'l': case L'm': case L'n': case L'o': case L'p': case L'q': case L'r': case L's': case L't': case L'u': case L'v': case L'w': case L'x': case L'y': case L'z': case L'{': case L'|': case L'}': case L'~': break; default: return (wctype_t) 0; } # endif /* Avoid overrunning the buffer. */ if (cp == s + CHAR_CLASS_MAX_LENGTH) return (wctype_t) 0; *cp++ = (char) *wcs++; } while (*wcs != L'\0'); *cp = '\0'; # ifdef _LIBC return __wctype (s); # else return wctype (s); # endif } # define IS_CHAR_CLASS(string) is_char_class (string) # include "fnmatch_loop.c" # endif int fnmatch (const char *pattern, const char *string, int flags) { # if HANDLE_MULTIBYTE # define ALLOCA_LIMIT 2000 if (__builtin_expect (MB_CUR_MAX, 1) != 1) { mbstate_t ps; size_t patsize; size_t strsize; size_t totsize; wchar_t *wpattern; wchar_t *wstring; int res; /* Calculate the size needed to convert the strings to wide characters. */ memset (&ps, '\0', sizeof (ps)); patsize = mbsrtowcs (NULL, &pattern, 0, &ps) + 1; if (__builtin_expect (patsize != 0, 1)) { assert (mbsinit (&ps)); strsize = mbsrtowcs (NULL, &string, 0, &ps) + 1; if (__builtin_expect (strsize != 0, 1)) { assert (mbsinit (&ps)); totsize = patsize + strsize; if (__builtin_expect (! (patsize <= totsize && totsize <= SIZE_MAX / sizeof (wchar_t)), 0)) { errno = ENOMEM; return -1; } /* Allocate room for the wide characters. */ if (__builtin_expect (totsize < ALLOCA_LIMIT, 1)) wpattern = (wchar_t *) alloca (totsize * sizeof (wchar_t)); else { wpattern = malloc (totsize * sizeof (wchar_t)); if (__builtin_expect (! wpattern, 0)) { errno = ENOMEM; return -1; } } wstring = wpattern + patsize; /* Convert the strings into wide characters. */ mbsrtowcs (wpattern, &pattern, patsize, &ps); assert (mbsinit (&ps)); mbsrtowcs (wstring, &string, strsize, &ps); res = internal_fnwmatch (wpattern, wstring, wstring + strsize - 1, flags & FNM_PERIOD, flags); if (__builtin_expect (! (totsize < ALLOCA_LIMIT), 0)) free (wpattern); return res; } } } # endif /* HANDLE_MULTIBYTE */ return internal_fnmatch (pattern, string, string + strlen (string), flags & FNM_PERIOD, flags); } # ifdef _LIBC # undef fnmatch versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3); # if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_3) strong_alias (__fnmatch, __fnmatch_old) compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0); # endif libc_hidden_ver (__fnmatch, fnmatch) # endif #endif /* _LIBC or not __GNU_LIBRARY__. */ microdc2-0.15.6/lib/fnmatch_.h0100644000076500007500000000446310516626546016072 0ustar chugunovmicrodc/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _FNMATCH_H # define _FNMATCH_H 1 # ifdef __cplusplus extern "C" { # endif /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ # undef FNM_PATHNAME # undef FNM_NOESCAPE # undef FNM_PERIOD /* Bits set in the FLAGS argument to `fnmatch'. */ # define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ # define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ # define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ # if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ # define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ # endif /* Value returned by `fnmatch' if STRING does not match PATTERN. */ # define FNM_NOMATCH 1 /* This value is returned if the implementation does not support `fnmatch'. Since this is not the case here it will never be returned but the conformance test suites still require the symbol to be defined. */ # ifdef _XOPEN_SOURCE # define FNM_NOSYS (-1) # endif /* Match NAME against the file name pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ extern int fnmatch (const char *__pattern, const char *__name, int __flags); # ifdef __cplusplus } # endif #endif /* fnmatch.h */ microdc2-0.15.6/lib/fnmatch_loop.c0100644000076500007500000007122610516626546016760 0ustar chugunovmicrodc/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Match STRING against the file name pattern PATTERN, returning zero if it matches, nonzero if not. */ static int EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, bool no_leading_period, int flags) internal_function; static const CHAR *END (const CHAR *patternp) internal_function; static int internal_function FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end, bool no_leading_period, int flags) { register const CHAR *p = pattern, *n = string; register UCHAR c; #ifdef _LIBC # if WIDE_CHAR_VERSION const char *collseq = (const char *) _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC); # else const UCHAR *collseq = (const UCHAR *) _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQMB); # endif #endif while ((c = *p++) != L('\0')) { bool new_no_leading_period = false; c = FOLD (c); switch (c) { case L('?'): if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(') { int res; res = EXT (c, p, n, string_end, no_leading_period, flags); if (res != -1) return res; } if (n == string_end) return FNM_NOMATCH; else if (*n == L('/') && (flags & FNM_FILE_NAME)) return FNM_NOMATCH; else if (*n == L('.') && no_leading_period) return FNM_NOMATCH; break; case L('\\'): if (!(flags & FNM_NOESCAPE)) { c = *p++; if (c == L('\0')) /* Trailing \ loses. */ return FNM_NOMATCH; c = FOLD (c); } if (n == string_end || FOLD ((UCHAR) *n) != c) return FNM_NOMATCH; break; case L('*'): if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(') { int res; res = EXT (c, p, n, string_end, no_leading_period, flags); if (res != -1) return res; } if (n != string_end && *n == L('.') && no_leading_period) return FNM_NOMATCH; for (c = *p++; c == L('?') || c == L('*'); c = *p++) { if (*p == L('(') && (flags & FNM_EXTMATCH) != 0) { const CHAR *endp = END (p); if (endp != p) { /* This is a pattern. Skip over it. */ p = endp; continue; } } if (c == L('?')) { /* A ? needs to match one character. */ if (n == string_end) /* There isn't another character; no match. */ return FNM_NOMATCH; else if (*n == L('/') && __builtin_expect (flags & FNM_FILE_NAME, 0)) /* A slash does not match a wildcard under FNM_FILE_NAME. */ return FNM_NOMATCH; else /* One character of the string is consumed in matching this ? wildcard, so *??? won't match if there are less than three characters. */ ++n; } } if (c == L('\0')) /* The wildcard(s) is/are the last element of the pattern. If the name is a file name and contains another slash this means it cannot match, unless the FNM_LEADING_DIR flag is set. */ { int result = (flags & FNM_FILE_NAME) == 0 ? 0 : FNM_NOMATCH; if (flags & FNM_FILE_NAME) { if (flags & FNM_LEADING_DIR) result = 0; else { if (MEMCHR (n, L('/'), string_end - n) == NULL) result = 0; } } return result; } else { const CHAR *endp; endp = MEMCHR (n, (flags & FNM_FILE_NAME) ? L('/') : L('\0'), string_end - n); if (endp == NULL) endp = string_end; if (c == L('[') || (__builtin_expect (flags & FNM_EXTMATCH, 0) != 0 && (c == L('@') || c == L('+') || c == L('!')) && *p == L('('))) { int flags2 = ((flags & FNM_FILE_NAME) ? flags : (flags & ~FNM_PERIOD)); bool no_leading_period2 = no_leading_period; for (--p; n < endp; ++n, no_leading_period2 = false) if (FCT (p, n, string_end, no_leading_period2, flags2) == 0) return 0; } else if (c == L('/') && (flags & FNM_FILE_NAME)) { while (n < string_end && *n != L('/')) ++n; if (n < string_end && *n == L('/') && (FCT (p, n + 1, string_end, flags & FNM_PERIOD, flags) == 0)) return 0; } else { int flags2 = ((flags & FNM_FILE_NAME) ? flags : (flags & ~FNM_PERIOD)); int no_leading_period2 = no_leading_period; if (c == L('\\') && !(flags & FNM_NOESCAPE)) c = *p; c = FOLD (c); for (--p; n < endp; ++n, no_leading_period2 = false) if (FOLD ((UCHAR) *n) == c && (FCT (p, n, string_end, no_leading_period2, flags2) == 0)) return 0; } } /* If we come here no match is possible with the wildcard. */ return FNM_NOMATCH; case L('['): { /* Nonzero if the sense of the character class is inverted. */ register bool not; CHAR cold; UCHAR fn; if (posixly_correct == 0) posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; if (n == string_end) return FNM_NOMATCH; if (*n == L('.') && no_leading_period) return FNM_NOMATCH; if (*n == L('/') && (flags & FNM_FILE_NAME)) /* `/' cannot be matched. */ return FNM_NOMATCH; not = (*p == L('!') || (posixly_correct < 0 && *p == L('^'))); if (not) ++p; fn = FOLD ((UCHAR) *n); c = *p++; for (;;) { if (!(flags & FNM_NOESCAPE) && c == L('\\')) { if (*p == L('\0')) return FNM_NOMATCH; c = FOLD ((UCHAR) *p); ++p; if (c == fn) goto matched; } else if (c == L('[') && *p == L(':')) { /* Leave room for the null. */ CHAR str[CHAR_CLASS_MAX_LENGTH + 1]; size_t c1 = 0; #if defined _LIBC || WIDE_CHAR_SUPPORT wctype_t wt; #endif const CHAR *startp = p; for (;;) { if (c1 == CHAR_CLASS_MAX_LENGTH) /* The name is too long and therefore the pattern is ill-formed. */ return FNM_NOMATCH; c = *++p; if (c == L(':') && p[1] == L(']')) { p += 2; break; } if (c < L('a') || c >= L('z')) { /* This cannot possibly be a character class name. Match it as a normal range. */ p = startp; c = L('['); goto normal_bracket; } str[c1++] = c; } str[c1] = L('\0'); #if defined _LIBC || WIDE_CHAR_SUPPORT wt = IS_CHAR_CLASS (str); if (wt == 0) /* Invalid character class name. */ return FNM_NOMATCH; # if defined _LIBC && ! WIDE_CHAR_VERSION /* The following code is glibc specific but does there a good job in speeding up the code since we can avoid the btowc() call. */ if (_ISCTYPE ((UCHAR) *n, wt)) goto matched; # else if (ISWCTYPE (BTOWC ((UCHAR) *n), wt)) goto matched; # endif #else if ((STREQ (str, L("alnum")) && ISALNUM ((UCHAR) *n)) || (STREQ (str, L("alpha")) && ISALPHA ((UCHAR) *n)) || (STREQ (str, L("blank")) && ISBLANK ((UCHAR) *n)) || (STREQ (str, L("cntrl")) && ISCNTRL ((UCHAR) *n)) || (STREQ (str, L("digit")) && ISDIGIT ((UCHAR) *n)) || (STREQ (str, L("graph")) && ISGRAPH ((UCHAR) *n)) || (STREQ (str, L("lower")) && ISLOWER ((UCHAR) *n)) || (STREQ (str, L("print")) && ISPRINT ((UCHAR) *n)) || (STREQ (str, L("punct")) && ISPUNCT ((UCHAR) *n)) || (STREQ (str, L("space")) && ISSPACE ((UCHAR) *n)) || (STREQ (str, L("upper")) && ISUPPER ((UCHAR) *n)) || (STREQ (str, L("xdigit")) && ISXDIGIT ((UCHAR) *n))) goto matched; #endif c = *p++; } #ifdef _LIBC else if (c == L('[') && *p == L('=')) { UCHAR str[1]; uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); const CHAR *startp = p; c = *++p; if (c == L('\0')) { p = startp; c = L('['); goto normal_bracket; } str[0] = c; c = *++p; if (c != L('=') || p[1] != L(']')) { p = startp; c = L('['); goto normal_bracket; } p += 2; if (nrules == 0) { if ((UCHAR) *n == str[0]) goto matched; } else { const int32_t *table; # if WIDE_CHAR_VERSION const int32_t *weights; const int32_t *extra; # else const unsigned char *weights; const unsigned char *extra; # endif const int32_t *indirect; int32_t idx; const UCHAR *cp = (const UCHAR *) str; /* This #include defines a local function! */ # if WIDE_CHAR_VERSION # include # else # include # endif # if WIDE_CHAR_VERSION table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC); weights = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC); extra = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC); # else table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB); weights = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB); extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB); indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); # endif idx = findidx (&cp); if (idx != 0) { /* We found a table entry. Now see whether the character we are currently at has the same equivalance class value. */ int len = weights[idx]; int32_t idx2; const UCHAR *np = (const UCHAR *) n; idx2 = findidx (&np); if (idx2 != 0 && len == weights[idx2]) { int cnt = 0; while (cnt < len && (weights[idx + 1 + cnt] == weights[idx2 + 1 + cnt])) ++cnt; if (cnt == len) goto matched; } } } c = *p++; } #endif else if (c == L('\0')) /* [ (unterminated) loses. */ return FNM_NOMATCH; else { bool is_range = false; #ifdef _LIBC bool is_seqval = false; if (c == L('[') && *p == L('.')) { uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); const CHAR *startp = p; size_t c1 = 0; while (1) { c = *++p; if (c == L('.') && p[1] == L(']')) { p += 2; break; } if (c == '\0') return FNM_NOMATCH; ++c1; } /* We have to handling the symbols differently in ranges since then the collation sequence is important. */ is_range = *p == L('-') && p[1] != L('\0'); if (nrules == 0) { /* There are no names defined in the collation data. Therefore we only accept the trivial names consisting of the character itself. */ if (c1 != 1) return FNM_NOMATCH; if (!is_range && *n == startp[1]) goto matched; cold = startp[1]; c = *p++; } else { int32_t table_size; const int32_t *symb_table; # ifdef WIDE_CHAR_VERSION char str[c1]; size_t strcnt; # else # define str (startp + 1) # endif const unsigned char *extra; int32_t idx; int32_t elem; int32_t second; int32_t hash; # ifdef WIDE_CHAR_VERSION /* We have to convert the name to a single-byte string. This is possible since the names consist of ASCII characters and the internal representation is UCS4. */ for (strcnt = 0; strcnt < c1; ++strcnt) str[strcnt] = startp[1 + strcnt]; # endif table_size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_SYMB_HASH_SIZEMB); symb_table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_TABLEMB); extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); /* Locate the character in the hashing table. */ hash = elem_hash (str, c1); idx = 0; elem = hash % table_size; second = hash % (table_size - 2); while (symb_table[2 * elem] != 0) { /* First compare the hashing value. */ if (symb_table[2 * elem] == hash && c1 == extra[symb_table[2 * elem + 1]] && memcmp (str, &extra[symb_table[2 * elem + 1] + 1], c1) == 0) { /* Yep, this is the entry. */ idx = symb_table[2 * elem + 1]; idx += 1 + extra[idx]; break; } /* Next entry. */ elem += second; } if (symb_table[2 * elem] != 0) { /* Compare the byte sequence but only if this is not part of a range. */ # ifdef WIDE_CHAR_VERSION int32_t *wextra; idx += 1 + extra[idx]; /* Adjust for the alignment. */ idx = (idx + 3) & ~3; wextra = (int32_t *) &extra[idx + 4]; # endif if (! is_range) { # ifdef WIDE_CHAR_VERSION for (c1 = 0; (int32_t) c1 < wextra[idx]; ++c1) if (n[c1] != wextra[1 + c1]) break; if ((int32_t) c1 == wextra[idx]) goto matched; # else for (c1 = 0; c1 < extra[idx]; ++c1) if (n[c1] != extra[1 + c1]) break; if (c1 == extra[idx]) goto matched; # endif } /* Get the collation sequence value. */ is_seqval = true; # ifdef WIDE_CHAR_VERSION cold = wextra[1 + wextra[idx]]; # else /* Adjust for the alignment. */ idx += 1 + extra[idx]; idx = (idx + 3) & ~4; cold = *((int32_t *) &extra[idx]); # endif c = *p++; } else if (c1 == 1) { /* No valid character. Match it as a single byte. */ if (!is_range && *n == str[0]) goto matched; cold = str[0]; c = *p++; } else return FNM_NOMATCH; } } else # undef str #endif { c = FOLD (c); normal_bracket: /* We have to handling the symbols differently in ranges since then the collation sequence is important. */ is_range = (*p == L('-') && p[1] != L('\0') && p[1] != L(']')); if (!is_range && c == fn) goto matched; cold = c; c = *p++; } if (c == L('-') && *p != L(']')) { #if _LIBC /* We have to find the collation sequence value for C. Collation sequence is nothing we can regularly access. The sequence value is defined by the order in which the definitions of the collation values for the various characters appear in the source file. A strange concept, nowhere documented. */ uint32_t fcollseq; uint32_t lcollseq; UCHAR cend = *p++; # ifdef WIDE_CHAR_VERSION /* Search in the `names' array for the characters. */ fcollseq = __collseq_table_lookup (collseq, fn); if (fcollseq == ~((uint32_t) 0)) /* XXX We don't know anything about the character we are supposed to match. This means we are failing. */ goto range_not_matched; if (is_seqval) lcollseq = cold; else lcollseq = __collseq_table_lookup (collseq, cold); # else fcollseq = collseq[fn]; lcollseq = is_seqval ? cold : collseq[(UCHAR) cold]; # endif is_seqval = false; if (cend == L('[') && *p == L('.')) { uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); const CHAR *startp = p; size_t c1 = 0; while (1) { c = *++p; if (c == L('.') && p[1] == L(']')) { p += 2; break; } if (c == '\0') return FNM_NOMATCH; ++c1; } if (nrules == 0) { /* There are no names defined in the collation data. Therefore we only accept the trivial names consisting of the character itself. */ if (c1 != 1) return FNM_NOMATCH; cend = startp[1]; } else { int32_t table_size; const int32_t *symb_table; # ifdef WIDE_CHAR_VERSION char str[c1]; size_t strcnt; # else # define str (startp + 1) # endif const unsigned char *extra; int32_t idx; int32_t elem; int32_t second; int32_t hash; # ifdef WIDE_CHAR_VERSION /* We have to convert the name to a single-byte string. This is possible since the names consist of ASCII characters and the internal representation is UCS4. */ for (strcnt = 0; strcnt < c1; ++strcnt) str[strcnt] = startp[1 + strcnt]; # endif table_size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_SYMB_HASH_SIZEMB); symb_table = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_TABLEMB); extra = (const unsigned char *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB); /* Locate the character in the hashing table. */ hash = elem_hash (str, c1); idx = 0; elem = hash % table_size; second = hash % (table_size - 2); while (symb_table[2 * elem] != 0) { /* First compare the hashing value. */ if (symb_table[2 * elem] == hash && (c1 == extra[symb_table[2 * elem + 1]]) && memcmp (str, &extra[symb_table[2 * elem + 1] + 1], c1) == 0) { /* Yep, this is the entry. */ idx = symb_table[2 * elem + 1]; idx += 1 + extra[idx]; break; } /* Next entry. */ elem += second; } if (symb_table[2 * elem] != 0) { /* Compare the byte sequence but only if this is not part of a range. */ # ifdef WIDE_CHAR_VERSION int32_t *wextra; idx += 1 + extra[idx]; /* Adjust for the alignment. */ idx = (idx + 3) & ~4; wextra = (int32_t *) &extra[idx + 4]; # endif /* Get the collation sequence value. */ is_seqval = true; # ifdef WIDE_CHAR_VERSION cend = wextra[1 + wextra[idx]]; # else /* Adjust for the alignment. */ idx += 1 + extra[idx]; idx = (idx + 3) & ~4; cend = *((int32_t *) &extra[idx]); # endif } else if (symb_table[2 * elem] != 0 && c1 == 1) { cend = str[0]; c = *p++; } else return FNM_NOMATCH; } # undef str } else { if (!(flags & FNM_NOESCAPE) && cend == L('\\')) cend = *p++; if (cend == L('\0')) return FNM_NOMATCH; cend = FOLD (cend); } /* XXX It is not entirely clear to me how to handle characters which are not mentioned in the collation specification. */ if ( # ifdef WIDE_CHAR_VERSION lcollseq == 0xffffffff || # endif lcollseq <= fcollseq) { /* We have to look at the upper bound. */ uint32_t hcollseq; if (is_seqval) hcollseq = cend; else { # ifdef WIDE_CHAR_VERSION hcollseq = __collseq_table_lookup (collseq, cend); if (hcollseq == ~((uint32_t) 0)) { /* Hum, no information about the upper bound. The matching succeeds if the lower bound is matched exactly. */ if (lcollseq != fcollseq) goto range_not_matched; goto matched; } # else hcollseq = collseq[cend]; # endif } if (lcollseq <= hcollseq && fcollseq <= hcollseq) goto matched; } # ifdef WIDE_CHAR_VERSION range_not_matched: # endif #else /* We use a boring value comparison of the character values. This is better than comparing using `strcoll' since the latter would have surprising and sometimes fatal consequences. */ UCHAR cend = *p++; if (!(flags & FNM_NOESCAPE) && cend == L('\\')) cend = *p++; if (cend == L('\0')) return FNM_NOMATCH; /* It is a range. */ if (cold <= fn && fn <= cend) goto matched; #endif c = *p++; } } if (c == L(']')) break; } if (!not) return FNM_NOMATCH; break; matched: /* Skip the rest of the [...] that already matched. */ do { ignore_next: c = *p++; if (c == L('\0')) /* [... (unterminated) loses. */ return FNM_NOMATCH; if (!(flags & FNM_NOESCAPE) && c == L('\\')) { if (*p == L('\0')) return FNM_NOMATCH; /* XXX 1003.2d11 is unclear if this is right. */ ++p; } else if (c == L('[') && *p == L(':')) { int c1 = 0; const CHAR *startp = p; while (1) { c = *++p; if (++c1 == CHAR_CLASS_MAX_LENGTH) return FNM_NOMATCH; if (*p == L(':') && p[1] == L(']')) break; if (c < L('a') || c >= L('z')) { p = startp; goto ignore_next; } } p += 2; c = *p++; } else if (c == L('[') && *p == L('=')) { c = *++p; if (c == L('\0')) return FNM_NOMATCH; c = *++p; if (c != L('=') || p[1] != L(']')) return FNM_NOMATCH; p += 2; c = *p++; } else if (c == L('[') && *p == L('.')) { ++p; while (1) { c = *++p; if (c == '\0') return FNM_NOMATCH; if (*p == L('.') && p[1] == L(']')) break; } p += 2; c = *p++; } } while (c != L(']')); if (not) return FNM_NOMATCH; } break; case L('+'): case L('@'): case L('!'): if (__builtin_expect (flags & FNM_EXTMATCH, 0) && *p == '(') { int res; res = EXT (c, p, n, string_end, no_leading_period, flags); if (res != -1) return res; } goto normal_match; case L('/'): if (NO_LEADING_PERIOD (flags)) { if (n == string_end || c != (UCHAR) *n) return FNM_NOMATCH; new_no_leading_period = true; break; } /* FALLTHROUGH */ default: normal_match: if (n == string_end || c != FOLD ((UCHAR) *n)) return FNM_NOMATCH; } no_leading_period = new_no_leading_period; ++n; } if (n == string_end) return 0; if ((flags & FNM_LEADING_DIR) && n != string_end && *n == L('/')) /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ return 0; return FNM_NOMATCH; } static const CHAR * internal_function END (const CHAR *pattern) { const CHAR *p = pattern; while (1) if (*++p == L('\0')) /* This is an invalid pattern. */ return pattern; else if (*p == L('[')) { /* Handle brackets special. */ if (posixly_correct == 0) posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; /* Skip the not sign. We have to recognize it because of a possibly following ']'. */ if (*++p == L('!') || (posixly_correct < 0 && *p == L('^'))) ++p; /* A leading ']' is recognized as such. */ if (*p == L(']')) ++p; /* Skip over all characters of the list. */ while (*p != L(']')) if (*p++ == L('\0')) /* This is no valid pattern. */ return pattern; } else if ((*p == L('?') || *p == L('*') || *p == L('+') || *p == L('@') || *p == L('!')) && p[1] == L('(')) p = END (p + 1); else if (*p == L(')')) break; return p + 1; } static int internal_function EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, bool no_leading_period, int flags) { const CHAR *startp; size_t level; struct patternlist { struct patternlist *next; CHAR str[1]; } *list = NULL; struct patternlist **lastp = &list; size_t pattern_len = STRLEN (pattern); const CHAR *p; const CHAR *rs; enum { ALLOCA_LIMIT = 8000 }; /* Parse the pattern. Store the individual parts in the list. */ level = 0; for (startp = p = pattern + 1; ; ++p) if (*p == L('\0')) /* This is an invalid pattern. */ return -1; else if (*p == L('[')) { /* Handle brackets special. */ if (posixly_correct == 0) posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; /* Skip the not sign. We have to recognize it because of a possibly following ']'. */ if (*++p == L('!') || (posixly_correct < 0 && *p == L('^'))) ++p; /* A leading ']' is recognized as such. */ if (*p == L(']')) ++p; /* Skip over all characters of the list. */ while (*p != L(']')) if (*p++ == L('\0')) /* This is no valid pattern. */ return -1; } else if ((*p == L('?') || *p == L('*') || *p == L('+') || *p == L('@') || *p == L('!')) && p[1] == L('(')) /* Remember the nesting level. */ ++level; else if (*p == L(')')) { if (level-- == 0) { /* This means we found the end of the pattern. */ #define NEW_PATTERN \ struct patternlist *newp; \ size_t plen; \ size_t plensize; \ size_t newpsize; \ \ plen = (opt == L('?') || opt == L('@') \ ? pattern_len \ : p - startp + 1); \ plensize = plen * sizeof (CHAR); \ newpsize = offsetof (struct patternlist, str) + plensize; \ if ((size_t) -1 / sizeof (CHAR) < plen \ || newpsize < offsetof (struct patternlist, str) \ || ALLOCA_LIMIT <= newpsize) \ return -1; \ newp = (struct patternlist *) alloca (newpsize); \ *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L('\0'); \ newp->next = NULL; \ *lastp = newp; \ lastp = &newp->next NEW_PATTERN; break; } } else if (*p == L('|')) { if (level == 0) { NEW_PATTERN; startp = p + 1; } } assert (list != NULL); assert (p[-1] == L(')')); #undef NEW_PATTERN switch (opt) { case L('*'): if (FCT (p, string, string_end, no_leading_period, flags) == 0) return 0; /* FALLTHROUGH */ case L('+'): do { for (rs = string; rs <= string_end; ++rs) /* First match the prefix with the current pattern with the current pattern. */ if (FCT (list->str, string, rs, no_leading_period, flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0 /* This was successful. Now match the rest with the rest of the pattern. */ && (FCT (p, rs, string_end, rs == string ? no_leading_period : rs[-1] == '/' && NO_LEADING_PERIOD (flags), flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0 /* This didn't work. Try the whole pattern. */ || (rs != string && FCT (pattern - 1, rs, string_end, rs == string ? no_leading_period : rs[-1] == '/' && NO_LEADING_PERIOD (flags), flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0))) /* It worked. Signal success. */ return 0; } while ((list = list->next) != NULL); /* None of the patterns lead to a match. */ return FNM_NOMATCH; case L('?'): if (FCT (p, string, string_end, no_leading_period, flags) == 0) return 0; /* FALLTHROUGH */ case L('@'): do /* I cannot believe it but `strcat' is actually acceptable here. Match the entire string with the prefix from the pattern list and the rest of the pattern following the pattern list. */ if (FCT (STRCAT (list->str, p), string, string_end, no_leading_period, flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0) /* It worked. Signal success. */ return 0; while ((list = list->next) != NULL); /* None of the patterns lead to a match. */ return FNM_NOMATCH; case L('!'): for (rs = string; rs <= string_end; ++rs) { struct patternlist *runp; for (runp = list; runp != NULL; runp = runp->next) if (FCT (runp->str, string, rs, no_leading_period, flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0) break; /* If none of the patterns matched see whether the rest does. */ if (runp == NULL && (FCT (p, rs, string_end, rs == string ? no_leading_period : rs[-1] == '/' && NO_LEADING_PERIOD (flags), flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0)) /* This is successful. */ return 0; } /* None of the patterns together with the rest of the pattern lead to a match. */ return FNM_NOMATCH; default: assert (! "Invalid extended matching operator"); break; } return -1; } #undef FOLD #undef CHAR #undef UCHAR #undef INT #undef FCT #undef EXT #undef END #undef MEMPCPY #undef MEMCHR #undef STRCOLL #undef STRLEN #undef STRCAT #undef L #undef BTOWC microdc2-0.15.6/lib/free.c0100644000076500007500000000174410516626545015225 0ustar chugunovmicrodc/* Work around incompatibility on older systems where free (NULL) fails. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* written by Paul Eggert */ #ifdef HAVE_CONFIG_H # include #endif #undef free #include void rpl_free (void *p) { if (p) free (p); } microdc2-0.15.6/lib/full-read.c0100644000076500007500000000155710516626546016162 0ustar chugunovmicrodc/* An interface to read that retries after partial reads and interrupts. Copyright (C) 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define FULL_READ #include "full-write.c" microdc2-0.15.6/lib/full-read.h0100644000076500007500000000213510516626546016160 0ustar chugunovmicrodc/* An interface to read() that reads all it is asked to read. Copyright (C) 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, read to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Read COUNT bytes at BUF to descriptor FD, retrying if interrupted or if partial reads occur. Return the number of bytes successfully read, setting errno if that is less than COUNT. errno = 0 means EOF. */ extern size_t full_read (int fd, void *buf, size_t count); microdc2-0.15.6/lib/full-write.c0100644000076500007500000000446310516626546016400 0ustar chugunovmicrodc/* An interface to read and write that retries (if necessary) until complete. Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #ifdef FULL_READ # include "full-read.h" #else # include "full-write.h" #endif #include #ifdef FULL_READ # include "safe-read.h" # define safe_rw safe_read # define full_rw full_read # undef const # define const /* empty */ #else # include "safe-write.h" # define safe_rw safe_write # define full_rw full_write #endif #ifdef FULL_READ /* Set errno to zero upon EOF. */ # define ZERO_BYTE_TRANSFER_ERRNO 0 #else /* Some buggy drivers return 0 when one tries to write beyond a device's end. (Example: Linux 1.2.13 on /dev/fd0.) Set errno to ENOSPC so they get a sensible diagnostic. */ # define ZERO_BYTE_TRANSFER_ERRNO ENOSPC #endif /* Write(read) COUNT bytes at BUF to(from) descriptor FD, retrying if interrupted or if a partial write(read) occurs. Return the number of bytes transferred. When writing, set errno if fewer than COUNT bytes are written. When reading, if fewer than COUNT bytes are read, you must examine errno to distinguish failure from EOF (errno == 0). */ size_t full_rw (int fd, const void *buf, size_t count) { size_t total = 0; const char *ptr = buf; while (count > 0) { size_t n_rw = safe_rw (fd, ptr, count); if (n_rw == (size_t) -1) break; if (n_rw == 0) { errno = ZERO_BYTE_TRANSFER_ERRNO; break; } total += n_rw; ptr += n_rw; count -= n_rw; } return total; } microdc2-0.15.6/lib/full-write.h0100644000076500007500000000224410516626546016400 0ustar chugunovmicrodc/* An interface to write() that writes all it is asked to write. Copyright (C) 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #ifdef __cplusplus extern "C" { #endif /* Write COUNT bytes at BUF to descriptor FD, retrying if interrupted or if partial writes occur. Return the number of bytes successfully written, setting errno if that is less than COUNT. */ extern size_t full_write (int fd, const void *buf, size_t count); #ifdef __cplusplus } #endif microdc2-0.15.6/lib/gai_strerror.c0100644000076500007500000000465610516626546017014 0ustar chugunovmicrodc/* Copyright (C) 1997, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell , 1997. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifndef _LIBC # include "getaddrinfo.h" #endif #include #include #ifdef _LIBC # include #else # include "gettext.h" # define _(String) gettext (String) # define N_(String) String #endif static struct { int code; const char *msg; } values[] = { { EAI_ADDRFAMILY, N_("Address family for hostname not supported") }, { EAI_AGAIN, N_("Temporary failure in name resolution") }, { EAI_BADFLAGS, N_("Bad value for ai_flags") }, { EAI_FAIL, N_("Non-recoverable failure in name resolution") }, { EAI_FAMILY, N_("ai_family not supported") }, { EAI_MEMORY, N_("Memory allocation failure") }, { EAI_NODATA, N_("No address associated with hostname") }, { EAI_NONAME, N_("Name or service not known") }, { EAI_SERVICE, N_("Servname not supported for ai_socktype") }, { EAI_SOCKTYPE, N_("ai_socktype not supported") }, { EAI_SYSTEM, N_("System error") }, #ifdef __USE_GNU { EAI_INPROGRESS, N_("Processing request in progress") }, { EAI_CANCELED, N_("Request canceled") }, { EAI_NOTCANCELED, N_("Request not canceled") }, { EAI_ALLDONE, N_("All requests done") }, { EAI_INTR, N_("Interrupted by a signal") }, { EAI_IDN_ENCODE, N_("Parameter string not correctly encoded") } #endif }; const char * gai_strerror (int code) { size_t i; for (i = 0; i < sizeof (values) / sizeof (values[0]); ++i) if (values[i].code == code) return _(values[i].msg); return _("Unknown error"); } #ifdef _LIBC libc_hidden_def (gai_strerror) #endif microdc2-0.15.6/lib/getaddrinfo.c0100644000076500007500000001215710516626546016573 0ustar chugunovmicrodc/* Get address information (partial implementation). Copyright (C) 1997, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Simon Josefsson . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "getaddrinfo.h" #if HAVE_NETINET_IN_H # include #endif /* Get calloc. */ #include /* Get memcpy. */ #include #include #include "gettext.h" #define _(String) gettext (String) #define N_(String) String #include "strdup.h" static inline bool validate_family (int family) { /* FIXME: Support more families. */ #if HAVE_IPV4 if (family == PF_INET) return true; #endif #if HAVE_IPV6 if (family == PF_INET6) return true; #endif if (family == PF_UNSPEC) return true; return false; } /* Translate name of a service location and/or a service name to set of socket addresses. */ int getaddrinfo (const char *restrict nodename, const char *restrict servname, const struct addrinfo *restrict hints, struct addrinfo **restrict res) { struct addrinfo *tmp; struct servent *se = NULL; struct hostent *he; void *storage; size_t size; #if HAVE_IPV6 struct v6_pair { struct addrinfo addrinfo; struct sockaddr_in6 sockaddr_in6; }; #endif #if HAVE_IPV4 struct v4_pair { struct addrinfo addrinfo; struct sockaddr_in sockaddr_in; }; #endif if (hints && (hints->ai_flags & ~AI_CANONNAME)) /* FIXME: Support more flags. */ return EAI_BADFLAGS; if (hints && !validate_family (hints->ai_family)) return EAI_FAMILY; if (hints && hints->ai_socktype != SOCK_STREAM && hints->ai_socktype != SOCK_DGRAM) /* FIXME: Support other socktype. */ return EAI_SOCKTYPE; /* FIXME: Better return code? */ if (!nodename) /* FIXME: Support server bind mode. */ return EAI_NONAME; if (servname) { const char *proto = (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp"; /* FIXME: Use getservbyname_r if available. */ se = getservbyname (servname, proto); if (!se) return EAI_SERVICE; } /* FIXME: Use gethostbyname_r if available. */ he = gethostbyname (nodename); if (!he || he->h_addr_list[0] == NULL) return EAI_NONAME; switch (he->h_addrtype) { #if HAVE_IPV6 case PF_INET6: size = sizeof (struct v6_pair); break; #endif #if HAVE_IPV4 case PF_INET: size = sizeof (struct v4_pair); break; #endif default: return EAI_NODATA; } storage = calloc (1, size); if (!storage) return EAI_MEMORY; switch (he->h_addrtype) { #if HAVE_IPV6 case PF_INET6: { struct v6_pair *p = storage; struct sockaddr_in6 *sinp = &p->sockaddr_in6; tmp = &p->addrinfo; if (se) sinp->sin6_port = se->s_port; if (he->h_length != sizeof (sinp->sin6_addr)) { free (storage); return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */ } memcpy (&sinp->sin6_addr, he->h_addr_list[0], sizeof sinp->sin6_addr); tmp->ai_addr = (struct sockaddr *) sinp; tmp->ai_addrlen = sizeof *sinp; } break; #endif #if HAVE_IPV4 case PF_INET: { struct v4_pair *p = storage; struct sockaddr_in *sinp = &p->sockaddr_in; tmp = &p->addrinfo; if (se) sinp->sin_port = se->s_port; if (he->h_length != sizeof (sinp->sin_addr)) { free (storage); return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */ } memcpy (&sinp->sin_addr, he->h_addr_list[0], sizeof sinp->sin_addr); tmp->ai_addr = (struct sockaddr *) sinp; tmp->ai_addrlen = sizeof *sinp; } break; #endif default: free (storage); return EAI_NODATA; } if (hints && hints->ai_flags & AI_CANONNAME) { const char *cn; if (he->h_name) cn = he->h_name; else cn = nodename; tmp->ai_canonname = strdup (cn); if (!tmp->ai_canonname) { free (storage); return EAI_MEMORY; } } tmp->ai_protocol = (hints) ? hints->ai_protocol : 0; tmp->ai_socktype = (hints) ? hints->ai_socktype : 0; tmp->ai_addr->sa_family = he->h_addrtype; /* FIXME: If more than one address, create linked list of addrinfo's. */ *res = tmp; return 0; } /* Free `addrinfo' structure AI including associated storage. */ void freeaddrinfo (struct addrinfo *ai) { while (ai) { struct addrinfo *cur; cur = ai; ai = ai->ai_next; if (cur->ai_canonname) free (cur->ai_canonname); free (cur); } } microdc2-0.15.6/lib/getaddrinfo.h0100644000076500007500000001103110516626546016566 0ustar chugunovmicrodc/* Get address information. Copyright (C) 1996-2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Simon Josefsson . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GETADDRINFO_H # define GETADDRINFO_H /* sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 require sys/types.h, so include it first. Then we'll also get 'socklen_t' and 'struct sockaddr' which are used below. */ # include /* Get all getaddrinfo related declarations, if available. */ # include # include # ifndef HAVE_STRUCT_ADDRINFO /* Structure to contain information about address of a service provider. */ struct addrinfo { int ai_flags; /* Input flags. */ int ai_family; /* Protocol family for socket. */ int ai_socktype; /* Socket type. */ int ai_protocol; /* Protocol for socket. */ socklen_t ai_addrlen; /* Length of socket address. */ struct sockaddr *ai_addr; /* Socket address for socket. */ char *ai_canonname; /* Canonical name for service location. */ struct addrinfo *ai_next; /* Pointer to next in list. */ }; # endif /* Possible values for `ai_flags' field in `addrinfo' structure. */ # ifndef AI_PASSIVE # define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */ # define AI_CANONNAME 0x0002 /* Request for canonical name. */ # define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */ # define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */ # define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ # define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type.. */ # endif /* Error values for `getaddrinfo' function. */ # ifndef EAI_BADFLAGS # define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */ # define EAI_NONAME -2 /* NAME or SERVICE is unknown. */ # define EAI_AGAIN -3 /* Temporary failure in name resolution. */ # define EAI_FAIL -4 /* Non-recoverable failure in name res. */ # define EAI_NODATA -5 /* No address associated with NAME. */ # define EAI_FAMILY -6 /* `ai_family' not supported. */ # define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */ # define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */ # define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */ # define EAI_MEMORY -10 /* Memory allocation failure. */ # define EAI_SYSTEM -11 /* System error returned in `errno'. */ # define EAI_OVERFLOW -12 /* Argument buffer overflow. */ # endif # ifdef __USE_GNU # ifndef EAI_INPROGRESS # define EAI_INPROGRESS -100 /* Processing request in progress. */ # define EAI_CANCELED -101 /* Request canceled. */ # define EAI_NOTCANCELED -102 /* Request not canceled. */ # define EAI_ALLDONE -103 /* All requests done. */ # define EAI_INTR -104 /* Interrupted by a signal. */ # define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ # endif # endif # ifndef HAVE_DECL_GETADDRINFO /* Translate name of a service location and/or a service name to set of socket addresses. For more details, see the POSIX:2001 specification . */ extern int getaddrinfo (const char *restrict nodename, const char *restrict servname, const struct addrinfo *restrict hints, struct addrinfo **restrict res); # endif # ifndef HAVE_DECL_FREEADDRINFO /* Free `addrinfo' structure AI including associated storage. For more details, see the POSIX:2001 specification . */ extern void freeaddrinfo (struct addrinfo *ai); # endif # ifndef HAVE_DECL_GAI_STRERROR /* Convert error return from getaddrinfo() to a string. For more details, see the POSIX:2001 specification . */ extern const char *gai_strerror (int ecode); # endif #endif /* GETADDRINFO_H */ microdc2-0.15.6/lib/getdelim.c0100644000076500007500000000565110516626546016100 0ustar chugunovmicrodc/* getdelim.c --- Implementation of replacement getdelim function. Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Ported from glibc by Simon Josefsson. */ #ifdef HAVE_CONFIG_H # include #endif #include "getdelim.h" #include #include #include #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif #ifndef SSIZE_MAX # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2)) #endif #if !HAVE_FLOCKFILE # undef flockfile # define flockfile(x) ((void) 0) #endif #if !HAVE_FUNLOCKFILE # undef funlockfile # define funlockfile(x) ((void) 0) #endif /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and NUL-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'ed as necessary. Returns the number of characters read (not including the null terminator), or -1 on error or EOF. */ ssize_t getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) { ssize_t result; size_t cur_len = 0; if (lineptr == NULL || n == NULL || fp == NULL) { errno = EINVAL; return -1; } flockfile (fp); if (*lineptr == NULL || *n == 0) { *n = 120; *lineptr = (char *) malloc (*n); if (*lineptr == NULL) { result = -1; goto unlock_return; } } for (;;) { int i; i = getc (fp); if (i == EOF) { result = -1; break; } /* Make enough space for len+1 (for final NUL) bytes. */ if (cur_len + 1 >= *n) { size_t needed_max = SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX; size_t needed = 2 * *n + 1; /* Be generous. */ char *new_lineptr; if (needed_max < needed) needed = needed_max; if (cur_len + 1 >= needed) { result = -1; goto unlock_return; } new_lineptr = (char *) realloc (*lineptr, needed); if (new_lineptr == NULL) { result = -1; goto unlock_return; } *lineptr = new_lineptr; *n = needed; } (*lineptr)[cur_len] = i; cur_len++; if (i == delimiter) break; } (*lineptr)[cur_len] = '\0'; result = cur_len ? cur_len : result; unlock_return: funlockfile (fp); return result; } microdc2-0.15.6/lib/getdelim.h0100644000076500007500000000213310516626546016075 0ustar chugunovmicrodc/* getdelim.h --- Prototype for replacement getdelim function. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Simon Josefsson. */ /* Get size_t, FILE, ssize_t. And getdelim, if available. */ # include # include # include #if !HAVE_DECL_GETDELIM ssize_t getdelim (char **lineptr, size_t *n, int delimiter, FILE *stream); #endif /* !HAVE_GETDELIM */ microdc2-0.15.6/lib/gethostname.c0100644000076500007500000000302010516626546016610 0ustar chugunovmicrodc/* gethostname emulation for SysV and POSIX.1. Copyright (C) 1992, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* David MacKenzie */ #ifdef HAVE_CONFIG_H # include #endif #ifdef HAVE_UNAME # include #endif /* Put up to LEN chars of the host name into NAME. Null terminate it if the name is shorter than LEN. Return 0 if ok, -1 if error. */ #include int gethostname (char *name, size_t len) { #ifdef HAVE_UNAME struct utsname uts; if (uname (&uts) == -1) return -1; if (len > sizeof (uts.nodename)) { /* More space than we need is available. */ name[sizeof (uts.nodename)] = '\0'; len = sizeof (uts.nodename); } strncpy (name, uts.nodename, len); #else strcpy (name, ""); /* Hardcode your system name if you want. */ #endif return 0; } microdc2-0.15.6/lib/getline.c0100644000076500007500000000204710516626546015731 0ustar chugunovmicrodc/* getline.c --- Implementation of replacement getline function. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Simon Josefsson. */ #ifdef HAVE_CONFIG_H # include #endif #include "getdelim.h" #include "getline.h" ssize_t getline (char **lineptr, size_t *n, FILE *stream) { return getdelim (lineptr, n, '\n', stream); } microdc2-0.15.6/lib/getline.h0100644000076500007500000000210610516626546015732 0ustar chugunovmicrodc/* getline.h --- Prototype for replacement getline function. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Simon Josefsson. */ /* Get size_t, FILE, ssize_t. And getline, if available. */ # include # include # include #if !HAVE_DECL_GETLINE ssize_t getline (char **lineptr, size_t *n, FILE *stream); #endif /* !HAVE_GETLINE */ microdc2-0.15.6/lib/getopt.c0100644000076500007500000010123710516626546015605 0ustar chugunovmicrodc/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001,2002,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO # define _NO_PROTO #endif #ifdef HAVE_CONFIG_H # include #endif #include /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include # include #endif /* GNU C library. */ #include #ifdef VMS # include #endif #ifdef _LIBC # include #else # include "gettext.h" # define _(msgid) gettext (msgid) #endif #if defined _LIBC && defined USE_IN_LIBIO # include #endif #ifndef attribute_hidden # define attribute_hidden #endif /* Unlike standard Unix `getopt', functions like `getopt_long' let the user intersperse the options with the other arguments. As `getopt_long' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Using `getopt' or setting the environment variable POSIXLY_CORRECT disables permutation. Then the application's behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" #include "getopt_int.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Keep a global copy of all internal members of getopt_data. */ static struct _getopt_data getopt_data; #ifndef __GNU_LIBRARY__ /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif #endif /* not __GNU_LIBRARY__ */ #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ extern int __libc_argc; extern char **__libc_argv; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (d->__nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ static void exchange (char **argv, struct _getopt_data *d) { int bottom = d->__first_nonopt; int middle = d->__last_nonopt; int top = d->optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, d->__nonoption_flags_max_len), '\0', top + 1 - d->__nonoption_flags_max_len); d->__nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ d->__first_nonopt += (d->optind - d->__last_nonopt); d->__last_nonopt = d->optind; } /* Initialize the internal data when the first call is made. */ static const char * _getopt_initialize (int argc, char **argv, const char *optstring, int posixly_correct, struct _getopt_data *d) { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ d->__first_nonopt = d->__last_nonopt = d->optind; d->__nextchar = NULL; d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { d->__ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { d->__ordering = REQUIRE_ORDER; ++optstring; } else if (d->__posixly_correct) d->__ordering = REQUIRE_ORDER; else d->__ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (!d->__posixly_correct && argc == __libc_argc && argv == __libc_argv) { if (d->__nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') d->__nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = d->__nonoption_flags_max_len = strlen (orig_str); if (d->__nonoption_flags_max_len < argc) d->__nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (d->__nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) d->__nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', d->__nonoption_flags_max_len - len); } } d->__nonoption_flags_len = d->__nonoption_flags_max_len; } else d->__nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT environment variable were set. */ int _getopt_internal_r (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct, struct _getopt_data *d) { int print_errors = d->opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; d->optarg = NULL; if (d->optind == 0 || !d->__initialized) { if (d->optind == 0) d->optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring, posixly_correct, d); d->__initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ || (d->optind < d->__nonoption_flags_len \ && __getopt_nonoption_flags[d->optind] == '1')) #else # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') #endif if (d->__nextchar == NULL || *d->__nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (d->__last_nonopt > d->optind) d->__last_nonopt = d->optind; if (d->__first_nonopt > d->optind) d->__first_nonopt = d->optind; if (d->__ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__last_nonopt != d->optind) d->__first_nonopt = d->optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (d->optind < argc && NONOPTION_P) d->optind++; d->__last_nonopt = d->optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (d->optind != argc && !strcmp (argv[d->optind], "--")) { d->optind++; if (d->__first_nonopt != d->__last_nonopt && d->__last_nonopt != d->optind) exchange ((char **) argv, d); else if (d->__first_nonopt == d->__last_nonopt) d->__first_nonopt = d->optind; d->__last_nonopt = argc; d->optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (d->optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (d->__first_nonopt != d->__last_nonopt) d->optind = d->__first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (d->__ordering == REQUIRE_ORDER) return -1; d->optarg = argv[d->optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ d->__nextchar = (argv[d->optind] + 1 + (longopts != NULL && argv[d->optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[d->optind][1] == '-' || (long_only && (argv[d->optind][2] || !strchr (optstring, argv[d->optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { if ((unsigned int) (nameend - d->__nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), argv[0], argv[d->optind]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[d->optind]); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; d->optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; d->optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[d->optind - 1][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #else fprintf (stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[d->optind - 1][0], pfound->name); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]); #endif } d->__nextchar += strlen (d->__nextchar); d->optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[d->optind][1] == '-' || strchr (optstring, *d->__nextchar) == NULL) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (argv[d->optind][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), argv[0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], d->__nextchar); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #else fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[d->optind][0], d->__nextchar); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->__nextchar = (char *) ""; d->optind++; d->optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *d->__nextchar++; char *temp = strchr (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*d->__nextchar == '\0') ++d->optind; if (temp == NULL || c == ':') { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; int n; #endif if (d->__posixly_correct) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: illegal option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); #endif } else { #if defined _LIBC && defined USE_IN_LIBIO n = __asprintf (&buf, _("%s: invalid option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (n >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #endif } d->optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option requires an argument -- %c\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `d->optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) { if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[d->optind]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[d->optind]); #endif } d->__nextchar += strlen (d->__nextchar); d->optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) d->optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } d->__nextchar += strlen (d->__nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (d->optind < argc) d->optarg = argv[d->optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[d->optind - 1]); #endif } d->__nextchar += strlen (d->__nextchar); return optstring[0] == ':' ? ':' : '?'; } } d->__nextchar += strlen (d->__nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } d->__nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; d->optind++; } else d->optarg = NULL; d->__nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*d->__nextchar != '\0') { d->optarg = d->__nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ d->optind++; } else if (d->optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; if (__asprintf (&buf, _("\ %s: option requires an argument -- %c\n"), argv[0], c) >= 0) { _IO_flockfile (stderr); int old_flags2 = ((_IO_FILE *) stderr)->_flags2; ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); ((_IO_FILE *) stderr)->_flags2 = old_flags2; _IO_funlockfile (stderr); free (buf); } #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } d->optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ d->optarg = argv[d->optind++]; d->__nextchar = NULL; } } return c; } } int _getopt_internal (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct) { int result; getopt_data.optind = optind; getopt_data.opterr = opterr; result = _getopt_internal_r (argc, argv, optstring, longopts, longind, long_only, posixly_correct, &getopt_data); optind = getopt_data.optind; optarg = getopt_data.optarg; optopt = getopt_data.optopt; return result; } /* glibc gets a LSB-compliant getopt. Standalone applications get a POSIX-compliant getopt. */ #if _LIBC enum { POSIXLY_CORRECT = 0 }; #else enum { POSIXLY_CORRECT = 1 }; #endif int getopt (int argc, char *const *argv, const char *optstring) { return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, POSIXLY_CORRECT); } #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ microdc2-0.15.6/lib/getopt1.c0100644000076500007500000000765310516626546015675 0ustar chugunovmicrodc/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # include #else # include "getopt.h" #endif #include "getopt_int.h" #include /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (int argc, char *__getopt_argv_const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, (char **) argv, options, long_options, opt_index, 0, 0); } int _getopt_long_r (int argc, char **argv, const char *options, const struct option *long_options, int *opt_index, struct _getopt_data *d) { return _getopt_internal_r (argc, argv, options, long_options, opt_index, 0, 0, d); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (int argc, char *__getopt_argv_const *argv, const char *options, const struct option *long_options, int *opt_index) { return _getopt_internal (argc, (char **) argv, options, long_options, opt_index, 1, 0); } int _getopt_long_only_r (int argc, char **argv, const char *options, const struct option *long_options, int *opt_index, struct _getopt_data *d) { return _getopt_internal_r (argc, argv, options, long_options, opt_index, 1, 0, d); } #ifdef TEST #include int main (int argc, char **argv) { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ microdc2-0.15.6/lib/getopt_.h0100644000076500007500000001742410516626546015755 0ustar chugunovmicrodc/* Declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* Standalone applications should #define __GETOPT_PREFIX to an identifier that prefixes the external functions and variables defined in this header. When this happens, include the headers that might declare getopt so that they will not cause confusion if included after this file. Then systematically rename identifiers so that they do not collide with the system functions and variables. Renaming avoids problems with some compilers and linkers. */ #if defined __GETOPT_PREFIX && !defined __need_getopt # include # include # include # undef __need_getopt # undef getopt # undef getopt_long # undef getopt_long_only # undef optarg # undef opterr # undef optind # undef optopt # define __GETOPT_CONCAT(x, y) x ## y # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) # define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) # define getopt __GETOPT_ID (getopt) # define getopt_long __GETOPT_ID (getopt_long) # define getopt_long_only __GETOPT_ID (getopt_long_only) # define optarg __GETOPT_ID (optarg) # define opterr __GETOPT_ID (opterr) # define optind __GETOPT_ID (optind) # define optopt __GETOPT_ID (optopt) #endif /* Standalone applications get correct prototypes for getopt_long and getopt_long_only; they declare "char **argv". libc uses prototypes with "char *const *argv" that are incorrect because getopt_long and getopt_long_only can permute argv; this is required for backward compatibility (e.g., for LSB 2.0.1). This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt', but it caused redefinition warnings if both unistd.h and getopt.h were included, since unistd.h includes getopt.h having previously defined __need_getopt. The only place where __getopt_argv_const is used is in definitions of getopt_long and getopt_long_only below, but these are visible only if __need_getopt is not defined, so it is quite safe to rewrite the conditional as follows: */ #if !defined __need_getopt # if defined __GETOPT_PREFIX # define __getopt_argv_const /* empty */ # else # define __getopt_argv_const const # endif #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifndef __THROW # ifndef __GNUC_PREREQ # define __GNUC_PREREQ(maj, min) (0) # endif # if defined __cplusplus && __GNUC_PREREQ (2,8) # define __THROW throw () # else # define __THROW # endif #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { const char *name; /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW; #ifndef __need_getopt extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __THROW; #endif #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ microdc2-0.15.6/lib/getopt_int.h0100644000076500007500000001127410516626546016465 0ustar chugunovmicrodc/* Internal declarations for getopt. Copyright (C) 1989-1994,1996-1999,2001,2003,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GETOPT_INT_H #define _GETOPT_INT_H 1 extern int _getopt_internal (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, int __posixly_correct); /* Reentrant versions which can handle parsing multiple argument vectors at the same time. */ /* Data type for reentrant functions. */ struct _getopt_data { /* These have exactly the same meaning as the corresponding global variables, except that they are used for the reentrant versions of getopt. */ int optind; int opterr; int optopt; char *optarg; /* Internal members. */ /* True if the internal members have been initialized. */ int __initialized; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ char *__nextchar; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters, or by calling getopt. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } __ordering; /* If the POSIXLY_CORRECT environment variable is set or getopt was called. */ int __posixly_correct; /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ int __first_nonopt; int __last_nonopt; #if defined _LIBC && defined USE_NONOPTION_FLAGS int __nonoption_flags_max_len; int __nonoption_flags_len; # endif }; /* The initializer is necessary to set OPTIND and OPTERR to their default values and to clear the initialization flag. */ #define _GETOPT_DATA_INITIALIZER { 1, 1 } extern int _getopt_internal_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only, int __posixly_correct, struct _getopt_data *__data); extern int _getopt_long_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); extern int _getopt_long_only_r (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind, struct _getopt_data *__data); #endif /* getopt_int.h */ microdc2-0.15.6/lib/gettext.h0100644000076500007500000000653510516626546016001 0ustar chugunovmicrodc/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((const char *) (Msgid)) # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String #endif /* _LIBGETTEXT_H */ microdc2-0.15.6/lib/human.c0100644000076500007500000003052210516626546015411 0ustar chugunovmicrodc/* human.c -- print human readable file size Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert and Larry McVoy. */ #ifdef HAVE_CONFIG_H # include #endif #include "human.h" #include #include #include #include #include "gettext.h" #define _(msgid) gettext (msgid) #include #include #include #include #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif #ifndef UINTMAX_MAX # define UINTMAX_MAX ((uintmax_t) -1) #endif /* The maximum length of a suffix like "KiB". */ #define HUMAN_READABLE_SUFFIX_LENGTH_MAX 3 static const char power_letter[] = { 0, /* not used */ 'K', /* kibi ('k' for kilo is a special case) */ 'M', /* mega or mebi */ 'G', /* giga or gibi */ 'T', /* tera or tebi */ 'P', /* peta or pebi */ 'E', /* exa or exbi */ 'Z', /* zetta or 2**70 */ 'Y' /* yotta or 2**80 */ }; /* If INEXACT_STYLE is not human_round_to_nearest, and if easily possible, adjust VALUE according to the style. */ static long double adjust_value (int inexact_style, long double value) { /* Do not use the floorl or ceill functions, as that would mean checking for their presence and possibly linking with the standard math library, which is a porting pain. So leave the value alone if it is too large to easily round. */ if (inexact_style != human_round_to_nearest && value < UINTMAX_MAX) { uintmax_t u = value; value = u + (inexact_style == human_ceiling && u != value); } return value; } /* Group the digits of NUMBER according to the grouping rules of the current locale. NUMBER contains NUMBERLEN digits. Modify the bytes pointed to by NUMBER in place, subtracting 1 from NUMBER for each byte inserted. Return the starting address of the modified number. To group the digits, use GROUPING and THOUSANDS_SEP as in `struct lconv' from . */ static char * group_number (char *number, size_t numberlen, char const *grouping, char const *thousands_sep) { register char *d; size_t grouplen = SIZE_MAX; size_t thousands_seplen = strlen (thousands_sep); size_t i = numberlen; /* The maximum possible value for NUMBERLEN is the number of digits in the square of the largest uintmax_t, so double the size needed. */ char buf[2 * INT_STRLEN_BOUND (uintmax_t) + 1]; memcpy (buf, number, numberlen); d = number + numberlen; for (;;) { unsigned char g = *grouping; if (g) { grouplen = g < CHAR_MAX ? g : i; grouping++; } if (i < grouplen) grouplen = i; d -= grouplen; i -= grouplen; memcpy (d, buf + i, grouplen); if (i == 0) return d; d -= thousands_seplen; memcpy (d, thousands_sep, thousands_seplen); } } /* Convert N to a human readable format in BUF, using the options OPTS. N is expressed in units of FROM_BLOCK_SIZE. FROM_BLOCK_SIZE must be nonnegative. Use units of TO_BLOCK_SIZE in the output number. TO_BLOCK_SIZE must be positive. Use (OPTS & (human_round_to_nearest | human_floor | human_ceiling)) to determine whether to take the ceiling or floor of any result that cannot be expressed exactly. If (OPTS & human_group_digits), group the thousands digits according to the locale, e.g., `1,000,000' in an American English locale. If (OPTS & human_autoscale), deduce the output block size automatically; TO_BLOCK_SIZE must be 1 but it has no effect on the output. Use powers of 1024 if (OPTS & human_base_1024), and powers of 1000 otherwise. For example, assuming powers of 1024, 8500 would be converted to 8.3, 133456345 to 127, 56990456345 to 53, and so on. Numbers smaller than the power aren't modified. human_autoscale is normally used together with human_SI. If (OPTS & human_space_before_unit), use a space to separate the number from any suffix that is appended as described below. If (OPTS & human_SI), append an SI prefix indicating which power is being used. If in addition (OPTS & human_B), append "B" (if base 1000) or "iB" (if base 1024) to the SI prefix. When ((OPTS & human_SI) && ! (OPTS & human_autoscale)), TO_BLOCK_SIZE must be a power of 1024 or of 1000, depending on (OPTS & human_base_1024). */ char * human_readable (uintmax_t n, char *buf, int opts, uintmax_t from_block_size, uintmax_t to_block_size) { int inexact_style = opts & (human_round_to_nearest | human_floor | human_ceiling); unsigned int base = opts & human_base_1024 ? 1024 : 1000; uintmax_t amt; int tenths; int exponent = -1; int exponent_max = sizeof power_letter - 1; char *p; char *psuffix; char const *integerlim; /* 0 means adjusted N == AMT.TENTHS; 1 means AMT.TENTHS < adjusted N < AMT.TENTHS + 0.05; 2 means adjusted N == AMT.TENTHS + 0.05; 3 means AMT.TENTHS + 0.05 < adjusted N < AMT.TENTHS + 0.1. */ int rounding; char const *decimal_point = "."; size_t decimal_pointlen = 1; char const *grouping = ""; char const *thousands_sep = ""; struct lconv const *l = localeconv (); size_t pointlen = strlen (l->decimal_point); if (0 < pointlen && pointlen <= MB_LEN_MAX) { decimal_point = l->decimal_point; decimal_pointlen = pointlen; } grouping = l->grouping; if (strlen (l->thousands_sep) <= MB_LEN_MAX) thousands_sep = l->thousands_sep; psuffix = buf + LONGEST_HUMAN_READABLE - HUMAN_READABLE_SUFFIX_LENGTH_MAX; p = psuffix; /* Adjust AMT out of FROM_BLOCK_SIZE units and into TO_BLOCK_SIZE units. If this can be done exactly with integer arithmetic, do not use floating point operations. */ if (to_block_size <= from_block_size) { if (from_block_size % to_block_size == 0) { uintmax_t multiplier = from_block_size / to_block_size; amt = n * multiplier; if (amt / multiplier == n) { tenths = 0; rounding = 0; goto use_integer_arithmetic; } } } else if (from_block_size != 0 && to_block_size % from_block_size == 0) { uintmax_t divisor = to_block_size / from_block_size; uintmax_t r10 = (n % divisor) * 10; uintmax_t r2 = (r10 % divisor) * 2; amt = n / divisor; tenths = r10 / divisor; rounding = r2 < divisor ? 0 < r2 : 2 + (divisor < r2); goto use_integer_arithmetic; } { /* Either the result cannot be computed easily using uintmax_t, or from_block_size is zero. Fall back on floating point. FIXME: This can yield answers that are slightly off. */ long double dto_block_size = to_block_size; long double damt = n * (from_block_size / dto_block_size); size_t buflen; size_t nonintegerlen; if (! (opts & human_autoscale)) { sprintf (buf, "%.0Lf", adjust_value (inexact_style, damt)); buflen = strlen (buf); nonintegerlen = 0; } else { long double e = 1; exponent = 0; do { e *= base; exponent++; } while (e * base <= damt && exponent < exponent_max); damt /= e; sprintf (buf, "%.1Lf", adjust_value (inexact_style, damt)); buflen = strlen (buf); nonintegerlen = decimal_pointlen + 1; if (1 + nonintegerlen + ! (opts & human_base_1024) < buflen || ((opts & human_suppress_point_zero) && buf[buflen - 1] == '0')) { sprintf (buf, "%.0Lf", adjust_value (inexact_style, damt * 10) / 10); buflen = strlen (buf); nonintegerlen = 0; } } p = psuffix - buflen; memmove (p, buf, buflen); integerlim = p + buflen - nonintegerlen; } goto do_grouping; use_integer_arithmetic: { /* The computation can be done exactly, with integer arithmetic. Use power of BASE notation if requested and if adjusted AMT is large enough. */ if (opts & human_autoscale) { exponent = 0; if (base <= amt) { do { unsigned int r10 = (amt % base) * 10 + tenths; unsigned int r2 = (r10 % base) * 2 + (rounding >> 1); amt /= base; tenths = r10 / base; rounding = (r2 < base ? (r2 + rounding) != 0 : 2 + (base < r2 + rounding)); exponent++; } while (base <= amt && exponent < exponent_max); if (amt < 10) { if (inexact_style == human_round_to_nearest ? 2 < rounding + (tenths & 1) : inexact_style == human_ceiling && 0 < rounding) { tenths++; rounding = 0; if (tenths == 10) { amt++; tenths = 0; } } if (amt < 10 && (tenths || ! (opts & human_suppress_point_zero))) { *--p = '0' + tenths; p -= decimal_pointlen; memcpy (p, decimal_point, decimal_pointlen); tenths = rounding = 0; } } } } if (inexact_style == human_round_to_nearest ? 5 < tenths + (0 < rounding + (amt & 1)) : inexact_style == human_ceiling && 0 < tenths + rounding) { amt++; if ((opts & human_autoscale) && amt == base && exponent < exponent_max) { exponent++; if (! (opts & human_suppress_point_zero)) { *--p = '0'; p -= decimal_pointlen; memcpy (p, decimal_point, decimal_pointlen); } amt = 1; } } integerlim = p; do { int digit = amt % 10; *--p = digit + '0'; } while ((amt /= 10) != 0); } do_grouping: if (opts & human_group_digits) p = group_number (p, integerlim - p, grouping, thousands_sep); if (opts & human_SI) { if (exponent < 0) { uintmax_t power; exponent = 0; for (power = 1; power < to_block_size; power *= base) if (++exponent == exponent_max) break; } if ((exponent | (opts & human_B)) && (opts & human_space_before_unit)) *psuffix++ = ' '; if (exponent) *psuffix++ = (! (opts & human_base_1024) && exponent == 1 ? 'k' : power_letter[exponent]); if (opts & human_B) { if ((opts & human_base_1024) && exponent) *psuffix++ = 'i'; *psuffix++ = 'B'; } } *psuffix = '\0'; return p; } /* The default block size used for output. This number may change in the future as disks get larger. */ #ifndef DEFAULT_BLOCK_SIZE # define DEFAULT_BLOCK_SIZE 1024 #endif static char const *const block_size_args[] = { "human-readable", "si", 0 }; static int const block_size_opts[] = { human_autoscale + human_SI + human_base_1024, human_autoscale + human_SI }; static uintmax_t default_block_size (void) { return getenv ("POSIXLY_CORRECT") ? 512 : DEFAULT_BLOCK_SIZE; } static strtol_error humblock (char const *spec, uintmax_t *block_size, int *options) { int i; int opts = 0; if (! spec && ! (spec = getenv ("BLOCK_SIZE")) && ! (spec = getenv ("BLOCKSIZE"))) *block_size = default_block_size (); else { if (*spec == '\'') { opts |= human_group_digits; spec++; } if (0 <= (i = ARGMATCH (spec, block_size_args, block_size_opts))) { opts |= block_size_opts[i]; *block_size = 1; } else { char *ptr; strtol_error e = xstrtoumax (spec, &ptr, 0, block_size, "eEgGkKmMpPtTyYzZ0"); if (e != LONGINT_OK) { *options = 0; return e; } for (; ! ('0' <= *spec && *spec <= '9'); spec++) if (spec == ptr) { opts |= human_SI; if (ptr[-1] == 'B') opts |= human_B; if (ptr[-1] != 'B' || ptr[-2] == 'i') opts |= human_base_1024; break; } } } *options = opts; return LONGINT_OK; } int human_options (char const *spec, bool report_errors, uintmax_t *block_size) { int opts; strtol_error e = humblock (spec, block_size, &opts); if (*block_size == 0) { *block_size = default_block_size (); e = LONGINT_INVALID; } if (e != LONGINT_OK && report_errors) STRTOL_FATAL_ERROR (spec, _("block size"), e); return opts; } microdc2-0.15.6/lib/human.h0100644000076500007500000000552310516626546015421 0ustar chugunovmicrodc/* human.h -- print human readable file size Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert and Larry McVoy. */ #ifndef HUMAN_H_ # define HUMAN_H_ 1 # include # include # if HAVE_STDINT_H # include # endif # include /* A conservative bound on the maximum length of a human-readable string. The output can be the square of the largest uintmax_t, so double its size before converting to a bound. log10 (2.0) < 146/485. Add 1 for integer division truncation. Also, the output can have a thousands separator between every digit, so multiply by MB_LEN_MAX + 1 and then subtract MB_LEN_MAX. Append 1 for a space before the suffix. Finally, append 3, the maximum length of a suffix. */ # define LONGEST_HUMAN_READABLE \ ((2 * sizeof (uintmax_t) * CHAR_BIT * 146 / 485 + 1) * (MB_LEN_MAX + 1) \ - MB_LEN_MAX + 1 + 3) /* Options for human_readable. */ enum { /* Unless otherwise specified these options may be ORed together. */ /* The following three options are mutually exclusive. */ /* Round to plus infinity (default). */ human_ceiling = 0, /* Round to nearest, ties to even. */ human_round_to_nearest = 1, /* Round to minus infinity. */ human_floor = 2, /* Group digits together, e.g. `1,000,000'. This uses the locale-defined grouping; the traditional C locale does not group, so this has effect only if some other locale is in use. */ human_group_digits = 4, /* When autoscaling, suppress ".0" at end. */ human_suppress_point_zero = 8, /* Scale output and use SI-style units, ignoring the output block size. */ human_autoscale = 16, /* Prefer base 1024 to base 1000. */ human_base_1024 = 32, /* Prepend " " before unit symbol. */ human_space_before_unit = 64, /* Append SI prefix, e.g. "k" or "M". */ human_SI = 128, /* Append "B" (if base 1000) or "iB" (if base 1024) to SI prefix. */ human_B = 256 }; char *human_readable (uintmax_t, char *, int, uintmax_t, uintmax_t); int human_options (char const *, bool, uintmax_t *); #endif /* HUMAN_H_ */ microdc2-0.15.6/lib/iconvme.c0100644000076500007500000001120110527413317015722 0ustar chugunovmicrodc/* Recode strings between character sets, using iconv. Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Get prototype. */ #include "iconvme.h" /* Get malloc. */ #include /* Get strcmp. */ #include /* Get errno. */ #include #ifdef _LIBC # define HAVE_ICONV 1 #else /* Get strdup. */ # include "strdup.h" #endif #if HAVE_ICONV /* Get iconv etc. */ # include /* Get MB_LEN_MAX, CHAR_BIT. */ # include #endif #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif /* Convert a zero-terminated string STR from the FROM_CODSET code set to the TO_CODESET code set. The returned string is allocated using malloc, and must be dellocated by the caller using free. On failure, NULL is returned and errno holds the error reason. Note that if TO_CODESET uses \0 for anything but to terminate the string, the caller of this function may have difficulties finding out the length of the output string. */ char * iconv_string (const char *str, const char *from_codeset, const char *to_codeset) { char *dest = NULL; #if HAVE_ICONV iconv_t cd; #endif if (strcmp (to_codeset, from_codeset) == 0) return strdup (str); #if HAVE_ICONV cd = iconv_open (to_codeset, from_codeset); if (cd == (iconv_t) -1) return NULL; dest = iconv_alloc(cd, str); { int save_errno = errno; if (iconv_close (cd) < 0 && dest) { int save_errno2 = errno; /* If we didn't have a real error before, make sure we restore the iconv_close error below. */ free (dest); dest = NULL; errno = save_errno2; } else errno = save_errno; } #else errno = ENOSYS; #endif return dest; } /* Convert a zero-terminated string STR using iconv descriptor CD. The returned string is allocated using malloc, and must be dellocated by the caller using free. On failure, NULL is returned and errno holds the error reason. Note that if the target character set uses \0 for anything but to terminate the string, the caller of this function may have difficulties finding out the length of the output string. */ #if HAVE_ICONV char * iconv_alloc (iconv_t cd, const char *str) { char *dest; char *p = (char *) str; char *outp; if ( (cd == (iconv_t)-1) || !str ) return NULL; size_t inbytes_remaining = strlen (p); /* Guess the maximum length the output string can have. */ size_t outbuf_size = inbytes_remaining + 1; size_t outbytes_remaining; size_t err; int have_error = 0; /* Use a worst-case output size guess, so long as that wouldn't be too large for comfort. It's OK if the guess is wrong so long as it's nonzero. */ size_t approx_sqrt_SIZE_MAX = SIZE_MAX >> (sizeof (size_t) * CHAR_BIT / 2); if (outbuf_size <= approx_sqrt_SIZE_MAX / MB_LEN_MAX) outbuf_size *= MB_LEN_MAX; outbytes_remaining = outbuf_size - 1; outp = dest = (char *) malloc (outbuf_size); if (dest == NULL) return NULL; again: err = iconv (cd, &p, &inbytes_remaining, &outp, &outbytes_remaining); if (err == (size_t) -1) { switch (errno) { case EINVAL: /* Incomplete text, do not report an error */ break; case E2BIG: { size_t used = outp - dest; size_t newsize = outbuf_size * 2; char *newdest; if (newsize <= outbuf_size) { errno = ENOMEM; have_error = 1; goto out; } newdest = (char *) realloc (dest, newsize); if (newdest == NULL) { have_error = 1; goto out; } dest = newdest; outbuf_size = newsize; outp = dest + used; outbytes_remaining = outbuf_size - used - 1; /* -1 for NUL */ goto again; } break; case EILSEQ: have_error = 1; break; default: have_error = 1; break; } } *outp = '\0'; out: if (have_error && dest) { int save_errno = errno; free(dest); errno = save_errno; dest = NULL; } return dest; } #endif microdc2-0.15.6/lib/iconvme.h0100644000076500007500000000212210516626546015741 0ustar chugunovmicrodc/* Recode strings between character sets, using iconv. Copyright (C) 2004 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ICONVME_H # define ICONVME_H extern char *iconv_string (const char *string, const char *from_code, const char *to_code); #if HAVE_ICONV # include extern char *iconv_alloc (iconv_t cd, const char *string); #endif #endif /* ICONVME_H */ microdc2-0.15.6/lib/intprops.h0100644000076500007500000000614110516626546016164 0ustar chugunovmicrodc/* intprops.h -- properties of integer types Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ #include /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ /* True if the arithmetic type T is an integer type. bool counts as an integer. */ #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) /* True if negative values of the signed integer type T use two's complement, ones' complement, or signed magnitude representation, respectively. Much GNU code assumes two's complement, but some people like to be portable to all possible C hosts. */ #define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) #define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) #define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) /* True if the arithmetic type T is signed. */ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* The maximum and minimum values for the integer type T. These macros have undefined behavior if T is signed and has padding bits. If this is a problem for you, please let us know how to fix it for your host. */ #define TYPE_MINIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) 0 \ : TYPE_SIGNED_MAGNITUDE (t) \ ? ~ (t) 0 \ : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) #define TYPE_MAXIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) -1 \ : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) /* Return zero if T can be determined to be an unsigned type. Otherwise, return 1. When compiling with GCC, INT_STRLEN_BOUND uses this macro to obtain a tighter bound. Otherwise, it overestimates the true bound by one byte when applied to unsigned types of size 2, 4, 16, ... bytes. The symbol signed_type_or_expr__ is private to this header file. */ #if __GNUC__ >= 2 # define signed_type_or_expr__(t) TYPE_SIGNED (__typeof__ (t)) #else # define signed_type_or_expr__(t) 1 #endif /* Bound on length of the string representing an integer type or expression T. Subtract 1 for the sign bit if T is signed; log10 (2.0) < 146/485; add 1 for integer division truncation; add 1 more for a minus sign if needed. */ #define INT_STRLEN_BOUND(t) \ ((sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) * 146 / 485 \ + signed_type_or_expr__ (t) + 1) /* Bound on buffer size needed to represent an integer type or expression T, including the terminating null. */ #define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) microdc2-0.15.6/lib/memmem.c0100644000076500007500000000353510516626546015562 0ustar chugunovmicrodc/* Copyright (C) 1991,92,93,94,96,97,98,2000,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #ifndef _LIBC # define __builtin_expect(expr, val) (expr) #endif #undef memmem /* Return the first occurrence of NEEDLE in HAYSTACK. */ void * memmem (haystack, haystack_len, needle, needle_len) const void *haystack; size_t haystack_len; const void *needle; size_t needle_len; { const char *begin; const char *const last_possible = (const char *) haystack + haystack_len - needle_len; if (needle_len == 0) /* The first occurrence of the empty string is deemed to occur at the beginning of the string. */ return (void *) haystack; /* Sanity check, otherwise the loop might search through the whole memory. */ if (__builtin_expect (haystack_len < needle_len, 0)) return NULL; for (begin = (const char *) haystack; begin <= last_possible; ++begin) if (begin[0] == ((const char *) needle)[0] && !memcmp ((const void *) &begin[1], (const void *) ((const char *) needle + 1), needle_len - 1)) return (void *) begin; return NULL; } microdc2-0.15.6/lib/memmem.h0100644000076500007500000000205110516626546015557 0ustar chugunovmicrodc/* * Copyright (C) 2004 Free Software Foundation * Written by Simon Josefsson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #ifndef MEMMEM_H # define MEMMEM_H /* Get memmem, if available. */ # include # if defined HAVE_DECL_MEMMEM && !HAVE_DECL_MEMMEM void * memmem (const void *haystack, size_t haystack_len, const void *needle, size_t needle_len); # endif #endif /* MEMMEM_H */ microdc2-0.15.6/lib/minmax.h0100644000076500007500000000456310516626546015605 0ustar chugunovmicrodc/* MIN, MAX macros. Copyright (C) 1995, 1998, 2001, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _MINMAX_H #define _MINMAX_H /* Note: MIN, MAX are also defined in on some systems (glibc, IRIX, HP-UX, OSF/1). Therefore you might get warnings about MIN, MAX macro redefinitions on some systems; the workaround is to #include this file as the last one among the #include list. */ /* Before we define the following symbols we get the file since otherwise we get redefinitions on some systems if is included after this file. Likewise for . If more than one of these system headers define MIN and MAX, pick just one of the headers (because the definitions most likely are the same). */ #if HAVE_MINMAX_IN_LIMITS_H # include #elif HAVE_MINMAX_IN_SYS_PARAM_H # include #endif /* Note: MIN and MAX should be used with two arguments of the same type. They might not return the minimum and maximum of their two arguments, if the arguments have different types or have unusual floating-point values. For example, on a typical host with 32-bit 'int', 64-bit 'long long', and 64-bit IEEE 754 'double' types: MAX (-1, 2147483648) returns 4294967295. MAX (9007199254740992.0, 9007199254740993) returns 9007199254740992.0. MAX (NaN, 0.0) returns 0.0. MAX (+0.0, -0.0) returns -0.0. and in each case the answer is in some sense bogus. */ /* MAX(a,b) returns the maximum of A and B. */ #ifndef MAX # define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif /* MIN(a,b) returns the minimum of A and B. */ #ifndef MIN # define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif #endif /* _MINMAX_H */ microdc2-0.15.6/lib/printf-args.c0100644000076500007500000000622410516626546016537 0ustar chugunovmicrodc/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "printf-args.h" #ifdef STATIC STATIC #endif int printf_fetchargs (va_list args, arguments *a) { size_t i; argument *ap; for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) switch (ap->type) { case TYPE_SCHAR: ap->a.a_schar = va_arg (args, /*signed char*/ int); break; case TYPE_UCHAR: ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); break; case TYPE_SHORT: ap->a.a_short = va_arg (args, /*short*/ int); break; case TYPE_USHORT: ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); break; case TYPE_INT: ap->a.a_int = va_arg (args, int); break; case TYPE_UINT: ap->a.a_uint = va_arg (args, unsigned int); break; case TYPE_LONGINT: ap->a.a_longint = va_arg (args, long int); break; case TYPE_ULONGINT: ap->a.a_ulongint = va_arg (args, unsigned long int); break; #ifdef HAVE_LONG_LONG case TYPE_LONGLONGINT: ap->a.a_longlongint = va_arg (args, long long int); break; case TYPE_ULONGLONGINT: ap->a.a_ulonglongint = va_arg (args, unsigned long long int); break; #endif case TYPE_DOUBLE: ap->a.a_double = va_arg (args, double); break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: ap->a.a_longdouble = va_arg (args, long double); break; #endif case TYPE_CHAR: ap->a.a_char = va_arg (args, int); break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: ap->a.a_wide_char = va_arg (args, wint_t); break; #endif case TYPE_STRING: ap->a.a_string = va_arg (args, const char *); break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: ap->a.a_wide_string = va_arg (args, const wchar_t *); break; #endif case TYPE_POINTER: ap->a.a_pointer = va_arg (args, void *); break; case TYPE_COUNT_SCHAR_POINTER: ap->a.a_count_schar_pointer = va_arg (args, signed char *); break; case TYPE_COUNT_SHORT_POINTER: ap->a.a_count_short_pointer = va_arg (args, short *); break; case TYPE_COUNT_INT_POINTER: ap->a.a_count_int_pointer = va_arg (args, int *); break; case TYPE_COUNT_LONGINT_POINTER: ap->a.a_count_longint_pointer = va_arg (args, long int *); break; #ifdef HAVE_LONG_LONG case TYPE_COUNT_LONGLONGINT_POINTER: ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); break; #endif default: /* Unknown type. */ return -1; } return 0; } microdc2-0.15.6/lib/printf-args.h0100644000076500007500000000545310516626546016547 0ustar chugunovmicrodc/* Decomposed printf argument list. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PRINTF_ARGS_H #define _PRINTF_ARGS_H /* Get size_t. */ #include /* Get wchar_t. */ #ifdef HAVE_WCHAR_T # include #endif /* Get wint_t. */ #ifdef HAVE_WINT_T # include #endif /* Get va_list. */ #include /* Argument types */ typedef enum { TYPE_NONE, TYPE_SCHAR, TYPE_UCHAR, TYPE_SHORT, TYPE_USHORT, TYPE_INT, TYPE_UINT, TYPE_LONGINT, TYPE_ULONGINT, #ifdef HAVE_LONG_LONG TYPE_LONGLONGINT, TYPE_ULONGLONGINT, #endif TYPE_DOUBLE, #ifdef HAVE_LONG_DOUBLE TYPE_LONGDOUBLE, #endif TYPE_CHAR, #ifdef HAVE_WINT_T TYPE_WIDE_CHAR, #endif TYPE_STRING, #ifdef HAVE_WCHAR_T TYPE_WIDE_STRING, #endif TYPE_POINTER, TYPE_COUNT_SCHAR_POINTER, TYPE_COUNT_SHORT_POINTER, TYPE_COUNT_INT_POINTER, TYPE_COUNT_LONGINT_POINTER #ifdef HAVE_LONG_LONG , TYPE_COUNT_LONGLONGINT_POINTER #endif } arg_type; /* Polymorphic argument */ typedef struct { arg_type type; union { signed char a_schar; unsigned char a_uchar; short a_short; unsigned short a_ushort; int a_int; unsigned int a_uint; long int a_longint; unsigned long int a_ulongint; #ifdef HAVE_LONG_LONG long long int a_longlongint; unsigned long long int a_ulonglongint; #endif float a_float; double a_double; #ifdef HAVE_LONG_DOUBLE long double a_longdouble; #endif int a_char; #ifdef HAVE_WINT_T wint_t a_wide_char; #endif const char* a_string; #ifdef HAVE_WCHAR_T const wchar_t* a_wide_string; #endif void* a_pointer; signed char * a_count_schar_pointer; short * a_count_short_pointer; int * a_count_int_pointer; long int * a_count_longint_pointer; #ifdef HAVE_LONG_LONG long long int * a_count_longlongint_pointer; #endif } a; } argument; typedef struct { size_t count; argument *arg; } arguments; /* Fetch the arguments, putting them into a. */ #ifdef STATIC STATIC #else extern #endif int printf_fetchargs (va_list args, arguments *a); #endif /* _PRINTF_ARGS_H */ microdc2-0.15.6/lib/printf-parse.c0100644000076500007500000002730410516626546016717 0ustar chugunovmicrodc/* Formatted output to strings. Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Get size_t, NULL. */ #include /* Get intmax_t. */ #if HAVE_STDINT_H_WITH_UINTMAX # include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX # include #endif /* malloc(), realloc(), free(). */ #include /* Checked size_t computations. */ #include "xsize.h" #if WIDE_CHAR_VERSION # define PRINTF_PARSE wprintf_parse # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives #else # define PRINTF_PARSE printf_parse # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives #endif #ifdef STATIC STATIC #endif int PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) { const CHAR_T *cp = format; /* pointer into format */ size_t arg_posn = 0; /* number of regular arguments consumed */ size_t d_allocated; /* allocated elements of d->dir */ size_t a_allocated; /* allocated elements of a->arg */ size_t max_width_length = 0; size_t max_precision_length = 0; d->count = 0; d_allocated = 1; d->dir = malloc (d_allocated * sizeof (DIRECTIVE)); if (d->dir == NULL) /* Out of memory. */ return -1; a->count = 0; a_allocated = 0; a->arg = NULL; #define REGISTER_ARG(_index_,_type_) \ { \ size_t n = (_index_); \ if (n >= a_allocated) \ { \ size_t memory_size; \ argument *memory; \ \ a_allocated = xtimes (a_allocated, 2); \ if (a_allocated <= n) \ a_allocated = xsum (n, 1); \ memory_size = xtimes (a_allocated, sizeof (argument)); \ if (size_overflow_p (memory_size)) \ /* Overflow, would lead to out of memory. */ \ goto error; \ memory = (a->arg \ ? realloc (a->arg, memory_size) \ : malloc (memory_size)); \ if (memory == NULL) \ /* Out of memory. */ \ goto error; \ a->arg = memory; \ } \ while (a->count <= n) \ a->arg[a->count++].type = TYPE_NONE; \ if (a->arg[n].type == TYPE_NONE) \ a->arg[n].type = (_type_); \ else if (a->arg[n].type != (_type_)) \ /* Ambiguous type for positional argument. */ \ goto error; \ } while (*cp != '\0') { CHAR_T c = *cp++; if (c == '%') { size_t arg_index = ARG_NONE; DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */ /* Initialize the next directive. */ dp->dir_start = cp - 1; dp->flags = 0; dp->width_start = NULL; dp->width_end = NULL; dp->width_arg_index = ARG_NONE; dp->precision_start = NULL; dp->precision_end = NULL; dp->precision_arg_index = ARG_NONE; dp->arg_index = ARG_NONE; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; arg_index = n - 1; cp = np + 1; } } /* Read the flags. */ for (;;) { if (*cp == '\'') { dp->flags |= FLAG_GROUP; cp++; } else if (*cp == '-') { dp->flags |= FLAG_LEFT; cp++; } else if (*cp == '+') { dp->flags |= FLAG_SHOWSIGN; cp++; } else if (*cp == ' ') { dp->flags |= FLAG_SPACE; cp++; } else if (*cp == '#') { dp->flags |= FLAG_ALT; cp++; } else if (*cp == '0') { dp->flags |= FLAG_ZERO; cp++; } else break; } /* Parse the field width. */ if (*cp == '*') { dp->width_start = cp; cp++; dp->width_end = cp; if (max_width_length < 1) max_width_length = 1; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->width_arg_index = n - 1; cp = np + 1; } } if (dp->width_arg_index == ARG_NONE) { dp->width_arg_index = arg_posn++; if (dp->width_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->width_arg_index, TYPE_INT); } else if (*cp >= '0' && *cp <= '9') { size_t width_length; dp->width_start = cp; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->width_end = cp; width_length = dp->width_end - dp->width_start; if (max_width_length < width_length) max_width_length = width_length; } /* Parse the precision. */ if (*cp == '.') { cp++; if (*cp == '*') { dp->precision_start = cp - 1; cp++; dp->precision_end = cp; if (max_precision_length < 2) max_precision_length = 2; /* Test for positional argument. */ if (*cp >= '0' && *cp <= '9') { const CHAR_T *np; for (np = cp; *np >= '0' && *np <= '9'; np++) ; if (*np == '$') { size_t n = 0; for (np = cp; *np >= '0' && *np <= '9'; np++) n = xsum (xtimes (n, 10), *np - '0'); if (n == 0) /* Positional argument 0. */ goto error; if (size_overflow_p (n)) /* n too large, would lead to out of memory later. */ goto error; dp->precision_arg_index = n - 1; cp = np + 1; } } if (dp->precision_arg_index == ARG_NONE) { dp->precision_arg_index = arg_posn++; if (dp->precision_arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->precision_arg_index, TYPE_INT); } else { size_t precision_length; dp->precision_start = cp - 1; for (; *cp >= '0' && *cp <= '9'; cp++) ; dp->precision_end = cp; precision_length = dp->precision_end - dp->precision_start; if (max_precision_length < precision_length) max_precision_length = precision_length; } } { arg_type type; /* Parse argument type/size specifiers. */ { int flags = 0; for (;;) { if (*cp == 'h') { flags |= (1 << (flags & 1)); cp++; } else if (*cp == 'L') { flags |= 4; cp++; } else if (*cp == 'l') { flags += 8; cp++; } #ifdef HAVE_INTMAX_T else if (*cp == 'j') { if (sizeof (intmax_t) > sizeof (long)) { /* intmax_t = long long */ flags += 16; } else if (sizeof (intmax_t) > sizeof (int)) { /* intmax_t = long */ flags += 8; } cp++; } #endif else if (*cp == 'z' || *cp == 'Z') { /* 'z' is standardized in ISO C 99, but glibc uses 'Z' because the warning facility in gcc-2.95.2 understands only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ if (sizeof (size_t) > sizeof (long)) { /* size_t = long long */ flags += 16; } else if (sizeof (size_t) > sizeof (int)) { /* size_t = long */ flags += 8; } cp++; } else if (*cp == 't') { if (sizeof (ptrdiff_t) > sizeof (long)) { /* ptrdiff_t = long long */ flags += 16; } else if (sizeof (ptrdiff_t) > sizeof (int)) { /* ptrdiff_t = long */ flags += 8; } cp++; } else break; } /* Read the conversion character. */ c = *cp++; switch (c) { case 'd': case 'i': #ifdef HAVE_LONG_LONG if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; else #endif if (flags >= 8) type = TYPE_LONGINT; else if (flags & 2) type = TYPE_SCHAR; else if (flags & 1) type = TYPE_SHORT; else type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': #ifdef HAVE_LONG_LONG if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; else #endif if (flags >= 8) type = TYPE_ULONGINT; else if (flags & 2) type = TYPE_UCHAR; else if (flags & 1) type = TYPE_USHORT; else type = TYPE_UINT; break; case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': #ifdef HAVE_LONG_DOUBLE if (flags >= 16 || (flags & 4)) type = TYPE_LONGDOUBLE; else #endif type = TYPE_DOUBLE; break; case 'c': if (flags >= 8) #ifdef HAVE_WINT_T type = TYPE_WIDE_CHAR; #else goto error; #endif else type = TYPE_CHAR; break; #ifdef HAVE_WINT_T case 'C': type = TYPE_WIDE_CHAR; c = 'c'; break; #endif case 's': if (flags >= 8) #ifdef HAVE_WCHAR_T type = TYPE_WIDE_STRING; #else goto error; #endif else type = TYPE_STRING; break; #ifdef HAVE_WCHAR_T case 'S': type = TYPE_WIDE_STRING; c = 's'; break; #endif case 'p': type = TYPE_POINTER; break; case 'n': #ifdef HAVE_LONG_LONG if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; else #endif if (flags >= 8) type = TYPE_COUNT_LONGINT_POINTER; else if (flags & 2) type = TYPE_COUNT_SCHAR_POINTER; else if (flags & 1) type = TYPE_COUNT_SHORT_POINTER; else type = TYPE_COUNT_INT_POINTER; break; case '%': type = TYPE_NONE; break; default: /* Unknown conversion character. */ goto error; } } if (type != TYPE_NONE) { dp->arg_index = arg_index; if (dp->arg_index == ARG_NONE) { dp->arg_index = arg_posn++; if (dp->arg_index == ARG_NONE) /* arg_posn wrapped around. */ goto error; } REGISTER_ARG (dp->arg_index, type); } dp->conversion = c; dp->dir_end = cp; } d->count++; if (d->count >= d_allocated) { size_t memory_size; DIRECTIVE *memory; d_allocated = xtimes (d_allocated, 2); memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); if (size_overflow_p (memory_size)) /* Overflow, would lead to out of memory. */ goto error; memory = realloc (d->dir, memory_size); if (memory == NULL) /* Out of memory. */ goto error; d->dir = memory; } } } d->dir[d->count].dir_start = cp; d->max_width_length = max_width_length; d->max_precision_length = max_precision_length; return 0; error: if (a->arg) free (a->arg); if (d->dir) free (d->dir); return -1; } #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef PRINTF_PARSE microdc2-0.15.6/lib/printf-parse.h0100644000076500007500000000416010516626546016717 0ustar chugunovmicrodc/* Parse printf format string. Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PRINTF_PARSE_H #define _PRINTF_PARSE_H #include "printf-args.h" /* Flags */ #define FLAG_GROUP 1 /* ' flag */ #define FLAG_LEFT 2 /* - flag */ #define FLAG_SHOWSIGN 4 /* + flag */ #define FLAG_SPACE 8 /* space flag */ #define FLAG_ALT 16 /* # flag */ #define FLAG_ZERO 32 /* arg_index value indicating that no argument is consumed. */ #define ARG_NONE (~(size_t)0) /* A parsed directive. */ typedef struct { const char* dir_start; const char* dir_end; int flags; const char* width_start; const char* width_end; size_t width_arg_index; const char* precision_start; const char* precision_end; size_t precision_arg_index; char conversion; /* d i o u x X f e E g G c s p n U % but not C S */ size_t arg_index; } char_directive; /* A parsed format string. */ typedef struct { size_t count; char_directive *dir; size_t max_width_length; size_t max_precision_length; } char_directives; /* Parses the format string. Fills in the number N of directives, and fills in directives[0], ..., directives[N-1], and sets directives[N].dir_start to the end of the format string. Also fills in the arg_type fields of the arguments and the needed count of arguments. */ #ifdef STATIC STATIC #else extern #endif int printf_parse (const char *format, char_directives *d, arguments *a); #endif /* _PRINTF_PARSE_H */ microdc2-0.15.6/lib/progname.c0100644000076500007500000000330010516626546016103 0ustar chugunovmicrodc/* Program name management. Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "progname.h" #include #undef set_program_name /* String containing name the program is called with. To be initialized by main(). */ const char *program_name = NULL; /* Set program_name, based on argv[0]. */ void set_program_name (const char *argv0) { /* libtool creates a temporary executable whose name is sometimes prefixed with "lt-" (depends on the platform). It also makes argv[0] absolute. Remove this "/.libs/" or "/.libs/lt-" prefix here. */ const char *slash; const char *base; slash = strrchr (argv0, '/'); base = (slash != NULL ? slash + 1 : argv0); if (base - argv0 >= 7 && memcmp (base - 7, "/.libs/", 7) == 0) argv0 = base; if (strncmp (base, "lt-", 3) == 0) argv0 = base + 3; program_name = argv0; } microdc2-0.15.6/lib/progname.h0100644000076500007500000000350610516626546016120 0ustar chugunovmicrodc/* Program name management. Copyright (C) 2001-2004 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PROGNAME_H #define _PROGNAME_H /* Programs using this file should do the following in main(): set_program_name (argv[0]); */ #ifdef __cplusplus extern "C" { #endif /* String containing name the program is called with. */ extern const char *program_name; /* Set program_name, based on argv[0]. */ extern void set_program_name (const char *argv0); #if ENABLE_RELOCATABLE /* Set program_name, based on argv[0], and original installation prefix and directory, for relocatability. */ extern void set_program_name_and_installdir (const char *argv0, const char *orig_installprefix, const char *orig_installdir); #define set_program_name(ARG0) \ set_program_name_and_installdir (ARG0, INSTALLPREFIX, INSTALLDIR) /* Return the full pathname of the current executable, based on the earlier call to set_program_name_and_installdir. Return NULL if unknown. */ extern char *get_full_program_name (void); #endif #ifdef __cplusplus } #endif #endif /* _PROGNAME_H */ microdc2-0.15.6/lib/quote.c0100644000076500007500000000250710516626546015440 0ustar chugunovmicrodc/* quote.c - quote arguments for output Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert */ #ifdef HAVE_CONFIG_H # include #endif #include "quotearg.h" #include "quote.h" /* Return an unambiguous printable representation of NAME, allocated in slot N, suitable for diagnostics. */ char const * quote_n (int n, char const *name) { return quotearg_n_style (n, locale_quoting_style, name); } /* Return an unambiguous printable representation of NAME, suitable for diagnostics. */ char const * quote (char const *name) { return quote_n (0, name); } microdc2-0.15.6/lib/quote.h0100644000076500007500000000161410516626546015443 0ustar chugunovmicrodc/* quote.h - prototypes for quote.c Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ char const *quote_n (int n, char const *name); char const *quote (char const *name); microdc2-0.15.6/lib/quotearg.c0100644000076500007500000004406110516626546016133 0ustar chugunovmicrodc/* quotearg.c - quote arguments for output Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert */ #ifdef HAVE_CONFIG_H # include #endif #include "quotearg.h" #include "xalloc.h" #include #include #include #include #include #include #include "gettext.h" #define _(msgid) gettext (msgid) #define N_(msgid) msgid #if HAVE_WCHAR_H /* BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared. */ # include # include # include #endif #if !HAVE_MBRTOWC /* Disable multibyte processing entirely. Since MB_CUR_MAX is 1, the other macros are defined only for documentation and to satisfy C syntax. */ # undef MB_CUR_MAX # define MB_CUR_MAX 1 # define mbrtowc(pwc, s, n, ps) ((*(pwc) = *(s)) != 0) # define iswprint(wc) isprint ((unsigned char) (wc)) # undef HAVE_MBSINIT #endif #if !defined mbsinit && !HAVE_MBSINIT # define mbsinit(ps) 1 #endif #ifndef iswprint # if HAVE_WCTYPE_H # include # endif # if !defined iswprint && !HAVE_ISWPRINT # define iswprint(wc) 1 # endif #endif #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif #define INT_BITS (sizeof (int) * CHAR_BIT) struct quoting_options { /* Basic quoting style. */ enum quoting_style style; /* Quote the characters indicated by this bit vector even if the quoting style would not normally require them to be quoted. */ unsigned int quote_these_too[(UCHAR_MAX / INT_BITS) + 1]; }; /* Names of quoting styles. */ char const *const quoting_style_args[] = { "literal", "shell", "shell-always", "c", "escape", "locale", "clocale", 0 }; /* Correspondences to quoting style names. */ enum quoting_style const quoting_style_vals[] = { literal_quoting_style, shell_quoting_style, shell_always_quoting_style, c_quoting_style, escape_quoting_style, locale_quoting_style, clocale_quoting_style }; /* The default quoting options. */ static struct quoting_options default_quoting_options; /* Allocate a new set of quoting options, with contents initially identical to O if O is not null, or to the default if O is null. It is the caller's responsibility to free the result. */ struct quoting_options * clone_quoting_options (struct quoting_options *o) { int e = errno; struct quoting_options *p = xmalloc (sizeof *p); *p = *(o ? o : &default_quoting_options); errno = e; return p; } /* Get the value of O's quoting style. If O is null, use the default. */ enum quoting_style get_quoting_style (struct quoting_options *o) { return (o ? o : &default_quoting_options)->style; } /* In O (or in the default if O is null), set the value of the quoting style to S. */ void set_quoting_style (struct quoting_options *o, enum quoting_style s) { (o ? o : &default_quoting_options)->style = s; } /* In O (or in the default if O is null), set the value of the quoting options for character C to I. Return the old value. Currently, the only values defined for I are 0 (the default) and 1 (which means to quote the character even if it would not otherwise be quoted). */ int set_char_quoting (struct quoting_options *o, char c, int i) { unsigned char uc = c; unsigned int *p = (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS; int shift = uc % INT_BITS; int r = (*p >> shift) & 1; *p ^= ((i & 1) ^ r) << shift; return r; } /* MSGID approximates a quotation mark. Return its translation if it has one; otherwise, return either it or "\"", depending on S. */ static char const * gettext_quote (char const *msgid, enum quoting_style s) { char const *translation = _(msgid); if (translation == msgid && s == clocale_quoting_style) translation = "\""; return translation; } /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of argument ARG (of size ARGSIZE), using QUOTING_STYLE and the non-quoting-style part of O to control quoting. Terminate the output with a null character, and return the written size of the output, not counting the terminating null. If BUFFERSIZE is too small to store the output string, return the value that would have been returned had BUFFERSIZE been large enough. If ARGSIZE is SIZE_MAX, use the string length of the argument for ARGSIZE. This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG, ARGSIZE, O), except it uses QUOTING_STYLE instead of the quoting style specified by O, and O may not be null. */ static size_t quotearg_buffer_restyled (char *buffer, size_t buffersize, char const *arg, size_t argsize, enum quoting_style quoting_style, struct quoting_options const *o) { size_t i; size_t len = 0; char const *quote_string = 0; size_t quote_string_len = 0; bool backslash_escapes = false; bool unibyte_locale = MB_CUR_MAX == 1; #define STORE(c) \ do \ { \ if (len < buffersize) \ buffer[len] = (c); \ len++; \ } \ while (0) switch (quoting_style) { case c_quoting_style: STORE ('"'); backslash_escapes = true; quote_string = "\""; quote_string_len = 1; break; case escape_quoting_style: backslash_escapes = true; break; case locale_quoting_style: case clocale_quoting_style: { /* TRANSLATORS: Get translations for open and closing quotation marks. The message catalog should translate "`" to a left quotation mark suitable for the locale, and similarly for "'". If the catalog has no translation, locale_quoting_style quotes `like this', and clocale_quoting_style quotes "like this". For example, an American English Unicode locale should translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and should translate "'" to U+201D (RIGHT DOUBLE QUOTATION MARK). A British English Unicode locale should instead translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. If you don't know what to put here, please see and use glyphs suitable for your language. */ char const *left = gettext_quote (N_("`"), quoting_style); char const *right = gettext_quote (N_("'"), quoting_style); for (quote_string = left; *quote_string; quote_string++) STORE (*quote_string); backslash_escapes = true; quote_string = right; quote_string_len = strlen (quote_string); } break; case shell_always_quoting_style: STORE ('\''); quote_string = "'"; quote_string_len = 1; break; default: break; } for (i = 0; ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize); i++) { unsigned char c; unsigned char esc; if (backslash_escapes && quote_string_len && i + quote_string_len <= argsize && memcmp (arg + i, quote_string, quote_string_len) == 0) STORE ('\\'); c = arg[i]; switch (c) { case '\0': if (backslash_escapes) { STORE ('\\'); STORE ('0'); STORE ('0'); c = '0'; } break; case '?': switch (quoting_style) { case shell_quoting_style: goto use_shell_always_quoting_style; case c_quoting_style: if (i + 2 < argsize && arg[i + 1] == '?') switch (arg[i + 2]) { case '!': case '\'': case '(': case ')': case '-': case '/': case '<': case '=': case '>': /* Escape the second '?' in what would otherwise be a trigraph. */ c = arg[i + 2]; i += 2; STORE ('?'); STORE ('\\'); STORE ('?'); break; } break; default: break; } break; case '\a': esc = 'a'; goto c_escape; case '\b': esc = 'b'; goto c_escape; case '\f': esc = 'f'; goto c_escape; case '\n': esc = 'n'; goto c_and_shell_escape; case '\r': esc = 'r'; goto c_and_shell_escape; case '\t': esc = 't'; goto c_and_shell_escape; case '\v': esc = 'v'; goto c_escape; case '\\': esc = c; goto c_and_shell_escape; c_and_shell_escape: if (quoting_style == shell_quoting_style) goto use_shell_always_quoting_style; c_escape: if (backslash_escapes) { c = esc; goto store_escape; } break; case '{': case '}': /* sometimes special if isolated */ if (! (argsize == SIZE_MAX ? arg[1] == '\0' : argsize == 1)) break; /* Fall through. */ case '#': case '~': if (i != 0) break; /* Fall through. */ case ' ': case '!': /* special in bash */ case '"': case '$': case '&': case '(': case ')': case '*': case ';': case '<': case '=': /* sometimes special in 0th or (with "set -k") later args */ case '>': case '[': case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */ case '`': case '|': /* A shell special character. In theory, '$' and '`' could be the first bytes of multibyte characters, which means we should check them with mbrtowc, but in practice this doesn't happen so it's not worth worrying about. */ if (quoting_style == shell_quoting_style) goto use_shell_always_quoting_style; break; case '\'': switch (quoting_style) { case shell_quoting_style: goto use_shell_always_quoting_style; case shell_always_quoting_style: STORE ('\''); STORE ('\\'); STORE ('\''); break; default: break; } break; case '%': case '+': case ',': case '-': case '.': case '/': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case ':': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': case ']': case '_': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': /* These characters don't cause problems, no matter what the quoting style is. They cannot start multibyte sequences. */ break; default: /* If we have a multibyte sequence, copy it until we reach its end, find an error, or come back to the initial shift state. For C-like styles, if the sequence has unprintable characters, escape the whole sequence, since we can't easily escape single characters within it. */ { /* Length of multibyte sequence found so far. */ size_t m; bool printable; if (unibyte_locale) { m = 1; printable = isprint (c) != 0; } else { mbstate_t mbstate; memset (&mbstate, 0, sizeof mbstate); m = 0; printable = true; if (argsize == SIZE_MAX) argsize = strlen (arg); do { wchar_t w; size_t bytes = mbrtowc (&w, &arg[i + m], argsize - (i + m), &mbstate); if (bytes == 0) break; else if (bytes == (size_t) -1) { printable = false; break; } else if (bytes == (size_t) -2) { printable = false; while (i + m < argsize && arg[i + m]) m++; break; } else { /* Work around a bug with older shells that "see" a '\' that is really the 2nd byte of a multibyte character. In practice the problem is limited to ASCII chars >= '@' that are shell special chars. */ if ('[' == 0x5b && quoting_style == shell_quoting_style) { size_t j; for (j = 1; j < bytes; j++) switch (arg[i + m + j]) { case '[': case '\\': case '^': case '`': case '|': goto use_shell_always_quoting_style; } } if (! iswprint (w)) printable = false; m += bytes; } } while (! mbsinit (&mbstate)); } if (1 < m || (backslash_escapes && ! printable)) { /* Output a multibyte sequence, or an escaped unprintable unibyte character. */ size_t ilim = i + m; for (;;) { if (backslash_escapes && ! printable) { STORE ('\\'); STORE ('0' + (c >> 6)); STORE ('0' + ((c >> 3) & 7)); c = '0' + (c & 7); } if (ilim <= i + 1) break; STORE (c); c = arg[++i]; } goto store_c; } } } if (! (backslash_escapes && o->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))) goto store_c; store_escape: STORE ('\\'); store_c: STORE (c); } if (i == 0 && quoting_style == shell_quoting_style) goto use_shell_always_quoting_style; if (quote_string) for (; *quote_string; quote_string++) STORE (*quote_string); if (len < buffersize) buffer[len] = '\0'; return len; use_shell_always_quoting_style: return quotearg_buffer_restyled (buffer, buffersize, arg, argsize, shell_always_quoting_style, o); } /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of argument ARG (of size ARGSIZE), using O to control quoting. If O is null, use the default. Terminate the output with a null character, and return the written size of the output, not counting the terminating null. If BUFFERSIZE is too small to store the output string, return the value that would have been returned had BUFFERSIZE been large enough. If ARGSIZE is SIZE_MAX, use the string length of the argument for ARGSIZE. */ size_t quotearg_buffer (char *buffer, size_t buffersize, char const *arg, size_t argsize, struct quoting_options const *o) { struct quoting_options const *p = o ? o : &default_quoting_options; int e = errno; size_t r = quotearg_buffer_restyled (buffer, buffersize, arg, argsize, p->style, p); errno = e; return r; } /* Like quotearg_buffer (..., ARG, ARGSIZE, O), except return newly allocated storage containing the quoted string. */ char * quotearg_alloc (char const *arg, size_t argsize, struct quoting_options const *o) { int e = errno; size_t bufsize = quotearg_buffer (0, 0, arg, argsize, o) + 1; char *buf = xmalloc (bufsize); quotearg_buffer (buf, bufsize, arg, argsize, o); errno = e; return buf; } /* Use storage slot N to return a quoted version of argument ARG. ARG is of size ARGSIZE, but if that is SIZE_MAX, ARG is a null-terminated string. OPTIONS specifies the quoting options. The returned value points to static storage that can be reused by the next call to this function with the same value of N. N must be nonnegative. N is deliberately declared with type "int" to allow for future extensions (using negative values). */ static char * quotearg_n_options (int n, char const *arg, size_t argsize, struct quoting_options const *options) { int e = errno; /* Preallocate a slot 0 buffer, so that the caller can always quote one small component of a "memory exhausted" message in slot 0. */ static char slot0[256]; static unsigned int nslots = 1; unsigned int n0 = n; struct slotvec { size_t size; char *val; }; static struct slotvec slotvec0 = {sizeof slot0, slot0}; static struct slotvec *slotvec = &slotvec0; if (n < 0) abort (); if (nslots <= n0) { /* FIXME: technically, the type of n1 should be `unsigned int', but that evokes an unsuppressible warning from gcc-4.0.1 and older. If gcc ever provides an option to suppress that warning, revert to the original type, so that the test in xalloc_oversized is once again performed only at compile time. */ size_t n1 = n0 + 1; if (xalloc_oversized (n1, sizeof *slotvec)) xalloc_die (); if (slotvec == &slotvec0) { slotvec = xmalloc (sizeof *slotvec); *slotvec = slotvec0; } slotvec = xrealloc (slotvec, n1 * sizeof *slotvec); memset (slotvec + nslots, 0, (n1 - nslots) * sizeof *slotvec); nslots = n1; } { size_t size = slotvec[n].size; char *val = slotvec[n].val; size_t qsize = quotearg_buffer (val, size, arg, argsize, options); if (size <= qsize) { slotvec[n].size = size = qsize + 1; if (val != slot0) free (val); slotvec[n].val = val = xmalloc (size); quotearg_buffer (val, size, arg, argsize, options); } errno = e; return val; } } char * quotearg_n (int n, char const *arg) { return quotearg_n_options (n, arg, SIZE_MAX, &default_quoting_options); } char * quotearg (char const *arg) { return quotearg_n (0, arg); } /* Return quoting options for STYLE, with no extra quoting. */ static struct quoting_options quoting_options_from_style (enum quoting_style style) { struct quoting_options o; o.style = style; memset (o.quote_these_too, 0, sizeof o.quote_these_too); return o; } char * quotearg_n_style (int n, enum quoting_style s, char const *arg) { struct quoting_options const o = quoting_options_from_style (s); return quotearg_n_options (n, arg, SIZE_MAX, &o); } char * quotearg_n_style_mem (int n, enum quoting_style s, char const *arg, size_t argsize) { struct quoting_options const o = quoting_options_from_style (s); return quotearg_n_options (n, arg, argsize, &o); } char * quotearg_style (enum quoting_style s, char const *arg) { return quotearg_n_style (0, s, arg); } char * quotearg_char (char const *arg, char ch) { struct quoting_options options; options = default_quoting_options; set_char_quoting (&options, ch, 1); return quotearg_n_options (0, arg, SIZE_MAX, &options); } char * quotearg_colon (char const *arg) { return quotearg_char (arg, ':'); } microdc2-0.15.6/lib/quotearg.h0100644000076500007500000001267110516626546016142 0ustar chugunovmicrodc/* quotearg.h - quote arguments for output Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert */ #ifndef QUOTEARG_H_ # define QUOTEARG_H_ 1 # include /* Basic quoting styles. */ enum quoting_style { /* Output names as-is (ls --quoting-style=literal). */ literal_quoting_style, /* Quote names for the shell if they contain shell metacharacters or would cause ambiguous output (ls --quoting-style=shell). */ shell_quoting_style, /* Quote names for the shell, even if they would normally not require quoting (ls --quoting-style=shell-always). */ shell_always_quoting_style, /* Quote names as for a C language string (ls --quoting-style=c). */ c_quoting_style, /* Like c_quoting_style except omit the surrounding double-quote characters (ls --quoting-style=escape). */ escape_quoting_style, /* Like clocale_quoting_style, but quote `like this' instead of "like this" in the default C locale (ls --quoting-style=locale). */ locale_quoting_style, /* Like c_quoting_style except use quotation marks appropriate for the locale (ls --quoting-style=clocale). */ clocale_quoting_style }; /* For now, --quoting-style=literal is the default, but this may change. */ # ifndef DEFAULT_QUOTING_STYLE # define DEFAULT_QUOTING_STYLE literal_quoting_style # endif /* Names of quoting styles and their corresponding values. */ extern char const *const quoting_style_args[]; extern enum quoting_style const quoting_style_vals[]; struct quoting_options; /* The functions listed below set and use a hidden variable that contains the default quoting style options. */ /* Allocate a new set of quoting options, with contents initially identical to O if O is not null, or to the default if O is null. It is the caller's responsibility to free the result. */ struct quoting_options *clone_quoting_options (struct quoting_options *o); /* Get the value of O's quoting style. If O is null, use the default. */ enum quoting_style get_quoting_style (struct quoting_options *o); /* In O (or in the default if O is null), set the value of the quoting style to S. */ void set_quoting_style (struct quoting_options *o, enum quoting_style s); /* In O (or in the default if O is null), set the value of the quoting options for character C to I. Return the old value. Currently, the only values defined for I are 0 (the default) and 1 (which means to quote the character even if it would not otherwise be quoted). */ int set_char_quoting (struct quoting_options *o, char c, int i); /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of argument ARG (of size ARGSIZE), using O to control quoting. If O is null, use the default. Terminate the output with a null character, and return the written size of the output, not counting the terminating null. If BUFFERSIZE is too small to store the output string, return the value that would have been returned had BUFFERSIZE been large enough. If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */ size_t quotearg_buffer (char *buffer, size_t buffersize, char const *arg, size_t argsize, struct quoting_options const *o); /* Like quotearg_buffer, except return the result in a newly allocated buffer. It is the caller's responsibility to free the result. */ char *quotearg_alloc (char const *arg, size_t argsize, struct quoting_options const *o); /* Use storage slot N to return a quoted version of the string ARG. Use the default quoting options. The returned value points to static storage that can be reused by the next call to this function with the same value of N. N must be nonnegative. */ char *quotearg_n (int n, char const *arg); /* Equivalent to quotearg_n (0, ARG). */ char *quotearg (char const *arg); /* Use style S and storage slot N to return a quoted version of the string ARG. This is like quotearg_n (N, ARG), except that it uses S with no other options to specify the quoting method. */ char *quotearg_n_style (int n, enum quoting_style s, char const *arg); /* Use style S and storage slot N to return a quoted version of the argument ARG of size ARGSIZE. This is like quotearg_n_style (N, S, ARG), except it can quote null bytes. */ char *quotearg_n_style_mem (int n, enum quoting_style s, char const *arg, size_t argsize); /* Equivalent to quotearg_n_style (0, S, ARG). */ char *quotearg_style (enum quoting_style s, char const *arg); /* Like quotearg (ARG), except also quote any instances of CH. */ char *quotearg_char (char const *arg, char ch); /* Equivalent to quotearg_char (ARG, ':'). */ char *quotearg_colon (char const *arg); #endif /* !QUOTEARG_H_ */ microdc2-0.15.6/lib/safe-read.c0100644000076500007500000000424410516626546016132 0ustar chugunovmicrodc/* An interface to read and write that retries after interrupts. Copyright (C) 1993, 1994, 1998, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #ifdef SAFE_WRITE # include "safe-write.h" #else # include "safe-read.h" #endif /* Get ssize_t. */ #include #include #include #ifdef EINTR # define IS_EINTR(x) ((x) == EINTR) #else # define IS_EINTR(x) 0 #endif #include #ifdef SAFE_WRITE # define safe_rw safe_write # define rw write #else # define safe_rw safe_read # define rw read # undef const # define const /* empty */ #endif /* Read(write) up to COUNT bytes at BUF from(to) descriptor FD, retrying if interrupted. Return the actual number of bytes read(written), zero for EOF, or SAFE_READ_ERROR(SAFE_WRITE_ERROR) upon error. */ size_t safe_rw (int fd, void const *buf, size_t count) { /* Work around a bug in Tru64 5.1. Attempting to read more than INT_MAX bytes fails with errno == EINVAL. See . When decreasing COUNT, keep it block-aligned. */ enum { BUGGY_READ_MAXIMUM = INT_MAX & ~8191 }; for (;;) { ssize_t result = rw (fd, buf, count); if (0 <= result) return result; else if (IS_EINTR (errno)) continue; else if (errno == EINVAL && BUGGY_READ_MAXIMUM < count) count = BUGGY_READ_MAXIMUM; else return result; } } microdc2-0.15.6/lib/safe-read.h0100644000076500007500000000212310516626546016131 0ustar chugunovmicrodc/* An interface to read() that retries after interrupts. Copyright (C) 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #define SAFE_READ_ERROR ((size_t) -1) /* Read up to COUNT bytes at BUF from descriptor FD, retrying if interrupted. Return the actual number of bytes read, zero for EOF, or SAFE_READ_ERROR upon error. */ extern size_t safe_read (int fd, void *buf, size_t count); microdc2-0.15.6/lib/safe-write.c0100644000076500007500000000153010516626546016344 0ustar chugunovmicrodc/* An interface to write that retries after interrupts. Copyright (C) 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define SAFE_WRITE #include "safe-read.c" microdc2-0.15.6/lib/safe-write.h0100644000076500007500000000213710516626546016355 0ustar chugunovmicrodc/* An interface to write() that retries after interrupts. Copyright (C) 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #define SAFE_WRITE_ERROR ((size_t) -1) /* Write up to COUNT bytes at BUF to descriptor FD, retrying if interrupted. Return the actual number of bytes written, zero for EOF, or SAFE_WRITE_ERROR upon error. */ extern size_t safe_write (int fd, const void *buf, size_t count); microdc2-0.15.6/lib/sig2str.c0100644000076500007500000001546010516626546015702 0ustar chugunovmicrodc/* sig2str.c -- convert between signal names and numbers Copyright (C) 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include "sig2str.h" #ifndef SIGRTMIN # define SIGRTMIN 0 # undef SIGRTMAX #endif #ifndef SIGRTMAX # define SIGRTMAX (SIGRTMIN - 1) #endif #define NUMNAME(name) { SIG##name, #name } /* Signal names and numbers. Put the preferred name first. */ static struct numname { int num; char const name[8]; } numname_table[] = { /* Signals required by POSIX 1003.1-2001 base, listed in traditional numeric order. */ #ifdef SIGHUP NUMNAME (HUP), #endif #ifdef SIGINT NUMNAME (INT), #endif #ifdef SIGQUIT NUMNAME (QUIT), #endif #ifdef SIGILL NUMNAME (ILL), #endif #ifdef SIGTRAP NUMNAME (TRAP), #endif #ifdef SIGABRT NUMNAME (ABRT), #endif #ifdef SIGFPE NUMNAME (FPE), #endif #ifdef SIGKILL NUMNAME (KILL), #endif #ifdef SIGBUS NUMNAME (BUS), #endif #ifdef SIGSEGV NUMNAME (SEGV), #endif #ifdef SIGPIPE NUMNAME (PIPE), #endif #ifdef SIGALRM NUMNAME (ALRM), #endif #ifdef SIGTERM NUMNAME (TERM), #endif #ifdef SIGUSR1 NUMNAME (USR1), #endif #ifdef SIGUSR2 NUMNAME (USR2), #endif #ifdef SIGCHLD NUMNAME (CHLD), #endif #ifdef SIGURG NUMNAME (URG), #endif #ifdef SIGSTOP NUMNAME (STOP), #endif #ifdef SIGTSTP NUMNAME (TSTP), #endif #ifdef SIGCONT NUMNAME (CONT), #endif #ifdef SIGTTIN NUMNAME (TTIN), #endif #ifdef SIGTTOU NUMNAME (TTOU), #endif /* Signals required by POSIX 1003.1-2001 with the XSI extension. */ #ifdef SIGSYS NUMNAME (SYS), #endif #ifdef SIGPOLL NUMNAME (POLL), #endif #ifdef SIGVTALRM NUMNAME (VTALRM), #endif #ifdef SIGPROF NUMNAME (PROF), #endif #ifdef SIGXCPU NUMNAME (XCPU), #endif #ifdef SIGXFSZ NUMNAME (XFSZ), #endif /* Unix Version 7. */ #ifdef SIGIOT NUMNAME (IOT), /* Older name for ABRT. */ #endif #ifdef SIGEMT NUMNAME (EMT), #endif /* USG Unix. */ #ifdef SIGPHONE NUMNAME (PHONE), #endif #ifdef SIGWIND NUMNAME (WIND), #endif /* Unix System V. */ #ifdef SIGCLD NUMNAME (CLD), #endif #ifdef SIGPWR NUMNAME (PWR), #endif /* GNU/Linux 2.2 and Solaris 8. */ #ifdef SIGCANCEL NUMNAME (CANCEL), #endif #ifdef SIGLWP NUMNAME (LWP), #endif #ifdef SIGWAITING NUMNAME (WAITING), #endif #ifdef SIGFREEZE NUMNAME (FREEZE), #endif #ifdef SIGTHAW NUMNAME (THAW), #endif #ifdef SIGLOST NUMNAME (LOST), #endif #ifdef SIGWINCH NUMNAME (WINCH), #endif /* GNU/Linux 2.2. */ #ifdef SIGINFO NUMNAME (INFO), #endif #ifdef SIGIO NUMNAME (IO), #endif #ifdef SIGSTKFLT NUMNAME (STKFLT), #endif /* AIX 5L. */ #ifdef SIGDANGER NUMNAME (DANGER), #endif #ifdef SIGGRANT NUMNAME (GRANT), #endif #ifdef SIGMIGRATE NUMNAME (MIGRATE), #endif #ifdef SIGMSG NUMNAME (MSG), #endif #ifdef SIGPRE NUMNAME (PRE), #endif #ifdef SIGRETRACT NUMNAME (RETRACT), #endif #ifdef SIGSAK NUMNAME (SAK), #endif #ifdef SIGSOUND NUMNAME (SOUND), #endif /* Older AIX versions. */ #ifdef SIGALRM1 NUMNAME (ALRM1), /* unknown; taken from Bash 2.05 */ #endif #ifdef SIGKAP NUMNAME (KAP), /* Older name for SIGGRANT. */ #endif #ifdef SIGVIRT NUMNAME (VIRT), /* unknown; taken from Bash 2.05 */ #endif #ifdef SIGWINDOW NUMNAME (WINDOW), /* Older name for SIGWINCH. */ #endif /* BeOS */ #ifdef SIGKILLTHR NUMNAME (KILLTHR), #endif /* Older HP-UX versions. */ #ifdef SIGDIL NUMNAME (DIL), #endif /* Korn shell and Bash, of uncertain vintage. */ { 0, "EXIT" } }; #define NUMNAME_ENTRIES (sizeof numname_table / sizeof numname_table[0]) /* ISDIGIT differs from isdigit, as follows: - Its arg may be any int or unsigned int; it need not be an unsigned char. - It's guaranteed to evaluate its argument exactly once. - It's typically faster. POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE unless it's important to use the locale's definition of `digit' even when the host does not conform to POSIX. */ #define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9) /* Convert the signal name SIGNAME to a signal number. Return the signal number if successful, -1 otherwise. */ static int str2signum (char const *signame) { if (ISDIGIT (*signame)) { char *endp; long int n = strtol (signame, &endp, 10); if (! *endp && n <= SIGNUM_BOUND) return n; } else { unsigned int i; for (i = 0; i < NUMNAME_ENTRIES; i++) if (strcmp (numname_table[i].name, signame) == 0) return numname_table[i].num; { char *endp; int rtmin = SIGRTMIN; int rtmax = SIGRTMAX; if (0 < rtmin && strncmp (signame, "RTMIN", 5) == 0) { long int n = strtol (signame + 5, &endp, 10); if (! *endp && 0 <= n && n <= rtmax - rtmin) return rtmin + n; } else if (0 < rtmax && strncmp (signame, "RTMAX", 5) == 0) { long int n = strtol (signame + 5, &endp, 10); if (! *endp && rtmin - rtmax <= n && n <= 0) return rtmax + n; } } } return -1; } /* Convert the signal name SIGNAME to the signal number *SIGNUM. Return 0 if successful, -1 otherwise. */ int str2sig (char const *signame, int *signum) { *signum = str2signum (signame); return *signum < 0 ? -1 : 0; } /* Convert SIGNUM to a signal name in SIGNAME. SIGNAME must point to a buffer of at least SIG2STR_MAX bytes. Return 0 if successful, -1 otherwise. */ int sig2str (int signum, char *signame) { unsigned int i; for (i = 0; i < NUMNAME_ENTRIES; i++) if (numname_table[i].num == signum) { strcpy (signame, numname_table[i].name); return 0; } { int rtmin = SIGRTMIN; int rtmax = SIGRTMAX; if (! (rtmin <= signum && signum <= rtmax)) return -1; if (signum <= rtmin + (rtmax - rtmin) / 2) { int delta = signum - rtmin; sprintf (signame, delta ? "RTMIN+%d" : "RTMIN", delta); } else { int delta = rtmax - signum; sprintf (signame, delta ? "RTMAX-%d" : "RTMAX", delta); } return 0; } } microdc2-0.15.6/lib/sig2str.h0100644000076500007500000000261110516626546015701 0ustar chugunovmicrodc/* sig2str.h -- convert between signal names and numbers Copyright (C) 2002, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ #include /* Don't override system declarations of SIG2STR_MAX, sig2str, str2sig. */ #ifndef SIG2STR_MAX # include "intprops.h" /* Size of a buffer needed to hold a signal name like "HUP". */ # define SIG2STR_MAX (sizeof "SIGRTMAX" + INT_STRLEN_BOUND (int) - 1) int sig2str (int, char *); int str2sig (char const *, int *); #endif /* An upper bound on signal numbers allowed by the system. */ #if defined _sys_nsig # define SIGNUM_BOUND (_sys_nsig - 1) #elif defined NSIG # define SIGNUM_BOUND (NSIG - 1) #else # define SIGNUM_BOUND 64 #endif microdc2-0.15.6/lib/size_max.h0100644000076500007500000000175110516626546016127 0ustar chugunovmicrodc/* size_max.h -- declare SIZE_MAX through system headers Copyright (C) 2005 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GNULIB_SIZE_MAX_H #define GNULIB_SIZE_MAX_H # include # if HAVE_STDINT_H # include # endif #endif /* GNULIB_SIZE_MAX_H */ microdc2-0.15.6/lib/stdbool_.h0100644000076500007500000000656610516626546016126 0ustar chugunovmicrodc/* Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _STDBOOL_H #define _STDBOOL_H /* ISO C 99 for platforms that lack it. */ /* Usage suggestions: Programs that use should be aware of some limitations and standards compliance issues. Standards compliance: - must be #included before 'bool', 'false', 'true' can be used. - You cannot assume that sizeof (bool) == 1. - Programs should not undefine the macros bool, true, and false, as C99 lists that as an "obsolescent feature". Limitations of this substitute, when used in a C89 environment: - must be #included before the '_Bool' type can be used. - You cannot assume that _Bool is a typedef; it might be a macro. - In C99, casts and automatic conversions to '_Bool' or 'bool' are performed in such a way that every nonzero value gets converted to 'true', and zero gets converted to 'false'. This doesn't work with this substitute. With this substitute, only the values 0 and 1 give the expected result when converted to _Bool' or 'bool'. Also, it is suggested that programs use 'bool' rather than '_Bool'; this isn't required, but 'bool' is more common. */ /* 7.16. Boolean type and values */ /* BeOS already #defines false 0, true 1. We use the same definitions below, but temporarily we have to #undef them. */ #ifdef __BEOS__ # include /* defines bool but not _Bool */ # undef false # undef true #endif /* For the sake of symbolic names in gdb, we define true and false as enum constants, not only as macros. It is tempting to write typedef enum { false = 0, true = 1 } _Bool; so that gdb prints values of type 'bool' symbolically. But if we do this, values of type '_Bool' may promote to 'int' or 'unsigned int' (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the enum; this ensures that '_Bool' promotes to 'int'. */ #if !(defined __cplusplus || defined __BEOS__) # if !@HAVE__BOOL@ # if defined __SUNPRO_C && (__SUNPRO_C < 0x550 || __STDC__ == 1) /* Avoid stupid "warning: _Bool is a keyword in ISO C99". */ # define _Bool signed char enum { false = 0, true = 1 }; # else typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; # endif # endif #else typedef bool _Bool; #endif #define bool _Bool /* The other macros must be usable in preprocessor directives. */ #define false 0 #define true 1 #define __bool_true_false_are_defined 1 #endif /* _STDBOOL_H */ microdc2-0.15.6/lib/stdint_.h0100644000076500007500000001730310516626546015754 0ustar chugunovmicrodc/* Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc. Written by Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _STDINT_H #define _STDINT_H /* * ISO C 99 for platforms that lack it. * */ /* Get wchar_t, WCHAR_MIN, WCHAR_MAX. */ #include /* Get CHAR_BIT, LONG_MIN, LONG_MAX, ULONG_MAX. */ #include /* Get those types that are already defined in other system include files. */ #if defined(__FreeBSD__) # include #endif #if defined(__sun) && HAVE_SYS_INTTYPES_H # include /* Solaris 7 has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. But note that contains only the type definitions! */ # define _STDINT_H_HAVE_SYSTEM_INTTYPES #endif #if (defined(__hpux) || defined(_AIX)) && HAVE_INTTYPES_H # include /* HP-UX 10 has nearly everything, except UINT_LEAST8_MAX, UINT_FAST8_MAX, PTRDIFF_MIN, PTRDIFF_MAX. */ /* AIX 4 has nearly everything, except INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX, PTRDIFF_MIN, PTRDIFF_MAX. */ # define _STDINT_H_HAVE_SYSTEM_INTTYPES #endif #if !(defined(UNIX_CYGWIN32) && defined(__BIT_TYPES_DEFINED__)) # define _STDINT_H_NEED_SIGNED_INT_TYPES #endif #if !defined(_STDINT_H_HAVE_SYSTEM_INTTYPES) /* 7.18.1.1. Exact-width integer types */ #if !defined(__FreeBSD__) #ifdef _STDINT_H_NEED_SIGNED_INT_TYPES typedef signed char int8_t; #endif typedef unsigned char uint8_t; #ifdef _STDINT_H_NEED_SIGNED_INT_TYPES typedef short int16_t; #endif typedef unsigned short uint16_t; #ifdef _STDINT_H_NEED_SIGNED_INT_TYPES typedef int int32_t; #endif typedef unsigned int uint32_t; #if @HAVE_LONG_64BIT@ #ifdef _STDINT_H_NEED_SIGNED_INT_TYPES typedef long int64_t; #endif typedef unsigned long uint64_t; #define _STDINT_H_HAVE_INT64 #elif @HAVE_LONG_LONG_64BIT@ #ifdef _STDINT_H_NEED_SIGNED_INT_TYPES typedef long long int64_t; #endif typedef unsigned long long uint64_t; #define _STDINT_H_HAVE_INT64 #elif defined(_MSC_VER) typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #define _STDINT_H_HAVE_INT64 #endif #endif /* !FreeBSD */ /* 7.18.1.2. Minimum-width integer types */ typedef int8_t int_least8_t; typedef uint8_t uint_least8_t; typedef int16_t int_least16_t; typedef uint16_t uint_least16_t; typedef int32_t int_least32_t; typedef uint32_t uint_least32_t; #ifdef _STDINT_H_HAVE_INT64 typedef int64_t int_least64_t; typedef uint64_t uint_least64_t; #endif /* 7.18.1.3. Fastest minimum-width integer types */ typedef int32_t int_fast8_t; typedef uint32_t uint_fast8_t; typedef int32_t int_fast16_t; typedef uint32_t uint_fast16_t; typedef int32_t int_fast32_t; typedef uint32_t uint_fast32_t; #ifdef _STDINT_H_HAVE_INT64 typedef int64_t int_fast64_t; typedef uint64_t uint_fast64_t; #endif /* 7.18.1.4. Integer types capable of holding object pointers */ #if !defined(__FreeBSD__) /* On some platforms (like IRIX6 MIPS with -n32) sizeof(void*) < sizeof(long), but this doesn't matter here. */ typedef long intptr_t; typedef unsigned long uintptr_t; #endif /* !FreeBSD */ /* 7.18.1.5. Greatest-width integer types */ #ifdef _STDINT_H_HAVE_INT64 typedef int64_t intmax_t; typedef uint64_t uintmax_t; #else typedef int32_t intmax_t; typedef uint32_t uintmax_t; #endif /* 7.18.2. Limits of specified-width integer types */ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) /* 7.18.2.1. Limits of exact-width integer types */ #define INT8_MIN -128 #define INT8_MAX 127 #define UINT8_MAX 255U #define INT16_MIN -32768 #define INT16_MAX 32767 #define UINT16_MAX 65535U #define INT32_MIN (~INT32_MAX) #define INT32_MAX 2147483647 #define UINT32_MAX 4294967295U #ifdef _STDINT_H_HAVE_INT64 #define INT64_MIN (~INT64_MAX) #if @HAVE_LONG_64BIT@ #define INT64_MAX 9223372036854775807L #define UINT64_MAX 18446744073709551615UL #elif @HAVE_LONG_LONG_64BIT@ #define INT64_MAX 9223372036854775807LL #define UINT64_MAX 18446744073709551615ULL #elif defined(_MSC_VER) #define INT64_MAX 9223372036854775807i64 #define UINT64_MAX 18446744073709551615ui64 #endif #endif /* 7.18.2.2. Limits of minimum-width integer types */ #define INT_LEAST8_MIN INT8_MIN #define INT_LEAST8_MAX INT8_MAX #define UINT_LEAST8_MAX UINT8_MAX #define INT_LEAST16_MIN INT16_MIN #define INT_LEAST16_MAX INT16_MAX #define UINT_LEAST16_MAX UINT16_MAX #define INT_LEAST32_MIN INT32_MIN #define INT_LEAST32_MAX INT32_MAX #define UINT_LEAST32_MAX UINT32_MAX #ifdef _STDINT_H_HAVE_INT64 #define INT_LEAST64_MIN INT64_MIN #define INT_LEAST64_MAX INT64_MAX #define UINT_LEAST64_MAX UINT64_MAX #endif /* 7.18.2.3. Limits of fastest minimum-width integer types */ #define INT_FAST8_MIN INT32_MIN #define INT_FAST8_MAX INT32_MAX #define UINT_FAST8_MAX UINT32_MAX #define INT_FAST16_MIN INT32_MIN #define INT_FAST16_MAX INT32_MAX #define UINT_FAST16_MAX UINT32_MAX #define INT_FAST32_MIN INT32_MIN #define INT_FAST32_MAX INT32_MAX #define UINT_FAST32_MAX UINT32_MAX #ifdef _STDINT_H_HAVE_INT64 #define INT_FAST64_MIN INT64_MIN #define INT_FAST64_MAX INT64_MAX #define UINT_FAST64_MAX UINT64_MAX #endif /* 7.18.2.4. Limits of integer types capable of holding object pointers */ #define INTPTR_MIN LONG_MIN #define INTPTR_MAX LONG_MAX #define UINTPTR_MAX ULONG_MAX /* 7.18.2.5. Limits of greatest-width integer types */ #ifdef _STDINT_H_HAVE_INT64 #define INTMAX_MIN INT64_MIN #define INTMAX_MAX INT64_MAX #define UINTMAX_MAX UINT64_MAX #else #define INTMAX_MIN INT32_MIN #define INTMAX_MAX INT32_MAX #define UINTMAX_MAX UINT32_MAX #endif /* 7.18.3. Limits of other integer types */ #define PTRDIFF_MIN (~(ptrdiff_t)0 << (sizeof(ptrdiff_t)*CHAR_BIT-1)) #define PTRDIFF_MAX (~PTRDIFF_MIN) /* This may be wrong... */ #define SIG_ATOMIC_MIN 0 #define SIG_ATOMIC_MAX 127 #define SIZE_MAX (~(size_t)0) /* wchar_t limits already defined in . */ /* wint_t limits already defined in . */ #endif /* 7.18.4. Macros for integer constants */ #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) /* 7.18.4.1. Macros for minimum-width integer constants */ #define INT8_C(x) x #define UINT8_C(x) x##U #define INT16_C(x) x #define UINT16_C(x) x##U #define INT32_C(x) x #define UINT32_C(x) x##U #if @HAVE_LONG_64BIT@ #define INT64_C(x) x##L #define UINT64_C(x) x##UL #elif @HAVE_LONG_LONG_64BIT@ #define INT64_C(x) x##LL #define UINT64_C(x) x##ULL #elif defined(_MSC_VER) #define INT64_C(x) x##i64 #define UINT64_C(x) x##ui64 #endif /* 7.18.4.2. Macros for greatest-width integer constants */ #if @HAVE_LONG_64BIT@ #define INTMAX_C(x) x##L #define UINTMAX_C(x) x##UL #elif @HAVE_LONG_LONG_64BIT@ #define INTMAX_C(x) x##LL #define UINTMAX_C(x) x##ULL #elif defined(_MSC_VER) #define INTMAX_C(x) x##i64 #define UINTMAX_C(x) x##ui64 #else #define INTMAX_C(x) x #define UINTMAX_C(x) x##U #endif #endif #endif /* !_STDINT_H_HAVE_SYSTEM_INTTYPES */ #endif /* _STDINT_H */ microdc2-0.15.6/lib/stpcpy.c0100644000076500007500000000264410516626546015627 0ustar chugunovmicrodc/* stpcpy.c -- copy a string and return pointer to end of new string Copyright (C) 1992, 1995, 1997, 1998 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #undef __stpcpy #undef stpcpy #ifndef weak_alias # define __stpcpy stpcpy #endif /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ char * __stpcpy (char *dest, const char *src) { register char *d = dest; register const char *s = src; do *d++ = *s; while (*s++ != '\0'); return d - 1; } #ifdef weak_alias weak_alias (__stpcpy, stpcpy) #endif microdc2-0.15.6/lib/stpcpy.h0100644000076500007500000000215510516626546015631 0ustar chugunovmicrodc/* String copying. Copyright (C) 1995, 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _STPCPY_H #define _STPCPY_H #if HAVE_STPCPY /* Get stpcpy() declaration. */ #include #else #ifdef __cplusplus extern "C" { #endif /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ extern char *stpcpy (char *dst, const char *src); #ifdef __cplusplus } #endif #endif #endif /* _STPCPY_H */ microdc2-0.15.6/lib/strdup.c0100644000076500007500000000262510516626546015625 0ustar chugunovmicrodc/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifndef _LIBC /* Get specification. */ # include "strdup.h" #endif #include #include #undef __strdup #undef strdup #ifndef weak_alias # define __strdup strdup #endif /* Duplicate S, returning an identical malloc'd string. */ char * __strdup (const char *s) { size_t len = strlen (s) + 1; void *new = malloc (len); if (new == NULL) return NULL; return (char *) memcpy (new, s, len); } #ifdef libc_hidden_def libc_hidden_def (__strdup) #endif #ifdef weak_alias weak_alias (__strdup, strdup) #endif microdc2-0.15.6/lib/strdup.h0100644000076500007500000000210410516626546015622 0ustar chugunovmicrodc/* strdup.h -- duplicate a string Copyright (C) 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef STRDUP_H_ #define STRDUP_H_ /* Get strdup declaration, if available. */ #include #if defined HAVE_DECL_STRDUP && !HAVE_DECL_STRDUP && !defined strdup /* Duplicate S, returning an identical malloc'd string. */ extern char *strdup (const char *s); #endif #endif /* STRDUP_H_ */ microdc2-0.15.6/lib/strftime.c0100644000076500007500000011322110516626546016134 0ustar chugunovmicrodc/* Copyright (C) 1991-1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define HAVE_MBLEN 1 # define HAVE_MBRLEN 1 # define HAVE_STRUCT_ERA_ENTRY 1 # define HAVE_TM_GMTOFF 1 # define HAVE_TM_ZONE 1 # define HAVE_TZNAME 1 # define HAVE_TZSET 1 # define MULTIBYTE_IS_FORMAT_SAFE 1 # include "../locale/localeinfo.h" #endif #include #include /* Some systems define `time_t' here. */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #if HAVE_TZNAME extern char *tzname[]; #endif /* Do multibyte processing if multibytes are supported, unless multibyte sequences are safe in formats. Multibyte sequences are safe if they cannot contain byte sequences that look like format conversion specifications. The GNU C Library uses UTF8 multibyte encoding, which is safe for formats, but strftime.c can be used with other C libraries that use unsafe encodings. */ #define DO_MULTIBYTE (HAVE_MBLEN && HAVE_WCHAR_H && ! MULTIBYTE_IS_FORMAT_SAFE) #if DO_MULTIBYTE # if HAVE_MBRLEN # include # else /* Simulate mbrlen with mblen as best we can. */ # define mbstate_t int # define mbrlen(s, n, ps) mblen (s, n) # define mbsinit(ps) (*(ps) == 0) # endif static const mbstate_t mbstate_zero; #endif #include #include #include #include #include #ifdef COMPILE_WIDE # include # define CHAR_T wchar_t # define UCHAR_T unsigned int # define L_(Str) L##Str # define NLW(Sym) _NL_W##Sym # define MEMCPY(d, s, n) __wmemcpy (d, s, n) # define STRLEN(s) __wcslen (s) #else # define CHAR_T char # define UCHAR_T unsigned char # define L_(Str) Str # define NLW(Sym) Sym # define MEMCPY(d, s, n) memcpy (d, s, n) # define STRLEN(s) strlen (s) # ifdef _LIBC # define MEMPCPY(d, s, n) __mempcpy (d, s, n) # else # ifndef HAVE_MEMPCPY # define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n))) # endif # endif #endif /* Shift A right by B bits portably, by dividing A by 2**B and truncating towards minus infinity. A and B should be free of side effects, and B should be in the range 0 <= B <= INT_BITS - 2, where INT_BITS is the number of useful bits in an int. GNU code can assume that INT_BITS is at least 32. ISO C99 says that A >> B is implementation-defined if A < 0. Some implementations (e.g., UNICOS 9.0 on a Cray Y-MP EL) don't shift right in the usual way when A < 0, so SHR falls back on division if ordinary A >> B doesn't seem to be the usual signed shift. */ #define SHR(a, b) \ (-1 >> 1 == -1 \ ? (a) >> (b) \ : (a) / (1 << (b)) - ((a) % (1 << (b)) < 0)) /* Bound on length of the string representing an integer type or expression T. Subtract 1 for the sign bit if t is signed; log10 (2.0) < 146/485; add 1 for integer division truncation; add 1 more for a minus sign if needed. */ #define INT_STRLEN_BOUND(t) \ ((sizeof (t) * CHAR_BIT - 1) * 146 / 485 + 2) #define TM_YEAR_BASE 1900 #ifndef __isleap /* Nonzero if YEAR is a leap year (every 4 years, except every 100th isn't, and every 400th is). */ # define __isleap(year) \ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0)) #endif #ifdef _LIBC # define tzname __tzname # define tzset __tzset #endif #if !HAVE_TM_GMTOFF /* Portable standalone applications should supply a "time_r.h" that declares a POSIX-compliant localtime_r, for the benefit of older implementations that lack localtime_r or have a nonstandard one. See the gnulib time_r module for one way to implement this. */ # include "time_r.h" # undef __gmtime_r # undef __localtime_r # define __gmtime_r gmtime_r # define __localtime_r localtime_r #endif #ifndef FPRINTFTIME # define FPRINTFTIME 0 #endif #if FPRINTFTIME # define STREAM_OR_CHAR_T FILE # define STRFTIME_ARG(x) /* empty */ #else # define STREAM_OR_CHAR_T CHAR_T # define STRFTIME_ARG(x) x, #endif #if FPRINTFTIME # define memset_byte(P, Len, Byte) \ do { size_t _i; for (_i = 0; _i < Len; _i++) fputc (Byte, P); } while (0) # define memset_space(P, Len) memset_byte (P, Len, ' ') # define memset_zero(P, Len) memset_byte (P, Len, '0') #elif defined COMPILE_WIDE # define memset_space(P, Len) (wmemset (P, L' ', Len), (P) += (Len)) # define memset_zero(P, Len) (wmemset (P, L'0', Len), (P) += (Len)) #else # define memset_space(P, Len) (memset (P, ' ', Len), (P) += (Len)) # define memset_zero(P, Len) (memset (P, '0', Len), (P) += (Len)) #endif #define add(n, f) \ do \ { \ int _n = (n); \ int _delta = width - _n; \ int _incr = _n + (_delta > 0 ? _delta : 0); \ if ((size_t) _incr >= maxsize - i) \ return 0; \ if (p) \ { \ if (digits == 0 && _delta > 0) \ { \ if (pad == L_('0')) \ memset_zero (p, _delta); \ else \ memset_space (p, _delta); \ } \ f; \ p += FPRINTFTIME ? 0 : _n; \ } \ i += _incr; \ } while (0) #if FPRINTFTIME # define add1(C) add (1, fputc (C, p)) #else # define add1(C) add (1, *p = C) #endif #if FPRINTFTIME # define cpy(n, s) \ add ((n), \ if (to_lowcase) \ fwrite_lowcase (p, (s), _n); \ else if (to_uppcase) \ fwrite_uppcase (p, (s), _n); \ else \ fwrite ((s), _n, 1, p)) #else # define cpy(n, s) \ add ((n), \ if (to_lowcase) \ memcpy_lowcase (p, (s), _n LOCALE_ARG); \ else if (to_uppcase) \ memcpy_uppcase (p, (s), _n LOCALE_ARG); \ else \ MEMCPY ((void *) p, (void const *) (s), _n)) #endif #ifdef COMPILE_WIDE # ifndef USE_IN_EXTENDED_LOCALE_MODEL # undef __mbsrtowcs_l # define __mbsrtowcs_l(d, s, l, st, loc) __mbsrtowcs (d, s, l, st) # endif # define widen(os, ws, l) \ { \ mbstate_t __st; \ const char *__s = os; \ memset (&__st, '\0', sizeof (__st)); \ l = __mbsrtowcs_l (NULL, &__s, 0, &__st, loc); \ ws = (wchar_t *) alloca ((l + 1) * sizeof (wchar_t)); \ (void) __mbsrtowcs_l (ws, &__s, l, &__st, loc); \ } #endif #if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL /* We use this code also for the extended locale handling where the function gets as an additional argument the locale which has to be used. To access the values we have to redefine the _NL_CURRENT macro. */ # define strftime __strftime_l # define wcsftime __wcsftime_l # undef _NL_CURRENT # define _NL_CURRENT(category, item) \ (current->values[_NL_ITEM_INDEX (item)].string) # define LOCALE_ARG , loc # define LOCALE_PARAM_PROTO , __locale_t loc # define HELPER_LOCALE_ARG , current #else # define LOCALE_PARAM_PROTO # define LOCALE_ARG # ifdef _LIBC # define HELPER_LOCALE_ARG , _NL_CURRENT_DATA (LC_TIME) # else # define HELPER_LOCALE_ARG # endif #endif #ifdef COMPILE_WIDE # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define TOUPPER(Ch, L) __towupper_l (Ch, L) # define TOLOWER(Ch, L) __towlower_l (Ch, L) # else # define TOUPPER(Ch, L) towupper (Ch) # define TOLOWER(Ch, L) towlower (Ch) # endif #else # ifdef _LIBC # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define TOUPPER(Ch, L) __toupper_l (Ch, L) # define TOLOWER(Ch, L) __tolower_l (Ch, L) # else # define TOUPPER(Ch, L) toupper (Ch) # define TOLOWER(Ch, L) tolower (Ch) # endif # else # define TOUPPER(Ch, L) (islower (Ch) ? toupper (Ch) : (Ch)) # define TOLOWER(Ch, L) (isupper (Ch) ? tolower (Ch) : (Ch)) # endif #endif /* We don't use `isdigit' here since the locale dependent interpretation is not what we want here. We only need to accept the arabic digits in the ASCII range. One day there is perhaps a more reliable way to accept other sets of digits. */ #define ISDIGIT(Ch) ((unsigned int) (Ch) - L_('0') <= 9) #if FPRINTFTIME static void fwrite_lowcase (FILE *fp, const CHAR_T *src, size_t len) { while (len-- > 0) { fputc (TOLOWER ((UCHAR_T) *src, loc), fp); ++src; } } static void fwrite_uppcase (FILE *fp, const CHAR_T *src, size_t len) { while (len-- > 0) { fputc (TOUPPER ((UCHAR_T) *src, loc), fp); ++src; } } #else static CHAR_T * memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_PROTO) { while (len-- > 0) dest[len] = TOLOWER ((UCHAR_T) src[len], loc); return dest; } static CHAR_T * memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, size_t len LOCALE_PARAM_PROTO) { while (len-- > 0) dest[len] = TOUPPER ((UCHAR_T) src[len], loc); return dest; } #endif #if ! HAVE_TM_GMTOFF /* Yield the difference between *A and *B, measured in seconds, ignoring leap seconds. */ # define tm_diff ftime_tm_diff static int tm_diff (const struct tm *a, const struct tm *b) { /* Compute intervening leap days correctly even if year is negative. Take care to avoid int overflow in leap day calculations, but it's OK to assume that A and B are close to each other. */ int a4 = SHR (a->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (a->tm_year & 3); int b4 = SHR (b->tm_year, 2) + SHR (TM_YEAR_BASE, 2) - ! (b->tm_year & 3); int a100 = a4 / 25 - (a4 % 25 < 0); int b100 = b4 / 25 - (b4 % 25 < 0); int a400 = SHR (a100, 2); int b400 = SHR (b100, 2); int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); int years = a->tm_year - b->tm_year; int days = (365 * years + intervening_leap_days + (a->tm_yday - b->tm_yday)); return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + (a->tm_min - b->tm_min)) + (a->tm_sec - b->tm_sec)); } #endif /* ! HAVE_TM_GMTOFF */ /* The number of days from the first day of the first ISO week of this year to the year day YDAY with week day WDAY. ISO weeks start on Monday; the first ISO week has the year's first Thursday. YDAY may be as small as YDAY_MINIMUM. */ #define ISO_WEEK_START_WDAY 1 /* Monday */ #define ISO_WEEK1_WDAY 4 /* Thursday */ #define YDAY_MINIMUM (-366) #ifdef __GNUC__ __inline__ #endif static int iso_week_days (int yday, int wday) { /* Add enough to the first operand of % to make it nonnegative. */ int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7; return (yday - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7 + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY); } #if !(defined _NL_CURRENT || HAVE_STRFTIME) static CHAR_T const weekday_name[][10] = { L_("Sunday"), L_("Monday"), L_("Tuesday"), L_("Wednesday"), L_("Thursday"), L_("Friday"), L_("Saturday") }; static CHAR_T const month_name[][10] = { L_("January"), L_("February"), L_("March"), L_("April"), L_("May"), L_("June"), L_("July"), L_("August"), L_("September"), L_("October"), L_("November"), L_("December") }; #endif /* When compiling this file, GNU applications can #define my_strftime to a symbol (typically nstrftime) to get an extended strftime with extra arguments UT and NS. Emacs is a special case for now, but this Emacs-specific code can be removed once Emacs's config.h defines my_strftime. */ #if defined emacs && !defined my_strftime # define my_strftime nstrftime #endif #if FPRINTFTIME # undef my_strftime # define my_strftime fprintftime #endif #ifdef my_strftime # define extra_args , ut, ns # define extra_args_spec , int ut, int ns #else # if defined COMPILE_WIDE # define my_strftime wcsftime # define nl_get_alt_digit _nl_get_walt_digit # else # define my_strftime strftime # define nl_get_alt_digit _nl_get_alt_digit # endif # define extra_args # define extra_args_spec /* We don't have this information in general. */ # define ut 0 # define ns 0 #endif /* Just like my_strftime, below, but with one more parameter, UPCASE, to indicate that the result should be converted to upper case. */ static size_t strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) const CHAR_T *format, const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO) { #if defined _LIBC && defined USE_IN_EXTENDED_LOCALE_MODEL struct locale_data *const current = loc->__locales[LC_TIME]; #endif #if FPRINTFTIME size_t maxsize = (size_t) -1; #endif int hour12 = tp->tm_hour; #ifdef _NL_CURRENT /* We cannot make the following values variables since we must delay the evaluation of these values until really needed since some expressions might not be valid in every situation. The `struct tm' might be generated by a strptime() call that initialized only a few elements. Dereference the pointers only if the format requires this. Then it is ok to fail if the pointers are invalid. */ # define a_wkday \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + tp->tm_wday)) # define f_wkday \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday)) # define a_month \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon)) # define f_month \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon)) # define ampm \ ((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \ ? NLW(PM_STR) : NLW(AM_STR))) # define aw_len STRLEN (a_wkday) # define am_len STRLEN (a_month) # define ap_len STRLEN (ampm) #else # if !HAVE_STRFTIME # define f_wkday (weekday_name[tp->tm_wday]) # define f_month (month_name[tp->tm_mon]) # define a_wkday f_wkday # define a_month f_month # define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11)) size_t aw_len = 3; size_t am_len = 3; size_t ap_len = 2; # endif #endif const char *zone; size_t i = 0; STREAM_OR_CHAR_T *p = s; const CHAR_T *f; #if DO_MULTIBYTE && !defined COMPILE_WIDE const char *format_end = NULL; #endif #if ! defined _LIBC && ! HAVE_RUN_TZSET_TEST /* Solaris 2.5.x and 2.6 tzset sometimes modify the storage returned by localtime. On such systems, we must either use the tzset and localtime wrappers to work around the bug (which sets HAVE_RUN_TZSET_TEST) or make a copy of the structure. */ struct tm copy = *tp; tp = © #endif zone = NULL; #if HAVE_TM_ZONE /* The POSIX test suite assumes that setting the environment variable TZ to a new value before calling strftime() will influence the result (the %Z format) even if the information in TP is computed with a totally different time zone. This is bogus: though POSIX allows bad behavior like this, POSIX does not require it. Do the right thing instead. */ zone = (const char *) tp->tm_zone; #endif #if HAVE_TZNAME if (ut) { if (! (zone && *zone)) zone = "GMT"; } else { /* POSIX.1 requires that local time zone information be used as though strftime called tzset. */ # if HAVE_TZSET tzset (); # endif } #endif if (hour12 > 12) hour12 -= 12; else if (hour12 == 0) hour12 = 12; for (f = format; *f != '\0'; ++f) { int pad = 0; /* Padding for number ('-', '_', or 0). */ int modifier; /* Field modifier ('E', 'O', or 0). */ int digits = 0; /* Max digits for numeric format. */ int number_value; /* Numeric value to be printed. */ unsigned int u_number_value; /* (unsigned int) number_value. */ bool negative_number; /* The number is negative. */ bool always_output_a_sign; /* +/- should always be output. */ int tz_colon_mask; /* Bitmask of where ':' should appear. */ const CHAR_T *subfmt; CHAR_T sign_char; CHAR_T *bufp; CHAR_T buf[1 + 2 /* for the two colons in a %::z or %:::z time zone */ + (sizeof (int) < sizeof (time_t) ? INT_STRLEN_BOUND (time_t) : INT_STRLEN_BOUND (int))]; int width = -1; bool to_lowcase = false; bool to_uppcase = upcase; size_t colons; bool change_case = false; int format_char; #if DO_MULTIBYTE && !defined COMPILE_WIDE switch (*f) { case L_('%'): break; case L_('\b'): case L_('\t'): case L_('\n'): case L_('\v'): case L_('\f'): case L_('\r'): case L_(' '): case L_('!'): case L_('"'): case L_('#'): case L_('&'): case L_('\''): case L_('('): case L_(')'): case L_('*'): case L_('+'): case L_(','): case L_('-'): case L_('.'): case L_('/'): case L_('0'): case L_('1'): case L_('2'): case L_('3'): case L_('4'): case L_('5'): case L_('6'): case L_('7'): case L_('8'): case L_('9'): case L_(':'): case L_(';'): case L_('<'): case L_('='): case L_('>'): case L_('?'): case L_('A'): case L_('B'): case L_('C'): case L_('D'): case L_('E'): case L_('F'): case L_('G'): case L_('H'): case L_('I'): case L_('J'): case L_('K'): case L_('L'): case L_('M'): case L_('N'): case L_('O'): case L_('P'): case L_('Q'): case L_('R'): case L_('S'): case L_('T'): case L_('U'): case L_('V'): case L_('W'): case L_('X'): case L_('Y'): case L_('Z'): case L_('['): case L_('\\'): case L_(']'): case L_('^'): case L_('_'): case L_('a'): case L_('b'): case L_('c'): case L_('d'): case L_('e'): case L_('f'): case L_('g'): case L_('h'): case L_('i'): case L_('j'): case L_('k'): case L_('l'): case L_('m'): case L_('n'): case L_('o'): case L_('p'): case L_('q'): case L_('r'): case L_('s'): case L_('t'): case L_('u'): case L_('v'): case L_('w'): case L_('x'): case L_('y'): case L_('z'): case L_('{'): case L_('|'): case L_('}'): case L_('~'): /* The C Standard requires these 98 characters (plus '%') to be in the basic execution character set. None of these characters can start a multibyte sequence, so they need not be analyzed further. */ add1 (*f); continue; default: /* Copy this multibyte sequence until we reach its end, find an error, or come back to the initial shift state. */ { mbstate_t mbstate = mbstate_zero; size_t len = 0; size_t fsize; if (! format_end) format_end = f + strlen (f) + 1; fsize = format_end - f; do { size_t bytes = mbrlen (f + len, fsize - len, &mbstate); if (bytes == 0) break; if (bytes == (size_t) -2) { len += strlen (f + len); break; } if (bytes == (size_t) -1) { len++; break; } len += bytes; } while (! mbsinit (&mbstate)); cpy (len, f); f += len - 1; continue; } } #else /* ! DO_MULTIBYTE */ /* Either multibyte encodings are not supported, they are safe for formats, so any non-'%' byte can be copied through, or this is the wide character version. */ if (*f != L_('%')) { add1 (*f); continue; } #endif /* ! DO_MULTIBYTE */ /* Check for flags that can modify a format. */ while (1) { switch (*++f) { /* This influences the number formats. */ case L_('_'): case L_('-'): case L_('0'): pad = *f; continue; /* This changes textual output. */ case L_('^'): to_uppcase = true; continue; case L_('#'): change_case = true; continue; default: break; } break; } /* As a GNU extension we allow to specify the field width. */ if (ISDIGIT (*f)) { width = 0; do { if (width > INT_MAX / 10 || (width == INT_MAX / 10 && *f - L_('0') > INT_MAX % 10)) /* Avoid overflow. */ width = INT_MAX; else { width *= 10; width += *f - L_('0'); } ++f; } while (ISDIGIT (*f)); } /* Check for modifiers. */ switch (*f) { case L_('E'): case L_('O'): modifier = *f++; break; default: modifier = 0; break; } /* Now do the specified format. */ format_char = *f; switch (format_char) { #define DO_NUMBER(d, v) \ digits = d; \ number_value = v; goto do_number #define DO_SIGNED_NUMBER(d, negative, v) \ digits = d; \ negative_number = negative; \ u_number_value = v; goto do_signed_number /* The mask is not what you might think. When the ordinal i'th bit is set, insert a colon before the i'th digit of the time zone representation. */ #define DO_TZ_OFFSET(d, negative, mask, v) \ digits = d; \ negative_number = negative; \ tz_colon_mask = mask; \ u_number_value = v; goto do_tz_offset #define DO_NUMBER_SPACEPAD(d, v) \ digits = d; \ number_value = v; goto do_number_spacepad case L_('%'): if (modifier != 0) goto bad_format; add1 (*f); break; case L_('a'): if (modifier != 0) goto bad_format; if (change_case) { to_uppcase = true; to_lowcase = false; } #if defined _NL_CURRENT || !HAVE_STRFTIME cpy (aw_len, a_wkday); break; #else goto underlying_strftime; #endif case 'A': if (modifier != 0) goto bad_format; if (change_case) { to_uppcase = true; to_lowcase = false; } #if defined _NL_CURRENT || !HAVE_STRFTIME cpy (STRLEN (f_wkday), f_wkday); break; #else goto underlying_strftime; #endif case L_('b'): case L_('h'): if (change_case) { to_uppcase = true; to_lowcase = false; } if (modifier != 0) goto bad_format; #if defined _NL_CURRENT || !HAVE_STRFTIME cpy (am_len, a_month); break; #else goto underlying_strftime; #endif case L_('B'): if (modifier != 0) goto bad_format; if (change_case) { to_uppcase = true; to_lowcase = false; } #if defined _NL_CURRENT || !HAVE_STRFTIME cpy (STRLEN (f_month), f_month); break; #else goto underlying_strftime; #endif case L_('c'): if (modifier == L_('O')) goto bad_format; #ifdef _NL_CURRENT if (! (modifier == 'E' && (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_D_T_FMT))) != '\0'))) subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT)); #else # if HAVE_STRFTIME goto underlying_strftime; # else subfmt = L_("%a %b %e %H:%M:%S %Y"); # endif #endif subformat: { size_t len = strftime_case_ (to_uppcase, NULL, STRFTIME_ARG ((size_t) -1) subfmt, tp extra_args LOCALE_ARG); add (len, strftime_case_ (to_uppcase, p, STRFTIME_ARG (maxsize - i) subfmt, tp extra_args LOCALE_ARG)); } break; #if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY) underlying_strftime: { /* The relevant information is available only via the underlying strftime implementation, so use that. */ char ufmt[5]; char *u = ufmt; char ubuf[1024]; /* enough for any single format in practice */ size_t len; /* Make sure we're calling the actual underlying strftime. In some cases, config.h contains something like "#define strftime rpl_strftime". */ # ifdef strftime # undef strftime size_t strftime (); # endif /* The space helps distinguish strftime failure from empty output. */ *u++ = ' '; *u++ = '%'; if (modifier != 0) *u++ = modifier; *u++ = format_char; *u = '\0'; len = strftime (ubuf, sizeof ubuf, ufmt, tp); if (len != 0) cpy (len - 1, ubuf + 1); } break; #endif case L_('C'): if (modifier == L_('O')) goto bad_format; if (modifier == L_('E')) { #if HAVE_STRUCT_ERA_ENTRY struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); if (era) { # ifdef COMPILE_WIDE size_t len = __wcslen (era->era_wname); cpy (len, era->era_wname); # else size_t len = strlen (era->era_name); cpy (len, era->era_name); # endif break; } #else # if HAVE_STRFTIME goto underlying_strftime; # endif #endif } { int century = tp->tm_year / 100 + TM_YEAR_BASE / 100; century -= tp->tm_year % 100 < 0 && 0 < century; DO_SIGNED_NUMBER (2, tp->tm_year < - TM_YEAR_BASE, century); } case L_('x'): if (modifier == L_('O')) goto bad_format; #ifdef _NL_CURRENT if (! (modifier == L_('E') && (*(subfmt = (const CHAR_T *)_NL_CURRENT (LC_TIME, NLW(ERA_D_FMT))) != L_('\0')))) subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT)); goto subformat; #else # if HAVE_STRFTIME goto underlying_strftime; # else /* Fall through. */ # endif #endif case L_('D'): if (modifier != 0) goto bad_format; subfmt = L_("%m/%d/%y"); goto subformat; case L_('d'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, tp->tm_mday); case L_('e'): if (modifier == L_('E')) goto bad_format; DO_NUMBER_SPACEPAD (2, tp->tm_mday); /* All numeric formats set DIGITS and NUMBER_VALUE (or U_NUMBER_VALUE) and then jump to one of these labels. */ do_tz_offset: always_output_a_sign = true; goto do_number_body; do_number_spacepad: /* Force `_' flag unless overridden by `0' or `-' flag. */ if (pad != L_('0') && pad != L_('-')) pad = L_('_'); do_number: /* Format NUMBER_VALUE according to the MODIFIER flag. */ negative_number = number_value < 0; u_number_value = number_value; do_signed_number: always_output_a_sign = false; tz_colon_mask = 0; do_number_body: /* Format U_NUMBER_VALUE according to the MODIFIER flag. NEGATIVE_NUMBER is nonzero if the original number was negative; in this case it was converted directly to unsigned int (i.e., modulo (UINT_MAX + 1)) without negating it. */ if (modifier == L_('O') && !negative_number) { #ifdef _NL_CURRENT /* Get the locale specific alternate representation of the number. If none exist NULL is returned. */ const CHAR_T *cp = nl_get_alt_digit (u_number_value HELPER_LOCALE_ARG); if (cp != NULL) { size_t digitlen = STRLEN (cp); if (digitlen != 0) { cpy (digitlen, cp); break; } } #else # if HAVE_STRFTIME goto underlying_strftime; # endif #endif } bufp = buf + sizeof (buf) / sizeof (buf[0]); if (negative_number) u_number_value = - u_number_value; do { if (tz_colon_mask & 1) *--bufp = ':'; tz_colon_mask >>= 1; *--bufp = u_number_value % 10 + L_('0'); u_number_value /= 10; } while (u_number_value != 0 || tz_colon_mask != 0); do_number_sign_and_padding: if (digits < width) digits = width; sign_char = (negative_number ? L_('-') : always_output_a_sign ? L_('+') : 0); if (pad == L_('-')) { if (sign_char) add1 (sign_char); } else { int padding = digits - (buf + (sizeof (buf) / sizeof (buf[0])) - bufp) - !!sign_char; if (padding > 0) { if (pad == L_('_')) { if ((size_t) padding >= maxsize - i) return 0; if (p) memset_space (p, padding); i += padding; width = width > padding ? width - padding : 0; if (sign_char) add1 (sign_char); } else { if ((size_t) digits >= maxsize - i) return 0; if (sign_char) add1 (sign_char); if (p) memset_zero (p, padding); i += padding; width = 0; } } else { if (sign_char) add1 (sign_char); } } cpy (buf + sizeof (buf) / sizeof (buf[0]) - bufp, bufp); break; case L_('F'): if (modifier != 0) goto bad_format; subfmt = L_("%Y-%m-%d"); goto subformat; case L_('H'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, tp->tm_hour); case L_('I'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, hour12); case L_('k'): /* GNU extension. */ if (modifier == L_('E')) goto bad_format; DO_NUMBER_SPACEPAD (2, tp->tm_hour); case L_('l'): /* GNU extension. */ if (modifier == L_('E')) goto bad_format; DO_NUMBER_SPACEPAD (2, hour12); case L_('j'): if (modifier == L_('E')) goto bad_format; DO_SIGNED_NUMBER (3, tp->tm_yday < -1, tp->tm_yday + 1U); case L_('M'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, tp->tm_min); case L_('m'): if (modifier == L_('E')) goto bad_format; DO_SIGNED_NUMBER (2, tp->tm_mon < -1, tp->tm_mon + 1U); #ifndef _LIBC case L_('N'): /* GNU extension. */ if (modifier == L_('E')) goto bad_format; number_value = ns; if (width == -1) width = 9; else { /* Take an explicit width less than 9 as a precision. */ int j; for (j = width; j < 9; j++) number_value /= 10; } DO_NUMBER (width, number_value); #endif case L_('n'): add1 (L_('\n')); break; case L_('P'): to_lowcase = true; #if !defined _NL_CURRENT && HAVE_STRFTIME format_char = L_('p'); #endif /* FALLTHROUGH */ case L_('p'): if (change_case) { to_uppcase = false; to_lowcase = true; } #if defined _NL_CURRENT || !HAVE_STRFTIME cpy (ap_len, ampm); break; #else goto underlying_strftime; #endif case L_('R'): subfmt = L_("%H:%M"); goto subformat; case L_('r'): #if !defined _NL_CURRENT && HAVE_STRFTIME goto underlying_strftime; #else # ifdef _NL_CURRENT if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT_AMPM))) == L_('\0')) # endif subfmt = L_("%I:%M:%S %p"); goto subformat; #endif case L_('S'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, tp->tm_sec); case L_('s'): /* GNU extension. */ { struct tm ltm; time_t t; ltm = *tp; t = mktime (<m); /* Generate string value for T using time_t arithmetic; this works even if sizeof (long) < sizeof (time_t). */ bufp = buf + sizeof (buf) / sizeof (buf[0]); negative_number = t < 0; do { int d = t % 10; t /= 10; *--bufp = (negative_number ? -d : d) + L_('0'); } while (t != 0); digits = 1; always_output_a_sign = false; goto do_number_sign_and_padding; } case L_('X'): if (modifier == L_('O')) goto bad_format; #ifdef _NL_CURRENT if (! (modifier == L_('E') && (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_T_FMT))) != L_('\0')))) subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT)); goto subformat; #else # if HAVE_STRFTIME goto underlying_strftime; # else /* Fall through. */ # endif #endif case L_('T'): subfmt = L_("%H:%M:%S"); goto subformat; case L_('t'): add1 (L_('\t')); break; case L_('u'): DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1); case L_('U'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7); case L_('V'): case L_('g'): case L_('G'): if (modifier == L_('E')) goto bad_format; { /* YEAR is a leap year if and only if (tp->tm_year + TM_YEAR_BASE) is a leap year, except that YEAR and YEAR - 1 both work correctly even when (tp->tm_year + TM_YEAR_BASE) would overflow. */ int year = (tp->tm_year + (tp->tm_year < 0 ? TM_YEAR_BASE % 400 : TM_YEAR_BASE % 400 - 400)); int year_adjust = 0; int days = iso_week_days (tp->tm_yday, tp->tm_wday); if (days < 0) { /* This ISO week belongs to the previous year. */ year_adjust = -1; days = iso_week_days (tp->tm_yday + (365 + __isleap (year - 1)), tp->tm_wday); } else { int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)), tp->tm_wday); if (0 <= d) { /* This ISO week belongs to the next year. */ year_adjust = 1; days = d; } } switch (*f) { case L_('g'): { int yy = (tp->tm_year % 100 + year_adjust) % 100; DO_NUMBER (2, (0 <= yy ? yy : tp->tm_year < -TM_YEAR_BASE - year_adjust ? -yy : yy + 100)); } case L_('G'): DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE - year_adjust, (tp->tm_year + (unsigned int) TM_YEAR_BASE + year_adjust)); default: DO_NUMBER (2, days / 7 + 1); } } case L_('W'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7); case L_('w'): if (modifier == L_('E')) goto bad_format; DO_NUMBER (1, tp->tm_wday); case L_('Y'): if (modifier == 'E') { #if HAVE_STRUCT_ERA_ENTRY struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); if (era) { # ifdef COMPILE_WIDE subfmt = era->era_wformat; # else subfmt = era->era_format; # endif goto subformat; } #else # if HAVE_STRFTIME goto underlying_strftime; # endif #endif } if (modifier == L_('O')) goto bad_format; else DO_SIGNED_NUMBER (4, tp->tm_year < -TM_YEAR_BASE, tp->tm_year + (unsigned int) TM_YEAR_BASE); case L_('y'): if (modifier == L_('E')) { #if HAVE_STRUCT_ERA_ENTRY struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG); if (era) { int delta = tp->tm_year - era->start_date[0]; DO_NUMBER (1, (era->offset + delta * era->absolute_direction)); } #else # if HAVE_STRFTIME goto underlying_strftime; # endif #endif } { int yy = tp->tm_year % 100; if (yy < 0) yy = tp->tm_year < - TM_YEAR_BASE ? -yy : yy + 100; DO_NUMBER (2, yy); } case L_('Z'): if (change_case) { to_uppcase = false; to_lowcase = true; } #if HAVE_TZNAME /* The tzset() call might have changed the value. */ if (!(zone && *zone) && tp->tm_isdst >= 0) zone = tzname[tp->tm_isdst != 0]; #endif if (! zone) zone = ""; #ifdef COMPILE_WIDE { /* The zone string is always given in multibyte form. We have to transform it first. */ wchar_t *wczone; size_t len; widen (zone, wczone, len); cpy (len, wczone); } #else cpy (strlen (zone), zone); #endif break; case L_(':'): /* :, ::, and ::: are valid only just before 'z'. :::: etc. are rejected later. */ for (colons = 1; f[colons] == L_(':'); colons++) continue; if (f[colons] != L_('z')) goto bad_format; f += colons; goto do_z_conversion; case L_('z'): colons = 0; do_z_conversion: if (tp->tm_isdst < 0) break; { int diff; int hour_diff; int min_diff; int sec_diff; #if HAVE_TM_GMTOFF diff = tp->tm_gmtoff; #else if (ut) diff = 0; else { struct tm gtm; struct tm ltm; time_t lt; ltm = *tp; lt = mktime (<m); if (lt == (time_t) -1) { /* mktime returns -1 for errors, but -1 is also a valid time_t value. Check whether an error really occurred. */ struct tm tm; if (! __localtime_r (<, &tm) || ((ltm.tm_sec ^ tm.tm_sec) | (ltm.tm_min ^ tm.tm_min) | (ltm.tm_hour ^ tm.tm_hour) | (ltm.tm_mday ^ tm.tm_mday) | (ltm.tm_mon ^ tm.tm_mon) | (ltm.tm_year ^ tm.tm_year))) break; } if (! __gmtime_r (<, >m)) break; diff = tm_diff (<m, >m); } #endif hour_diff = diff / 60 / 60; min_diff = diff / 60 % 60; sec_diff = diff % 60; switch (colons) { case 0: /* +hhmm */ DO_TZ_OFFSET (5, diff < 0, 0, hour_diff * 100 + min_diff); case 1: tz_hh_mm: /* +hh:mm */ DO_TZ_OFFSET (6, diff < 0, 04, hour_diff * 100 + min_diff); case 2: tz_hh_mm_ss: /* +hh:mm:ss */ DO_TZ_OFFSET (9, diff < 0, 024, hour_diff * 10000 + min_diff * 100 + sec_diff); case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */ if (sec_diff != 0) goto tz_hh_mm_ss; if (min_diff != 0) goto tz_hh_mm; DO_TZ_OFFSET (3, diff < 0, 0, hour_diff); default: goto bad_format; } } case L_('\0'): /* GNU extension: % at end of format. */ --f; /* Fall through. */ default: /* Unknown format; output the format, including the '%', since this is most likely the right thing to do if a multibyte string has been misparsed. */ bad_format: { int flen; for (flen = 1; f[1 - flen] != L_('%'); flen++) continue; cpy (flen, &f[1 - flen]); } break; } } #if ! FPRINTFTIME if (p && maxsize != 0) *p = L_('\0'); #endif return i; } /* Write information from TP into S according to the format string FORMAT, writing no more that MAXSIZE characters (including the terminating '\0') and returning number of characters written. If S is NULL, nothing will be written anywhere, so to determine how many characters would be written, use NULL for S and (size_t) -1 for MAXSIZE. */ size_t my_strftime (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) const CHAR_T *format, const struct tm *tp extra_args_spec LOCALE_PARAM_PROTO) { return strftime_case_ (false, s, STRFTIME_ARG (maxsize) format, tp extra_args LOCALE_ARG); } #if defined _LIBC && ! FPRINTFTIME libc_hidden_def (my_strftime) #endif #if defined emacs && ! FPRINTFTIME /* For Emacs we have a separate interface which corresponds to the normal strftime function plus the ut argument, but without the ns argument. */ size_t emacs_strftimeu (char *s, size_t maxsize, const char *format, const struct tm *tp, int ut) { return my_strftime (s, maxsize, format, tp, ut, 0); } #endif microdc2-0.15.6/lib/strftime.h0100644000076500007500000000157510516626546016151 0ustar chugunovmicrodc/* declarations for strftime.c Copyright (C) 2002, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include size_t nstrftime (char *, size_t, char const *, struct tm const *, int, int); microdc2-0.15.6/lib/stripslash.c0100644000076500007500000000273610516626546016503 0ustar chugunovmicrodc/* stripslash.c -- remove redundant trailing slashes from a file name Copyright (C) 1990, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "dirname.h" /* Remove trailing slashes from FILE. Return true if a trailing slash was removed. This is useful when using file name completion from a shell that adds a "/" after directory names (such as tcsh and bash), because the Unix rename and rmdir system calls return an "Invalid argument" error when given a file that ends in "/" (except for the root directory). */ bool strip_trailing_slashes (char *file) { char *base = base_name (file); char *base_lim = base + base_len (base); bool had_slash = (*base_lim != '\0'); *base_lim = '\0'; return had_slash; } microdc2-0.15.6/lib/strndup.c0100644000076500007500000000256610527424345016002 0ustar chugunovmicrodc/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2005 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #include /* Get strnlen. */ #include "strnlen.h" #undef __strndup #undef strndup #ifndef weak_alias # define __strndup strndup #endif char * __strndup (const char *s, size_t n) { size_t len = strnlen (s, n); char *new = malloc (len + 1); if (new == NULL) return NULL; new[len] = '\0'; return memcpy (new, s, len); } #ifdef weak_alias weak_alias (__strndup, strndup) #endif microdc2-0.15.6/lib/strndup.h0100644000076500007500000000177710516626546016017 0ustar chugunovmicrodc/* Duplicate a size-bounded string. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if HAVE_STRNDUP /* Get strndup() declaration. */ #include #else #include /* Return a newly allocated copy of at most N bytes of STRING. */ extern char *strndup (const char *string, size_t n); #endif microdc2-0.15.6/lib/strnlen.c0100644000076500007500000000270110516626546015764 0ustar chugunovmicrodc/* Find the length of STRING, but scan at most MAXLEN characters. Copyright (C) 1996, 1997, 1998, 2000-2003 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #undef strnlen #include #undef __strnlen #undef strnlen #ifndef _LIBC # define strnlen rpl_strnlen #endif #ifndef weak_alias # define __strnlen strnlen #endif /* Find the length of STRING, but scan at most MAXLEN characters. If no '\0' terminator is found in that many characters, return MAXLEN. */ size_t __strnlen (const char *string, size_t maxlen) { const char *end = memchr (string, '\0', maxlen); return end ? (size_t) (end - string) : maxlen; } #ifdef weak_alias weak_alias (__strnlen, strnlen) #endif microdc2-0.15.6/lib/strnlen.h0100644000076500007500000000235010516626546015771 0ustar chugunovmicrodc/* Find the length of STRING, but scan at most MAXLEN characters. Copyright (C) 2005 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef STRNLEN_H #define STRNLEN_H /* Get strnlen declaration, if available. */ #include #if defined HAVE_DECL_STRNLEN && !HAVE_DECL_STRNLEN /* Find the length (number of bytes) of STRING, but scan at most MAXLEN bytes. If no '\0' terminator is found in that many bytes, return MAXLEN. */ extern size_t strnlen(const char *string, size_t maxlen); #endif #endif /* STRNLEN_H */ microdc2-0.15.6/lib/strtoimax.c0100644000076500007500000000404010516626546016327 0ustar chugunovmicrodc/* Convert string representation of a number into an intmax_t value. Copyright (C) 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ #ifdef HAVE_CONFIG_H # include #endif #if HAVE_INTTYPES_H # include #endif #if HAVE_STDINT_H # include #endif #include #include "verify.h" #ifdef UNSIGNED # ifndef HAVE_DECL_STRTOULL "this configure-time declaration test was not run" # endif # if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG unsigned long long strtoull (char const *, char **, int); # endif #else # ifndef HAVE_DECL_STRTOLL "this configure-time declaration test was not run" # endif # if !HAVE_DECL_STRTOLL && HAVE_UNSIGNED_LONG_LONG long long strtoll (char const *, char **, int); # endif #endif #ifdef UNSIGNED # undef HAVE_LONG_LONG # define HAVE_LONG_LONG HAVE_UNSIGNED_LONG_LONG # define INT uintmax_t # define strtoimax strtoumax # define strtol strtoul # define strtoll strtoull #else # define INT intmax_t #endif INT strtoimax (char const *ptr, char **endptr, int base) { #if HAVE_LONG_LONG verify (sizeof (INT) == sizeof (long int) || sizeof (INT) == sizeof (long long int)); if (sizeof (INT) != sizeof (long int)) return strtoll (ptr, endptr, base); #else verify (sizeof (INT) == sizeof (long int)); #endif return strtol (ptr, endptr, base); } microdc2-0.15.6/lib/strtol.c0100644000076500007500000002614210516626546015633 0ustar chugunovmicrodc/* Convert string representation of a number into an integer value. Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2003, 2005 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define USE_NUMBER_GROUPING #endif #include #include #ifndef errno extern int errno; #endif #ifndef __set_errno # define __set_errno(Val) errno = (Val) #endif #include #include #include #include #ifdef USE_NUMBER_GROUPING # include "../locale/localeinfo.h" #endif /* Nonzero if we are defining `strtoul' or `strtoull', operating on unsigned integers. */ #ifndef UNSIGNED # define UNSIGNED 0 # define INT LONG int #else # define INT unsigned LONG int #endif /* Determine the name. */ #ifdef USE_IN_EXTENDED_LOCALE_MODEL # if UNSIGNED # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol __wcstoull_l # else # define strtol __wcstoul_l # endif # else # ifdef QUAD # define strtol __strtoull_l # else # define strtol __strtoul_l # endif # endif # else # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol __wcstoll_l # else # define strtol __wcstol_l # endif # else # ifdef QUAD # define strtol __strtoll_l # else # define strtol __strtol_l # endif # endif # endif #else # if UNSIGNED # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol wcstoull # else # define strtol wcstoul # endif # else # ifdef QUAD # define strtol strtoull # else # define strtol strtoul # endif # endif # else # ifdef USE_WIDE_CHAR # ifdef QUAD # define strtol wcstoll # else # define strtol wcstol # endif # else # ifdef QUAD # define strtol strtoll # endif # endif # endif #endif /* If QUAD is defined, we are defining `strtoll' or `strtoull', operating on `long long int's. */ #ifdef QUAD # define LONG long long # define STRTOL_LONG_MIN LONG_LONG_MIN # define STRTOL_LONG_MAX LONG_LONG_MAX # define STRTOL_ULONG_MAX ULONG_LONG_MAX /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ /* True if negative values of the signed integer type T use two's complement, ones' complement, or signed magnitude representation, respectively. Much GNU code assumes two's complement, but some people like to be portable to all possible C hosts. */ # define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) # define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) # define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) /* True if the arithmetic type T is signed. */ # define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* The maximum and minimum values for the integer type T. These macros have undefined behavior if T is signed and has padding bits. If this is a problem for you, please let us know how to fix it for your host. */ # define TYPE_MINIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) 0 \ : TYPE_SIGNED_MAGNITUDE (t) \ ? ~ (t) 0 \ : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))) # define TYPE_MAXIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) -1 \ : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))) # ifndef ULONG_LONG_MAX # define ULONG_LONG_MAX TYPE_MAXIMUM (unsigned long long) # endif # ifndef LONG_LONG_MAX # define LONG_LONG_MAX TYPE_MAXIMUM (long long int) # endif # ifndef LONG_LONG_MIN # define LONG_LONG_MIN TYPE_MINIMUM (long long int) # endif # if __GNUC__ == 2 && __GNUC_MINOR__ < 7 /* Work around gcc bug with using this constant. */ static const unsigned long long int maxquad = ULONG_LONG_MAX; # undef STRTOL_ULONG_MAX # define STRTOL_ULONG_MAX maxquad # endif #else # define LONG long # define STRTOL_LONG_MIN LONG_MIN # define STRTOL_LONG_MAX LONG_MAX # define STRTOL_ULONG_MAX ULONG_MAX #endif /* We use this code also for the extended locale handling where the function gets as an additional argument the locale which has to be used. To access the values we have to redefine the _NL_CURRENT macro. */ #ifdef USE_IN_EXTENDED_LOCALE_MODEL # undef _NL_CURRENT # define _NL_CURRENT(category, item) \ (current->values[_NL_ITEM_INDEX (item)].string) # define LOCALE_PARAM , loc # define LOCALE_PARAM_PROTO , __locale_t loc #else # define LOCALE_PARAM # define LOCALE_PARAM_PROTO #endif #if defined _LIBC || defined HAVE_WCHAR_H # include #endif #ifdef USE_WIDE_CHAR # include # define L_(Ch) L##Ch # define UCHAR_TYPE wint_t # define STRING_TYPE wchar_t # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define ISSPACE(Ch) __iswspace_l ((Ch), loc) # define ISALPHA(Ch) __iswalpha_l ((Ch), loc) # define TOUPPER(Ch) __towupper_l ((Ch), loc) # else # define ISSPACE(Ch) iswspace (Ch) # define ISALPHA(Ch) iswalpha (Ch) # define TOUPPER(Ch) towupper (Ch) # endif #else # if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII) # define IN_CTYPE_DOMAIN(c) 1 # else # define IN_CTYPE_DOMAIN(c) isascii(c) # endif # define L_(Ch) Ch # define UCHAR_TYPE unsigned char # define STRING_TYPE char # ifdef USE_IN_EXTENDED_LOCALE_MODEL # define ISSPACE(Ch) __isspace_l ((Ch), loc) # define ISALPHA(Ch) __isalpha_l ((Ch), loc) # define TOUPPER(Ch) __toupper_l ((Ch), loc) # else # define ISSPACE(Ch) (IN_CTYPE_DOMAIN (Ch) && isspace (Ch)) # define ISALPHA(Ch) (IN_CTYPE_DOMAIN (Ch) && isalpha (Ch)) # define TOUPPER(Ch) (IN_CTYPE_DOMAIN (Ch) ? toupper (Ch) : (Ch)) # endif #endif #define INTERNAL(X) INTERNAL1(X) #define INTERNAL1(X) __##X##_internal #define WEAKNAME(X) WEAKNAME1(X) #ifdef USE_NUMBER_GROUPING /* This file defines a function to check for correct grouping. */ # include "grouping.h" #endif /* Convert NPTR to an `unsigned long int' or `long int' in base BASE. If BASE is 0 the base is determined by the presence of a leading zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. If BASE is < 2 or > 36, it is reset to 10. If ENDPTR is not NULL, a pointer to the character after the last one converted is stored in *ENDPTR. */ INT INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr, int base, int group LOCALE_PARAM_PROTO) { int negative; register unsigned LONG int cutoff; register unsigned int cutlim; register unsigned LONG int i; register const STRING_TYPE *s; register UCHAR_TYPE c; const STRING_TYPE *save, *end; int overflow; #ifdef USE_NUMBER_GROUPING # ifdef USE_IN_EXTENDED_LOCALE_MODEL struct locale_data *current = loc->__locales[LC_NUMERIC]; # endif /* The thousands character of the current locale. */ wchar_t thousands = L'\0'; /* The numeric grouping specification of the current locale, in the format described in . */ const char *grouping; if (group) { grouping = _NL_CURRENT (LC_NUMERIC, GROUPING); if (*grouping <= 0 || *grouping == CHAR_MAX) grouping = NULL; else { /* Figure out the thousands separator character. */ # if defined _LIBC || defined _HAVE_BTOWC thousands = __btowc (*_NL_CURRENT (LC_NUMERIC, THOUSANDS_SEP)); if (thousands == WEOF) thousands = L'\0'; # endif if (thousands == L'\0') grouping = NULL; } } else grouping = NULL; #endif if (base < 0 || base == 1 || base > 36) { __set_errno (EINVAL); return 0; } save = s = nptr; /* Skip white space. */ while (ISSPACE (*s)) ++s; if (*s == L_('\0')) goto noconv; /* Check for a sign. */ if (*s == L_('-')) { negative = 1; ++s; } else if (*s == L_('+')) { negative = 0; ++s; } else negative = 0; /* Recognize number prefix and if BASE is zero, figure it out ourselves. */ if (*s == L_('0')) { if ((base == 0 || base == 16) && TOUPPER (s[1]) == L_('X')) { s += 2; base = 16; } else if (base == 0) base = 8; } else if (base == 0) base = 10; /* Save the pointer so we can check later if anything happened. */ save = s; #ifdef USE_NUMBER_GROUPING if (group) { /* Find the end of the digit string and check its grouping. */ end = s; for (c = *end; c != L_('\0'); c = *++end) if ((wchar_t) c != thousands && ((wchar_t) c < L_('0') || (wchar_t) c > L_('9')) && (!ISALPHA (c) || (int) (TOUPPER (c) - L_('A') + 10) >= base)) break; if (*s == thousands) end = s; else end = correctly_grouped_prefix (s, end, thousands, grouping); } else #endif end = NULL; cutoff = STRTOL_ULONG_MAX / (unsigned LONG int) base; cutlim = STRTOL_ULONG_MAX % (unsigned LONG int) base; overflow = 0; i = 0; for (c = *s; c != L_('\0'); c = *++s) { if (s == end) break; if (c >= L_('0') && c <= L_('9')) c -= L_('0'); else if (ISALPHA (c)) c = TOUPPER (c) - L_('A') + 10; else break; if ((int) c >= base) break; /* Check for overflow. */ if (i > cutoff || (i == cutoff && c > cutlim)) overflow = 1; else { i *= (unsigned LONG int) base; i += c; } } /* Check if anything actually happened. */ if (s == save) goto noconv; /* Store in ENDPTR the address of one character past the last character we converted. */ if (endptr != NULL) *endptr = (STRING_TYPE *) s; #if !UNSIGNED /* Check for a value that is within the range of `unsigned LONG int', but outside the range of `LONG int'. */ if (overflow == 0 && i > (negative ? -((unsigned LONG int) (STRTOL_LONG_MIN + 1)) + 1 : (unsigned LONG int) STRTOL_LONG_MAX)) overflow = 1; #endif if (overflow) { __set_errno (ERANGE); #if UNSIGNED return STRTOL_ULONG_MAX; #else return negative ? STRTOL_LONG_MIN : STRTOL_LONG_MAX; #endif } /* Return the result of the appropriate sign. */ return negative ? -i : i; noconv: /* We must handle a special case here: the base is 0 or 16 and the first two characters are '0' and 'x', but the rest are no hexadecimal digits. This is no error case. We return 0 and ENDPTR points to the `x`. */ if (endptr != NULL) { if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X') && save[-2] == L_('0')) *endptr = (STRING_TYPE *) &save[-1]; else /* There was no number to convert. */ *endptr = (STRING_TYPE *) nptr; } return 0L; } /* External user entry point. */ INT #ifdef weak_function weak_function #endif strtol (const STRING_TYPE *nptr, STRING_TYPE **endptr, int base LOCALE_PARAM_PROTO) { return INTERNAL (strtol) (nptr, endptr, base, 0 LOCALE_PARAM); } microdc2-0.15.6/lib/strtoll.c0100644000076500007500000000216710516626546016010 0ustar chugunovmicrodc/* Function to parse a `long long int' from text. Copyright (C) 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define QUAD 1 #include #ifdef _LIBC # ifdef SHARED # include # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) compat_symbol (libc, __strtoll_internal, __strtoq_internal, GLIBC_2_0); # endif # endif weak_alias (strtoll, strtoq) #endif microdc2-0.15.6/lib/strtoul.c0100644000076500007500000000151710516626546016017 0ustar chugunovmicrodc/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define UNSIGNED 1 #include "strtol.c" microdc2-0.15.6/lib/strtoull.c0100644000076500007500000000212410516626546016166 0ustar chugunovmicrodc/* Function to parse an `unsigned long long int' from text. Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define QUAD 1 #include "strtoul.c" #ifdef _LIBC strong_alias (__strtoull_internal, __strtouq_internal) weak_alias (strtoull, strtouq) #endif microdc2-0.15.6/lib/strtoumax.c0100644000076500007500000000005210516626546016342 0ustar chugunovmicrodc#define UNSIGNED 1 #include "strtoimax.c" microdc2-0.15.6/lib/time_r.c0100644000076500007500000000317110516626546015560 0ustar chugunovmicrodc/* Reentrant time functions like localtime_r. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ #ifdef HAVE_CONFIG_H # include #endif #include "time_r.h" #include static char * copy_string_result (char *dest, char const *src) { if (! src) return 0; return strcpy (dest, src); } static struct tm * copy_tm_result (struct tm *dest, struct tm const *src) { if (! src) return 0; *dest = *src; return dest; } char * asctime_r (struct tm const * restrict tm, char * restrict buf) { return copy_string_result (buf, asctime (tm)); } char * ctime_r (time_t const *t, char *buf) { return copy_string_result (buf, ctime (t)); } struct tm * gmtime_r (time_t const * restrict t, struct tm * restrict tp) { return copy_tm_result (tp, gmtime (t)); } struct tm * localtime_r (time_t const * restrict t, struct tm * restrict tp) { return copy_tm_result (tp, localtime (t)); } microdc2-0.15.6/lib/time_r.h0100644000076500007500000000360210516626546015564 0ustar chugunovmicrodc/* Reentrant time functions like localtime_r. Copyright (C) 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ #ifndef _TIME_R_H #define _TIME_R_H /* Include first, since it may declare these functions with signatures that disagree with POSIX, and we don't want to rename those declarations. */ #include #if !HAVE_TIME_R_POSIX # undef asctime_r # undef ctime_r # undef gmtime_r # undef localtime_r # define asctime_r rpl_asctime_r # define ctime_r rpl_ctime_r # define gmtime_r rpl_gmtime_r # define localtime_r rpl_localtime_r /* See the POSIX:2001 specification . */ char *asctime_r (struct tm const * restrict, char * restrict); /* See the POSIX:2001 specification . */ char *ctime_r (time_t const *, char *); /* See the POSIX:2001 specification . */ struct tm *gmtime_r (time_t const * restrict, struct tm * restrict); /* See the POSIX:2001 specification . */ struct tm *localtime_r (time_t const * restrict, struct tm * restrict); #endif #endif microdc2-0.15.6/lib/vasnprintf.c0100644000076500007500000005372710516626546016507 0ustar chugunovmicrodc/* vsprintf with automatic memory allocation. Copyright (C) 1999, 2002-2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Tell glibc's to provide a prototype for snprintf(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #ifndef IN_LIBINTL # include #endif /* Specification. */ #if WIDE_CHAR_VERSION # include "vasnwprintf.h" #else # include "vasnprintf.h" #endif #include /* snprintf(), sprintf() */ #include /* abort(), malloc(), realloc(), free() */ #include /* memcpy(), strlen() */ #include /* errno */ #include /* CHAR_BIT, INT_MAX */ #include /* DBL_MAX_EXP, LDBL_MAX_EXP */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" #else # include "printf-parse.h" #endif /* Checked size_t computations. */ #include "xsize.h" /* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ #ifndef EOVERFLOW # define EOVERFLOW E2BIG #endif #ifdef HAVE_WCHAR_T # ifdef HAVE_WCSLEN # define local_wcslen wcslen # else /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid a dependency towards this library, here is a local substitute. Define this substitute only once, even if this file is included twice in the same compilation unit. */ # ifndef local_wcslen_defined # define local_wcslen_defined 1 static size_t local_wcslen (const wchar_t *s) { const wchar_t *ptr; for (ptr = s; *ptr != (wchar_t) 0; ptr++) ; return ptr - s; } # endif # endif #endif #if WIDE_CHAR_VERSION # define VASNPRINTF vasnwprintf # define CHAR_T wchar_t # define DIRECTIVE wchar_t_directive # define DIRECTIVES wchar_t_directives # define PRINTF_PARSE wprintf_parse # define USE_SNPRINTF 1 # if HAVE_DECL__SNWPRINTF /* On Windows, the function swprintf() has a different signature than on Unix; we use the _snwprintf() function instead. */ # define SNPRINTF _snwprintf # else /* Unix. */ # define SNPRINTF swprintf # endif #else # define VASNPRINTF vasnprintf # define CHAR_T char # define DIRECTIVE char_directive # define DIRECTIVES char_directives # define PRINTF_PARSE printf_parse # define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) # if HAVE_DECL__SNPRINTF /* Windows. */ # define SNPRINTF _snprintf # else /* Unix. */ # define SNPRINTF snprintf # endif #endif CHAR_T * VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args) { DIRECTIVES d; arguments a; if (PRINTF_PARSE (format, &d, &a) < 0) { errno = EINVAL; return NULL; } #define CLEANUP() \ free (d.dir); \ if (a.arg) \ free (a.arg); if (printf_fetchargs (args, &a) < 0) { CLEANUP (); errno = EINVAL; return NULL; } { size_t buf_neededlength; CHAR_T *buf; CHAR_T *buf_malloced; const CHAR_T *cp; size_t i; DIRECTIVE *dp; /* Output string accumulator. */ CHAR_T *result; size_t allocated; size_t length; /* Allocate a small buffer that will hold a directive passed to sprintf or snprintf. */ buf_neededlength = xsum4 (7, d.max_width_length, d.max_precision_length, 6); #if HAVE_ALLOCA if (buf_neededlength < 4000 / sizeof (CHAR_T)) { buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T)); buf_malloced = NULL; } else #endif { size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T)); if (size_overflow_p (buf_memsize)) goto out_of_memory_1; buf = (CHAR_T *) malloc (buf_memsize); if (buf == NULL) goto out_of_memory_1; buf_malloced = buf; } if (resultbuf != NULL) { result = resultbuf; allocated = *lengthp; } else { result = NULL; allocated = 0; } length = 0; /* Invariants: result is either == resultbuf or == NULL or malloc-allocated. If length > 0, then result != NULL. */ /* Ensures that allocated >= needed. Aborts through a jump to out_of_memory if needed is SIZE_MAX or otherwise too big. */ #define ENSURE_ALLOCATION(needed) \ if ((needed) > allocated) \ { \ size_t memory_size; \ CHAR_T *memory; \ \ allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ if ((needed) > allocated) \ allocated = (needed); \ memory_size = xtimes (allocated, sizeof (CHAR_T)); \ if (size_overflow_p (memory_size)) \ goto out_of_memory; \ if (result == resultbuf || result == NULL) \ memory = (CHAR_T *) malloc (memory_size); \ else \ memory = (CHAR_T *) realloc (result, memory_size); \ if (memory == NULL) \ goto out_of_memory; \ if (result == resultbuf && length > 0) \ memcpy (memory, result, length * sizeof (CHAR_T)); \ result = memory; \ } for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) { if (cp != dp->dir_start) { size_t n = dp->dir_start - cp; size_t augmented_length = xsum (length, n); ENSURE_ALLOCATION (augmented_length); memcpy (result + length, cp, n * sizeof (CHAR_T)); length = augmented_length; } if (i == d.count) break; /* Execute a single directive. */ if (dp->conversion == '%') { size_t augmented_length; if (!(dp->arg_index == ARG_NONE)) abort (); augmented_length = xsum (length, 1); ENSURE_ALLOCATION (augmented_length); result[length] = '%'; length = augmented_length; } else { if (!(dp->arg_index != ARG_NONE)) abort (); if (dp->conversion == 'n') { switch (a.arg[dp->arg_index].type) { case TYPE_COUNT_SCHAR_POINTER: *a.arg[dp->arg_index].a.a_count_schar_pointer = length; break; case TYPE_COUNT_SHORT_POINTER: *a.arg[dp->arg_index].a.a_count_short_pointer = length; break; case TYPE_COUNT_INT_POINTER: *a.arg[dp->arg_index].a.a_count_int_pointer = length; break; case TYPE_COUNT_LONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longint_pointer = length; break; #ifdef HAVE_LONG_LONG case TYPE_COUNT_LONGLONGINT_POINTER: *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; break; #endif default: abort (); } } else { arg_type type = a.arg[dp->arg_index].type; CHAR_T *p; unsigned int prefix_count; int prefixes[2]; #if !USE_SNPRINTF size_t tmp_length; CHAR_T tmpbuf[700]; CHAR_T *tmp; /* Allocate a temporary buffer of sufficient size for calling sprintf. */ { size_t width; size_t precision; width = 0; if (dp->width_start != dp->width_end) { if (dp->width_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->width_arg_index].a.a_int; width = (arg < 0 ? (unsigned int) (-arg) : arg); } else { const CHAR_T *digitp = dp->width_start; do width = xsum (xtimes (width, 10), *digitp++ - '0'); while (digitp != dp->width_end); } } precision = 6; if (dp->precision_start != dp->precision_end) { if (dp->precision_arg_index != ARG_NONE) { int arg; if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); arg = a.arg[dp->precision_arg_index].a.a_int; precision = (arg < 0 ? 0 : arg); } else { const CHAR_T *digitp = dp->precision_start + 1; precision = 0; while (digitp != dp->precision_end) precision = xsum (xtimes (precision, 10), *digitp++ - '0'); } } switch (dp->conversion) { case 'd': case 'i': case 'u': # ifdef HAVE_LONG_LONG if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ break; case 'o': # ifdef HAVE_LONG_LONG if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.333334 /* binary -> octal */ ) + 1 /* turn floor into ceil */ + 1; /* account for leading sign */ break; case 'x': case 'X': # ifdef HAVE_LONG_LONG if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) tmp_length = (unsigned int) (sizeof (unsigned long long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading sign or alternate form */ else # endif if (type == TYPE_LONGINT || type == TYPE_ULONGINT) tmp_length = (unsigned int) (sizeof (unsigned long) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading sign or alternate form */ else tmp_length = (unsigned int) (sizeof (unsigned int) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading sign or alternate form */ break; case 'f': case 'F': # ifdef HAVE_LONG_DOUBLE if (type == TYPE_LONGDOUBLE) tmp_length = (unsigned int) (LDBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ else # endif tmp_length = (unsigned int) (DBL_MAX_EXP * 0.30103 /* binary -> decimal */ * 2 /* estimate for FLAG_GROUP */ ) + 1 /* turn floor into ceil */ + 10; /* sign, decimal point etc. */ tmp_length = xsum (tmp_length, precision); break; case 'e': case 'E': case 'g': case 'G': case 'a': case 'A': tmp_length = 12; /* sign, decimal point, exponent etc. */ tmp_length = xsum (tmp_length, precision); break; case 'c': # if defined HAVE_WINT_T && !WIDE_CHAR_VERSION if (type == TYPE_WIDE_CHAR) tmp_length = MB_CUR_MAX; else # endif tmp_length = 1; break; case 's': # ifdef HAVE_WCHAR_T if (type == TYPE_WIDE_STRING) { tmp_length = local_wcslen (a.arg[dp->arg_index].a.a_wide_string); # if !WIDE_CHAR_VERSION tmp_length = xtimes (tmp_length, MB_CUR_MAX); # endif } else # endif tmp_length = strlen (a.arg[dp->arg_index].a.a_string); break; case 'p': tmp_length = (unsigned int) (sizeof (void *) * CHAR_BIT * 0.25 /* binary -> hexadecimal */ ) + 1 /* turn floor into ceil */ + 2; /* account for leading 0x */ break; default: abort (); } if (tmp_length < width) tmp_length = width; tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ } if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T)) tmp = tmpbuf; else { size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T)); if (size_overflow_p (tmp_memsize)) /* Overflow, would lead to out of memory. */ goto out_of_memory; tmp = (CHAR_T *) malloc (tmp_memsize); if (tmp == NULL) /* Out of memory. */ goto out_of_memory; } #endif /* Construct the format string for calling snprintf or sprintf. */ p = buf; *p++ = '%'; if (dp->flags & FLAG_GROUP) *p++ = '\''; if (dp->flags & FLAG_LEFT) *p++ = '-'; if (dp->flags & FLAG_SHOWSIGN) *p++ = '+'; if (dp->flags & FLAG_SPACE) *p++ = ' '; if (dp->flags & FLAG_ALT) *p++ = '#'; if (dp->flags & FLAG_ZERO) *p++ = '0'; if (dp->width_start != dp->width_end) { size_t n = dp->width_end - dp->width_start; memcpy (p, dp->width_start, n * sizeof (CHAR_T)); p += n; } if (dp->precision_start != dp->precision_end) { size_t n = dp->precision_end - dp->precision_start; memcpy (p, dp->precision_start, n * sizeof (CHAR_T)); p += n; } switch (type) { #ifdef HAVE_LONG_LONG case TYPE_LONGLONGINT: case TYPE_ULONGLONGINT: *p++ = 'l'; /*FALLTHROUGH*/ #endif case TYPE_LONGINT: case TYPE_ULONGINT: #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: #endif #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: #endif *p++ = 'l'; break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: *p++ = 'L'; break; #endif default: break; } *p = dp->conversion; #if USE_SNPRINTF p[1] = '%'; p[2] = 'n'; p[3] = '\0'; #else p[1] = '\0'; #endif /* Construct the arguments for calling snprintf or sprintf. */ prefix_count = 0; if (dp->width_arg_index != ARG_NONE) { if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; } if (dp->precision_arg_index != ARG_NONE) { if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) abort (); prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; } #if USE_SNPRINTF /* Prepare checking whether snprintf returns the count via %n. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; #endif for (;;) { size_t maxlen; int count; int retcount; maxlen = allocated - length; count = -1; retcount = 0; #if USE_SNPRINTF # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ retcount = SNPRINTF (result + length, maxlen, buf, \ arg, &count); \ break; \ case 1: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], arg, &count); \ break; \ case 2: \ retcount = SNPRINTF (result + length, maxlen, buf, \ prefixes[0], prefixes[1], arg, \ &count); \ break; \ default: \ abort (); \ } #else # define SNPRINTF_BUF(arg) \ switch (prefix_count) \ { \ case 0: \ count = sprintf (tmp, buf, arg); \ break; \ case 1: \ count = sprintf (tmp, buf, prefixes[0], arg); \ break; \ case 2: \ count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ arg); \ break; \ default: \ abort (); \ } #endif switch (type) { case TYPE_SCHAR: { int arg = a.arg[dp->arg_index].a.a_schar; SNPRINTF_BUF (arg); } break; case TYPE_UCHAR: { unsigned int arg = a.arg[dp->arg_index].a.a_uchar; SNPRINTF_BUF (arg); } break; case TYPE_SHORT: { int arg = a.arg[dp->arg_index].a.a_short; SNPRINTF_BUF (arg); } break; case TYPE_USHORT: { unsigned int arg = a.arg[dp->arg_index].a.a_ushort; SNPRINTF_BUF (arg); } break; case TYPE_INT: { int arg = a.arg[dp->arg_index].a.a_int; SNPRINTF_BUF (arg); } break; case TYPE_UINT: { unsigned int arg = a.arg[dp->arg_index].a.a_uint; SNPRINTF_BUF (arg); } break; case TYPE_LONGINT: { long int arg = a.arg[dp->arg_index].a.a_longint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGINT: { unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_LONG case TYPE_LONGLONGINT: { long long int arg = a.arg[dp->arg_index].a.a_longlongint; SNPRINTF_BUF (arg); } break; case TYPE_ULONGLONGINT: { unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; SNPRINTF_BUF (arg); } break; #endif case TYPE_DOUBLE: { double arg = a.arg[dp->arg_index].a.a_double; SNPRINTF_BUF (arg); } break; #ifdef HAVE_LONG_DOUBLE case TYPE_LONGDOUBLE: { long double arg = a.arg[dp->arg_index].a.a_longdouble; SNPRINTF_BUF (arg); } break; #endif case TYPE_CHAR: { int arg = a.arg[dp->arg_index].a.a_char; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WINT_T case TYPE_WIDE_CHAR: { wint_t arg = a.arg[dp->arg_index].a.a_wide_char; SNPRINTF_BUF (arg); } break; #endif case TYPE_STRING: { const char *arg = a.arg[dp->arg_index].a.a_string; SNPRINTF_BUF (arg); } break; #ifdef HAVE_WCHAR_T case TYPE_WIDE_STRING: { const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; SNPRINTF_BUF (arg); } break; #endif case TYPE_POINTER: { void *arg = a.arg[dp->arg_index].a.a_pointer; SNPRINTF_BUF (arg); } break; default: abort (); } #if USE_SNPRINTF /* Portability: Not all implementations of snprintf() are ISO C 99 compliant. Determine the number of bytes that snprintf() has produced or would have produced. */ if (count >= 0) { /* Verify that snprintf() has NUL-terminated its result. */ if (count < maxlen && result[length + count] != '\0') abort (); /* Portability hack. */ if (retcount > count) count = retcount; } else { /* snprintf() doesn't understand the '%n' directive. */ if (p[1] != '\0') { /* Don't use the '%n' directive; instead, look at the snprintf() return value. */ p[1] = '\0'; continue; } else { /* Look at the snprintf() return value. */ if (retcount < 0) { /* HP-UX 10.20 snprintf() is doubly deficient: It doesn't understand the '%n' directive, *and* it returns -1 (rather than the length that would have been required) when the buffer is too small. */ size_t bigger_need = xsum (xtimes (allocated, 2), 12); ENSURE_ALLOCATION (bigger_need); continue; } else count = retcount; } } #endif /* Attempt to handle failure. */ if (count < 0) { if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); errno = EINVAL; return NULL; } #if !USE_SNPRINTF if (count >= tmp_length) /* tmp_length was incorrectly calculated - fix the code above! */ abort (); #endif /* Make room for the result. */ if (count >= maxlen) { /* Need at least count bytes. But allocate proportionally, to avoid looping eternally if snprintf() reports a too small count. */ size_t n = xmax (xsum (length, count), xtimes (allocated, 2)); ENSURE_ALLOCATION (n); #if USE_SNPRINTF continue; #endif } #if USE_SNPRINTF /* The snprintf() result did fit. */ #else /* Append the sprintf() result. */ memcpy (result + length, tmp, count * sizeof (CHAR_T)); if (tmp != tmpbuf) free (tmp); #endif length += count; break; } } } } /* Add the final NUL. */ ENSURE_ALLOCATION (xsum (length, 1)); result[length] = '\0'; if (result != resultbuf && length + 1 < allocated) { /* Shrink the allocated memory if possible. */ CHAR_T *memory; memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T)); if (memory != NULL) result = memory; } if (buf_malloced != NULL) free (buf_malloced); CLEANUP (); *lengthp = length; if (length > INT_MAX) goto length_overflow; return result; length_overflow: /* We could produce such a big string, but its length doesn't fit into an 'int'. POSIX says that snprintf() fails with errno = EOVERFLOW in this case. */ if (result != resultbuf) free (result); errno = EOVERFLOW; return NULL; out_of_memory: if (!(result == resultbuf || result == NULL)) free (result); if (buf_malloced != NULL) free (buf_malloced); out_of_memory_1: CLEANUP (); errno = ENOMEM; return NULL; } } #undef SNPRINTF #undef USE_SNPRINTF #undef PRINTF_PARSE #undef DIRECTIVES #undef DIRECTIVE #undef CHAR_T #undef VASNPRINTF microdc2-0.15.6/lib/vasnprintf.h0100644000076500007500000000541010516626546016476 0ustar chugunovmicrodc/* vsprintf with automatic memory allocation. Copyright (C) 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _VASNPRINTF_H #define _VASNPRINTF_H /* Get va_list. */ #include /* Get size_t. */ #include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). You can pass a preallocated buffer for the result in RESULTBUF and its size in *LENGTHP; otherwise you pass RESULTBUF = NULL. If successful, return the address of the string (this may be = RESULTBUF if no dynamic memory allocation was necessary) and set *LENGTHP to the number of resulting bytes, excluding the trailing NUL. Upon error, set errno and return NULL. When dynamic memory allocation occurs, the preallocated buffer is left alone (with possibly modified contents). This makes it possible to use a statically allocated or stack-allocated buffer, like this: char buf[100]; size_t len = sizeof (buf); char *output = vasnprintf (buf, &len, format, args); if (output == NULL) ... error handling ...; else { ... use the output string ...; if (output != buf) free (output); } */ extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 3, 0))); #ifdef __cplusplus } #endif #endif /* _VASNPRINTF_H */ microdc2-0.15.6/lib/vasprintf.c0100644000076500007500000000247610516626546016324 0ustar chugunovmicrodc/* Formatted output to strings. Copyright (C) 1999, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "vasprintf.h" #include #include "vasnprintf.h" int vasprintf (char **resultp, const char *format, va_list args) { size_t length; char *result = vasnprintf (NULL, &length, format, args); if (result == NULL) return -1; *resultp = result; /* Return the number of resulting bytes, excluding the trailing NUL. If it wouldn't fit in an 'int', vasnprintf() would have returned NULL and set errno to EOVERFLOW. */ return length; } microdc2-0.15.6/lib/vasprintf.h0100644000076500007500000000410510516626546016320 0ustar chugunovmicrodc/* vsprintf with automatic memory allocation. Copyright (C) 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _VASPRINTF_H #define _VASPRINTF_H #if HAVE_VASPRINTF /* Get asprintf(), vasprintf() declarations. */ #include #else /* Get va_list. */ #include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). If the memory allocation succeeds, store the address of the string in *RESULT and return the number of resulting bytes, excluding the trailing NUL. Upon memory allocation error, or some other error, return -1. */ extern int asprintf (char **result, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int vasprintf (char **result, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 2, 0))); #ifdef __cplusplus } #endif #endif #endif /* _VASPRINTF_H */ microdc2-0.15.6/lib/verify.h0100644000076500007500000000374210516626546015616 0ustar chugunovmicrodc/* Compile-time assert-like macros. Copyright (C) 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert and Jim Meyering. */ #ifndef VERIFY_H # define VERIFY_H 1 /* Each of these macros verifies that its argument R is a nonzero constant expression. To be portable, R's type must be integer (or boolean). Unlike assert, there is no run-time overhead. There are two macros, since no single macro can be used in all contexts in C. verify_true (R) is for scalar contexts, where it may be cast to void if need be. verify (R) is for declaration contexts, e.g., the top level. The symbols verify_error_if_negative_size__ and verify_function__ are private to this header. */ /* Verify requirement R at compile-time, as an integer constant expression. Return true. */ # ifdef __cplusplus template struct verify_type__ { unsigned int verify_error_if_negative_size__: w; }; # define verify_true(R) \ (!!sizeof (verify_type__<(R) ? 1 : -1>)) # else # define verify_true(R) \ (!!sizeof \ (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; })) # endif /* Verify requirement R at compile-time, as a declaration without a trailing ';'. */ # define verify(R) extern int (* verify_function__ (void)) [verify_true (R)] #endif microdc2-0.15.6/lib/version-etc.c0100644000076500007500000001330610516626546016540 0ustar chugunovmicrodc/* Utility to help print --version output in a consistent format. Copyright (C) 1999-2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "version-etc.h" #include #include #include #if USE_UNLOCKED_IO # include "unlocked-io.h" #endif #include "gettext.h" #define _(msgid) gettext (msgid) enum { COPYRIGHT_YEAR = 2005 }; /* Like version_etc, below, but with the NULL-terminated author list provided via a variable of type va_list. */ void version_etc_va (FILE *stream, const char *command_name, const char *package, const char *version, va_list authors) { size_t n_authors; /* Count the number of authors. */ { va_list tmp_authors; #ifdef __va_copy __va_copy (tmp_authors, authors); #else tmp_authors = authors; #endif n_authors = 0; while (va_arg (tmp_authors, const char *) != NULL) ++n_authors; } if (command_name) fprintf (stream, "%s (%s) %s\n", command_name, package, version); else fprintf (stream, "%s %s\n", package, version); /* TRANSLATORS: Translate "(C)" to the copyright symbol (C-in-a-circle), if this symbol is available in the user's locale. Otherwise, do not translate "(C)"; leave it as-is. */ fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR); fputs (_("\ \n\ This is free software. You may redistribute copies of it under the terms of\n\ the GNU General Public License .\n\ There is NO WARRANTY, to the extent permitted by law.\n\ \n\ "), stream); switch (n_authors) { case 0: /* The caller must provide at least one author name. */ abort (); case 1: /* TRANSLATORS: %s denotes an author name. */ vfprintf (stream, _("Written by %s.\n"), authors); break; case 2: /* TRANSLATORS: Each %s denotes an author name. */ vfprintf (stream, _("Written by %s and %s.\n"), authors); break; case 3: /* TRANSLATORS: Each %s denotes an author name. */ vfprintf (stream, _("Written by %s, %s, and %s.\n"), authors); break; case 4: /* TRANSLATORS: Each %s denotes an author name. You can use line breaks, estimating that each author name occupies ca. 16 screen columns and that a screen line has ca. 80 columns. */ vfprintf (stream, _("Written by %s, %s, %s,\nand %s.\n"), authors); break; case 5: /* TRANSLATORS: Each %s denotes an author name. You can use line breaks, estimating that each author name occupies ca. 16 screen columns and that a screen line has ca. 80 columns. */ vfprintf (stream, _("Written by %s, %s, %s,\n%s, and %s.\n"), authors); break; case 6: /* TRANSLATORS: Each %s denotes an author name. You can use line breaks, estimating that each author name occupies ca. 16 screen columns and that a screen line has ca. 80 columns. */ vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"), authors); break; case 7: /* TRANSLATORS: Each %s denotes an author name. You can use line breaks, estimating that each author name occupies ca. 16 screen columns and that a screen line has ca. 80 columns. */ vfprintf (stream, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"), authors); break; case 8: /* TRANSLATORS: Each %s denotes an author name. You can use line breaks, estimating that each author name occupies ca. 16 screen columns and that a screen line has ca. 80 columns. */ vfprintf (stream, _("\ Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"), authors); break; case 9: /* TRANSLATORS: Each %s denotes an author name. You can use line breaks, estimating that each author name occupies ca. 16 screen columns and that a screen line has ca. 80 columns. */ vfprintf (stream, _("\ Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"), authors); break; default: /* 10 or more authors. Use an abbreviation, since the human reader will probably not want to read the entire list anyway. */ /* TRANSLATORS: Each %s denotes an author name. You can use line breaks, estimating that each author name occupies ca. 16 screen columns and that a screen line has ca. 80 columns. */ vfprintf (stream, _("\ Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"), authors); break; } va_end (authors); } /* Display the --version information the standard way. If COMMAND_NAME is NULL, the PACKAGE is asumed to be the name of the program. The formats are therefore: PACKAGE VERSION or COMMAND_NAME (PACKAGE) VERSION. The author names are passed as separate arguments, with an additional NULL argument at the end. */ void version_etc (FILE *stream, const char *command_name, const char *package, const char *version, /* const char *author1, ...*/ ...) { va_list authors; va_start (authors, version); version_etc_va (stream, command_name, package, version, authors); } microdc2-0.15.6/lib/version-etc.h0100644000076500007500000000246710516626546016553 0ustar chugunovmicrodc/* Utility to help print --version output in a consistent format. Copyright (C) 1999, 2003, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering. */ #ifndef VERSION_ETC_H # define VERSION_ETC_H 1 # include # include extern const char version_etc_copyright[]; extern void version_etc_va (FILE *stream, const char *command_name, const char *package, const char *version, va_list authors); extern void version_etc (FILE *stream, const char *command_name, const char *package, const char *version, /* const char *author1, ...*/ ...); #endif /* VERSION_ETC_H */ microdc2-0.15.6/lib/xalloc-die.c0100644000076500007500000000262210516626546016322 0ustar chugunovmicrodc/* Report a memory allocation failure and exit. Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "xalloc.h" #include #include "error.h" #include "exitfail.h" #include "gettext.h" #define _(msgid) gettext (msgid) #define N_(msgid) msgid void xalloc_die (void) { error (exit_failure, 0, "%s", _("memory exhausted")); /* The `noreturn' cannot be given to error, since it may return if its first argument is 0. To help compilers understand the xalloc_die does not return, call abort. Also, the abort is a safety feature if exit_failure is 0 (which shouldn't happen). */ abort (); } microdc2-0.15.6/lib/xalloc.h0100644000076500007500000000534310516626546015573 0ustar chugunovmicrodc/* xalloc.h -- malloc with out-of-memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XALLOC_H_ # define XALLOC_H_ # include # ifdef __cplusplus extern "C" { # endif # ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) # endif # endif # ifndef ATTRIBUTE_NORETURN # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) # endif /* This function is always triggered when memory is exhausted. It must be defined by the application, either explicitly or by using gnulib's xalloc-die module. This is the function to call when one wants the program to die because of a memory allocation failure. */ extern void xalloc_die (void) ATTRIBUTE_NORETURN; void *xmalloc (size_t s); void *xnmalloc (size_t n, size_t s); void *xzalloc (size_t s); void *xcalloc (size_t n, size_t s); void *xrealloc (void *p, size_t s); void *xnrealloc (void *p, size_t n, size_t s); void *x2realloc (void *p, size_t *pn); void *x2nrealloc (void *p, size_t *pn, size_t s); void *xmemdup (void const *p, size_t s); char *xstrdup (char const *str); /* Return 1 if an array of N objects, each of size S, cannot exist due to size arithmetic overflow. S must be positive and N must be nonnegative. This is a macro, not an inline function, so that it works correctly even when SIZE_MAX < N. By gnulib convention, SIZE_MAX represents overflow in size calculations, so the conservative dividend to use here is SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value. However, malloc (SIZE_MAX) fails on all known hosts where sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for exactly-SIZE_MAX allocations on such hosts; this avoids a test and branch when S is known to be 1. */ # define xalloc_oversized(n, s) \ ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n)) # ifdef __cplusplus } # endif #endif /* !XALLOC_H_ */ microdc2-0.15.6/lib/xasprintf.c0100644000076500007500000000211510516626546016314 0ustar chugunovmicrodc/* vasprintf and asprintf with out-of-memory checking. Copyright (C) 1999, 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "xvasprintf.h" char * xasprintf (const char *format, ...) { va_list args; char *result; va_start (args, format); result = xvasprintf (format, args); va_end (args); return result; } microdc2-0.15.6/lib/xgethostname.c0100644000076500007500000000420110516626546017002 0ustar chugunovmicrodc/* xgethostname.c -- return current hostname with unlimited length Copyright (C) 1992, 1996, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* written by Jim Meyering */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "xgethostname.h" #include #include #include #include "xalloc.h" #ifndef ENAMETOOLONG # define ENAMETOOLONG 0 #endif #ifndef INITIAL_HOSTNAME_LENGTH # define INITIAL_HOSTNAME_LENGTH 34 #endif /* Return the current hostname in malloc'd storage. If malloc fails, exit. Upon any other failure, return NULL and set errno. */ char * xgethostname (void) { char *hostname = NULL; size_t size = INITIAL_HOSTNAME_LENGTH; while (1) { /* Use SIZE_1 here rather than SIZE to work around the bug in SunOS 5.5's gethostname whereby it NUL-terminates HOSTNAME even when the name is as long as the supplied buffer. */ size_t size_1; hostname = x2realloc (hostname, &size); size_1 = size - 1; hostname[size_1 - 1] = '\0'; errno = 0; if (gethostname (hostname, size_1) == 0) { if (! hostname[size_1 - 1]) break; } else if (errno != 0 && errno != ENAMETOOLONG && errno != EINVAL /* OSX/Darwin does this when the buffer is not large enough */ && errno != ENOMEM) { int saved_errno = errno; free (hostname); errno = saved_errno; return NULL; } } return hostname; } microdc2-0.15.6/lib/xgethostname.h0100644000076500007500000000003310516626546017006 0ustar chugunovmicrodcchar *xgethostname (void); microdc2-0.15.6/lib/xmalloc.c0100644000076500007500000001417310516626546015744 0ustar chugunovmicrodc/* xmalloc.c -- malloc with out of memory checking Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include "xalloc.h" #include #include #ifndef SIZE_MAX # define SIZE_MAX ((size_t) -1) #endif /* 1 if calloc is known to be compatible with GNU calloc. This matters if we are not also using the calloc module, which defines HAVE_CALLOC and supports the GNU API even on non-GNU platforms. */ #if defined HAVE_CALLOC || defined __GLIBC__ enum { HAVE_GNU_CALLOC = 1 }; #else enum { HAVE_GNU_CALLOC = 0 }; #endif /* Allocate an array of N objects, each with S bytes of memory, dynamically, with error checking. S must be nonzero. */ static inline void * xnmalloc_inline (size_t n, size_t s) { void *p; if (xalloc_oversized (n, s) || (! (p = malloc (n * s)) && n != 0)) xalloc_die (); return p; } void * xnmalloc (size_t n, size_t s) { return xnmalloc_inline (n, s); } /* Allocate N bytes of memory dynamically, with error checking. */ void * xmalloc (size_t n) { return xnmalloc_inline (n, 1); } /* Change the size of an allocated block of memory P to an array of N objects each of S bytes, with error checking. S must be nonzero. */ static inline void * xnrealloc_inline (void *p, size_t n, size_t s) { if (xalloc_oversized (n, s) || (! (p = realloc (p, n * s)) && n != 0)) xalloc_die (); return p; } void * xnrealloc (void *p, size_t n, size_t s) { return xnrealloc_inline (p, n, s); } /* Change the size of an allocated block of memory P to N bytes, with error checking. */ void * xrealloc (void *p, size_t n) { return xnrealloc_inline (p, n, 1); } /* If P is null, allocate a block of at least *PN such objects; otherwise, reallocate P so that it contains more than *PN objects each of S bytes. *PN must be nonzero unless P is null, and S must be nonzero. Set *PN to the new number of objects, and return the pointer to the new block. *PN is never set to zero, and the returned pointer is never null. Repeated reallocations are guaranteed to make progress, either by allocating an initial block with a nonzero size, or by allocating a larger block. In the following implementation, nonzero sizes are doubled so that repeated reallocations have O(N log N) overall cost rather than O(N**2) cost, but the specification for this function does not guarantee that sizes are doubled. Here is an example of use: int *p = NULL; size_t used = 0; size_t allocated = 0; void append_int (int value) { if (used == allocated) p = x2nrealloc (p, &allocated, sizeof *p); p[used++] = value; } This causes x2nrealloc to allocate a block of some nonzero size the first time it is called. To have finer-grained control over the initial size, set *PN to a nonzero value before calling this function with P == NULL. For example: int *p = NULL; size_t used = 0; size_t allocated = 0; size_t allocated1 = 1000; void append_int (int value) { if (used == allocated) { p = x2nrealloc (p, &allocated1, sizeof *p); allocated = allocated1; } p[used++] = value; } */ static inline void * x2nrealloc_inline (void *p, size_t *pn, size_t s) { size_t n = *pn; if (! p) { if (! n) { /* The approximate size to use for initial small allocation requests, when the invoking code specifies an old size of zero. 64 bytes is the largest "small" request for the GNU C library malloc. */ enum { DEFAULT_MXFAST = 64 }; n = DEFAULT_MXFAST / s; n += !n; } } else { if (SIZE_MAX / 2 / s < n) xalloc_die (); n *= 2; } *pn = n; return xrealloc (p, n * s); } void * x2nrealloc (void *p, size_t *pn, size_t s) { return x2nrealloc_inline (p, pn, s); } /* If P is null, allocate a block of at least *PN bytes; otherwise, reallocate P so that it contains more than *PN bytes. *PN must be nonzero unless P is null. Set *PN to the new block's size, and return the pointer to the new block. *PN is never set to zero, and the returned pointer is never null. */ void * x2realloc (void *p, size_t *pn) { return x2nrealloc_inline (p, pn, 1); } /* Allocate S bytes of zeroed memory dynamically, with error checking. There's no need for xnzalloc (N, S), since it would be equivalent to xcalloc (N, S). */ void * xzalloc (size_t s) { return memset (xmalloc (s), 0, s); } /* Allocate zeroed memory for N elements of S bytes, with error checking. S must be nonzero. */ void * xcalloc (size_t n, size_t s) { void *p; /* Test for overflow, since some calloc implementations don't have proper overflow checks. But omit overflow and size-zero tests if HAVE_GNU_CALLOC, since GNU calloc catches overflow and never returns NULL if successful. */ if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s)) || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0))) xalloc_die (); return p; } /* Clone an object P of size S, with error checking. There's no need for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any need for an arithmetic overflow check. */ void * xmemdup (void const *p, size_t s) { return memcpy (xmalloc (s), p, s); } /* Clone STRING. */ char * xstrdup (char const *string) { return xmemdup (string, strlen (string) + 1); } microdc2-0.15.6/lib/xsize.h0100644000076500007500000000667310516626546015462 0ustar chugunovmicrodc/* xsize.h -- Checked size_t computations. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XSIZE_H #define _XSIZE_H /* Get size_t. */ #include /* Get SIZE_MAX. */ #include #if HAVE_STDINT_H # include #endif /* The size of memory objects is often computed through expressions of type size_t. Example: void* p = malloc (header_size + n * element_size). These computations can lead to overflow. When this happens, malloc() returns a piece of memory that is way too small, and the program then crashes while attempting to fill the memory. To avoid this, the functions and macros in this file check for overflow. The convention is that SIZE_MAX represents overflow. malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc implementation that uses mmap --, it's recommended to use size_overflow_p() or size_in_bounds_p() before invoking malloc(). The example thus becomes: size_t size = xsum (header_size, xtimes (n, element_size)); void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); */ /* Convert an arbitrary value >= 0 to type size_t. */ #define xcast_size_t(N) \ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) /* Sum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum (size_t size1, size_t size2) { size_t sum = size1 + size2; return (sum >= size1 ? sum : SIZE_MAX); } /* Sum of three sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum3 (size_t size1, size_t size2, size_t size3) { return xsum (xsum (size1, size2), size3); } /* Sum of four sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) { return xsum (xsum (xsum (size1, size2), size3), size4); } /* Maximum of two sizes, with overflow check. */ static inline size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif xmax (size_t size1, size_t size2) { /* No explicit check is needed here, because for any n: max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ return (size1 >= size2 ? size1 : size2); } /* Multiplication of a count with an element size, with overflow check. The count must be >= 0 and the element size must be > 0. This is a macro, not an inline function, so that it works correctly even when N is of a wider tupe and N > SIZE_MAX. */ #define xtimes(N, ELSIZE) \ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) /* Check for overflow. */ #define size_overflow_p(SIZE) \ ((SIZE) == SIZE_MAX) /* Check against overflow. */ #define size_in_bounds_p(SIZE) \ ((SIZE) != SIZE_MAX) #endif /* _XSIZE_H */ microdc2-0.15.6/lib/xstrndup.c0100644000076500007500000000234610516626546016173 0ustar chugunovmicrodc/* Duplicate a bounded initial segment of a string, with out-of-memory checking. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "xstrndup.h" #include "strndup.h" #include "xalloc.h" /* Return a newly allocated copy of at most N bytes of STRING. In other words, return a copy of the initial segment of length N of STRING. */ char * xstrndup (const char *string, size_t n) { char *s = strndup (string, n); if (! s) xalloc_die (); return s; } microdc2-0.15.6/lib/xstrndup.h0100644000076500007500000000205210516626546016172 0ustar chugunovmicrodc/* Duplicate a bounded initial segment of a string, with out-of-memory checking. Copyright (C) 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Return a newly allocated copy of at most N bytes of STRING. In other words, return a copy of the initial segment of length N of STRING. */ extern char *xstrndup (const char *string, size_t n); microdc2-0.15.6/lib/xstrtol.c0100644000076500007500000001427210516626546016024 0ustar chugunovmicrodc/* A more useful interface to strtol. Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Jim Meyering. */ #ifdef HAVE_CONFIG_H # include #endif #include "xstrtol.h" #ifndef __strtol # define __strtol strtol # define __strtol_t long int # define __xstrtol xstrtol # define STRTOL_T_MINIMUM LONG_MIN # define STRTOL_T_MAXIMUM LONG_MAX #endif /* Some pre-ANSI implementations (e.g. SunOS 4) need stderr defined if assertion checking is enabled. */ #include #include #include #include #include #include #include #include "intprops.h" #ifndef STRTOL_T_MINIMUM # define STRTOL_T_MINIMUM TYPE_MINIMUM (__strtol_t) # define STRTOL_T_MAXIMUM TYPE_MAXIMUM (__strtol_t) #endif #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) # define IN_CTYPE_DOMAIN(c) 1 #else # define IN_CTYPE_DOMAIN(c) isascii(c) #endif #define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c)) #if !HAVE_DECL_STRTOIMAX && !defined strtoimax intmax_t strtoimax (); #endif #if !HAVE_DECL_STRTOUMAX && !defined strtoumax uintmax_t strtoumax (); #endif static strtol_error bkm_scale (__strtol_t *x, int scale_factor) { if (TYPE_SIGNED (__strtol_t) && *x < STRTOL_T_MINIMUM / scale_factor) { *x = STRTOL_T_MINIMUM; return LONGINT_OVERFLOW; } if (STRTOL_T_MAXIMUM / scale_factor < *x) { *x = STRTOL_T_MAXIMUM; return LONGINT_OVERFLOW; } *x *= scale_factor; return LONGINT_OK; } static strtol_error bkm_scale_by_power (__strtol_t *x, int base, int power) { strtol_error err = LONGINT_OK; while (power--) err |= bkm_scale (x, base); return err; } /* FIXME: comment. */ strtol_error __xstrtol (const char *s, char **ptr, int strtol_base, __strtol_t *val, const char *valid_suffixes) { char *t_ptr; char **p; __strtol_t tmp; strtol_error err = LONGINT_OK; assert (0 <= strtol_base && strtol_base <= 36); p = (ptr ? ptr : &t_ptr); if (! TYPE_SIGNED (__strtol_t)) { const char *q = s; unsigned char ch = *q; while (ISSPACE (ch)) ch = *++q; if (ch == '-') return LONGINT_INVALID; } errno = 0; tmp = __strtol (s, p, strtol_base); if (*p == s) { /* If there is no number but there is a valid suffix, assume the number is 1. The string is invalid otherwise. */ if (valid_suffixes && **p && strchr (valid_suffixes, **p)) tmp = 1; else return LONGINT_INVALID; } else if (errno != 0) { if (errno != ERANGE) return LONGINT_INVALID; err = LONGINT_OVERFLOW; } /* Let valid_suffixes == NULL mean `allow any suffix'. */ /* FIXME: update all callers except the ones that allow suffixes after the number, changing last parameter NULL to `""'. */ if (!valid_suffixes) { *val = tmp; return err; } if (**p != '\0') { int base = 1024; int suffixes = 1; strtol_error overflow; if (!strchr (valid_suffixes, **p)) { *val = tmp; return err | LONGINT_INVALID_SUFFIX_CHAR; } if (strchr (valid_suffixes, '0')) { /* The ``valid suffix'' '0' is a special flag meaning that an optional second suffix is allowed, which can change the base. A suffix "B" (e.g. "100MB") stands for a power of 1000, whereas a suffix "iB" (e.g. "100MiB") stands for a power of 1024. If no suffix (e.g. "100M"), assume power-of-1024. */ switch (p[0][1]) { case 'i': if (p[0][2] == 'B') suffixes += 2; break; case 'B': case 'D': /* 'D' is obsolescent */ base = 1000; suffixes++; break; } } switch (**p) { case 'b': overflow = bkm_scale (&tmp, 512); break; case 'B': overflow = bkm_scale (&tmp, 1024); break; case 'c': overflow = 0; break; case 'E': /* exa or exbi */ overflow = bkm_scale_by_power (&tmp, base, 6); break; case 'G': /* giga or gibi */ case 'g': /* 'g' is undocumented; for compatibility only */ overflow = bkm_scale_by_power (&tmp, base, 3); break; case 'k': /* kilo */ case 'K': /* kibi */ overflow = bkm_scale_by_power (&tmp, base, 1); break; case 'M': /* mega or mebi */ case 'm': /* 'm' is undocumented; for compatibility only */ overflow = bkm_scale_by_power (&tmp, base, 2); break; case 'P': /* peta or pebi */ overflow = bkm_scale_by_power (&tmp, base, 5); break; case 'T': /* tera or tebi */ case 't': /* 't' is undocumented; for compatibility only */ overflow = bkm_scale_by_power (&tmp, base, 4); break; case 'w': overflow = bkm_scale (&tmp, 2); break; case 'Y': /* yotta or 2**80 */ overflow = bkm_scale_by_power (&tmp, base, 8); break; case 'Z': /* zetta or 2**70 */ overflow = bkm_scale_by_power (&tmp, base, 7); break; default: *val = tmp; return err | LONGINT_INVALID_SUFFIX_CHAR; } err |= overflow; *p += suffixes; if (**p) err |= LONGINT_INVALID_SUFFIX_CHAR; } *val = tmp; return err; } #ifdef TESTING_XSTRTO # include # include "error.h" char *program_name; int main (int argc, char **argv) { strtol_error s_err; int i; program_name = argv[0]; for (i=1; i%lu (%s)\n", argv[i], val, p); } else { STRTOL_FATAL_ERROR (argv[i], "arg", s_err); } } exit (0); } #endif /* TESTING_XSTRTO */ microdc2-0.15.6/lib/xstrtol.h0100644000076500007500000000523710516626546016032 0ustar chugunovmicrodc/* A more useful interface to strtol. Copyright (C) 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef XSTRTOL_H_ # define XSTRTOL_H_ 1 # include "exitfail.h" # if HAVE_INTTYPES_H # include # endif # if HAVE_STDINT_H # include # endif # ifndef _STRTOL_ERROR enum strtol_error { LONGINT_OK = 0, /* These two values can be ORed together, to indicate that both errors occurred. */ LONGINT_OVERFLOW = 1, LONGINT_INVALID_SUFFIX_CHAR = 2, LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW = (LONGINT_INVALID_SUFFIX_CHAR | LONGINT_OVERFLOW), LONGINT_INVALID = 4 }; typedef enum strtol_error strtol_error; # endif # define _DECLARE_XSTRTOL(name, type) \ strtol_error name (const char *, char **, int, type *, const char *); _DECLARE_XSTRTOL (xstrtol, long int) _DECLARE_XSTRTOL (xstrtoul, unsigned long int) _DECLARE_XSTRTOL (xstrtoimax, intmax_t) _DECLARE_XSTRTOL (xstrtoumax, uintmax_t) # define _STRTOL_ERROR(Exit_code, Str, Argument_type_string, Err) \ do \ { \ switch ((Err)) \ { \ default: \ abort (); \ \ case LONGINT_INVALID: \ error ((Exit_code), 0, "invalid %s `%s'", \ (Argument_type_string), (Str)); \ break; \ \ case LONGINT_INVALID_SUFFIX_CHAR: \ case LONGINT_INVALID_SUFFIX_CHAR | LONGINT_OVERFLOW: \ error ((Exit_code), 0, "invalid character following %s in `%s'", \ (Argument_type_string), (Str)); \ break; \ \ case LONGINT_OVERFLOW: \ error ((Exit_code), 0, "%s `%s' too large", \ (Argument_type_string), (Str)); \ break; \ } \ } \ while (0) # define STRTOL_FATAL_ERROR(Str, Argument_type_string, Err) \ _STRTOL_ERROR (exit_failure, Str, Argument_type_string, Err) # define STRTOL_FAIL_WARN(Str, Argument_type_string, Err) \ _STRTOL_ERROR (0, Str, Argument_type_string, Err) #endif /* not XSTRTOL_H_ */ microdc2-0.15.6/lib/xstrtoul.c0100644000076500007500000000025410516626546016204 0ustar chugunovmicrodc#define __strtol strtoul #define __strtol_t unsigned long int #define __xstrtol xstrtoul #define STRTOL_T_MINIMUM 0 #define STRTOL_T_MAXIMUM ULONG_MAX #include "xstrtol.c" microdc2-0.15.6/lib/xstrtoumax.c0100644000076500007500000000215010516626546016533 0ustar chugunovmicrodc/* xstrtoumax.c -- A more useful interface to strtoumax. Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Paul Eggert. */ #ifdef HAVE_CONFIG_H # include #endif #include "xstrtol.h" #define __strtol strtoumax #define __strtol_t uintmax_t #define __xstrtol xstrtoumax #ifdef UINTMAX_MAX # define STRTOL_T_MINIMUM 0 # define STRTOL_T_MAXIMUM UINTMAX_MAX #endif #include "xstrtol.c" microdc2-0.15.6/lib/xvasprintf.c0100644000076500007500000000225410516626546016506 0ustar chugunovmicrodc/* vasprintf and asprintf with out-of-memory checking. Copyright (C) 1999, 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H # include #endif /* Specification. */ #include "xvasprintf.h" #include #include "vasprintf.h" #include "xalloc.h" char * xvasprintf (const char *format, va_list args) { char *result; if (vasprintf (&result, format, args) < 0) { if (errno == ENOMEM) xalloc_die (); return NULL; } return result; } microdc2-0.15.6/lib/xvasprintf.h0100644000076500007500000000424110516626546016511 0ustar chugunovmicrodc/* vasprintf and asprintf with out-of-memory checking. Copyright (C) 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _XVASPRINTF_H #define _XVASPRINTF_H /* Get va_list. */ #include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif /* Write formatted output to a string dynamically allocated with malloc(). If the memory allocation succeeds, store the address of the string in *RESULT and return the number of resulting bytes, excluding the trailing NUL. Upon [ENOMEM] memory allocation error, call xalloc_die. On some other error - [EOVERFLOW] resulting string length is > INT_MAX, - [EINVAL] invalid format string, - [EILSEQ] error during conversion between wide and multibyte characters, return NULL. */ extern char *xasprintf (const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); extern char *xvasprintf (const char *format, va_list args) __attribute__ ((__format__ (__printf__, 1, 0))); #ifdef __cplusplus } #endif #endif /* _XVASPRINTF_H */ microdc2-0.15.6/m4/0040755000076500007500000000000010527341105013673 5ustar chugunovmicrodcmicrodc2-0.15.6/m4/CVS/0040755000076500007500000000000010527341105014326 5ustar chugunovmicrodcmicrodc2-0.15.6/m4/CVS/Root0100644000076500007500000000003610527341105015170 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/m4/CVS/Repository0100644000076500007500000000001310527341105016417 0ustar chugunovmicrodcmicrodc/m4 microdc2-0.15.6/m4/CVS/Entries0100644000076500007500000001251010527341105015656 0ustar chugunovmicrodc/ac_define_dir.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /ac_lib_readline.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /acx_pthread.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /alloca.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /dirname.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /dos.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /eoverflow.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /error.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /exitfail.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /extensions.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /fnmatch.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /free.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /getaddrinfo.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /getdelim.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /gethostname.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /getline.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /getopt.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /gettext.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /gnulib-cache.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /gnulib-comp.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /human.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /iconv.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /iconvme.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /intmax_t.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /inttypes.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /inttypes_h.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /lib-ld.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /lib-link.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /lib-prefix.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /longdouble.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /longlong.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /mbrtowc.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /mbstate_t.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /memmem.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /minmax.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /nls.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /onceonly_2_57.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /po.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /progtest.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /quote.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /quotearg.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /restrict.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /safe-read.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /safe-write.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /sig2str.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /signed.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /size_max.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /socklen.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /sockpfaf.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /ssize_t.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /stdbool.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /stdint.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /stdint_h.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /stpcpy.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strdup.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strftime.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strndup.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strnlen.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strtoimax.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strtol.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strtoll.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strtoul.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strtoull.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /strtoumax.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /time_r.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /tm_gmtoff.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /uintmax_t.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /ulonglong.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /vasnprintf.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /vasprintf.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /wchar_t.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /wint_t.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /xalloc.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /xsize.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /xstrndup.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /xstrtol.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /xstrtoumax.m4/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/m4/CVS/Tag0100644000076500007500000000003010527341105014752 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/m4/ac_define_dir.m40100644000076500007500000000223710516626545016705 0ustar chugunovmicrodcdnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) dnl dnl This macro sets VARNAME to the expansion of the DIR variable, dnl taking care of fixing up ${prefix} and such. dnl dnl VARNAME is then offered as both an output variable and a C dnl preprocessor symbol. dnl dnl Example: dnl dnl AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) dnl dnl @category Misc dnl @author Stepan Kasal dnl @author Andreas Schwab dnl @author Guido Draheim dnl @author Alexandre Oliva dnl @version 2005-07-29 dnl @license AllPermissive AC_DEFUN([AC_DEFINE_DIR], [ prefix_NONE= exec_prefix_NONE= test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn dnl refers to ${prefix}. Thus we have to use `eval' twice. eval ac_define_dir="\"[$]$2\"" eval ac_define_dir="\"$ac_define_dir\"" AC_SUBST($1, "$ac_define_dir") AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) test "$prefix_NONE" && prefix=NONE test "$exec_prefix_NONE" && exec_prefix=NONE ]) microdc2-0.15.6/m4/ac_lib_readline.m40100644000076500007500000000620610516626545017226 0ustar chugunovmicrodcdnl @synopsis AC_LIB_READLINE([ACTION-IF-TRUE], [ACTION-IF-FALSE]) dnl dnl A modified version of VL_LIB_READLINE found in the GNU ac-archive dnl (http://www.gnu.org/software/ac-archive) and the SF ac-archive dnl (http://ac-archive.sourceforge.net/). Don't set LIBS, set dnl READLINE_LIBS instead. dnl dnl Searches for the GNU Readline library. If found, defines dnl `HAVE_LIBREADLINE'. If the found library has the `add_history' dnl function, sets also `HAVE_READLINE_HISTORY'. Also checks for the dnl locations of the necessary include files and sets `HAVE_READLINE_H' dnl or `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or dnl 'HAVE_HISTORY_H' if the corresponding include files exists. dnl dnl The libraries that may be readline compatible are `libedit', dnl `libeditline' and `libreadline'. However, this script does not check dnl for those libraries. Sometimes we need to link a termcap library for dnl readline to work, this macro tests these cases too by trying to link dnl with `libtermcap', `libcurses' or `libncurses' before giving up. dnl dnl Here is an example of how to use the information provided by this dnl macro to perform the necessary includes or declarations in a C file: dnl dnl #if defined(HAVE_READLINE_READLINE_H) dnl # include dnl #elif defined(HAVE_READLINE_H) dnl # include dnl #endif dnl #if defined(HAVE_READLINE_HISTORY_H) dnl # include dnl #elif defined(HAVE_HISTORY_H) dnl # include dnl #endif dnl dnl TODO: dnl + --without-readline, --with-readline dnl + READLINE_CFLAGS so that #include is ok dnl even with includes in readline subdirectory? dnl dnl @originalversion 1.1 dnl @originalauthor Ville Laurikari dnl @version 1.3 dnl @author Oskar Liljeblad dnl AC_DEFUN([AC_LIB_READLINE], [ AH_TEMPLATE(HAVE_LIBREADLINE, [Define if you have a readline compatible library]) AH_TEMPLATE(HAVE_READLINE_HISTORY, [Define if your readline library has `add_history']) AC_MSG_CHECKING([for the GNU Readline library]) ORIG_LIBS="$LIBS" for readline_lib in readline; do for termcap_lib in "" termcap curses ncurses; do if test -z "$termcap_lib"; then TRY_LIB="-l$readline_lib" else TRY_LIB="-l$readline_lib -l$termcap_lib" fi LIBS="$ORIG_LIBS $TRY_LIB" AC_TRY_LINK_FUNC(readline, ol_cv_lib_readline="$TRY_LIB") if test -n "$ol_cv_lib_readline"; then break fi done if test -n "$ol_cv_lib_readline"; then break fi done if test -z "$ol_cv_lib_readline"; then AC_MSG_RESULT([not found]) AC_SUBST(READLINE_LIBS, "") $2 else AC_MSG_RESULT([found]) AC_SUBST(READLINE_LIBS, "$ol_cv_lib_readline") AC_DEFINE(HAVE_LIBREADLINE, 1) AC_CHECK_HEADERS(readline.h readline/readline.h) ol_cv_lib_readline_history="no" AC_MSG_CHECKING([whether readline supports history]) AC_TRY_LINK_FUNC(add_history, [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_READLINE_HISTORY, 1) AC_CHECK_HEADERS(history.h readline/history.h) ], [ AC_MSG_RESULT([no]) ]) $1 fi LIBS="$ORIG_LIBS" ])dnl microdc2-0.15.6/m4/acx_pthread.m40100644000076500007500000002365610516626545016444 0ustar chugunovmicrodcdnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl dnl This macro figures out how to build C programs using POSIX threads. dnl It sets the PTHREAD_LIBS output variable to the threads library, the dnl PTHREAD_LDFLAGS output variable to the linker flags, and the dnl PTHREAD_CFLAGS outputvariable to any special C compiler flags that dnl are needed. (The user can also force certain compiler flags/libs to dnl be tested by setting these environment variables.) dnl dnl Also sets PTHREAD_CC to any special C compiler that is needed for dnl multi-threaded programs (defaults to the value of CC otherwise). dnl (This is necessary on AIX to use the special cc_r compiler alias.) dnl dnl NOTE: You are assumed to not only compile your program with these dnl flags, but also link it with them as well. e.g. you should link dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS $PTHREAD_LDFLAGS dnl ... $PTHREAD_LIBS $LIBS dnl dnl If you are only building threads programs, you may wish to use dnl these variables in your default LIBS, CFLAGS, and CC: dnl dnl LIBS="$PTHREAD_LIBS $LIBS" dnl LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS" dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS" dnl CC="$PTHREAD_CC" dnl dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). dnl dnl ACTION-IF-FOUND is a list of shell commands to run if a threads dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the dnl default action will define HAVE_PTHREAD. dnl dnl Please let the authors know if this macro fails on any platform, or dnl if you have any other suggestions or comments. This macro was based dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros dnl posted by Alejandro Forero Cuervo to the autoconf macro repository. dnl We are also grateful for the helpful feedback of numerous users. dnl dnl This file was last modified by Oskar Liljeblad on 2005-06-08. dnl All linker flags have been split from PTHREAD_LIBS into dnl PTHREAD_LDFLAGS to comply with automake guidelines. It was based on dnl acx_pthread.m4 2005-01-14. (The only difference between 2005-01-14 dnl and 2005-01-16 appears to be in the document formatting.) dnl dnl @category InstalledPackages dnl @author Steven G. Johnson dnl @version 2005-06-08 dnl @license GPLWithACException AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS$PTHREAD_LDFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS and LDFLAGS=$PTHREAD_LDFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" PTHREAD_LDFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LDFLAGS="`pthread-config --ldflags`" PTHREAD_LIBS="`pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" save_LDFLAGS="$LDFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" PTHREAD_LDFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_TRY_LINK([#include ], [int attr=$attr;], [attr_name=$attr; break]) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" LDFLAGS="$save_LDFLAGS" # More AIX lossage: must compile with cc_r AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_LDFLAGS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD microdc2-0.15.6/m4/alloca.m40100644000076500007500000000246310516626545015406 0ustar chugunovmicrodc# alloca.m4 serial 5 dnl Copyright (C) 2002, 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_FUNC_ALLOCA], [ dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([AC_PROG_EGREP]) AC_REQUIRE([AC_FUNC_ALLOCA]) if test $ac_cv_func_alloca_works = no; then gl_PREREQ_ALLOCA fi # Define an additional variable used in the Makefile substitution. if test $ac_cv_working_alloca_h = yes; then AC_EGREP_CPP([Need own alloca], [ #if defined __GNUC__ || defined _AIX || defined _MSC_VER Need own alloca #endif ], [AC_DEFINE(HAVE_ALLOCA, 1, [Define to 1 if you have `alloca' after including , a header that may be supplied by this distribution.]) ALLOCA_H=alloca.h], [ALLOCA_H=]) else ALLOCA_H=alloca.h fi AC_SUBST([ALLOCA_H]) AC_DEFINE(HAVE_ALLOCA_H, 1, [Define HAVE_ALLOCA_H for backward compatibility with older code that includes only if HAVE_ALLOCA_H is defined.]) ]) # Prerequisites of lib/alloca.c. # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. AC_DEFUN([gl_PREREQ_ALLOCA], [:]) microdc2-0.15.6/m4/dirname.m40100644000076500007500000000101110516626545015556 0ustar chugunovmicrodc# dirname.m4 serial 5 dnl Copyright (C) 2002, 2003, 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. AC_DEFUN([gl_DIRNAME], [ AC_LIBSOURCES([dirname.c, dirname.h]) AC_LIBOBJ([dirname]) dnl Prerequisites of lib/dirname.h. AC_REQUIRE([gl_AC_DOS]) dnl No prerequisites of lib/basename.c, lib/dirname.c, lib/stripslash.c. ]) microdc2-0.15.6/m4/dos.m40100644000076500007500000000355110516626545014737 0ustar chugunovmicrodc#serial 9 # Define some macros required for proper operation of code in lib/*.c # on MSDOS/Windows systems. # Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # From Jim Meyering. AC_DEFUN([gl_AC_DOS], [ AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos], [ AC_TRY_COMPILE([], [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__ neither MSDOS nor Windows #endif], [ac_cv_win_or_dos=yes], [ac_cv_win_or_dos=no]) ]) if test x"$ac_cv_win_or_dos" = xyes; then ac_fs_accepts_drive_letter_prefix=1 ac_fs_backslash_is_file_name_separator=1 else ac_fs_accepts_drive_letter_prefix=0 ac_fs_backslash_is_file_name_separator=0 fi AH_VERBATIM(FILE_SYSTEM_PREFIX_LEN, [#if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX # define FILE_SYSTEM_PREFIX_LEN(Filename) \ ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) #else # define FILE_SYSTEM_PREFIX_LEN(Filename) 0 #endif]) AC_DEFINE_UNQUOTED([FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX], $ac_fs_accepts_drive_letter_prefix, [Define on systems for which file names may have a so-called `drive letter' prefix, define this to compute the length of that prefix, including the colon.]) AH_VERBATIM(ISSLASH, [#if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR # define ISSLASH(C) ((C) == '/' || (C) == '\\') #else # define ISSLASH(C) ((C) == '/') #endif]) AC_DEFINE_UNQUOTED([FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR], $ac_fs_backslash_is_file_name_separator, [Define if the backslash character may also serve as a file name component separator.]) ]) microdc2-0.15.6/m4/eoverflow.m40100644000076500007500000000413610516626545016162 0ustar chugunovmicrodc# eoverflow.m4 serial 1 dnl Copyright (C) 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 Bruno Haible. # The EOVERFLOW errno value ought to be defined in , according to # POSIX. But some systems (like AIX 3) don't define it, and some systems # (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined. # Define EOVERFLOW as a C macro and as a substituted macro in such a way that # 1. on all systems, after inclusion of , EOVERFLOW is usable, # 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric # value. AC_DEFUN([gl_EOVERFLOW], [ AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [ AC_EGREP_CPP(yes,[ #include #ifdef EOVERFLOW yes #endif ], have_eoverflow=1) if test -n "$have_eoverflow"; then dnl EOVERFLOW exists in . Don't need to define EOVERFLOW ourselves. ac_cv_decl_EOVERFLOW=yes else AC_EGREP_CPP(yes,[ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef EOVERFLOW yes #endif ], have_eoverflow=1) if test -n "$have_eoverflow"; then dnl EOVERFLOW exists but is hidden. dnl Define it to the same value. _AC_COMPUTE_INT([EOVERFLOW], ac_cv_decl_EOVERFLOW, [ #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ #include #include ]) else dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but dnl don't define it as EINVAL, because snprintf() callers want to dnl distinguish EINVAL and EOVERFLOW. ac_cv_decl_EOVERFLOW=E2BIG fi fi ]) if test "$ac_cv_decl_EOVERFLOW" != yes; then AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW], [Define as good substitute value for EOVERFLOW.]) EOVERFLOW="$ac_cv_decl_EOVERFLOW" AC_SUBST(EOVERFLOW) fi ]) microdc2-0.15.6/m4/error.m40100644000076500007500000000103410516626545015275 0ustar chugunovmicrodc#serial 11 # Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_ERROR], [ AC_FUNC_ERROR_AT_LINE dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]). gl_PREREQ_ERROR ]) # Prerequisites of lib/error.c. AC_DEFUN([gl_PREREQ_ERROR], [ AC_REQUIRE([AC_FUNC_STRERROR_R]) : ]) microdc2-0.15.6/m4/exitfail.m40100644000076500007500000000065210516626545015756 0ustar chugunovmicrodc# exitfail.m4 serial 5 dnl Copyright (C) 2002, 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. AC_DEFUN([gl_EXITFAIL], [ AC_LIBSOURCES([exitfail.c, exitfail.h]) AC_LIBOBJ([exitfail]) dnl No prerequisites of lib/exitfail.c. : ]) microdc2-0.15.6/m4/extensions.m40100644000076500007500000000163710516626545016354 0ustar chugunovmicrodc# Enable extensions on systems that normally disable them. # Copyright (C) 2003 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # gl_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [ AC_BEFORE([$0], [AC_COMPILE_IFELSE]) AC_BEFORE([$0], [AC_RUN_IFELSE]) AC_REQUIRE([AC_GNU_SOURCE]) AC_REQUIRE([AC_AIX]) AC_REQUIRE([AC_MINIX]) AH_VERBATIM([__EXTENSIONS__], [/* Enable extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif]) AC_DEFINE([__EXTENSIONS__]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) ]) microdc2-0.15.6/m4/fnmatch.m40100644000076500007500000000726310516626545015576 0ustar chugunovmicrodc# Check for fnmatch. # This is a modified version of autoconf's AC_FUNC_FNMATCH. # This file should be simplified after Autoconf 2.57 is required. # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE) # ------------------------------------------------------------------------- # If a STANDARD compliant fnmatch is found, run IF-TRUE, otherwise # IF-FALSE. Use CACHE_VAR. AC_DEFUN([_AC_FUNC_FNMATCH_IF], [AC_CACHE_CHECK( [for working $1 fnmatch], [$2], [dnl Some versions of Solaris, SCO, and the GNU C Library dnl have a broken or incompatible fnmatch. dnl So we run a test program. If we are cross-compiling, take no chance. dnl Thanks to John Oleynick, François Pinard, and Paul Eggert for this test. AC_RUN_IFELSE( [AC_LANG_PROGRAM( [ # include # include # define y(a, b, c) (fnmatch (a, b, c) == 0) # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH) static int fnm (char const *pattern, char const *string, int flags) { return fnmatch (pattern, string, flags); } ], [exit (!((fnm ? fnm : fnmatch) ("a*", "", 0) == FNM_NOMATCH && y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) && n ("a\\\\bc", "abc", FNM_NOESCAPE) && y ("*x", ".x", 0) && n ("*x", ".x", FNM_PERIOD) && m4_if([$1], [GNU], [y ("xxXX", "xXxX", FNM_CASEFOLD) && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH) && n ("d*/*1", "d/s/1", FNM_FILE_NAME) && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR) && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR) && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)], 1)));])], [$2=yes], [$2=no], [$2=cross])]) AS_IF([test $$2 = yes], [$3], [$4]) ])# _AC_FUNC_FNMATCH_IF # _AC_LIBOBJ_FNMATCH # ------------------ # Prepare the replacement of fnmatch. AC_DEFUN([_AC_LIBOBJ_FNMATCH], [AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl AC_CHECK_DECLS([getenv]) AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmemchr wmemcpy wmempcpy]) AC_CHECK_HEADERS([wchar.h wctype.h]) AC_LIBOBJ([fnmatch]) FNMATCH_H=fnmatch.h ])# _AC_LIBOBJ_FNMATCH AC_DEFUN([gl_FUNC_FNMATCH_POSIX], [ FNMATCH_H= _AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_posix], [rm -f lib/fnmatch.h], [_AC_LIBOBJ_FNMATCH]) if test $ac_cv_func_fnmatch_posix != yes; then dnl We must choose a different name for our function, since on ELF systems dnl a broken fnmatch() in libc.so would override our fnmatch() if it is dnl compiled into a shared library. AC_DEFINE([fnmatch], [posix_fnmatch], [Define to a replacement function name for fnmatch().]) fi AC_SUBST([FNMATCH_H]) ]) AC_DEFUN([gl_FUNC_FNMATCH_GNU], [ dnl Persuade glibc to declare FNM_CASEFOLD etc. AC_REQUIRE([AC_GNU_SOURCE]) FNMATCH_H= _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu], [rm -f lib/fnmatch.h], [_AC_LIBOBJ_FNMATCH]) if test $ac_cv_func_fnmatch_gnu != yes; then dnl We must choose a different name for our function, since on ELF systems dnl a broken fnmatch() in libc.so would override our fnmatch() if it is dnl compiled into a shared library. AC_DEFINE([fnmatch], [gnu_fnmatch], [Define to a replacement function name for fnmatch().]) fi AC_SUBST([FNMATCH_H]) ]) microdc2-0.15.6/m4/free.m40100644000076500007500000000253110516626545015070 0ustar chugunovmicrodc# Check whether free (NULL) is supposed to work. # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Paul Eggert. # We can't test for free (NULL) even at runtime, since it might # happen to "work" for our test program, but not in general. So, be # conservative and use feature tests for relatively modern hosts, # where free (NULL) is known to work. This costs a bit of # performance on some older hosts, but we can fix that later if # needed. AC_DEFUN([gl_FUNC_FREE], [ AC_CACHE_CHECK([whether free (NULL) is known to work], [gl_cv_func_free], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[@%:@include ]], [[@%:@if _POSIX_VERSION < 199009L && \ (defined unix || defined _unix || defined _unix_ \ || defined __unix || defined __unix__) @%:@error "'free (NULL)' is not known to work" @%:@endif]])], [gl_cv_func_free=yes], [gl_cv_func_free=no])]) if test $gl_cv_func_free = no; then AC_LIBOBJ(free) AC_DEFINE(free, rpl_free, [Define to rpl_free if the replacement function should be used.]) fi ]) # Prerequisites of lib/free.c. AC_DEFUN([gl_PREREQ_FREE], [:]) microdc2-0.15.6/m4/getaddrinfo.m40100644000076500007500000000223510516626545016436 0ustar chugunovmicrodc# getaddrinfo.m4 serial 7 dnl Copyright (C) 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. AC_DEFUN([gl_GETADDRINFO], [ AC_SEARCH_LIBS(getaddrinfo, [nsl socket]) AC_SEARCH_LIBS(gethostbyname, [inet nsl]) AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet]) AC_REPLACE_FUNCS(getaddrinfo gai_strerror) gl_PREREQ_GETADDRINFO ]) # Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c. AC_DEFUN([gl_PREREQ_GETADDRINFO], [ AC_REQUIRE([gl_C_RESTRICT]) AC_REQUIRE([gl_SOCKET_FAMILIES]) AC_REQUIRE([AC_C_INLINE]) AC_REQUIRE([AC_GNU_SOURCE]) AC_CHECK_HEADERS_ONCE(netinet/in.h) AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror],,,[ /* sys/types.h is not needed according to POSIX, but the sys/socket.h in i386-unknown-freebsd4.10 and powerpc-apple-darwin5.5 required it. */ #include #include #include ]) AC_CHECK_TYPES([struct addrinfo],,,[ #include #include #include ]) ]) microdc2-0.15.6/m4/getdelim.m40100644000076500007500000000130210516626545015734 0ustar chugunovmicrodc# getdelim.m4 serial 1 dnl Copyright (C) 2005 Free Software dnl Foundation, Inc. dnl 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_PREREQ(2.52) AC_DEFUN([gl_FUNC_GETDELIM], [ AC_LIBSOURCES([getdelim.c, getdelim.h]) dnl Persuade glibc to declare getdelim(). AC_REQUIRE([AC_GNU_SOURCE]) AC_REPLACE_FUNCS(getdelim) AC_CHECK_DECLS_ONCE(getdelim) if test $ac_cv_func_getdelim = no; then gl_PREREQ_GETDELIM fi ]) # Prerequisites of lib/getdelim.c. AC_DEFUN([gl_PREREQ_GETDELIM], [ AC_CHECK_FUNCS([flockfile funlockfile]) ]) microdc2-0.15.6/m4/gethostname.m40100644000076500007500000000101210516626545016456 0ustar chugunovmicrodc# gethostname.m4 serial 2 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. AC_DEFUN([gl_FUNC_GETHOSTNAME], [ AC_REPLACE_FUNCS(gethostname) if test $ac_cv_func_gethostname = no; then gl_PREREQ_GETHOSTNAME fi ]) # Prerequisites of lib/gethostname.c. AC_DEFUN([gl_PREREQ_GETHOSTNAME], [ AC_CHECK_FUNCS(uname) ]) microdc2-0.15.6/m4/getline.m40100644000076500007500000000431610516626545015601 0ustar chugunovmicrodc# getline.m4 serial 13 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software dnl Foundation, Inc. dnl 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_PREREQ(2.52) dnl See if there's a working, system-supplied version of the getline function. dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems dnl have a function by that name in -linet that doesn't have anything dnl to do with the function we need. AC_DEFUN([gl_FUNC_GETLINE], [ AC_LIBSOURCES([getline.c, getline.h]) dnl Persuade glibc to declare getline(). AC_REQUIRE([AC_GNU_SOURCE]) AC_CHECK_DECLS([getline]) gl_getline_needs_run_time_check=no AC_CHECK_FUNC(getline, dnl Found it in some library. Verify that it works. gl_getline_needs_run_time_check=yes, am_cv_func_working_getline=no) if test $gl_getline_needs_run_time_check = yes; then AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline, [echo fooN |tr -d '\012'|tr N '\012' > conftest.data AC_TRY_RUN([ # include # include # include int main () { /* Based on a test program from Karl Heuer. */ char *line = NULL; size_t siz = 0; int len; FILE *in = fopen ("./conftest.data", "r"); if (!in) return 1; len = getline (&line, &siz, in); exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1); } ], am_cv_func_working_getline=yes dnl The library version works. , am_cv_func_working_getline=no dnl The library version does NOT work. , am_cv_func_working_getline=no dnl We're cross compiling. )]) fi if test $am_cv_func_working_getline = no; then dnl We must choose a different name for our function, since on ELF systems dnl a broken getline() in libc.so would override our getline() in dnl libgettextlib.so. AC_DEFINE([getline], [gnu_getline], [Define to a replacement function name for getline().]) AC_LIBOBJ(getline) gl_PREREQ_GETLINE fi ]) # Prerequisites of lib/getline.c. AC_DEFUN([gl_PREREQ_GETLINE], [ gl_FUNC_GETDELIM ]) microdc2-0.15.6/m4/getopt.m40100644000076500007500000000465510516626545015462 0ustar chugunovmicrodc# getopt.m4 serial 11 dnl Copyright (C) 2002, 2003, 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. # The getopt module assume you want GNU getopt, with getopt_long etc, # rather than vanilla POSIX getopt. This means your your code should # always include for the getopt prototypes. AC_DEFUN([gl_GETOPT_SUBSTITUTE], [ AC_LIBOBJ([getopt]) AC_LIBOBJ([getopt1]) gl_GETOPT_SUBSTITUTE_HEADER gl_PREREQ_GETOPT ]) AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER], [ GETOPT_H=getopt.h AC_DEFINE([__GETOPT_PREFIX], [[rpl_]], [Define to rpl_ if the getopt replacement functions and variables should be used.]) AC_SUBST([GETOPT_H]) ]) AC_DEFUN([gl_GETOPT_CHECK_HEADERS], [ if test -z "$GETOPT_H"; then AC_CHECK_HEADERS([getopt.h], [], [GETOPT_H=getopt.h]) fi if test -z "$GETOPT_H"; then AC_CHECK_FUNCS([getopt_long_only], [], [GETOPT_H=getopt.h]) fi dnl BSD getopt_long uses an incompatible method to reset option processing, dnl and (as of 2004-10-15) mishandles optional option-arguments. if test -z "$GETOPT_H"; then AC_CHECK_DECL([optreset], [GETOPT_H=getopt.h], [], [#include ]) fi dnl Solaris 10 getopt doesn't handle `+' as a leading character in an dnl option string (as of 2005-05-05). if test -z "$GETOPT_H"; then AC_CACHE_CHECK([for working GNU getopt function], [gl_cv_func_gnu_getopt], [AC_RUN_IFELSE( [AC_LANG_PROGRAM([#include ], [[ char *myargv[3]; myargv[0] = "conftest"; myargv[1] = "-+"; myargv[2] = 0; return getopt (2, myargv, "+a") != '?'; ]])], [gl_cv_func_gnu_getopt=yes], [gl_cv_func_gnu_getopt=no], [dnl cross compiling - pessimistically guess based on decls dnl Solaris 10 getopt doesn't handle `+' as a leading character in an dnl option string (as of 2005-05-05). AC_CHECK_DECL([getopt_clip], [gl_cv_func_gnu_getopt=no], [gl_cv_func_gnu_getopt=yes], [#include ])])]) if test "$gl_cv_func_gnu_getopt" = "no"; then GETOPT_H=getopt.h fi fi ]) AC_DEFUN([gl_GETOPT_IFELSE], [ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) AS_IF([test -n "$GETOPT_H"], [$1], [$2]) ]) AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])]) # Prerequisites of lib/getopt*. AC_DEFUN([gl_PREREQ_GETOPT], [:]) microdc2-0.15.6/m4/gettext.m40100644000076500007500000005166710516626545015651 0ustar chugunovmicrodc# 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], []) microdc2-0.15.6/m4/gnulib-cache.m40100644000076500007500000000300310516626545016463 0ustar chugunovmicrodc# Copyright (C) 2004 Free Software Foundation, Inc. # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # # This file represents the specification of how gnulib-tool is used. # It acts as a cache: It is written and read by gnulib-tool. # In projects using CVS, this file is meant to be stored in CVS, # like the configure.ac and various Makefile.am files. # Specification in the form of a command-line invocation: # gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --aux-dir=build-aux --macro-prefix=gl dirname fnmatch-gnu free full-read full-write getaddrinfo getline getopt gettext human iconv iconvme memmem minmax progname quote quotearg sig2str stdbool stdint stpcpy strftime strnlen version-etc xalloc xalloc-die xgethostname xstrndup xvasprintf # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_MODULES([dirname fnmatch-gnu free full-read full-write getaddrinfo getline getopt gettext human iconv iconvme memmem minmax progname quote quotearg sig2str stdbool stdint stpcpy strftime strnlen version-etc xalloc xalloc-die xgethostname xstrndup xvasprintf]) gl_AVOID([]) gl_SOURCE_BASE([lib]) gl_M4_BASE([m4]) gl_TESTS_BASE([test]) gl_LIB([libgnu]) gl_MACRO_PREFIX([gl]) microdc2-0.15.6/m4/gnulib-comp.m40100644000076500007500000001237310516626545016370 0ustar chugunovmicrodc# Copyright (C) 2004 Free Software Foundation, Inc. # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. # # This file represents the compiled summary of the specification in # gnulib-cache.m4. It lists the computed macro invocations that need # to be invoked from configure.ac. # In projects using CVS, this file can be treated like other built files. # This macro should be invoked from ./configure.ac, in the section # "Checks for programs", right after AC_PROG_CC, and certainly before # any checks for libraries, header files, types and library functions. AC_DEFUN([gl_EARLY], [ AC_REQUIRE([AC_GNU_SOURCE]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) ]) # This macro should be invoked from ./configure.ac, in the section # "Check for header files, types and library functions". AC_DEFUN([gl_INIT], [ gl_FUNC_ALLOCA gl_DIRNAME gl_ERROR gl_EXITFAIL dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac. # No macro. You should also use one of fnmatch-posix or fnmatch-gnu. gl_FUNC_FNMATCH_GNU gl_FUNC_FREE gl_GETADDRINFO gl_FUNC_GETDELIM gl_FUNC_GETHOSTNAME gl_FUNC_GETLINE gl_GETOPT dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. gl_HUMAN AM_ICONV gl_ICONVME gl_FUNC_MEMMEM gl_MINMAX gl_QUOTE gl_QUOTEARG gl_C_RESTRICT gl_SAFE_READ gl_SAFE_WRITE gl_FUNC_SIG2STR gl_SIZE_MAX gl_SOCKLEN_T gt_TYPE_SSIZE_T AM_STDBOOL_H gl_STDINT_H gl_FUNC_STPCPY gl_FUNC_STRDUP gl_FUNC_GNU_STRFTIME gl_FUNC_STRNDUP gl_FUNC_STRNLEN gl_FUNC_STRTOIMAX gl_FUNC_STRTOL gl_FUNC_STRTOLL gl_FUNC_STRTOUL gl_FUNC_STRTOULL gl_FUNC_STRTOUMAX gl_TIME_R gl_FUNC_VASNPRINTF gl_FUNC_VASPRINTF gl_XALLOC gl_XSIZE gl_XSTRNDUP gl_XSTRTOL gl_XSTRTOUMAX ]) # This macro records the list of files which have been installed by # gnulib-tool and may be removed by future gnulib-tool invocations. AC_DEFUN([gl_FILE_LIST], [ build-aux/config.rpath lib/alloca.c lib/alloca_.h lib/argmatch.c lib/argmatch.h lib/asnprintf.c lib/asprintf.c lib/basename.c lib/dirname.c lib/dirname.h lib/error.c lib/error.h lib/exit.h lib/exitfail.c lib/exitfail.h lib/fnmatch.c lib/fnmatch_.h lib/fnmatch_loop.c lib/free.c lib/full-read.c lib/full-read.h lib/full-write.c lib/full-write.h lib/gai_strerror.c lib/getaddrinfo.c lib/getaddrinfo.h lib/getdelim.c lib/getdelim.h lib/gethostname.c lib/getline.c lib/getline.h lib/getopt.c lib/getopt1.c lib/getopt_.h lib/getopt_int.h lib/gettext.h lib/human.c lib/human.h lib/iconvme.c lib/iconvme.h lib/intprops.h lib/memmem.c lib/memmem.h lib/minmax.h lib/printf-args.c lib/printf-args.h lib/printf-parse.c lib/printf-parse.h lib/progname.c lib/progname.h lib/quote.c lib/quote.h lib/quotearg.c lib/quotearg.h lib/safe-read.c lib/safe-read.h lib/safe-write.c lib/safe-write.h lib/sig2str.c lib/sig2str.h lib/size_max.h lib/stdbool_.h lib/stdint_.h lib/stpcpy.c lib/stpcpy.h lib/strdup.c lib/strdup.h lib/strftime.c lib/strftime.h lib/stripslash.c lib/strndup.c lib/strndup.h lib/strnlen.c lib/strnlen.h lib/strtoimax.c lib/strtol.c lib/strtoll.c lib/strtoul.c lib/strtoull.c lib/strtoumax.c lib/time_r.c lib/time_r.h lib/vasnprintf.c lib/vasnprintf.h lib/vasprintf.c lib/vasprintf.h lib/verify.h lib/version-etc.c lib/version-etc.h lib/xalloc-die.c lib/xalloc.h lib/xasprintf.c lib/xgethostname.c lib/xgethostname.h lib/xmalloc.c lib/xsize.h lib/xstrndup.c lib/xstrndup.h lib/xstrtol.c lib/xstrtol.h lib/xstrtoul.c lib/xstrtoumax.c lib/xvasprintf.c lib/xvasprintf.h m4/alloca.m4 m4/codeset.m4 m4/dirname.m4 m4/dos.m4 m4/eoverflow.m4 m4/error.m4 m4/exitfail.m4 m4/extensions.m4 m4/fnmatch.m4 m4/free.m4 m4/getaddrinfo.m4 m4/getdelim.m4 m4/gethostname.m4 m4/getline.m4 m4/getopt.m4 m4/gettext.m4 m4/glibc2.m4 m4/glibc21.m4 m4/human.m4 m4/iconv.m4 m4/iconvme.m4 m4/intdiv0.m4 m4/intmax.m4 m4/intmax_t.m4 m4/inttypes-pri.m4 m4/inttypes.m4 m4/inttypes_h.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/lib-prefix.m4 m4/longdouble.m4 m4/longlong.m4 m4/mbrtowc.m4 m4/mbstate_t.m4 m4/memmem.m4 m4/minmax.m4 m4/nls.m4 m4/onceonly_2_57.m4 m4/po.m4 m4/printf-posix.m4 m4/progtest.m4 m4/quote.m4 m4/quotearg.m4 m4/restrict.m4 m4/safe-read.m4 m4/safe-write.m4 m4/sig2str.m4 m4/signed.m4 m4/size_max.m4 m4/socklen.m4 m4/sockpfaf.m4 m4/ssize_t.m4 m4/stdbool.m4 m4/stdint.m4 m4/stdint_h.m4 m4/stpcpy.m4 m4/strdup.m4 m4/strerror_r.m4 m4/strftime.m4 m4/strndup.m4 m4/strnlen.m4 m4/strtoimax.m4 m4/strtol.m4 m4/strtoll.m4 m4/strtoul.m4 m4/strtoull.m4 m4/strtoumax.m4 m4/time_r.m4 m4/tm_gmtoff.m4 m4/uintmax_t.m4 m4/ulonglong.m4 m4/vasnprintf.m4 m4/vasprintf.m4 m4/wchar_t.m4 m4/wint_t.m4 m4/xalloc.m4 m4/xsize.m4 m4/xstrndup.m4 m4/xstrtol.m4 m4/xstrtoumax.m4 ]) microdc2-0.15.6/m4/human.m40100644000076500007500000000100410516626545015251 0ustar chugunovmicrodc#serial 9 dnl Copyright (C) 2002, 2003, 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. AC_DEFUN([gl_HUMAN], [ AC_LIBSOURCES([human.c, human.h, intprops.h]) AC_LIBOBJ([human]) dnl Prerequisites of lib/human.h. AC_REQUIRE([AM_STDBOOL_H]) AC_REQUIRE([gl_AC_TYPE_UINTMAX_T]) dnl Prerequisites of lib/human.c. : ]) microdc2-0.15.6/m4/iconv.m40100644000076500007500000000642610516626545015274 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/iconvme.m40100644000076500007500000000106310516626545015606 0ustar chugunovmicrodc# iconvme.m4 serial 1 dnl Copyright (C) 2004 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. AC_DEFUN([gl_ICONVME], [ gl_PREREQ_ICONVME ]) # Prerequisites of lib/iconvme.c. AC_DEFUN([gl_PREREQ_ICONVME], [ AC_REQUIRE([AM_ICONV]) ]) microdc2-0.15.6/m4/intmax_t.m40100644000076500007500000000373610516626545016002 0ustar chugunovmicrodc# intmax_t.m4 serial 4 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 intmax_t to 'long' or 'long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_INTMAX_T], [ dnl For simplicity, we assume that a header file defines 'intmax_t' if and dnl only if it defines '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_LONG_LONG]) test $ac_cv_type_long_long = yes \ && ac_type='long long' \ || ac_type='long' AC_DEFINE_UNQUOTED(intmax_t, $ac_type, [Define to long or long long if and don't define.]) else AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) fi ]) dnl An alternative would be to explicitly test for 'intmax_t'. AC_DEFUN([gt_AC_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 .]) else AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) test $ac_cv_type_long_long = yes \ && ac_type='long long' \ || ac_type='long' AC_DEFINE_UNQUOTED(intmax_t, $ac_type, [Define to long or long long if and don't define.]) fi ]) microdc2-0.15.6/m4/inttypes.m40100644000076500007500000000147210516626545016031 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/inttypes_h.m40100644000076500007500000000162310516626545016336 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/lib-ld.m40100644000076500007500000000653110516626545015316 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/lib-link.m40100644000076500007500000005562210516626545015661 0ustar chugunovmicrodc# lib-link.m4 serial 7 (gettext-0.15) 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], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 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/$acl_libdirstem" 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/$acl_libdirstem"; 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 */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` 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/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; 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 ]) microdc2-0.15.6/m4/lib-prefix.m40100644000076500007500000001503610516626545016214 0ustar chugunovmicrodc# lib-prefix.m4 serial 5 (gettext-0.15) 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_MULTILIB]) 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/$acl_libdirstem" 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/$acl_libdirstem"; 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/$acl_libdirstem"; 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" ]) dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing dnl the basename of the libdir, either "lib" or "lib64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. The current dnl practice is that on a system supporting 32-bit and 64-bit instruction dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit dnl libraries go under $prefix/lib. We determine the compiler's default dnl mode by looking at the compiler's library search path. If at least dnl of its elements ends in /lib64 or points to a directory whose absolute dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the dnl default, namely "lib". acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ]) microdc2-0.15.6/m4/longdouble.m40100644000076500007500000000205310516626545016300 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/longlong.m40100644000076500007500000000141610516626545015767 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/mbrtowc.m40100644000076500007500000000212510516626545015623 0ustar chugunovmicrodc# mbrtowc.m4 serial 8 dnl Copyright (C) 2001-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 From Paul Eggert dnl This file can be removed, and gl_FUNC_MBRTOWC replaced with dnl AC_FUNC_MBRTOWC, when autoconf 2.60 can be assumed everywhere. AC_DEFUN([gl_FUNC_MBRTOWC], [ dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60. AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared], gl_cv_func_mbrtowc, [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[wchar_t wc; char const s[] = ""; size_t n = 1; mbstate_t state; return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])], gl_cv_func_mbrtowc=yes, gl_cv_func_mbrtowc=no)]) if test $gl_cv_func_mbrtowc = yes; then AC_DEFINE([HAVE_MBRTOWC], 1, [Define to 1 if mbrtowc and mbstate_t are properly declared.]) fi ]) microdc2-0.15.6/m4/mbstate_t.m40100644000076500007500000000177610516626545016143 0ustar chugunovmicrodc# mbstate_t.m4 serial 9 dnl Copyright (C) 2000, 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. # From Paul Eggert. # BeOS 5 has but does not define mbstate_t, # so you can't declare an object of that type. # Check for this incompatibility with Standard C. # AC_TYPE_MBSTATE_T # ----------------- AC_DEFUN([AC_TYPE_MBSTATE_T], [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t, [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT # include ], [mbstate_t x; return sizeof x;])], [ac_cv_type_mbstate_t=yes], [ac_cv_type_mbstate_t=no])]) if test $ac_cv_type_mbstate_t = yes; then AC_DEFINE([HAVE_MBSTATE_T], 1, [Define to 1 if declares mbstate_t.]) else AC_DEFINE([mbstate_t], int, [Define to a type if does not define.]) fi]) microdc2-0.15.6/m4/memmem.m40100644000076500007500000000103610516626545015423 0ustar chugunovmicrodc# memmem.m4 serial 2 dnl Copyright (C) 2002, 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_FUNC_MEMMEM], [ dnl Persuade glibc to declare memmem(). AC_REQUIRE([AC_GNU_SOURCE]) AC_REPLACE_FUNCS(memmem) AC_CHECK_DECLS_ONCE(memmem) gl_PREREQ_MEMMEM ]) # Prerequisites of lib/memmem.c. AC_DEFUN([gl_PREREQ_MEMMEM], [:]) microdc2-0.15.6/m4/minmax.m40100644000076500007500000000233510516626545015442 0ustar chugunovmicrodc# minmax.m4 serial 2 dnl Copyright (C) 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. AC_PREREQ(2.52) AC_DEFUN([gl_MINMAX], [ AC_REQUIRE([gl_PREREQ_MINMAX]) ]) # Prerequisites of lib/minmax.h. AC_DEFUN([gl_PREREQ_MINMAX], [ gl_MINMAX_IN_HEADER([limits.h]) gl_MINMAX_IN_HEADER([sys/param.h]) ]) dnl gl_MINMAX_IN_HEADER(HEADER) dnl The parameter has to be a literal header name; it cannot be macro, dnl nor a shell variable. (Because autoheader collects only AC_DEFINE dnl invocations with a literal macro name.) AC_DEFUN([gl_MINMAX_IN_HEADER], [ m4_pushdef([header], AS_TR_SH([$1])) m4_pushdef([HEADER], AS_TR_CPP([$1])) AC_CACHE_CHECK([whether <$1> defines MIN and MAX], [gl_cv_minmax_in_]header, [AC_TRY_COMPILE([#include <$1> int x = MIN (42, 17);], [], [gl_cv_minmax_in_]header[=yes], [gl_cv_minmax_in_]header[=no])]) if test $gl_cv_minmax_in_[]header = yes; then AC_DEFINE([HAVE_MINMAX_IN_]HEADER, 1, [Define to 1 if <$1> defines the MIN and MAX macros.]) fi m4_popdef([HEADER]) m4_popdef([header]) ]) microdc2-0.15.6/m4/nls.m40100644000076500007500000000353010516626545014743 0ustar chugunovmicrodc# 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) ]) microdc2-0.15.6/m4/onceonly_2_57.m40100644000076500007500000000700110516626545016526 0ustar chugunovmicrodc# onceonly_2_57.m4 serial 3 dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl This file defines some "once only" variants of standard autoconf macros. dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC dnl The advantage is that the check for each of the headers/functions/decls dnl will be put only once into the 'configure' file. It keeps the size of dnl the 'configure' file down, and avoids redundant output when 'configure' dnl is run. dnl The drawback is that the checks cannot be conditionalized. If you write dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to dnl empty, and the check will be inserted before the body of the AC_DEFUNed dnl function. dnl This is like onceonly.m4, except that it uses diversions to named sections dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once, dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The dnl size reduction is ca. 9%. dnl Autoconf version 2.57 or newer is recommended. AC_PREREQ(2.57) # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of # AC_CHECK_HEADERS(HEADER1 HEADER2 ...). AC_DEFUN([AC_CHECK_HEADERS_ONCE], [ : AC_FOREACH([gl_HEADER_NAME], [$1], [ AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, [./-], [___])), [ m4_divert_text([INIT_PREPARE], [gl_header_list="$gl_header_list gl_HEADER_NAME"]) gl_HEADERS_EXPANSION AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])), [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.]) ]) AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME, [./-], [___]))) ]) ]) m4_define([gl_HEADERS_EXPANSION], [ m4_divert_text([DEFAULTS], [gl_header_list=]) AC_CHECK_HEADERS([$gl_header_list]) m4_define([gl_HEADERS_EXPANSION], []) ]) # AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of # AC_CHECK_FUNCS(FUNC1 FUNC2 ...). AC_DEFUN([AC_CHECK_FUNCS_ONCE], [ : AC_FOREACH([gl_FUNC_NAME], [$1], [ AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [ m4_divert_text([INIT_PREPARE], [gl_func_list="$gl_func_list gl_FUNC_NAME"]) gl_FUNCS_EXPANSION AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])), [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.]) ]) AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME])) ]) ]) m4_define([gl_FUNCS_EXPANSION], [ m4_divert_text([DEFAULTS], [gl_func_list=]) AC_CHECK_FUNCS([$gl_func_list]) m4_define([gl_FUNCS_EXPANSION], []) ]) # AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of # AC_CHECK_DECLS(DECL1, DECL2, ...). AC_DEFUN([AC_CHECK_DECLS_ONCE], [ : AC_FOREACH([gl_DECL_NAME], [$1], [ AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [ AC_CHECK_DECLS(m4_defn([gl_DECL_NAME])) ]) AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME])) ]) ]) microdc2-0.15.6/m4/po.m40100644000076500007500000004364310516626545014576 0ustar chugunovmicrodc# 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" <, 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 ]) microdc2-0.15.6/m4/quote.m40100644000076500007500000000063610516626545015310 0ustar chugunovmicrodc# quote.m4 serial 4 dnl Copyright (C) 2002, 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. AC_DEFUN([gl_QUOTE], [ AC_LIBSOURCES([quote.c, quote.h]) AC_LIBOBJ([quote]) dnl Prerequisites of lib/quote.c. dnl (none) ]) microdc2-0.15.6/m4/quotearg.m40100644000076500007500000000103310516626545015772 0ustar chugunovmicrodc# quotearg.m4 serial 4 dnl Copyright (C) 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. AC_DEFUN([gl_QUOTEARG], [ AC_LIBSOURCES([quotearg.c, quotearg.h]) AC_LIBOBJ([quotearg]) dnl Prerequisites of lib/quotearg.c. AC_CHECK_HEADERS_ONCE(wchar.h wctype.h) AC_CHECK_FUNCS_ONCE(iswprint mbsinit) AC_TYPE_MBSTATE_T gl_FUNC_MBRTOWC ]) microdc2-0.15.6/m4/restrict.m40100644000076500007500000000305310516626545016006 0ustar chugunovmicrodc#serial 1003 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. # This macro can be removed once we can rely on Autoconf 2.57a or later, # since we can then use its AC_C_RESTRICT. # gl_C_RESTRICT # -------------- # Determine whether the C/C++ compiler supports the "restrict" keyword # introduced in ANSI C99, or an equivalent. Do nothing if the compiler # accepts it. Otherwise, if the compiler supports an equivalent, # define "restrict" to be that. Here are some variants: # - GCC supports both __restrict and __restrict__ # - older DEC Alpha C compilers support only __restrict # - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C # Otherwise, define "restrict" to be empty. AC_DEFUN([gl_C_RESTRICT], [AC_CACHE_CHECK([for C/C++ restrict keyword], gl_cv_c_restrict, [gl_cv_c_restrict=no # Try the official restrict keyword, then gcc's __restrict, and # the less common variants. for ac_kw in restrict __restrict __restrict__ _Restrict; do AC_COMPILE_IFELSE([AC_LANG_SOURCE( [float * $ac_kw x;])], [gl_cv_c_restrict=$ac_kw; break]) done ]) case $gl_cv_c_restrict in restrict) ;; no) AC_DEFINE(restrict,, [Define to equivalent of C99 restrict keyword, or to nothing if this is not supported. Do not define if restrict is supported directly.]) ;; *) AC_DEFINE_UNQUOTED(restrict, $gl_cv_c_restrict) ;; esac ]) microdc2-0.15.6/m4/safe-read.m40100644000076500007500000000100010516626545015764 0ustar chugunovmicrodc# safe-read.m4 serial 4 dnl Copyright (C) 2002-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. AC_DEFUN([gl_SAFE_READ], [ AC_LIBSOURCES([safe-read.c, safe-read.h]) AC_LIBOBJ([safe-read]) gl_PREREQ_SAFE_READ ]) # Prerequisites of lib/safe-read.c. AC_DEFUN([gl_PREREQ_SAFE_READ], [ AC_REQUIRE([gt_TYPE_SSIZE_T]) ]) microdc2-0.15.6/m4/safe-write.m40100644000076500007500000000077110516626545016221 0ustar chugunovmicrodc# safe-write.m4 serial 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. AC_DEFUN([gl_SAFE_WRITE], [ AC_LIBSOURCES([safe-write.c, safe-write.h]) AC_LIBOBJ([safe-write]) gl_PREREQ_SAFE_WRITE ]) # Prerequisites of lib/safe-write.c. AC_DEFUN([gl_PREREQ_SAFE_WRITE], [ gl_PREREQ_SAFE_READ ]) microdc2-0.15.6/m4/sig2str.m40100644000076500007500000000101110516626545015534 0ustar chugunovmicrodc#serial 4 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. AC_DEFUN([gl_FUNC_SIG2STR], [ AC_LIBSOURCES([sig2str.c, sig2str.h, intprops.h]) AC_REPLACE_FUNCS(sig2str) if test $ac_cv_func_sig2str = no; then gl_PREREQ_SIG2STR fi ]) # Prerequisites of lib/sig2str.c. AC_DEFUN([gl_PREREQ_SIG2STR], [ : ]) microdc2-0.15.6/m4/signed.m40100644000076500007500000000115410516626545015420 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/size_max.m40100644000076500007500000000370510516626545015772 0ustar chugunovmicrodc# size_max.m4 serial 3 dnl Copyright (C) 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 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)~(size_t)0 / 10], res_hi, [#include ], result=?) _AC_COMPUTE_INT([(size_t)~(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)~(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 ]) microdc2-0.15.6/m4/socklen.m40100644000076500007500000000115510516626545015606 0ustar chugunovmicrodc# socklen.m4 serial 1 dnl Copyright (C) 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 Simon Josefsson. AC_DEFUN([gl_SOCKLEN_T], [ AC_CHECK_HEADERS_ONCE(sys/types.h sys/socket.h) AC_CHECK_TYPE([socklen_t],, [AC_DEFINE([socklen_t], [int], [Map `socklen_t' to `int' if it is missing.])], [ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif) ]) ]) microdc2-0.15.6/m4/sockpfaf.m40100644000076500007500000000271110516626545015743 0ustar chugunovmicrodc# sockpfaf.m4 serial 2 dnl Copyright (C) 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 Test for some common socket protocol families (PF_INET, PF_INET6, ...) dnl and some common address families (AF_INET, AF_INET6, ...). dnl This test assumes that a system supports an address family if and only if dnl it supports the corresponding protocol family. dnl From Bruno Haible. AC_DEFUN([gl_SOCKET_FAMILIES], [ AC_MSG_CHECKING(for IPv4 sockets) AC_CACHE_VAL(gl_cv_socket_ipv4, [AC_TRY_COMPILE([#include #include #include ], [int x = AF_INET; struct in_addr y; struct sockaddr_in z;], gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) AC_MSG_RESULT($gl_cv_socket_ipv4) if test $gl_cv_socket_ipv4 = yes; then AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if defines AF_INET.]) fi AC_MSG_CHECKING(for IPv6 sockets) AC_CACHE_VAL(gl_cv_socket_ipv6, [AC_TRY_COMPILE([#include #include #include ], [int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;], gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) AC_MSG_RESULT($gl_cv_socket_ipv6) if test $gl_cv_socket_ipv6 = yes; then AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if defines AF_INET6.]) fi ]) microdc2-0.15.6/m4/ssize_t.m40100644000076500007500000000131710516626545015630 0ustar chugunovmicrodc# ssize_t.m4 serial 3 (gettext-0.13) dnl Copyright (C) 2001-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 ssize_t is defined. AC_DEFUN([gt_TYPE_SSIZE_T], [ AC_CACHE_CHECK([for ssize_t], gt_cv_ssize_t, [AC_TRY_COMPILE([#include ], [int x = sizeof (ssize_t *) + sizeof (ssize_t);], gt_cv_ssize_t=yes, gt_cv_ssize_t=no)]) if test $gt_cv_ssize_t = no; then AC_DEFINE(ssize_t, int, [Define as a signed type of the same size as size_t.]) fi ]) microdc2-0.15.6/m4/stdbool.m40100644000076500007500000000447110516626545015622 0ustar chugunovmicrodc# Check for stdbool.h that conforms to C99. 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. # Prepare for substituting if it is not supported. AC_DEFUN([AM_STDBOOL_H], [ AC_REQUIRE([AC_HEADER_STDBOOL]) # Define two additional variables used in the Makefile substitution. if test "$ac_cv_header_stdbool_h" = yes; then STDBOOL_H='' else STDBOOL_H='stdbool.h' fi AC_SUBST([STDBOOL_H]) if test "$ac_cv_type__Bool" = yes; then HAVE__BOOL=1 else HAVE__BOOL=0 fi AC_SUBST([HAVE__BOOL]) ]) # AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) # This macro is only needed in autoconf <= 2.59. Newer versions of autoconf # have this macro built-in. AC_DEFUN([AC_HEADER_STDBOOL], [AC_CACHE_CHECK([for stdbool.h that conforms to C99], [ac_cv_header_stdbool_h], [AC_TRY_COMPILE( [ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) -0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) -0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; ], [ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l + !m + !n + !o + !p); ], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) if test $ac_cv_header_stdbool_h = yes; then AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) fi]) microdc2-0.15.6/m4/stdint.m40100644000076500007500000000371110516626545015455 0ustar chugunovmicrodc# stdint.m4 serial 4 dnl Copyright (C) 2001-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 From Bruno Haible. dnl Test whether is supported or must be substituted. AC_DEFUN([gl_STDINT_H], [dnl Check for . AC_REQUIRE([gt_HEADER_INTTYPES_H]) dnl Check for . AC_CHECK_HEADERS([sys/inttypes.h]) AC_MSG_CHECKING([for stdint.h]) AC_CACHE_VAL(gl_cv_header_stdint_h, [ AC_TRY_COMPILE([#include ], [], gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)]) AC_MSG_RESULT([$gl_cv_header_stdint_h]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE(HAVE_STDINT_H, 1, [Define if you have a working header file.]) STDINT_H='' else STDINT_H='stdint.h' dnl Is long == int64_t ? AC_CACHE_CHECK([whether 'long' is 64 bit wide], gl_cv_long_bitsize_64, [ AC_TRY_COMPILE([ #define POW63 ((((((long) 1 << 15) << 15) << 15) << 15) << 3) #define POW64 ((((((long) 1 << 15) << 15) << 15) << 15) << 4) typedef int array [2 * (POW63 != 0 && POW64 == 0) - 1]; ], , gl_cv_long_bitsize_64=yes, gl_cv_long_bitsize_64=no)]) if test $gl_cv_long_bitsize_64 = yes; then HAVE_LONG_64BIT=1 else HAVE_LONG_64BIT=0 fi AC_SUBST(HAVE_LONG_64BIT) dnl Is long long == int64_t ? AC_CACHE_CHECK([whether 'long long' is 64 bit wide], gl_cv_longlong_bitsize_64, [ AC_TRY_COMPILE([ #define POW63 ((((((long long) 1 << 15) << 15) << 15) << 15) << 3) #define POW64 ((((((long long) 1 << 15) << 15) << 15) << 15) << 4) typedef int array [2 * (POW63 != 0 && POW64 == 0) - 1]; ], , gl_cv_longlong_bitsize_64=yes, gl_cv_longlong_bitsize_64=no)]) if test $gl_cv_longlong_bitsize_64 = yes; then HAVE_LONG_LONG_64BIT=1 else HAVE_LONG_LONG_64BIT=0 fi AC_SUBST(HAVE_LONG_LONG_64BIT) fi AC_SUBST(STDINT_H) ]) microdc2-0.15.6/m4/stdint_h.m40100644000076500007500000000157310516626545015770 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/stpcpy.m40100644000076500007500000000105010516626545015464 0ustar chugunovmicrodc# stpcpy.m4 serial 1 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. AC_DEFUN([gl_FUNC_STPCPY], [ dnl Persuade glibc to declare stpcpy(). AC_REQUIRE([AC_GNU_SOURCE]) AC_REPLACE_FUNCS(stpcpy) if test $ac_cv_func_stpcpy = no; then gl_PREREQ_STPCPY fi ]) # Prerequisites of lib/stpcpy.c. AC_DEFUN([gl_PREREQ_STPCPY], [ : ]) microdc2-0.15.6/m4/strdup.m40100644000076500007500000000076710516626545015501 0ustar chugunovmicrodc# strdup.m4 serial 6 dnl Copyright (C) 2002, 2003, 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. AC_DEFUN([gl_FUNC_STRDUP], [ AC_LIBSOURCES([strdup.c, strdup.h]) AC_REPLACE_FUNCS(strdup) AC_CHECK_DECLS_ONCE(strdup) gl_PREREQ_STRDUP ]) # Prerequisites of lib/strdup.c. AC_DEFUN([gl_PREREQ_STRDUP], [:]) microdc2-0.15.6/m4/strftime.m40100644000076500007500000000210510516626545016001 0ustar chugunovmicrodc#serial 25 # Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Written by Jim Meyering and Paul Eggert. AC_DEFUN([gl_FUNC_GNU_STRFTIME], [AC_REQUIRE([gl_FUNC_STRFTIME])dnl AC_REQUIRE([AC_C_CONST])dnl ]) # These are the prerequisite macros for GNU's strftime.c replacement. AC_DEFUN([gl_FUNC_STRFTIME], [ AC_LIBSOURCES([strftime.c, strftime.h]) AC_LIBOBJ([strftime]) # strftime.c uses the underyling system strftime if it exists. AC_REQUIRE([AC_FUNC_STRFTIME]) # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE. AC_REQUIRE([AC_STRUCT_TIMEZONE]) AC_REQUIRE([AC_HEADER_TIME]) AC_REQUIRE([AC_TYPE_MBSTATE_T]) AC_REQUIRE([gl_TM_GMTOFF]) AC_CHECK_FUNCS_ONCE(mblen mbrlen mempcpy tzset) AC_CHECK_HEADERS_ONCE(sys/time.h wchar.h) AC_DEFINE([my_strftime], [nstrftime], [Define to the name of the strftime replacement function.]) ]) microdc2-0.15.6/m4/strndup.m40100644000076500007500000000114010516626545015641 0ustar chugunovmicrodc# strndup.m4 serial 5 dnl Copyright (C) 2002, 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. AC_DEFUN([gl_FUNC_STRNDUP], [ AC_LIBSOURCES([strndup.c, strndup.h]) dnl Persuade glibc to declare strndup(). AC_REQUIRE([AC_GNU_SOURCE]) AC_REPLACE_FUNCS(strndup) if test $ac_cv_func_strndup = no; then gl_PREREQ_STRNDUP fi ]) # Prerequisites of lib/strndup.c. AC_DEFUN([gl_PREREQ_STRNDUP], [:]) microdc2-0.15.6/m4/strnlen.m40100644000076500007500000000163710516626545015642 0ustar chugunovmicrodc# strnlen.m4 serial 5 dnl Copyright (C) 2002-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. AC_DEFUN([gl_FUNC_STRNLEN], [ AC_LIBSOURCES([strnlen.c, strnlen.h]) dnl Persuade glibc to declare strnlen(). AC_REQUIRE([AC_GNU_SOURCE]) AC_FUNC_STRNLEN if test $ac_cv_func_strnlen_working = no; then # This is necessary because automake-1.6.1 doens't understand # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. #AC_LIBOBJ(strnlen) AC_DEFINE(strnlen, rpl_strnlen, [Define to rpl_strnlen if the replacement function should be used.]) gl_PREREQ_STRNLEN fi ]) # Prerequisites of lib/strnlen.c. AC_DEFUN([gl_PREREQ_STRNLEN], [ AC_CHECK_DECLS_ONCE(strnlen) ]) microdc2-0.15.6/m4/strtoimax.m40100644000076500007500000000206310516626545016201 0ustar chugunovmicrodc# strtoimax.m4 serial 5 dnl Copyright (C) 2002, 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_FUNC_STRTOIMAX], [ dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([AC_PROG_EGREP]) AC_CACHE_CHECK([whether defines strtoimax as a macro], jm_cv_func_strtoimax_macro, [AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include #ifdef strtoimax inttypes_h_defines_strtoimax #endif], jm_cv_func_strtoimax_macro=yes, jm_cv_func_strtoimax_macro=no)]) if test "$jm_cv_func_strtoimax_macro" != yes; then AC_REPLACE_FUNCS(strtoimax) if test $ac_cv_func_strtoimax = no; then gl_PREREQ_STRTOIMAX fi fi ]) # Prerequisites of lib/strtoimax.c. AC_DEFUN([gl_PREREQ_STRTOIMAX], [ gl_AC_TYPE_INTMAX_T AC_CHECK_DECLS(strtoll) AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) ]) microdc2-0.15.6/m4/strtol.m40100644000076500007500000000102310516626545015471 0ustar chugunovmicrodc# strtol.m4 serial 3 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. AC_DEFUN([gl_FUNC_STRTOL], [ AC_REPLACE_FUNCS(strtol) if test $ac_cv_func_strtol = no; then gl_PREREQ_STRTOL fi ]) # Prerequisites of lib/strtol.c. AC_DEFUN([gl_PREREQ_STRTOL], [ AC_REQUIRE([AC_HEADER_STDC]) AC_CHECK_FUNCS_ONCE(isascii) ]) microdc2-0.15.6/m4/strtoll.m40100644000076500007500000000125210516626545015651 0ustar chugunovmicrodc# strtoll.m4 serial 3 dnl Copyright (C) 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. AC_DEFUN([gl_FUNC_STRTOLL], [ dnl We don't need (and can't compile) the replacement strtoll dnl unless the type 'long long' exists. AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) if test "$ac_cv_type_long_long" = yes; then AC_REPLACE_FUNCS(strtoll) if test $ac_cv_func_strtoll = no; then gl_PREREQ_STRTOLL fi fi ]) # Prerequisites of lib/strtoll.c. AC_DEFUN([gl_PREREQ_STRTOLL], [ : ]) microdc2-0.15.6/m4/strtoul.m40100644000076500007500000000075110516626545015665 0ustar chugunovmicrodc# strtoul.m4 serial 2 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. AC_DEFUN([gl_FUNC_STRTOUL], [ AC_REPLACE_FUNCS(strtoul) if test $ac_cv_func_strtoul = no; then gl_PREREQ_STRTOUL fi ]) # Prerequisites of lib/strtoul.c. AC_DEFUN([gl_PREREQ_STRTOUL], [ gl_PREREQ_STRTOL ]) microdc2-0.15.6/m4/strtoull.m40100644000076500007500000000131510516626545016036 0ustar chugunovmicrodc# strtoull.m4 serial 3 dnl Copyright (C) 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. AC_DEFUN([gl_FUNC_STRTOULL], [ dnl We don't need (and can't compile) the replacement strtoull dnl unless the type 'unsigned long long' exists. AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) if test "$ac_cv_type_unsigned_long_long" = yes; then AC_REPLACE_FUNCS(strtoull) if test $ac_cv_func_strtoull = no; then gl_PREREQ_STRTOULL fi fi ]) # Prerequisites of lib/strtoull.c. AC_DEFUN([gl_PREREQ_STRTOULL], [ : ]) microdc2-0.15.6/m4/strtoumax.m40100644000076500007500000000207610516626545016221 0ustar chugunovmicrodc# strtoumax.m4 serial 5 dnl Copyright (C) 2002, 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_FUNC_STRTOUMAX], [ dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([AC_PROG_EGREP]) AC_CACHE_CHECK([whether defines strtoumax as a macro], jm_cv_func_strtoumax_macro, [AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include #ifdef strtoumax inttypes_h_defines_strtoumax #endif], jm_cv_func_strtoumax_macro=yes, jm_cv_func_strtoumax_macro=no)]) if test "$jm_cv_func_strtoumax_macro" != yes; then AC_REPLACE_FUNCS(strtoumax) if test $ac_cv_func_strtoumax = no; then gl_PREREQ_STRTOUMAX fi fi ]) # Prerequisites of lib/strtoumax.c. AC_DEFUN([gl_PREREQ_STRTOUMAX], [ gl_AC_TYPE_UINTMAX_T AC_CHECK_DECLS(strtoull) AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) ]) microdc2-0.15.6/m4/time_r.m40100644000076500007500000000226510516626545015432 0ustar chugunovmicrodcdnl Reentrant time functions like localtime_r. 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 Written by Paul Eggert. AC_DEFUN([gl_TIME_R], [ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_C_RESTRICT]) AC_CACHE_CHECK([whether localtime_r is compatible with its POSIX signature], [gl_cv_time_r_posix], [AC_TRY_COMPILE( [#include ], [/* We don't need to append 'restrict's to the argument types, even though the POSIX signature has the 'restrict's, since C99 says they can't affect type compatibility. */ struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;], [gl_cv_time_r_posix=yes], [gl_cv_time_r_posix=no])]) if test $gl_cv_time_r_posix = yes; then AC_DEFINE([HAVE_TIME_R_POSIX], 1, [Define to 1 if localtime_r, etc. have the type signatures that POSIX requires.]) else AC_LIBOBJ([time_r]) gl_PREREQ_TIME_R fi ]) # Prerequisites of lib/time_r.c. AC_DEFUN([gl_PREREQ_TIME_R], [ : ]) microdc2-0.15.6/m4/tm_gmtoff.m40100644000076500007500000000101610516626545016126 0ustar chugunovmicrodc# tm_gmtoff.m4 serial 2 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. AC_DEFUN([gl_TM_GMTOFF], [ AC_CHECK_MEMBER([struct tm.tm_gmtoff], [AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if struct tm has the tm_gmtoff member.])], , [#include ]) ]) microdc2-0.15.6/m4/uintmax_t.m40100644000076500007500000000207610516626545016163 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/ulonglong.m40100644000076500007500000000161510516626545016155 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/vasnprintf.m40100644000076500007500000000300610516626545016337 0ustar chugunovmicrodc# vasnprintf.m4 serial 5 dnl Copyright (C) 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. AC_DEFUN([gl_FUNC_VASNPRINTF], [ AC_REQUIRE([gl_EOVERFLOW]) AC_REPLACE_FUNCS(vasnprintf) if test $ac_cv_func_vasnprintf = no; then AC_LIBOBJ(printf-args) AC_LIBOBJ(printf-parse) AC_LIBOBJ(asnprintf) gl_PREREQ_PRINTF_ARGS gl_PREREQ_PRINTF_PARSE gl_PREREQ_VASNPRINTF gl_PREREQ_ASNPRINTF fi ]) # Prequisites of lib/printf-args.h, lib/printf-args.c. AC_DEFUN([gl_PREREQ_PRINTF_ARGS], [ AC_REQUIRE([bh_C_SIGNED]) AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) AC_REQUIRE([gt_TYPE_LONGDOUBLE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) ]) # Prequisites of lib/printf-parse.h, lib/printf-parse.c. AC_DEFUN([gl_PREREQ_PRINTF_PARSE], [ AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) AC_REQUIRE([gt_TYPE_LONGDOUBLE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_REQUIRE([AC_TYPE_SIZE_T]) AC_CHECK_TYPES(ptrdiff_t) AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) ]) # Prerequisites of lib/vasnprintf.c. AC_DEFUN([gl_PREREQ_VASNPRINTF], [ AC_REQUIRE([AC_FUNC_ALLOCA]) AC_REQUIRE([gl_AC_TYPE_LONG_LONG]) AC_REQUIRE([gt_TYPE_LONGDOUBLE]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) AC_CHECK_FUNCS(snprintf wcslen) ]) # Prerequisites of lib/asnprintf.c. AC_DEFUN([gl_PREREQ_ASNPRINTF], [ ]) microdc2-0.15.6/m4/vasprintf.m40100644000076500007500000000114010516626545016156 0ustar chugunovmicrodc# vasprintf.m4 serial 1 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. AC_DEFUN([gl_FUNC_VASPRINTF], [ AC_REPLACE_FUNCS(vasprintf) if test $ac_cv_func_vasprintf = no; then AC_LIBOBJ(asprintf) gl_PREREQ_VASPRINTF gl_PREREQ_ASPRINTF fi ]) # Prerequisites of lib/vasprintf.c. AC_DEFUN([gl_PREREQ_VASPRINTF], [ ]) # Prerequisites of lib/asprintf.c. AC_DEFUN([gl_PREREQ_ASPRINTF], [ ]) microdc2-0.15.6/m4/wchar_t.m40100644000076500007500000000132610516626545015577 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/wint_t.m40100644000076500007500000000130410516626545015450 0ustar chugunovmicrodc# 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 ]) microdc2-0.15.6/m4/xalloc.m40100644000076500007500000000112010516626545015422 0ustar chugunovmicrodc# xalloc.m4 serial 12 dnl Copyright (C) 2002, 2003, 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. AC_DEFUN([gl_XALLOC], [ AC_LIBSOURCES([xmalloc.c, xalloc.h]) AC_LIBOBJ([xmalloc]) gl_PREREQ_XALLOC gl_PREREQ_XMALLOC ]) # Prerequisites of lib/xalloc.h. AC_DEFUN([gl_PREREQ_XALLOC], [ : ]) # Prerequisites of lib/xmalloc.c. AC_DEFUN([gl_PREREQ_XMALLOC], [ AC_REQUIRE([AC_C_INLINE]) : ]) microdc2-0.15.6/m4/xsize.m40100644000076500007500000000064510516626545015315 0ustar chugunovmicrodc# 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) ]) microdc2-0.15.6/m4/xstrndup.m40100644000076500007500000000061610516626545016040 0ustar chugunovmicrodc# xstrndup.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. AC_DEFUN([gl_XSTRNDUP], [ gl_PREREQ_XSTRNDUP ]) # Prerequisites of lib/xstrndup.c. AC_DEFUN([gl_PREREQ_XSTRNDUP], [ : ]) microdc2-0.15.6/m4/xstrtol.m40100644000076500007500000000166210516626545015672 0ustar chugunovmicrodc#serial 7 dnl Copyright (C) 2002, 2003, 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. AC_DEFUN([gl_XSTRTOL], [ AC_LIBSOURCES([xstrtol.c, xstrtol.h, xstrtoul.c, intprops.h]) AC_LIBOBJ([xstrtol]) AC_LIBOBJ([xstrtoul]) AC_REQUIRE([gl_PREREQ_XSTRTOL]) AC_REQUIRE([gl_PREREQ_XSTRTOUL]) ]) # Prerequisites of lib/xstrtol.h. AC_DEFUN([gl_PREREQ_XSTRTOL_H], [ AC_REQUIRE([gl_AC_TYPE_INTMAX_T]) AC_REQUIRE([gl_AC_TYPE_UINTMAX_T]) ]) # Prerequisites of lib/xstrtol.c. AC_DEFUN([gl_PREREQ_XSTRTOL], [ AC_REQUIRE([gl_PREREQ_XSTRTOL_H]) AC_REQUIRE([AC_HEADER_STDC]) AC_CHECK_FUNCS_ONCE(isascii) AC_CHECK_DECLS([strtoimax, strtoumax]) ]) # Prerequisites of lib/xstrtoul.c. AC_DEFUN([gl_PREREQ_XSTRTOUL], [ AC_REQUIRE([gl_PREREQ_XSTRTOL]) ]) microdc2-0.15.6/m4/xstrtoumax.m40100644000076500007500000000074510516626545016412 0ustar chugunovmicrodc#serial 7 dnl Cloned from xstrtoimax.m4. Keep these files in sync. dnl Copyright (C) 1999, 2000, 2001, 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_XSTRTOUMAX], [ dnl Prerequisites of lib/xstrtoumax.c. AC_REQUIRE([gl_AC_TYPE_UINTMAX_T]) AC_REQUIRE([gl_PREREQ_XSTRTOL]) ]) microdc2-0.15.6/po/0040755000076500007500000000000010543546024013776 5ustar chugunovmicrodcmicrodc2-0.15.6/po/CVS/0040755000076500007500000000000010527341105014424 5ustar chugunovmicrodcmicrodc2-0.15.6/po/CVS/Root0100644000076500007500000000003610527341105015266 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/po/CVS/Repository0100644000076500007500000000001310527341105016515 0ustar chugunovmicrodcmicrodc/po microdc2-0.15.6/po/CVS/Entries0100644000076500007500000000236610527341105015764 0ustar chugunovmicrodc/ChangeLog/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /LINGUAS/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /Makefile.in.in/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /Makevars/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /POTFILES.in/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /Rules-quot/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /boldquot.sed/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /en@boldquot.header/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /en@quot.header/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /insert-header.sin/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /microdc.pot/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /pl.gmo/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /pl.po/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /quot.sed/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /remove-potcdate.sin/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /stamp-po/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /sv.gmo/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale /sv.po/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/po/CVS/Tag0100644000076500007500000000003010527341105015050 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/po/ChangeLog0100644000076500007500000000073610516626545015562 0ustar chugunovmicrodc2005-05-01 gettextize * Makefile.in.in: New file, from gettext-0.14.4. * Rules-quot: New file, from gettext-0.14.4. * boldquot.sed: New file, from gettext-0.14.4. * en@boldquot.header: New file, from gettext-0.14.4. * en@quot.header: New file, from gettext-0.14.4. * insert-header.sin: New file, from gettext-0.14.4. * quot.sed: New file, from gettext-0.14.4. * remove-potcdate.sin: New file, from gettext-0.14.4. * POTFILES.in: New file. microdc2-0.15.6/po/LINGUAS0100644000076500007500000000000610516626545015023 0ustar chugunovmicrodcpl sv microdc2-0.15.6/po/Makefile.in.in0100644000076500007500000003170710516626545016464 0ustar chugunovmicrodc# 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: microdc2-0.15.6/po/Makevars0100644000076500007500000000342410516626545015501 0ustar chugunovmicrodc# 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 = Oskar Liljeblad # 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 = $(PACKAGE_BUGREPORT) # 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 = microdc2-0.15.6/po/POTFILES.in0100644000076500007500000000466610516626545015573 0ustar chugunovmicrodc# List of source files which contain translatable strings. lib/alloca.c lib/alloca_.h lib/argmatch.c lib/argmatch.h lib/asnprintf.c lib/asprintf.c lib/basename.c lib/dirname.c lib/dirname.h lib/error.c lib/error.h lib/exit.h lib/exitfail.c lib/exitfail.h lib/fnmatch.c lib/fnmatch_.h lib/fnmatch_loop.c lib/free.c lib/full-read.c lib/full-read.h lib/full-write.c lib/full-write.h lib/gai_strerror.c lib/getaddrinfo.c lib/getaddrinfo.h lib/getdelim.c lib/getdelim.h lib/gethostname.c lib/getline.c lib/getline.h lib/getopt.c lib/getopt1.c lib/getopt_.h lib/getopt_int.h lib/gettext.h lib/human.c lib/human.h lib/iconvme.c lib/iconvme.h lib/intprops.h lib/memmem.c lib/memmem.h lib/minmax.h lib/printf-args.c lib/printf-args.h lib/printf-parse.c lib/printf-parse.h lib/progname.c lib/progname.h lib/quote.c lib/quote.h lib/quotearg.c lib/quotearg.h lib/safe-read.c lib/safe-read.h lib/safe-write.c lib/safe-write.h lib/sig2str.c lib/sig2str.h lib/size_max.h lib/stdbool_.h lib/stdint_.h lib/stpcpy.c lib/stpcpy.h lib/strdup.c lib/strdup.h lib/strftime.c lib/strftime.h lib/stripslash.c lib/strndup.c lib/strndup.h lib/strnlen.c lib/strnlen.h lib/strtoimax.c lib/strtol.c lib/strtoll.c lib/strtoul.c lib/strtoull.c lib/strtoumax.c lib/time_r.c lib/time_r.h lib/vasnprintf.c lib/vasnprintf.h lib/vasprintf.c lib/vasprintf.h lib/verify.h lib/version-etc.c lib/version-etc.h lib/xalloc-die.c lib/xalloc.h lib/xasprintf.c lib/xgethostname.c lib/xgethostname.h lib/xmalloc.c lib/xsize.h lib/xstrndup.c lib/xstrndup.h lib/xstrtol.c lib/xstrtol.h lib/xstrtoul.c lib/xstrtoumax.c lib/xvasprintf.c lib/xvasprintf.h src/command.c src/connection.c src/filelist-in.c src/fs.c src/hub.c src/huffman.c src/lookup.c src/main.c src/microdc.h src/screen.c src/search.c src/user.c src/util.c src/variables.c src/common/bksearch.c src/common/bksearch.h src/common/byteq.c src/common/byteq.h src/common/comparison.h src/common/error.c src/common/error.h src/common/hmap.c src/common/hmap.h src/common/intutil.c src/common/intutil.h src/common/minmaxonce.h src/common/msgq.c src/common/msgq.h src/common/optparser.c src/common/optparser.h src/common/ptrv.c src/common/ptrv.h src/common/quoting.c src/common/quoting.h src/common/range.c src/common/range.h src/common/strbuf.c src/common/strbuf.h src/common/strleftcmp.c src/common/strleftcmp.h src/common/substrcmp.c src/common/substrcmp.h src/common/swap.h src/common/tempdir.c src/common/tempdir.h src/common/tempfailure.h src/common/tmap.c src/common/tmap.h microdc2-0.15.6/po/Rules-quot0100644000076500007500000000337610516626545016016 0ustar chugunovmicrodc# 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 microdc2-0.15.6/po/boldquot.sed0100644000076500007500000000033110516626545016325 0ustar chugunovmicrodcs/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g s/“/“/g s/â€/â€/g s/‘/‘/g s/’/’/g microdc2-0.15.6/po/en@boldquot.header0100644000076500007500000000247110516626545017434 0ustar chugunovmicrodc# 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. # microdc2-0.15.6/po/en@quot.header0100644000076500007500000000226310516626545016572 0ustar chugunovmicrodc# 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. # microdc2-0.15.6/po/insert-header.sin0100644000076500007500000000124010516626545017244 0ustar chugunovmicrodc# 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 } microdc2-0.15.6/po/microdc.pot0100644000076500007500000011723210516626545016154 0ustar chugunovmicrodc# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Oskar Liljeblad # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: oskar@osk.mine.nu\n" "POT-Creation-Date: 2005-10-18 08:31+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: lib/argmatch.c:137 #, c-format msgid "invalid argument %s for %s" msgstr "" #: lib/argmatch.c:138 #, c-format msgid "ambiguous argument %s for %s" msgstr "" #: lib/argmatch.c:157 #, c-format msgid "Valid arguments are:" msgstr "" #: lib/error.c:121 msgid "Unknown system error" msgstr "" #: lib/gai_strerror.c:45 msgid "Address family for hostname not supported" msgstr "" #: lib/gai_strerror.c:46 msgid "Temporary failure in name resolution" msgstr "" #: lib/gai_strerror.c:47 msgid "Bad value for ai_flags" msgstr "" #: lib/gai_strerror.c:48 msgid "Non-recoverable failure in name resolution" msgstr "" #: lib/gai_strerror.c:49 msgid "ai_family not supported" msgstr "" #: lib/gai_strerror.c:50 msgid "Memory allocation failure" msgstr "" #: lib/gai_strerror.c:51 msgid "No address associated with hostname" msgstr "" #: lib/gai_strerror.c:52 msgid "Name or service not known" msgstr "" #: lib/gai_strerror.c:53 msgid "Servname not supported for ai_socktype" msgstr "" #: lib/gai_strerror.c:54 msgid "ai_socktype not supported" msgstr "" #: lib/gai_strerror.c:55 msgid "System error" msgstr "" #: lib/gai_strerror.c:57 msgid "Processing request in progress" msgstr "" #: lib/gai_strerror.c:58 msgid "Request canceled" msgstr "" #: lib/gai_strerror.c:59 msgid "Request not canceled" msgstr "" #: lib/gai_strerror.c:60 msgid "All requests done" msgstr "" #: lib/gai_strerror.c:61 msgid "Interrupted by a signal" msgstr "" #: lib/gai_strerror.c:62 msgid "Parameter string not correctly encoded" msgstr "" #: lib/gai_strerror.c:74 msgid "Unknown error" msgstr "" #: lib/getopt.c:551 lib/getopt.c:570 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "" #: lib/getopt.c:603 lib/getopt.c:607 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" #: lib/getopt.c:616 lib/getopt.c:621 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" #: lib/getopt.c:667 lib/getopt.c:689 lib/getopt.c:1020 lib/getopt.c:1042 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "" #: lib/getopt.c:727 lib/getopt.c:730 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "" #: lib/getopt.c:738 lib/getopt.c:741 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "" #: lib/getopt.c:796 lib/getopt.c:799 #, c-format msgid "%s: illegal option -- %c\n" msgstr "" #: lib/getopt.c:805 lib/getopt.c:808 #, c-format msgid "%s: invalid option -- %c\n" msgstr "" #: lib/getopt.c:863 lib/getopt.c:882 lib/getopt.c:1095 lib/getopt.c:1116 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "" #: lib/getopt.c:935 lib/getopt.c:954 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "" #: lib/getopt.c:978 lib/getopt.c:999 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "" #: lib/human.c:486 msgid "block size" msgstr "" #. TRANSLATORS: #. Get translations for open and closing quotation marks. #. #. The message catalog should translate "`" to a left #. quotation mark suitable for the locale, and similarly for #. "'". If the catalog has no translation, #. locale_quoting_style quotes `like this', and #. clocale_quoting_style quotes "like this". #. #. For example, an American English Unicode locale should #. translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and #. should translate "'" to U+201D (RIGHT DOUBLE QUOTATION #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. #. #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. #: lib/quotearg.c:245 msgid "`" msgstr "" #: lib/quotearg.c:246 msgid "'" msgstr "" #. TRANSLATORS: Translate "(C)" to the copyright symbol #. (C-in-a-circle), if this symbol is available in the user's #. locale. Otherwise, do not translate "(C)"; leave it as-is. #: lib/version-etc.c:72 msgid "(C)" msgstr "" #: lib/version-etc.c:74 msgid "" "\n" "This is free software. You may redistribute copies of it under the terms " "of\n" "the GNU General Public License .\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" #. TRANSLATORS: %s denotes an author name. #: lib/version-etc.c:90 #, c-format msgid "Written by %s.\n" msgstr "" #. TRANSLATORS: Each %s denotes an author name. #: lib/version-etc.c:94 #, c-format msgid "Written by %s and %s.\n" msgstr "" #. TRANSLATORS: Each %s denotes an author name. #: lib/version-etc.c:98 #, c-format msgid "Written by %s, %s, and %s.\n" msgstr "" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:104 #, c-format msgid "" "Written by %s, %s, %s,\n" "and %s.\n" msgstr "" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:110 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, and %s.\n" msgstr "" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:116 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, and %s.\n" msgstr "" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:123 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, and %s.\n" msgstr "" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:130 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, %s,\n" "and %s.\n" msgstr "" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:138 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s, and %s.\n" msgstr "" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:148 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s, %s, and others.\n" msgstr "" #: lib/xalloc-die.c:38 msgid "memory exhausted" msgstr "" #: src/command.c:177 msgid "browse [USER]" msgstr "" #: src/command.c:178 msgid "" "If USER is specified, queue the file list for that user for download and " "start browsing the user's files as soon as the list is downloaded. With no " "arguments, stop browsing.\n" msgstr "" #: src/command.c:182 msgid "cancel CONNECTION ..." msgstr "" #: src/command.c:183 msgid "" "Close a user connection. Use the `transfers' command to get a list of " "connections.\n" msgstr "" #: src/command.c:186 msgid "cd [DIRECTORY]" msgstr "" #: src/command.c:187 msgid "" "Change directory when browsing another user's files. If DIRECTORY is not " "specified, change to the root directory (`/').\n" msgstr "" #: src/command.c:190 msgid "connect HOST[:PORT]" msgstr "" #: src/command.c:191 msgid "Connect to a hub. If PORT is not specified, assume port 411.\n" msgstr "" #: src/command.c:193 msgid "disconnect" msgstr "" #: src/command.c:194 msgid "Disconnect from the hub.\n" msgstr "" #: src/command.c:196 msgid "exit" msgstr "" #: src/command.c:197 msgid "Quit the program.\n" msgstr "" #: src/command.c:199 msgid "find [FILE ...]" msgstr "" #: src/command.c:200 msgid "" "List files and directories recursively. Assume current directory if FILE is " "not specified. Must be browsing a user's files to use this command.\n" msgstr "" #: src/command.c:203 msgid "get FILE ..." msgstr "" #: src/command.c:204 msgid "" "Queue file for download. Must be browsing a user's files to use this " "command.\n" msgstr "" #: src/command.c:207 msgid "grantslot [USER ...]" msgstr "" #: src/command.c:208 msgid "" "Grant a download slot for the specified users, or remove granted slot if the " "user was already granted one. Without arguments, display a list of users " "with granted slots.\n" msgstr "" #: src/command.c:212 msgid "help [COMMAND ...]" msgstr "" #: src/command.c:213 msgid "" "If COMMAND is specified, display help for that command. Otherwise list all " "available commands.\n" msgstr "" #: src/command.c:216 msgid "ls [OPTION...] [FILE...]" msgstr "" #: src/command.c:217 msgid "" "List files and directories. Assume current directory if FILE is not\n" "specified.\n" "\n" "Options:\n" " -l, --long use a long listing format\n" msgstr "" #: src/command.c:223 msgid "retry USER ..." msgstr "" #: src/command.c:224 msgid "Try to connect and download files from the specified users.\n" msgstr "" #: src/command.c:226 msgid "msg USER MESSAGE..." msgstr "" #: src/command.c:227 msgid "" "Send a private message to USER. Note that characters such as semicolon " "(`;'), double quote (`\"') and number sign (`#') in MESSAGE need to be " "escaped or quoted. Therefore it is recommended to put MESSAGE in double " "quotes.\n" "\n" "Example:\n" " msg some_user \"hello, how are you?\"\n" msgstr "" #: src/command.c:235 msgid "pwd" msgstr "" #: src/command.c:236 msgid "Display user being browsed and current directory.\n" msgstr "" #: src/command.c:238 msgid "queue [USER ...]" msgstr "" #: src/command.c:239 msgid "" "Display files queued for download from the specified users. Without " "arguments, display a list of users we have queued files for.\n" msgstr "" #: src/command.c:242 msgid "raw DATA..." msgstr "" #: src/command.c:243 msgid "" "Send some raw data to the hub. Note that characters such as semicolon (`;'), " "double quote (`\"') and number sign (`#') in DATA need to be escaped or " "quoted. Therefore it is recommended to put DATA in double quotes.\n" msgstr "" #: src/command.c:248 msgid "results [INDEX ...]" msgstr "" #: src/command.c:249 msgid "" "If INDEX is specified, display results for the search by that index. " "Otherwise, display a list of searches and statistics over those searches.\n" msgstr "" #: src/command.c:252 msgid "say MESSAGE..." msgstr "" #: src/command.c:253 msgid "" "Send a public message to users on the hub. Note that characters such as " "semicolon (`;'), double quote (`\"') and number sign (`#') in MESSAGE need " "to be escaped or quoted. Therefore it is recommended to put MESSAGE in " "double quotes.\n" "\n" "Example:\n" " say \"hi everyone!\"\n" msgstr "" #: src/command.c:261 msgid "search WORD..." msgstr "" #: src/command.c:262 msgid "Issue a search for the specified search words.\n" msgstr "" #: src/command.c:264 msgid "set [NAME [VALUE...]]" msgstr "" #: src/command.c:265 msgid "" "Without arguments, display a list of variables and their current values. " "With only NAME argument, display the value of that variable. With NAME and " "VALUE arguments, change the value of a variable.\n" msgstr "" #: src/command.c:269 msgid "status" msgstr "" #: src/command.c:270 msgid "Display status information and some statistics.\n" msgstr "" #: src/command.c:272 msgid "transfers" msgstr "" #: src/command.c:273 msgid "Display a list of user connections.\n" msgstr "" #: src/command.c:275 msgid "unqueue USER [RANGE]" msgstr "" #: src/command.c:276 msgid "" "Remove all or a range of queued files for USER. If RANGE is not specified, " "remove all files from the queue. Use dash (`-') and comma (`,') in RANGE. " "Open ranges are accepted (e.g. `1-' or `-2').\n" msgstr "" #: src/command.c:280 msgid "unsearch INDEX ..." msgstr "" #: src/command.c:281 msgid "Remove a previously issued search and all results for that search.\n" msgstr "" #: src/command.c:283 msgid "who [USER ...]" msgstr "" #: src/command.c:284 msgid "" "If USER is specified, display information on that user. Otherwise, display a " "table of users with some user details.\n" msgstr "" #: src/command.c:287 msgid "alias [NAME[=VALUE] ...]" msgstr "" #: src/command.c:288 msgid "" "Without arguments, display the list of aliases. With NAME argument, display " "what value (command) that alias is set to. With both NAME and VALUE " "argument, change alias. Note that VALUE is a single argument - you need to " "use quotes for more complex commands.\n" "\n" "Example:\n" " alias ll \"ls -l\"\n" msgstr "" #: src/command.c:296 msgid "unalias NAME ..." msgstr "" #: src/command.c:297 msgid "Remove aliases.\n" msgstr "" #: src/command.c:299 msgid "shell [COMMAND [ARGUMENTS...]]" msgstr "" #: src/command.c:300 msgid "" "Execute a system command. If no arguments are specified, the current shell " "will be started (SHELL environment variable or `/bin/sh' if that is not " "set). microdc will continue in the background while the command is " "executing.\n" msgstr "" #: src/command.c:305 msgid "lookup HOST ..." msgstr "" #: src/command.c:306 msgid "Lookup the IP address of specified hosts.\n" msgstr "" #: src/command.c:496 #, c-format msgid "%s: Unknown command.\n" msgstr "" #: src/command.c:678 #, c-format msgid "Cannot create child process - %s\n" msgstr "" #: src/command.c:693 src/command.c:696 #, c-format msgid "%s: cannot execute - %s\n" msgstr "" #: src/command.c:711 src/command.c:714 src/command.c:717 src/command.c:720 #: src/command.c:723 src/command.c:726 #, c-format msgid "Hub state: %s\n" msgstr "" #: src/command.c:711 msgid "Not connected" msgstr "" #: src/command.c:714 msgid "Looking up IP address" msgstr "" #: src/command.c:717 msgid "Waiting for complete connection" msgstr "" #: src/command.c:720 msgid "Waiting for $Lock" msgstr "" #: src/command.c:723 msgid "Waiting for $Hello" msgstr "" #: src/command.c:726 msgid "Logged in" msgstr "" #: src/command.c:731 src/command.c:733 #, c-format msgid "Hub users: %s\n" msgstr "" #: src/command.c:733 msgid "(not logged in)" msgstr "" #: src/command.c:736 msgid "Pending user connections:\n" msgstr "" #: src/command.c:741 msgid " (none)\n" msgstr "" #: src/command.c:743 #, c-format msgid "Share size: % %s (%s)\n" msgstr "" #: src/command.c:745 src/command.c:749 src/command.c:753 src/command.c:1501 #: src/command.c:1898 src/main.c:616 src/main.c:623 src/main.c:860 #: src/user.c:421 msgid "byte" msgid_plural "bytes" msgstr[0] "" msgstr[1] "" #: src/command.c:747 #, c-format msgid "Bytes received: % %s (%s)\n" msgstr "" #: src/command.c:751 #, c-format msgid "Bytes sent: % %s (%s)\n" msgstr "" #: src/command.c:774 #, c-format msgid "Usage: %s MESSAGE..\n" msgstr "" #: src/command.c:778 src/command.c:806 src/command.c:839 src/command.c:881 #: src/command.c:894 src/command.c:1267 src/command.c:1298 src/command.c:1414 #: src/command.c:1489 src/command.c:1619 msgid "Not connected.\n" msgstr "" #: src/command.c:802 #, c-format msgid "Usage: %s USER MESSAGE..\n" msgstr "" #: src/command.c:811 src/command.c:913 src/command.c:1010 src/command.c:1276 #: src/command.c:1319 src/command.c:1419 src/command.c:1499 #, c-format msgid "%s: No such user on this hub\n" msgstr "" #: src/command.c:835 #, c-format msgid "Usage: %s DATA...\n" msgstr "" #: src/command.c:855 #, c-format msgid "Usage: %s HOST[:PORT]\n" msgstr "" #: src/command.c:859 msgid "Connection in progress, disconnect first.\n" msgstr "" #: src/command.c:867 #, c-format msgid "Invalid port number %s\n" msgstr "" #: src/command.c:883 msgid "Disconnecting from hub.\n" msgstr "" #: src/command.c:917 #, c-format msgid "%s has been granted a slot.\n" msgstr "" #: src/command.c:919 #, c-format msgid "%s is no longer granted a slot.\n" msgstr "" #: src/command.c:971 #, c-format msgid "Now browsing %s.\n" msgstr "" #: src/command.c:989 src/command.c:1062 src/command.c:1078 src/command.c:1141 #: src/command.c:1213 src/command.c:1854 msgid "Not browsing any user.\n" msgstr "" #: src/command.c:1017 src/filelist-in.c:240 src/fs.c:393 src/fs.c:470 #: src/main.c:1344 src/main.c:1362 src/user.c:531 src/util.c:109 #: src/variables.c:407 src/variables.c:427 src/variables.c:448 #, c-format msgid "%s: Cannot get file status - %s\n" msgstr "" #: src/command.c:1036 msgid "No free connections. Queued file for download.\n" msgstr "" #: src/command.c:1064 #, c-format msgid "(%s) Waiting for file list.\n" msgstr "" #: src/command.c:1067 #, c-format msgid "(%s) %s\n" msgstr "" #: src/command.c:1089 msgid "No previous path.\n" msgstr "" #: src/command.c:1118 #, c-format msgid "%s: not a directory\n" msgstr "" #: src/command.c:1182 src/command.c:1255 #, c-format msgid "%s: No such file or directory\n" msgstr "" #: src/command.c:1282 #, c-format msgid "%s: Already connected to user.\n" msgstr "" #: src/command.c:1402 #, c-format msgid "Usage: %s USER [RANGE]\n" msgstr "" #: src/command.c:1423 #, c-format msgid "%s: Invalid range, or index out of range (1-%d)\n" msgstr "" #: src/command.c:1502 #, c-format msgid "Nick: %s\n" msgstr "" #: src/command.c:1503 #, c-format msgid "Description: %s\n" msgstr "" #: src/command.c:1504 #, c-format msgid "Speed: %s\n" msgstr "" #: src/command.c:1505 #, c-format msgid "Level: %d\n" msgstr "" #: src/command.c:1506 #, c-format msgid "E-mail: %s\n" msgstr "" #: src/command.c:1507 #, c-format msgid "Operator: %d\n" msgstr "" #: src/command.c:1508 #, c-format msgid "Share Size: % %s (% MB)\n" msgstr "" #: src/command.c:1570 src/command.c:1637 src/main.c:262 src/main.c:629 #: src/search.c:523 src/search.c:567 #, c-format msgid "Cannot get current time - %s\n" msgstr "" #: src/command.c:1582 #, c-format msgid "Upload slots: %d/%d Download slots: %d/unlimited\n" msgstr "" #: src/command.c:1592 #, c-format msgid "Usage: %s CONNECTION ...\n" msgstr "" #: src/command.c:1601 #, c-format msgid "%s: No such user connection.\n" msgstr "" #: src/command.c:1615 #, c-format msgid "Usage: %s STRING...\n" msgstr "" #: src/command.c:1648 msgid "Closed" msgstr "" #: src/command.c:1648 msgid "Open" msgstr "" #: src/command.c:1649 #, c-format msgid "%d. %s (%s) Results: %d\n" msgstr "" #: src/command.c:1660 src/command.c:1695 #, c-format msgid "%s: Invalid search index.\n" msgstr "" #: src/command.c:1664 #, c-format msgid "Search %d:\n" msgstr "" #: src/command.c:1687 #, c-format msgid "Usage: %s INDEX\n" msgstr "" #: src/command.c:1735 src/command.c:1775 #, c-format msgid "%s: No such alias.\n" msgstr "" #: src/command.c:1741 #, c-format msgid "%s: Invalid alias name\n" msgstr "" #: src/command.c:1756 #, c-format msgid "%s: Cannot override built-in command.\n" msgstr "" #: src/command.c:1768 #, c-format msgid "Usage: %s NAME ...\n" msgstr "" #: src/command.c:1812 msgid "Queue already contains this file, ignoring\n" msgstr "" #: src/command.c:1850 #, c-format msgid "Usage: %s FILE ...\n" msgstr "" #: src/command.c:1888 #, c-format msgid "Matched %s\n" msgstr "" #: src/command.c:1897 #, c-format msgid "Downloading % %s in % %s\n" msgstr "" #: src/command.c:1899 msgid "file" msgid_plural "files" msgstr[0] "" msgstr[1] "" #: src/command.c:1902 #, c-format msgid "%s: No files to download.\n" msgstr "" #: src/command.c:1910 msgid "No free connections. Queued files for download.\n" msgstr "" #: src/command.c:1940 msgid "missing host argument\n" msgstr "" #: src/connection.c:44 msgid "Invalid $Lock message: Key to short\n" msgstr "" #: src/filelist-in.c:250 src/user.c:544 #, c-format msgid "%s: Cannot open file for reading - %s\n" msgstr "" #: src/filelist-in.c:256 src/main.c:117 src/main.c:836 #, c-format msgid "%s: Cannot read from file - %s\n" msgstr "" #: src/filelist-in.c:258 src/main.c:119 #, c-format msgid "%s: Premature end of file\n" msgstr "" #: src/filelist-in.c:261 src/filelist-in.c:265 src/fs.c:498 src/main.c:838 #: src/main.c:842 src/screen.c:125 src/user.c:314 #, c-format msgid "%s: Cannot close file - %s\n" msgstr "" #: src/filelist-in.c:269 #, c-format msgid "%s: Invalid data, cannot decode\n" msgstr "" #: src/filelist-in.c:426 src/lookup.c:308 src/main.c:373 src/main.c:1146 #: src/user.c:1058 #, c-format msgid "Cannot create pipe pair - %s\n" msgstr "" #: src/filelist-in.c:431 src/hub.c:291 src/lookup.c:313 src/main.c:389 #: src/main.c:966 src/main.c:1007 src/user.c:1104 #, c-format msgid "Cannot set non-blocking flag - %s\n" msgstr "" #: src/filelist-in.c:437 src/lookup.c:319 src/main.c:379 #, c-format msgid "Cannot create process - %s\n" msgstr "" #: src/fs.c:379 #, c-format msgid "%s: Cannot open directory - %s\n" msgstr "" #: src/fs.c:408 #, c-format msgid "%s: Not a regular file or directory, ignoring\n" msgstr "" #: src/fs.c:413 #, c-format msgid "%s: Cannot read directory - %s\n" msgstr "" #: src/fs.c:415 #, c-format msgid "%s: Cannot close directory - %s\n" msgstr "" #: src/fs.c:456 #, c-format msgid "Scanning directory %s\n" msgstr "" #: src/fs.c:473 src/main.c:1349 src/main.c:1367 #, c-format msgid "%s: Cannot remove file - %s\n" msgstr "" #: src/fs.c:481 src/user.c:436 #, c-format msgid "%s: Cannot open file for writing - %s\n" msgstr "" #: src/fs.c:491 src/main.c:114 #, c-format msgid "%s: Cannot write to file - %s\n" msgstr "" #: src/hub.c:166 src/main.c:230 msgid "UL" msgstr "" #: src/hub.c:171 src/main.c:230 msgid "DL" msgstr "" #: src/hub.c:223 #, c-format msgid "Cannot append to hub send queue - %s\n" msgstr "" #: src/hub.c:228 src/user.c:205 msgid "-->" msgstr "" #: src/hub.c:232 src/hub.c:823 src/hub.c:888 msgid "hub" msgstr "" #: src/hub.c:250 #, c-format msgid "%s: Cannot look up address - %s\n" msgstr "" #: src/hub.c:273 #, c-format msgid "Looking up IP address for %s\n" msgstr "" #: src/hub.c:284 src/main.c:961 src/main.c:1000 src/user.c:1093 #, c-format msgid "Cannot create socket - %s\n" msgstr "" #: src/hub.c:296 #, c-format msgid "Connecting to hub on %s.\n" msgstr "" #: src/hub.c:299 #, c-format msgid "%s: Cannot connect - %s\n" msgstr "" #: src/hub.c:313 msgid "Shutting down hub connection.\n" msgstr "" #: src/hub.c:322 src/main.c:392 src/main.c:946 src/main.c:1064 #, c-format msgid "Cannot close socket - %s\n" msgstr "" #: src/hub.c:348 src/user.c:149 src/user.c:754 #, c-format msgid "Received %s message in wrong state.\n" msgstr "" #: src/hub.c:389 src/user.c:654 msgid "Invalid $Lock message: Missing Pk value\n" msgstr "" #: src/hub.c:421 msgid "Hub requires password.\n" msgstr "" #: src/hub.c:425 msgid "Sending password to hub.\n" msgstr "" #: src/hub.c:430 msgid "Password not accepted.\n" msgstr "" #: src/hub.c:434 msgid "You have received operator status.\n" msgstr "" #: src/hub.c:439 #, c-format msgid "Hub name is %s.\n" msgstr "" #: src/hub.c:451 msgid "Hub did not accept nick. Nick may be in use.\n" msgstr "" #: src/hub.c:459 msgid "Nick accepted. You are now logged in.\n" msgstr "" #: src/hub.c:464 #, c-format msgid "Nick accepted but modified to %s. You are now logged in.\n" msgstr "" #: src/hub.c:479 #, c-format msgid "User %s logged in.\n" msgstr "" #: src/hub.c:497 msgid "Invalid $MyINFO message: Missing $ALL parameter, ignoring\n" msgstr "" #: src/hub.c:503 msgid "Invalid $MyINFO message: Missing nick parameter, ignoring\n" msgstr "" #: src/hub.c:516 msgid "Invalid $MyINFO message: Missing description parameter, ignoring\n" msgstr "" #: src/hub.c:524 msgid "Invalid $MyINFO message: Missing description separator, ignoring\n" msgstr "" #: src/hub.c:530 msgid "Invalid $MyINFO message: Missing connection speed, ignoring\n" msgstr "" #: src/hub.c:545 msgid "Invalid $MyINFO message: Missing e-mail address, ignoring\n" msgstr "" #: src/hub.c:553 msgid "Invalid $MyINFO message: Missing share size, ignoring\n" msgstr "" #: src/hub.c:557 msgid "Invalid $MyINFO message: Invalid share size, ignoring\n" msgstr "" #: src/hub.c:567 msgid "Hub is full.\n" msgstr "" #: src/hub.c:598 src/hub.c:601 #, c-format msgid "Public: %s\n" msgstr "" #: src/hub.c:598 src/hub.c:601 src/hub.c:634 src/hub.c:640 #, c-format msgid " | %s\n" msgstr "" #: src/hub.c:613 msgid "Invalid $To message: Missing text separator, ignoring\n" msgstr "" #: src/hub.c:631 src/hub.c:638 #, c-format msgid "Private: [%s] %s\n" msgstr "" #: src/hub.c:649 msgid "Invalid $ConnectToMe message: Missing or invalid nick\n" msgstr "" #: src/hub.c:653 msgid "Invalid $ConnectToMe message: Invalid address specification.\n" msgstr "" #: src/hub.c:657 #, c-format msgid "Connecting to user on %s\n" msgstr "" #: src/hub.c:666 msgid "Invalid $RevConnectToMe message: Missing nick parameter\n" msgstr "" #: src/hub.c:670 msgid "Invalid $RevConnectToMe message: Remote nick is our nick\n" msgstr "" #: src/hub.c:675 #, c-format msgid "Invalid $RevConnectToMe message: Unknown user %s, ignoring\n" msgstr "" #: src/hub.c:680 src/main.c:199 src/main.c:213 #, c-format msgid "No more connections to user %s allowed.\n" msgstr "" #: src/hub.c:686 #, c-format msgid "User %s is also passive. Cannot establish connection.\n" msgstr "" #: src/hub.c:761 #, c-format msgid "Invalid $Quit message: Unknown user %s.\n" msgstr "" #: src/hub.c:773 msgid "Invalid $Search message: Missing source specification.\n" msgstr "" #: src/hub.c:777 msgid "Invalid $Search message: Invalid search specification.\n" msgstr "" #: src/hub.c:783 #, c-format msgid "Invalid $Search message: Unknown user %s.\n" msgstr "" #: src/hub.c:793 msgid "Invalid $Search message: Invalid address specification.\n" msgstr "" #: src/hub.c:832 src/user.c:848 msgid "<--" msgstr "" #: src/hub.c:856 src/user.c:873 #, c-format msgid "Cannot get error status - %s\n" msgstr "" #: src/hub.c:861 src/user.c:878 src/user.c:1115 #, c-format msgid "Cannot connect - %s\n" msgstr "" #: src/hub.c:869 src/main.c:1039 #, c-format msgid "Cannot get socket address - %s\n" msgstr "" #: src/hub.c:876 #, c-format msgid "Connected to hub from %s.\n" msgstr "" #: src/hub.c:916 #, c-format msgid "ConnectToMe already sent to user %s. Waiting.\n" msgstr "" #: src/hub.c:927 #, c-format msgid "RevConnectToMe already sent to user %s. Waiting.\n" msgstr "" #: src/hub.c:931 #, c-format msgid "User %s is also passive. Cannot communicate.\n" msgstr "" #: src/huffman.c:332 msgid "Incorrect parity, ignoring\n" msgstr "" #: src/main.c:174 #, c-format msgid "User connection %s renamed to %s.\n" msgstr "" #: src/main.c:265 #, c-format msgid " in %s (%s/s)" msgstr "" #: src/main.c:279 #, c-format msgid "%s: %s of %s %s%s. %s %s%s.\n" msgstr "" #: src/main.c:281 msgid "Upload" msgstr "" #: src/main.c:281 msgid "Download" msgstr "" #: src/main.c:283 msgid "succeeded" msgstr "" #: src/main.c:283 msgid "failed" msgstr "" #: src/main.c:286 msgid "transferred" msgid_plural "transferred" msgstr[0] "" msgstr[1] "" #: src/main.c:342 #, c-format msgid "%s: Cannot rename file to %s - %s\n" msgstr "" #: src/main.c:343 msgid "cannot rename file" msgstr "" #: src/main.c:386 src/main.c:469 src/user.c:1055 src/user.c:1168 #: src/user.c:1170 #, c-format msgid "Cannot close pipe - %s\n" msgstr "" #. TRANSLATORS: This represents the connection name used when #. * the user name is not yet known. It must not contains '|', #. * because that's used to distinguish between 'unknown' and #. * (perhaps partially) identified connections. #. #: src/main.c:419 #, c-format msgid "unknown%" msgstr "" #: src/main.c:440 #, c-format msgid "Shutting down user connection process for %s.\n" msgstr "" #: src/main.c:494 #, c-format msgid "Downloading %3d%% (at %5d kb/s) %s" msgstr "" #: src/main.c:495 #, c-format msgid "Uploading %3d%% (at %5d kb/s) %s" msgstr "" #: src/main.c:498 msgid "Idle" msgstr "" #: src/main.c:520 src/main.c:535 #, c-format msgid "user process %s" msgstr "" #: src/main.c:549 #, c-format msgid "User %s: %s" msgstr "" #: src/main.c:610 #, c-format msgid "%s: Starting %s of %s (% of % %s).\n" msgstr "" #: src/main.c:612 src/main.c:620 msgid "upload" msgstr "" #: src/main.c:612 src/main.c:620 msgid "download" msgstr "" #: src/main.c:618 #, c-format msgid "%s: Starting %s of %s (% %s).\n" msgstr "" #: src/main.c:702 #, c-format msgid "Received unknown message %d from user process, shutting down process.\n" msgstr "" #: src/main.c:746 src/main.c:747 src/user.c:968 src/user.c:969 #, c-format msgid "Cannot write to signal pipe - %s\n" msgstr "" #: src/main.c:762 src/user.c:984 #, c-format msgid "Cannot read from signal pipe - %s\n" msgstr "" #: src/main.c:768 src/user.c:990 msgid "Received TERM signal, shutting down.\n" msgstr "" #: src/main.c:784 msgid "Shell process" msgstr "" #: src/main.c:786 msgid "Lookup process" msgstr "" #: src/main.c:789 msgid "Parse process" msgstr "" #: src/main.c:793 msgid "User process" msgstr "" #: src/main.c:796 #, c-format msgid "%s exited with return code %d.\n" msgstr "" #: src/main.c:802 #, c-format msgid "%s terminated by signal %s.\n" msgstr "" #: src/main.c:806 #, c-format msgid "Cannot wait for processes - %s\n" msgstr "" #: src/main.c:825 #, c-format msgid "%s: Cannot open file - %s\n" msgstr "" #: src/main.c:858 #, c-format msgid "Sharing % %s (%s) totally\n" msgstr "" #: src/main.c:875 src/main.c:906 src/main.c:928 msgid "user (search result)" msgstr "" #: src/main.c:910 msgid "<==" msgstr "" #: src/main.c:932 msgid "==>" msgstr "" #: src/main.c:972 src/main.c:1015 #, c-format msgid "Cannot enable address reusing - %s\n" msgstr "" #: src/main.c:980 src/main.c:1024 #, c-format msgid "Cannot bind to address - %s\n" msgstr "" #: src/main.c:1032 #, c-format msgid "Cannot listen - %s\n" msgstr "" #: src/main.c:1044 #, c-format msgid "Listening on %s.\n" msgstr "" #: src/main.c:1083 #, c-format msgid "Cannot accept user connection - %s\n" msgstr "" #: src/main.c:1087 #, c-format msgid "User from %s connected.\n" msgstr "" #: src/main.c:1103 #, c-format msgid "%s: Cannot set locale: %s\n" msgstr "" #: src/main.c:1106 #, c-format msgid "%s: Cannot bind message domain: %s\n" msgstr "" #: src/main.c:1108 #, c-format msgid "%s: Cannot set message domain: %s\n" msgstr "" #: src/main.c:1130 #, c-format msgid "Usage: %s [OPTION]...\n" msgstr "" #: src/main.c:1131 msgid "Start microdc, a command-line based Direct Connect client.\n" msgstr "" #: src/main.c:1132 #, c-format msgid " -n, --no-config do not read config file on startup\n" msgstr "" #: src/main.c:1133 #, c-format msgid " --help display this help and exit\n" msgstr "" #: src/main.c:1134 #, c-format msgid " --version output version information and exit\n" msgstr "" #: src/main.c:1135 #, c-format msgid "" "\n" "Report bugs to <%s>.\n" msgstr "" #: src/main.c:1153 src/user.c:1063 #, c-format msgid "Cannot empty signal set - %s\n" msgstr "" #: src/main.c:1164 src/main.c:1168 src/main.c:1172 src/main.c:1176 #: src/main.c:1181 src/user.c:1076 src/user.c:1083 #, c-format msgid "Cannot register signal handler - %s\n" msgstr "" #: src/main.c:1210 #, c-format msgid "Cannot find directory for temporary files - %s\n" msgstr "" #: src/main.c:1251 src/user.c:1133 #, c-format msgid "Cannot select - %s\n" msgstr "" #: src/main.c:1333 src/main.c:1335 src/variables.c:311 src/variables.c:313 #, c-format msgid "cannot close character convertor - %s\n" msgstr "" #: src/main.c:1374 #, c-format msgid "Cannot close search results socket - %s\n" msgstr "" #: src/main.c:1376 #, c-format msgid "Cannot close user connections socket - %s\n" msgstr "" #: src/main.c:1378 src/main.c:1380 src/user.c:1164 src/user.c:1166 #, c-format msgid "Cannot close signal pipe - %s\n" msgstr "" #: src/screen.c:132 msgid "No longer logging to file.\n" msgstr "" #: src/screen.c:137 #, c-format msgid "%s: Cannot open file for appending - %s\n" msgstr "" #: src/screen.c:142 #, c-format msgid "Logging to `%s'.\n" msgstr "" #: src/screen.c:369 #, c-format msgid "%s: Cannot write history - %s\n" msgstr "" #: src/screen.c:568 #, c-format msgid "%s: Cannot read history - %s\n" msgstr "" #: src/search.c:322 src/search.c:324 #, c-format msgid "Sent %d/%d search results to %s.\n" msgstr "" #: src/search.c:327 msgid "No search results.\n" msgstr "" #: src/search.c:512 msgid "No pattern to match.\n" msgstr "" #: src/search.c:529 #, c-format msgid "Reissuing search %d.\n" msgstr "" #: src/search.c:533 #, c-format msgid "Issuing new search with index %d.\n" msgstr "" #: src/search.c:573 #, c-format msgid "Unterminated or invalid $SR, discarding: %s\n" msgstr "" #: src/search.c:590 #, c-format msgid "Result has been added earlier to search %d.\n" msgstr "" #: src/search.c:596 #, c-format msgid "Added result to search %d (now %d result).\n" msgid_plural "Added result to search %d (now %d results).\n" msgstr[0] "" msgstr[1] "" #: src/user.c:124 msgid "main process" msgstr "" #: src/user.c:209 src/user.c:828 src/user.c:922 src/user.c:942 msgid "user" msgstr "" #: src/user.c:255 msgid "Too many connections to user, or no free slots.\n" msgstr "" #: src/user.c:297 #, c-format msgid "User %s not on hub, or too many connections to user.\n" msgstr "" #: src/user.c:365 msgid "No more files to download.\n" msgstr "" #: src/user.c:377 #, c-format msgid "%s: Cannot get file status: %s\n" msgstr "" #: src/user.c:378 src/user.c:387 src/user.c:437 src/user.c:443 src/user.c:533 #: src/user.c:546 src/user.c:552 src/user.c:611 src/user.c:912 msgid "local error" msgstr "" #: src/user.c:386 #, c-format msgid "%s: File exists and is not a regular file\n" msgstr "" #: src/user.c:397 src/user.c:449 src/user.c:557 src/user.c:923 msgid "communication error" msgstr "" #: src/user.c:420 #, c-format msgid "" "remote file is smaller than local (expected %, got % %s)" msgstr "" #: src/user.c:442 #, c-format msgid "%s: Cannot seek to resume position - %s\n" msgstr "" #: src/user.c:462 src/user.c:584 msgid "no data to transfer" msgstr "" #: src/user.c:525 #, c-format msgid "%s: No such shared file\n" msgstr "" #: src/user.c:527 msgid "no such shared file" msgstr "" #: src/user.c:537 #, c-format msgid "%s: Resume offset % outside file\n" msgstr "" #: src/user.c:539 msgid "resume offset out of range" msgstr "" #: src/user.c:550 #, c-format msgid "%s: Cannot seek in file - %s\n" msgstr "" #: src/user.c:620 src/user.c:932 msgid "transfer complete" msgstr "" #: src/user.c:682 msgid "Invalid $Direction message: Missing direction parameter\n" msgstr "" #: src/user.c:691 msgid "Invalid $Direction message: Invalid direction parameter\n" msgstr "" #: src/user.c:698 msgid "Invalid $Direction message: Missing challenge parameter\n" msgstr "" #: src/user.c:703 msgid "Invalid $Direction message: Invalid challenge parameter\n" msgstr "" #: src/user.c:724 msgid "User does not want to download, nor do we.\n" msgstr "" #: src/user.c:741 msgid "Invalid $Key message: Incorrect key, ignoring\n" msgstr "" #: src/user.c:760 msgid "Invalid $Get message: Missing offset, assuming start\n" msgstr "" #: src/user.c:765 msgid "Invalid $Get message: Offset not integer\n" msgstr "" #: src/user.c:775 msgid "remote did not want file" msgstr "" #: src/user.c:782 msgid "remote is maxed out" msgstr "" #: src/user.c:791 msgid "protocol error: invalid $FileLength message" msgstr "" #: src/user.c:800 msgid "file not available on remote" msgstr "" #: src/user.c:802 #, c-format msgid "remote error: %s" msgstr "" #: src/user.c:807 #, c-format msgid "Received error from user: %s\n" msgstr "" #: src/user.c:892 msgid "Connected to user.\n" msgstr "" #: src/user.c:993 #, c-format msgid "Idle timeout (%d seconds)\n" msgstr "" #: src/user.c:1024 msgid "Received unknown message from main process, shutting down process.\n" msgstr "" #: src/user.c:1162 #, c-format msgid "Cannot close transfer file - %s\n" msgstr "" #: src/user.c:1172 #, c-format msgid "Cannot close user connection - %s\n" msgstr "" #: src/util.c:113 #, c-format msgid "%s: Cannot create directory - %s\n" msgstr "" #. TRANSLATORS: This comma-separated list specifies #. * all strings which are considered negative boolean #. * values for variables such as `active'. #. * Retain the default English strings and add the #. * localized ones. #. #: src/variables.c:52 msgid "0,off,no,false" msgstr "" #. TRANSLATORS: This comma-separated list specifies #. * all strings which are considered positive boolean #. * values for variables such as `active'. #. * Retain the default English strings and add the #. * localized ones. #. #: src/variables.c:59 msgid "1,on,yes,true" msgstr "" #: src/variables.c:288 src/variables.c:324 src/variables.c:359 #: src/variables.c:388 src/variables.c:403 src/variables.c:423 #: src/variables.c:444 src/variables.c:464 src/variables.c:546 #: src/variables.c:571 src/variables.c:690 src/variables.c:709 #: src/variables.c:733 msgid "too many arguments\n" msgstr "" #: src/variables.c:296 msgid "cannot get current character set" msgstr "" #: src/variables.c:301 src/variables.c:306 #, c-format msgid "cannot create character set convertor - %s\n" msgstr "" #: src/variables.c:326 msgid "Nick cannot be empty.\n" msgstr "" #: src/variables.c:328 msgid "Nick is too long - max length is 35 characters.\n" msgstr "" #: src/variables.c:330 msgid "Nick may not contain `$', `|' or space characters.\n" msgstr "" #: src/variables.c:343 msgid "Description may not contain `$' or `|' characters.\n" msgstr "" #: src/variables.c:346 msgid "Description is too long - max length is 35 characters.\n" msgstr "" #: src/variables.c:361 msgid "E-mail may not contain `$' or `|' characters.\n" msgstr "" #: src/variables.c:363 msgid "E-mail is too long - max length is 35 characters.\n" msgstr "" #: src/variables.c:376 msgid "Tag may not contain `$' or `|' characters.\n" msgstr "" #: src/variables.c:390 msgid "Speed may not contain `$' or `|' characters.\n" msgstr "" #: src/variables.c:411 src/variables.c:431 src/variables.c:452 #, c-format msgid "%s: Not a directory\n" msgstr "" #: src/variables.c:468 #, c-format msgid "Invalid slot number `%s'\n" msgstr "" #: src/variables.c:550 msgid "Specify active as `0', `no', `off', `1', `yes', or `on'.\n" msgstr "" #: src/variables.c:554 src/variables.c:702 msgid "Active setting not changed.\n" msgstr "" #: src/variables.c:576 msgid "Removing listening address.\n" msgstr "" #: src/variables.c:581 #, c-format msgid "%s: Specify listen address as an IP address\n" msgstr "" #: src/variables.c:596 #, c-format msgid "Listening address set to %s.\n" msgstr "" #: src/variables.c:661 #, c-format msgid "No flag by the name %s, display flags not changed.\n" msgstr "" #: src/variables.c:668 msgid "Cannot set and add or delete flags at the same time.\n" msgstr "" #: src/variables.c:697 #, c-format msgid "Invalid value `%s' for port number.\n" msgstr "" #: src/variables.c:726 msgid "on" msgstr "" #: src/variables.c:726 msgid "off" msgstr "" #: src/variables.c:737 msgid "Removing current password.\n" msgstr "" #: src/variables.c:741 msgid "Password may not contain `|' characters.\n" msgstr "" #: src/variables.c:843 #, c-format msgid "No value is set for `%s'.\n" msgstr "" #: src/variables.c:845 #, c-format msgid "" "Current value for `%s':\n" "%s\n" msgstr "" #: src/common/optparser.c:93 #, c-format msgid "option `--%s' is ambiguous" msgstr "" #: src/common/optparser.c:101 #, c-format msgid "unrecognized option `--%s'" msgstr "" #: src/common/optparser.c:181 src/common/optparser.c:186 #, c-format msgid "invalid option -- %c" msgstr "" #: src/common/optparser.c:206 #, c-format msgid "option requires an argument -- %c" msgstr "" #: src/common/optparser.c:258 #, c-format msgid "option `--%s' doesn't allow an argument" msgstr "" #: src/common/optparser.c:266 #, c-format msgid "option `--%s' requires an argument" msgstr "" microdc2-0.15.6/po/pl.gmo0100644000076500007500000012146610516626545015133 0ustar chugunovmicrodcÞ•‡0h  ! $!P!t#u#ÌŒ#.Y$7ˆ$ À$6Ê$ %%%/%O% l%%ª%Ç%#ç% &,&H&!a& ƒ&¤& Ä&å&'( '&I'&p'&—'¾'Þ'þ'("9(\((z(£("¾(á()*)J) b)0ƒ)´)Ï)ê)þ)*6*T*r*.‡*¶*,Ñ*þ*+-+G+a+,v+£+%Á+,ç+-, B,&c,Š,ª,Ê,Ì,Õ,ò,ö,- - -'-+-/-3-XP-)©-Ó-å-#ü-% .F.c.({.¤.Ã. Ý."þ.*!/L/!a/ƒ/¡/½/Ø/#ö//0J0h0†0¦0"º0$Ý0151"L1o1!1x±1S*2~2=…2.Ã2ò2 3!3;3*U3€3œ37Ÿ33×3 4464$O4t40ö42'5Z5"c52†5.¹5 è5áô5ªÖ6-7 ¯7½7Î7æ7õ78 8_$8„8t9®‰98:T:=l:6ª:8á:8;8S;8Œ;5Å;)û;.%<$T<(y<6¢<:Ù<<=AQ=A“=:Õ=:>6K>(‚>8«>9ä>;?8Z?7“?7Ë?*@6.@e@}@$—@/¼@"ì@ AAƒ«A/BMB _BiB{B‘B¯B*¾B éBõBC9)C&cCŠC0¡C3ÒC D#D34D/hD0˜DÉD(åDE*E@ESEgE*‚E­E ÅEÓEãEõE úE&F /F)=FgFFšF¬F ËF+×FNGRG$eG%ŠG°GFÎGCHYHCoH³HÃÄHˆI¤IÁIÒI,çI1JFJ ]J iJwKÖLVM!pM&’M ¹MÇM.æM9N-ON }N;ˆN ÄN+ÑN$ýN0"O<SOO “O¡O,¶OãO2êO"P@PZPmPP˜P©P¾PÒPçPQQ-0Q6^Q•Q5©Q ßQ"ëQ+R:R SR`RuRˆRšRźR€SŸT;¶T3òT/&U+VU'‚U#ªUÎUîU V#V>V@VXVrV‹V ¨V ³V ÁVÌV&âV+ W 5WVWiWxWŒW  W«W´W¹W ÀWËWèW øWXX-X1XLX aXmX}X –X£X´XËXßXóXY Y'Y6Y"QY!tY+–YÂYÆY ×YãYüY Z!Z5ZPZ_ZnZ}Z“Z²Z ¹ZÃZ×ZéZ [ [[1[L[_[f[k[€[[²Ÿ[&R]Øy]8R^B‹^ Î^BØ^ _&_-_F_e_)€_!ª_Ì_-æ_1`$F`!k``%«`)Ñ`(û`&$a%Ka"qa1”a.Æa-õa,#b'Pb"xb%›b Áb-âb&c97c&qc0˜c$Éc"îc0dBd,bd:d'Êdòde&,e)Se/}e,­eÚe5óe)f2Hf{f’f®fÌfëf)g$.g Sg)tg*žg'Ég!ñgh3hShVh"_h‚h†h–h"šh!½hßhãhçh&ëh§i8ºióij.*j2YjŒj¬j4Ëj*k+k*Kk2vk5©kßk*ùk%$l Jl kl(Œl4µl5êl( m,Im&vmm+¹m1åmn=6n+tn$ n+Ån‹ñn`}o ÞoPèo@9pzp”p°pÉp9ép#qBq3Eq+yq ¥q¯q Íq*Ûq£r0ªrAÛr s+(s;Ts3sÄsÖsÛÜt6¸uïuvv$v3v Iv%Sv–yvw£ wÏDx"y7yCNyG’yEÚyE z=fz=¤z>âz?!{9a{1›{0Í{cþ{>b|Q¡|Eó|@9}=z}>¸}Z÷}6R~=‰~BÇ~I >TD“?Ø9€=R€€!®€-Ѐ,þ€-+ Y¾ež$‚%Âé‚ ÿ‚ ƒƒ5ƒTƒ#nƒ’ƒ#¡ƒ!Ń;çƒ'#„K„3e„4™„ ΄$Ø„Dý„7B…8z… ³….Ô… †$†B†]†#y†+†%Ɇï†ÿ†‡(‡ 0‡)>‡h‡$z‡Ÿ‡$±‡Ö‡)ꇈ%$ˆkJˆ¶ˆ&Òˆ"ùˆ"‰K?‰E‹‰щBï‰2ŠêAŠ,‹B‹_‹q‹?‡‹CÇ‹ Œ#Œ35Œ/i噎*™%Äêù5WN/¦ ÖCä(‘*7‘+b‘>Ž‘>Í‘ ’ ’’25’ h’7r’,ª’×’ò’““3“F“^“t“"‹“®“ΓNå“P4”…”C£”ç”/ù”*)•T•p•ƒ•š•°•%Å•âë•XΖ'˜7@˜4x˜0­˜,Þ˜( ™$4™ Y™z™—™©™Ç™4Ê™/ÿ™/š"Kšnš}š‘š£š)¹š2ãš+›B› `›m›~› ’› ›¨›­›¾›'Лø› œœ0œEœ Iœjœ „œ‘œ¡œ ¹œÇœÙœîœ ## GQ$Z!¡¿3Üžž +ž#7ž[ž"kžŽž$£žÈžÝžížŸ Ÿ;Ÿ BŸOŸfŸ|Ÿ šŸ¤Ÿ¶ŸÒŸíŸ     6 L ­—WÌ]래·u¼#"pj7 ±x€D)~J õ¨G6M}pr°Sh ËbÇiYJ Ô)Ä€u©`%sgm?ù!î^U…v×›;¤3RAÚ Xý„‰RC\|oBÛ2/óéM<cb»Õh†Ò”@'³ŠL3w] Pãt%ß ~*SÓmBtÂɃ´Ï™½:Ø _‡¸- s;H$ª•V>„`äNKœ1àû÷ò9Ê⣮ê5U=!zO‚Z79Fç <úGCH*Ž“EI‹Ù¯vyoí\üÖ§[?0ܹW+Da@Ð#TÁµ‚Qïj=¡2öqè–Íwì(’ÈAcøP6yZðÃ[g «†eô.L+,Iizl:$}š5q¦QŸÿ>¥NV,O¬E¾ Y梈¶8_Œrn-ÑF¿eÞ²/d|&(4‘ ‡"40^þ…Xxá{ÆKdå8ÝÀnÅk.kñ'ºffaƒT1Î&l{a h |!!¤!¸!Ô!ð!" "4"H"d"x"Œ" "´"Ð"ì"##0#D#`#o  ÿÿÿÿ†  ÿÿÿÿ¡  ÿÿÿÿ¸  ÿÿÿÿÑ  ÿÿÿÿë ÿÿÿÿô ÿÿÿÿ¡ÿÿÿÿ7¡ ÿÿÿÿR¡-ÿÿÿÿ‹¡ÿÿÿÿ­¡ ÿÿÿÿС ÿÿÿÿï¡ ÿÿÿÿ ¢ÿÿÿÿ1¢ ÿÿÿÿI¢ ÿÿÿÿS¢ÿÿÿÿ{¢ÿÿÿÿ¦¢ ÿÿÿÿÆ¢4 ÿÿÿÿ £ÿÿÿÿ Report bugs to <%s>. This is free software. You may redistribute copies of it under the terms of the GNU General Public License . There is NO WARRANTY, to the extent permitted by law. --help display this help and exit --version output version information and exit (none) -n, --no-config do not read config file on startup in %s (%s/s) | %s %d. %s (%s) Results: %d %s exited with return code %d. %s has been granted a slot. %s is no longer granted a slot. %s terminated by signal %s. %s: %s of %s %s%s. %s %s%s. %s: Already connected to user. %s: Cannot bind message domain: %s %s: Cannot close directory - %s %s: Cannot close file - %s %s: Cannot connect - %s %s: Cannot create directory - %s %s: Cannot get file status - %s %s: Cannot get file status: %s %s: Cannot look up address - %s %s: Cannot open directory - %s %s: Cannot open file - %s %s: Cannot open file for appending - %s %s: Cannot open file for reading - %s %s: Cannot open file for writing - %s %s: Cannot override built-in command. %s: Cannot read directory - %s %s: Cannot read from file - %s %s: Cannot read history - %s %s: Cannot remove file - %s %s: Cannot rename file to %s - %s %s: Cannot seek in file - %s %s: Cannot seek to resume position - %s %s: Cannot set locale: %s %s: Cannot set message domain: %s %s: Cannot write history - %s %s: Cannot write to file - %s %s: File exists and is not a regular file %s: Invalid alias name %s: Invalid data, cannot decode %s: Invalid range, or index out of range (1-%d) %s: Invalid search index. %s: No files to download. %s: No such alias. %s: No such file or directory %s: No such shared file %s: No such user connection. %s: No such user on this hub %s: Not a directory %s: Not a regular file or directory, ignoring %s: Premature end of file %s: Specify listen address as an IP address %s: Unknown command. %s: cannot execute - %s %s: illegal option -- %c %s: invalid option -- %c %s: not a directory %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: unrecognized option `%c%s' %s: unrecognized option `--%s' '(%s) %s (%s) Waiting for file list. (C)(not logged in)-->0,off,no,false1,on,yes,true<--<====>Active setting not changed. Added result to search %d (now %d result). Added result to search %d (now %d results). Address family for hostname not supportedAll requests doneBad value for ai_flagsCannot accept user connection - %s Cannot append to hub send queue - %s Cannot bind to address - %s Cannot close pipe - %s Cannot close search results socket - %s Cannot close signal pipe - %s Cannot close socket - %s Cannot close transfer file - %s Cannot close user connection - %s Cannot close user connections socket - %s Cannot connect - %s Cannot create child process - %s Cannot create pipe pair - %s Cannot create process - %s Cannot create socket - %s Cannot empty signal set - %s Cannot enable address reusing - %s Cannot find directory for temporary files - %s Cannot get current time - %s Cannot get error status - %s Cannot get socket address - %s Cannot listen - %s Cannot read from signal pipe - %s Cannot register signal handler - %s Cannot select - %s Cannot set and add or delete flags at the same time. Cannot set non-blocking flag - %s Cannot wait for processes - %s Cannot write to signal pipe - %s Change directory when browsing another user's files. If DIRECTORY is not specified, change to the root directory (`/'). Close a user connection. Use the `transfers' command to get a list of connections. ClosedConnect to a hub. If PORT is not specified, assume port 411. ConnectToMe already sent to user %s. Waiting. Connected to hub from %s. Connected to user. Connecting to hub on %s. Connecting to user on %s Connection in progress, disconnect first. Current value for `%s': %s DLDescription is too long - max length is 35 characters. Description may not contain `$' or `|' characters. Description: %s Disconnect from the hub. Disconnecting from hub. Display a list of user connections. Display files queued for download from the specified users. Without arguments, display a list of users we have queued files for. Display status information and some statistics. Display user being browsed and current directory. DownloadDownloading %3d%% (at %5d kb/s) %sE-mail is too long - max length is 35 characters. E-mail may not contain `$' or `|' characters. E-mail: %s Execute a system command. If no arguments are specified, the current shell will be started (SHELL environment variable or `/bin/sh' if that is not set). microdc will continue in the background while the command is executing. Grant a download slot for the specified users, or remove granted slot if the user was already granted one. Without arguments, display a list of users with granted slots. Hub did not accept nick. Nick may be in use. Hub is full. Hub name is %s. Hub requires password. Hub state: %s Hub users: %s IdleIdle timeout (%d seconds) If COMMAND is specified, display help for that command. Otherwise list all available commands. If INDEX is specified, display results for the search by that index. Otherwise, display a list of searches and statistics over those searches. If USER is specified, display information on that user. Otherwise, display a table of users with some user details. If USER is specified, queue the file list for that user for download and start browsing the user's files as soon as the list is downloaded. With no arguments, stop browsing. Incorrect parity, ignoring Interrupted by a signalInvalid $ConnectToMe message: Invalid address specification. Invalid $ConnectToMe message: Missing or invalid nick Invalid $Direction message: Invalid challenge parameter Invalid $Direction message: Invalid direction parameter Invalid $Direction message: Missing challenge parameter Invalid $Direction message: Missing direction parameter Invalid $Get message: Missing offset, assuming start Invalid $Get message: Offset not integer Invalid $Key message: Incorrect key, ignoring Invalid $Lock message: Key to short Invalid $Lock message: Missing Pk value Invalid $MyINFO message: Invalid share size, ignoring Invalid $MyINFO message: Missing $ALL parameter, ignoring Invalid $MyINFO message: Missing connection speed, ignoring Invalid $MyINFO message: Missing description parameter, ignoring Invalid $MyINFO message: Missing description separator, ignoring Invalid $MyINFO message: Missing e-mail address, ignoring Invalid $MyINFO message: Missing nick parameter, ignoring Invalid $MyINFO message: Missing share size, ignoring Invalid $Quit message: Unknown user %s. Invalid $RevConnectToMe message: Missing nick parameter Invalid $RevConnectToMe message: Remote nick is our nick Invalid $RevConnectToMe message: Unknown user %s, ignoring Invalid $Search message: Invalid address specification. Invalid $Search message: Invalid search specification. Invalid $Search message: Missing source specification. Invalid $Search message: Unknown user %s. Invalid $To message: Missing text separator, ignoring Invalid port number %s Invalid slot number `%s' Invalid value `%s' for port number. Issue a search for the specified search words. Issuing new search with index %d. Level: %d List files and directories recursively. Assume current directory if FILE is not specified. Must be browsing a user's files to use this command. List files and directories. Assume current directory if FILE is not specified. Options: -l, --long use a long listing format Listening address set to %s. Listening on %s. Logged inLogging to `%s'. Looking up IP addressLooking up IP address for %s Lookup processLookup the IP address of specified hosts. Matched %s Memory allocation failureName or service not knownNick accepted but modified to %s. You are now logged in. Nick accepted. You are now logged in. Nick cannot be empty. Nick is too long - max length is 35 characters. Nick may not contain `$', `|' or space characters. Nick: %s No address associated with hostnameNo flag by the name %s, display flags not changed. No free connections. Queued file for download. No free connections. Queued files for download. No longer logging to file. No more connections to user %s allowed. No more files to download. No pattern to match. No previous path. No search results. No value is set for `%s'. Non-recoverable failure in name resolutionNot browsing any user. Not connectedNot connected. Now browsing %s. OpenOperator: %d Parameter string not correctly encodedParse processPassword may not contain `|' characters. Password not accepted. Pending user connections: Private: [%s] %s Processing request in progressPublic: %s Queue already contains this file, ignoring Queue file for download. Must be browsing a user's files to use this command. Quit the program. Received %s message in wrong state. Received TERM signal, shutting down. Received error from user: %s Received unknown message %d from user process, shutting down process. Received unknown message from main process, shutting down process. Reissuing search %d. Remove a previously issued search and all results for that search. Remove aliases. Remove all or a range of queued files for USER. If RANGE is not specified, remove all files from the queue. Use dash (`-') and comma (`,') in RANGE. Open ranges are accepted (e.g. `1-' or `-2'). Removing current password. Removing listening address. Request canceledRequest not canceledResult has been added earlier to search %d. RevConnectToMe already sent to user %s. Waiting. Scanning directory %s Search %d: Send a private message to USER. Note that characters such as semicolon (`;'), double quote (`"') and number sign (`#') in MESSAGE need to be escaped or quoted. Therefore it is recommended to put MESSAGE in double quotes. Example: msg some_user "hello, how are you?" Send a public message to users on the hub. Note that characters such as semicolon (`;'), double quote (`"') and number sign (`#') in MESSAGE need to be escaped or quoted. Therefore it is recommended to put MESSAGE in double quotes. Example: say "hi everyone!" Send some raw data to the hub. Note that characters such as semicolon (`;'), double quote (`"') and number sign (`#') in DATA need to be escaped or quoted. Therefore it is recommended to put DATA in double quotes. Sending password to hub. Sent %d/%d search results to %s. Servname not supported for ai_socktypeShell processShutting down hub connection. Shutting down user connection process for %s. Specify active as `0', `no', `off', `1', `yes', or `on'. Speed may not contain `$' or `|' characters. Speed: %s Start microdc, a command-line based Direct Connect client. System errorTag may not contain `$' or `|' characters. Temporary failure in name resolutionToo many connections to user, or no free slots. Try to connect and download files from the specified users. ULUnknown errorUnknown system errorUnterminated or invalid $SR, discarding: %s UploadUpload slots: %d/%d Download slots: %d/unlimited Uploading %3d%% (at %5d kb/s) %sUsage: %s CONNECTION ... Usage: %s DATA... Usage: %s FILE ... Usage: %s HOST[:PORT] Usage: %s INDEX Usage: %s MESSAGE.. Usage: %s NAME ... Usage: %s STRING... Usage: %s USER MESSAGE.. Usage: %s USER [RANGE] Usage: %s [OPTION]... User %s is also passive. Cannot communicate. User %s is also passive. Cannot establish connection. User %s logged in. User %s not on hub, or too many connections to user. User %s: %sUser connection %s renamed to %s. User does not want to download, nor do we. User from %s connected. User processValid arguments are:Waiting for $HelloWaiting for $LockWaiting for complete connectionWithout arguments, display a list of variables and their current values. With only NAME argument, display the value of that variable. With NAME and VALUE arguments, change the value of a variable. Without arguments, display the list of aliases. With NAME argument, display what value (command) that alias is set to. With both NAME and VALUE argument, change alias. Note that VALUE is a single argument - you need to use quotes for more complex commands. Example: alias ll "ls -l" Written by %s and %s. Written by %s, %s, %s, %s, %s, %s, %s, %s, %s, and others. Written by %s, %s, %s, %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, and %s. Written by %s, %s, %s, and %s. Written by %s, %s, and %s. Written by %s. You have received operator status. `ai_family not supportedai_socktype not supportedalias [NAME[=VALUE] ...]ambiguous argument %s for %sblock sizebrowse [USER]bytebytescancel CONNECTION ...cannot close character convertor - %s cannot create character set convertor - %s cannot get current character setcannot rename filecd [DIRECTORY]communication errorconnect HOST[:PORT]disconnectdownloadexitfailedfilefilesfile not available on remotefind [FILE ...]get FILE ...grantslot [USER ...]help [COMMAND ...]hubinvalid argument %s for %sinvalid option -- %clocal errorlookup HOST ...ls [OPTION...] [FILE...]main processmemory exhaustedmissing host argument msg USER MESSAGE...no data to transferno such shared fileoffonoption `--%s' doesn't allow an argumentoption `--%s' is ambiguousoption `--%s' requires an argumentoption requires an argument -- %cprotocol error: invalid $FileLength messagepwdqueue [USER ...]raw DATA...remote did not want fileremote error: %sremote is maxed outresults [INDEX ...]resume offset out of rangeretry USER ...say MESSAGE...search WORD...set [NAME [VALUE...]]shell [COMMAND [ARGUMENTS...]]statussucceededtoo many arguments transfer completetransferredtransferredtransfersunalias NAME ...unqueue USER [RANGE]unrecognized option `--%s'unsearch INDEX ...uploaduseruser (search result)user process %swho [USER ...]Project-Id-Version: microdc 0.11.0 Report-Msgid-Bugs-To: oskar@osk.mine.nu POT-Creation-Date: 2005-10-18 08:31+0200 PO-Revision-Date: 2005-10-13 22:11+0200 Last-Translator: Jakub Jankowski Language-Team: Polish MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural= n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; B³êdy proszê zg³aszaæ na adres <%s>. To jest wolne oprogramowanie. Mo¿esz rozpowszechniaæ jego kopie na zasadach Powszechnej Licencji Publicznej GNU . Nie ma ¯ADNEJ GWARANCJI, w granicach dozwolonych przez prawo. --help wy¶wietla ten tekst i koñczy program --version wy¶wietla informacjê o wersji i koñczy program (brak) -n, --no-config nie czytaj pliku konfiguracyjnego przy starcie %s (%s/s) | %s %d. %s (%s) Wyników: %d %s zakoñczy³ siê w stanie %d. Przydzielono slot dla %s. %s nie posiada ju¿ przydzielonego slotu. %s zosta³ przerwany sygna³em %s. %s: %s %s %s%s. %s %s%s. %s: Po³±czenie z u¿ytkownikiem ju¿ istnieje. %s: Nie mo¿na dowi±zaæ dziedziny komunikatów: %s %s: Nie mo¿na zamkn±æ katalogu - %s %s: Nie mo¿na zamkn±æ pliku - %s %s: Nieudane po³±czenie - %s %s: Nie mo¿na utworzyæ katalogu - %s %s: Nie mo¿na wykonaæ operacji stat - %s %s: Nie mo¿na wykonaæ operacji stat: %s %s: Nieudane wyszukiwanie adresu - %s %s: Nie mo¿na otworzyæ katalogu - %s %s: Nie mo¿na otworzyæ pliku - %s %s: Nie mo¿na otworzyæ pliku do dopisywania - %s %s: Nie mo¿na otworzyæ pliku do czytania - %s %s: Nie mo¿na otworzyæ pliku do pisania - %s %s: Nie mo¿na nadpisaæ wewnêtrznej komendy. %s: Nie mo¿na przeczytaæ katalogu - %s %s: Nie mo¿na czytaæ z pliku - %s %s: Nie mo¿na odczytaæ historii - %s %s: Nie mo¿na usun±æ pliku - %s %s: Nie mo¿na zmieniæ nazwy pliku na %s - %s %s: Nie mo¿na wyszukiwaæ w pliku - %s %s: Nie mo¿na przewin±æ pliku do pozycji wznowienia - %s %s: Nie mo¿na ustawiæ lokalizacji: %s %s: Nie mo¿na ustawiæ dziedziny komunikatów: %s %s: Nie mo¿na zapisaæ historii - %s %s: Nie mo¿na pisaæ do pliku - %s %s: Plik istnieje i nie jest zwyczajnym plikiem %s: Nieprawid³owa nazwa aliasu %s: Nieprawid³owe dane, nie mo¿na dekodowaæ %s: Nieprawid³owy zakres, lub indeks poza zakresem (1-%d) %s: Nieprawid³owy indeks wyszukiwania. %s: Brak plików do pobrania. %s: Nie ma takiego aliasu. %s: Nie ma takiego pliku ani katalogu %s: Nie ma takiego pliku wspó³dzielonego %s: Nie ma takiego po³±czenia z u¿ytkownikiem. %s: Nie ma takiego u¿ytkownika na tym hubie %s: Nie jest katalogiem %s: Nie jest zwyk³ym plikiem ani katalogiem, pomijam %s: Przedwczesny koniec pliku %s: Podaj adres nas³uchiwania w postaci adresu IP %s: Nieznana komenda. %s: nie mo¿na wykonaæ - %s %s: niedozwolona opcja -- %c %s: nieprawid³owa opcja -- %c %s: nie jest katalogiem %s: opcja `%c%s' nie zezwala na argument %s: opcja `%s' jest niejednoznaczna %s: opcja `%s' wymaga argumentu %s: opcja `--%s' nie zezwala na argument %s: opcja `-W %s' nie zezwala na argument %s: opcja `-W %s' jest niejednoznaczna %s: opcja wymaga argumentu -- %c %s: nierozpoznana opcja `%c%s' %s: nierozpoznana opcja `--%s' ''(%s) %s (%s) Oczekiwanie na listê plików. (C)(niezalogowany)-->0,off,no,false,wy³±czone,nie,fa³sz1,on,yes,true,w³±czone,tak,prawda<--<====>Zmienna active nie zosta³a zmieniona. Dodano wynik do wyszukiwania %d (aktualnie %d wynik). Dodano wynik do wyszukiwania %d (aktualnie %d wyniki). Dodano wynik do wyszukiwania %d (aktualnie %d wyników). Rodzina adresów dla tej nazwy hosta nie jest obs³ugiwanaWszystkie ¿±dania wykonaneB³êdna warto¶æ dla ai_flagsNie mo¿na przyj±æ po³±czenia u¿ytkownika - %s Nie mo¿na dodaæ do kolejki wysy³ania do huba - %s Nie mo¿na dowi±zaæ adresu - %s Nie mo¿na zamkn±æ potoku - %s Nie mo¿na zamkn±æ gniazda wyników wyszukiwania - %s Nie mo¿na zamkn±æ potoku sygna³owego - %s Nie mo¿na zamkn±æ gniazda - %s Nie mo¿na zamkn±æ przesy³anego pliku - %s Nie mo¿na zamkn±æ po³±czenia z u¿ytkownikiem - %s Nie mo¿na zamkn±æ gniazda po³±czeñ u¿ytkowników - %s Nieudane po³±czenie - %s Nie mo¿na utworzyæ procesu potomnego - %s Nie mo¿na utworzyæ pary potoków - %s Nie mo¿na utworzyæ procesu - %s Nie mo¿na utworzyæ gniazda - %s Nie mo¿na opró¿niæ zbioru sygna³ów - %s Nie mo¿na zastosowaæ ponownego u¿ywania adresu - %s Nie mo¿na odnale¼æ katalogu na pliki tymczasowe - %s Nie mo¿na uzyskaæ aktualnego czasu - %s Nie mo¿na uzyskaæ informacji o b³êdzie - %s Nie mo¿na uzyskaæ adresu gniazda - %s Nie mo¿na nas³uchiwaæ - %s Nie mo¿na czytaæ z potoku sygna³owego - %s Nie mo¿na zarejestrowaæ odbiornika sygna³ów - %s Nie mo¿na wykonaæ select - %s Nie mo¿na jednocze¶nie ustawiaæ oraz dodawaæ i kasowaæ flag. Nie mo¿na ustawiæ opcji nieblokowania - %s Nieudane oczekiwanie na proces - %s Nie mo¿na pisaæ do potoku sygna³owego - %s Zmienia katalog podczas przegl±dania plików innego u¿ytkownika. Je¶li nie podano parametru KATALOG, przechodzi do katalogu g³ównego (`/'). Zamyka po³±czenie z u¿ytkownikiem. Skorzystaj z komendy `transfers' aby uzyskaæ listê po³±czeñ. ZamkniêteUstanawia po³±czenie z hubem. Je¶li nie podano parametru PORT, u¿ywa portu 411. ConnectToMe zosta³o ju¿ wys³ane do u¿ytkownika %s. Oczekiwanie. Pod³±czono do huba z %s. Po³±czono z u¿ytkownikiem. £±czenie z hubem na %s. £±czenie z u¿ytkownikiem na %s Po³±czenie w trakcie nawi±zywania, najpierw siê roz³±cz. Aktualna warto¶æ dla `%s': %s DLZbyt d³ugi opis - maksymalna d³ugo¶æ to 35 znaków. Opis nie mo¿e zawieraæ znaków `$' ani `|'. Opis: %s Przerywa po³±czenie z hubem. Roz³±czanie. Wy¶wietla listê po³±czeñ z u¿ytkownikami. Wy¶wietla listê plików oczekuj±cych na pobranie od podanych u¿ytkowników. Bez podanych parametrów, wy¶wietla listê u¿ytkowników, których pliki oczekuj± w kolejce. Wy¶wietla informacje o stanie i parê statystyk. Wy¶wietla aktualnie przegl±danego u¿ytkownika i bie¿±cy katalog. PobieraniePobieranie %3d%% (z prêdko¶ci± %5d kb/s) %sZbyt d³ugi adres e-mail - maksymalna d³ugo¶æ to 35 znaków. Adres e-mail nie mo¿e zawieraæ znaków `$' ani `|'. Adres e-mail: %s Wykonuje polecenie pow³oki. Je¶li nie zostan± podane ¿adne parametry, uruchomiona bêdzie aktualna pow³oka (ze zmiennej ¶rodowiskowej SHELL, lub `/bin/sh', gdy zmienna ta nie jest ustawiona). microdc bêdzie dzia³aæ w tle podczas gdy polecenie bêdzie wykonywane. Przydziela slot pobierania podanym u¿ytkownikom, lub usuwa przydzielony slot, je¶li u¿ytkownikowi slot taki zosta³ przydzielony wcze¶niej. Bez podanych parametrów, wy¶wietla listê u¿ytkowników z przydzielonymi slotami. Hub odrzuci³ Twój nick. Ten nick mo¿e juz byæ zajêty. Hub jest pe³ny. Nazwa huba: %s. Hub wymaga has³a. Stan huba: %s U¿ytkownicy huba: %s BezczynnyLimit czasu bezczynno¶ci (%d sekund) Je¶li podano parametr POLECENIE, wy¶wietla tekst pomocy dotycz±cy tego polecenie. W przeciwnym wypadku wy¶wietla listê wszystkich dostêpnych poleceñ. Je¶li podano parametr INDEKS, wy¶wietla wyniki wyszukiwania dla tegoindeksu. W przeciwnym wypadku wy¶wietla listê wyszukiwañ i ich statystyki. Je¶li podany zosta³ parametr U¯YTKOWNIK, wy¶wietla informacje o tym u¿ytkowniku. W przeciwnym wypadku wy¶wietla tabelkê z u¿ytkownikami i kilka informacji o nich. Je¶li podano parametr U¯YTKOWNIK, umieszcza w kolejce do pobrania listê plików tego u¿ytkownika i rozpoczyna przegl±danie jego plików jak tylko lista zostanie pobrana. Bez parametrów -- koñczy przegl±danie. Nieprawid³owa parzysto¶æ, pomijam Przerwane przez sygna³Nieprawid³owy komunikat $ConnectToMe: Nieprawid³owa postaæ adresu. Nieprawid³owy komunikat $ConnectToMe: Brakuj±cy lub nieprawid³owy nick Nieprawid³owy komunikat $Direction: Nieprawid³owy parametr challenge Nieprawid³owy komunikat $Direction: Nieprawid³owy parametr direction Nieprawid³owy komunikat $Direction: Brak parametru challenge Nieprawid³owy komunikat $Direction: Brak parametru direction Nieprawid³owy komunikat $Get: Brak offsetu, zak³adam pocz±tek Nieprawid³owy komunikat $Get: Offset nie jest liczb± ca³kowit± Nieprawid³owy komunikat $Key: Niew³a¶ciwy klucz, pomijam Nieprawid³owy komunikat $Lock: Zbyt krótki klucz Nieprawid³owy komunikat $Lock: Brak warto¶ci Pk Nieprawid³owy komunikat $MyINFO: Nieprawid³owa informacja o ilo¶ci udostêpnianych zasobów, pomijam Nieprawid³owy komunikat $MyINFO: Brak parametru $ALL, pomijam Nieprawid³owy komunikat $MyINFO: Brak informacji o prêdko¶ci po³±czenia, pomijam Nieprawid³owy komunikat $MyINFO: Brak parametru description, pomijam Nieprawid³owy komunikat $MyINFO: Brak separatora opisu, pomijam Nieprawid³owy komunikat $MyINFO: Brak adresu e-mail, pomijam Nieprawid³owy komunikat $MyINFO: Brak parametru nick, pomijam Nieprawid³owy komunikat $MyINFO: Brak informacji o ilo¶ci udostepnianych zasobów, pomijam Nieprawid³owy komunikat $Quit: Nieznany u¿ytkownik %s Nieprawid³owy komunikat $RevConnectToMe: Brak parametru nick Nieprawid³owy komunikat $RevConnectToMe: Zdalny nick to nasz nick Nieprawid³owy komunikat $RevConnectToMe: Nieznany u¿ytkownik %s, pomijam Nieprawid³owy komunikat $Search: Nieprawid³owa postaæ adresu. Nieprawid³owy komunikat $Search: Nieprawid³owa postaæ wyszukiwania. Nieprawid³owy komunikat $Search: Brak wyszczególnienia ¼ród³a. Nieprawid³owy komunikat $Search: Nieznany u¿ytkownik %s. Nieprawid³owy komunikat $To: Brak separatora tekstu, pomijam Nieprawid³owy numer portu %s Nieprawid³owa liczba slotów `%s' Nieprawid³owa warto¶æ `%s' dla numeru portu. Rozpoczyna wyszukiwanie podanego wyra¿enia. Wykonanie nowego wyszukiwania z indeksem %d. Poziom: %d Listuje rekursywnie pliki i katalogi. Je¶li parametr PLIK nie zosta³ podany, rozpoczyna od katalogu bie¿±cego. U¿ycie tego polecenia jest mo¿liwe tylko przy przegl±daniu plików u¿ytkownika. Listuje pliki i katalogi. Je¶li nie podano parametru PLIK, domy¶lnie u¿ywa bie¿±cego katalogu. Opcje: -l, --long u¿ywa obszernego formatu wy¶wietlania Adres nas³uchiwania ustawiony na %s. Nas³uchiwanie na %s. ZalogowanyLogowanie do `%s'. Wyszukiwanie adresu IPWyszukiwanie adresu IP dla %s Proces rozwi±zywania nazwWyszukuje adres IP podanych hostów Dopasowano %s Wyst±pi³ b³±d przydzielania pamiêciTa nazwa lub us³uga jest nieznanaNick zaakceptowany ale zmieniony na %s. Jeste¶ zalogowany. Nick zaakceptowany. Jeste¶ zalogowany. Nick nie mo¿e byæ pusty. Zbyt d³ugi nick - maksymalna d³ugo¶æ to 35 znaków. Nick nie mo¿e zawieraæ znaków `$', `|', ani spacji. Nick: %s Brak adresu zwi±zanego z nazw± hostaBrak flagi o nazwie %s, flagi wy¶wietlania pozosta³y nie zmienione. Brak wolnych po³±czeñ. Plik zakolejkowano do pobrania. Brak wolnych po³±czeñ. Pliki zakolejkowano do pobrania. Zaprzestano logowania do pliku. Wyczerpany limit po³±czeñ z u¿ytkownikiem %s. Brak innych plików do pobrania. Brak wzorca do porównywania. Brak poprzedniej ¶cie¿ki. Brak wyników wyszukiwania. Brak ustawionej warto¶ci dla `%s'. Wyst±pi³ krytyczny b³±d w odwzorowaniu nazwNie przegl±dasz ¿adnego u¿ytkownika. Brak po³±czeniaBrak po³±czenia. Przegl±dasz teraz %s. OtwarteOperator: %d £añcuch parametru niepoprawnie zakodowanyProces parsowaniaHas³o nie mo¿e zawieraæ znaków `|'. Has³o odrzucone. Oczekuj±ce po³±czenia u¿ytkowników: Prywatnie: [%s] %s ¯±danie przetworzenia jest ju¿ wykonywanePublicznie: %s Ten plik jest ju¿ w kolejce, pomijam Kolejkuje plik do pobrania. U¿ycie tego polecenia jest mo¿liwe tylko przy przegl±daniu plików u¿ytkownika. Koñczy dzia³anie programu. Otrzymano komunikat %s w z³ym stanie. Otrzymano sygna³ TERM, zamykanie. Otrzymano b³±d od u¿ytkownika: %s Otrzymano nieznany komunikat %d od procesu u¿ytkownika, zamykanie procesu. Otrzymano nieznany komunikat od procesu g³ównego, zamykanie procesu. Powtarzanie wyszukiwania %d. Usuwa wcze¶niej wykonane wyszukiwanie oraz wszystkie jego wyniki. Usuwa aliasy. Usuwa pliki z kolejki dla U¯YTKOWNIK. Je¶li parametr ZAKRES nie zosta³ podany, usuwa wszystkie pliki z kolejki. W parametrze ZAKRES mo¿na u¿ywaæ my¶lnika (`-') i przecinka (`,'). Dozwolone s± niedomkniête zakresy (np. `1-' czy `-2'). Usuwam obecne has³o. Usuwam adres nas³uchiwania. ¯±danie anulowane¯±danie nie anulowaneWynik wyszukiwania zosta³ wcze¶niej dodany do wyszukiwania %d. RevConnectToMe zosta³o ju¿ wys³ane do u¿ytkownika %s. Oczekiwanie. Przeszukujê katalog %s Wyszukiwanie %d: Wysy³a prywatn± wiadomo¶æ do U¯YTKOWNIK. Nale¿y pamiêtaæ, ¿e znaki takie jak ¶rednik (`;'), cudzys³ów (`"') oraz krzy¿yk (`#') w WIADOMO¦Æ musz± byæ eskejpowane lub brane w apostrofy. Z tego wzglêdu zalecane jest umieszczanie WIADOMO¦Æ w cudzys³owach. Przyk³ad: msg jaki¶_u¿ytkownik "cze¶æ, co s³ychaæ?" Wysy³a publiczn± wiadomo¶æ do u¿ytkowników na hubie. Nale¿y pamiêtaæ, ¿e znaki takie jak ¶rednik (`;'), cudzys³ów (`"') oraz krzy¿yk (`#') w WIADOMO¦Æ musz± byæ eskejpowane lub brane w apostrofy. Z tego wzglêdu zalecane jest umieszczanie WIADOMO¦Æ w cudzys³owach. Przyk³ad: msg "siemanko wszystkim!" Wysy³a surowe dane do huba. Nale¿y pamiêtaæ, ¿e znaki takie jak ¶rednik (`;'), cudzys³ów (`"') oraz krzy¿yk (`#') w DANE musz± byæ eskejpowane lub brane w apostrofy. Z tego wzglêdu zalecane jest umieszczanie DANE w cudzys³owach. Wysy³anie has³a do huba. Wys³ano %d/%d wyników wyszukiwania do %s. Nazwa nie obs³ugiwana dla ai_socktypeProces pow³okiZamykanie po³±czenia z hubem. Zamykanie procesu po³±czenia z u¿ytkownikiem dla %s. Warto¶ci± zmiennej active musi byæ `0', `nie', `wy³±czone', `1', `tak' lub `w³±czone'. Prêdko¶æ nie mo¿e zawieraæ znaków `$' ani `|'. Prêdko¶æ: %s Uruchamia microdc, klienta Direct Connect z interfejsem tekstowym. B³±d systemowyTag nie mo¿e zawieraæ znaków `$' ani `|'. Odwzorowanie nazwy jest chwilowo niemo¿liweZbyt wiele po³±czeñ z u¿ytkownikiem, lub brak wolnych slotów. Próbuje po³±czyæ siê i pobraæ pliki od podanych u¿ytkowników. ULNieznany b³±dNieznany b³±d systemowyNiezakoñczone lub nieprawid³owe $SR, odrzucam: %s Wysy³anieSloty upload: %d/%d Sloty download: %d/nieograniczone Wysy³anie %3d%% (z prêdko¶ci± %5d kb/s) %sU¿ycie: %s PO£¡CZENIE ... U¿ycie: %s DANE... U¿ycie: %s PLIK ... U¿ycie: %s HOST[:PORT] U¿ycie: %s INDEKS U¿ycie: %s WIADOMO¦Æ.. U¿ycie: %s NAZWA ... U¿ycie: %s WZORZEC... U¿ycie: %s U¯YTKOWNIK WIADOMO¦Æ.. U¿ycie: %s U¯YTKOWNIK [ZAKRES] U¿ycie: %s [OPCJA]... U¿ytkownik %s równie¿ pracuje w trybie pasywnym. Brak mo¿liwo¶ci komunikacji. U¿ytkownik %s równie¿ pracuje w trybie pasywnym. Nie mo¿na nawi±zaæ po³±czenia. U¿ytkownik %s zalogowa³ siê. U¿ytkownik %s poza hubem, lub zbyt wiele po³±czeñ z u¿ytkownikiem. U¿ytkownik %s: %sPo³±czenie u¿ytkownika %s przemianowane na %s. U¿ytkownik nie chce pobieraæ, my równie¿. U¿ytkownik z %s po³±czony. Proces u¿ytkownikaPoprawne parametry to:Oczekiwanie na $HelloOczekiwanie na $LockOczekiwanie na zakoñczenie po³±czeniaBez podanych parametrów, wy¶wietla listê zmiennych i ich aktualne warto¶ci. Je¶li podany zosta³ jedynie parametr NAZWA, wy¶wietla warto¶æ tej zmiennej. Je¶li podane zosta³y parametry NAZWA i WARTO¦Æ, zmienia warto¶æ zmiennej. Bez podanych parametrów, wy¶wietla aktualn± listê aliasów. Je¶li podano parametr NAZWA, wy¶wietla jak± warto¶æ (polecenie) ma przypisany alias. Je¶li podano parametry NAZWA i WARTO¦Æ, zmienia alias. Nale¿y pamiêtaæ, ¿e WARTO¦Æ jest pojedynczym argumentem -- nale¿y u¿yæ cudzys³owów dla bardziej z³o¿onych poleceñ. Przyk³ad: alias ll "ls -l" Autorami s± %s oraz %s. Autorami s± %s, %s, %s, %s, %s, %s, %s, %s, %s i inni. Autorami s± %s, %s, %s, %s, %s, %s, %s, %s oraz %s. Autorami s± %s, %s, %s, %s, %s, %s, %s oraz %s. Autorami s± %s, %s, %s, %s, %s, %s oraz %s. Autorami s± %s, %s, %s, %s, %s oraz %s. Autorami s± %s, %s, %s, %s oraz %s. Autorami s± %s, %s, %s oraz %s. Autorami s± %s, %s oraz %s. Autorem jest %s. Otrzyma³e¶ status operatora. ,,ai_family zawiera nie obs³ugiwan± rodzinê protoko³ówai_socktype zawiera nie obs³ugiwany typ gniazdaalias [NAZWA[=WARTO¦Æ] ...]niejednoznaczny parametr %s dla %swielko¶æ blokubrowse [U¯YTKOWNIK]bajtbajtybajtówcancel PO£¡CZENIE ...nie mo¿na zamkn±æ konwertera znaków - %s mie mo¿na utworzyæ konwertera zestawu znaków - %s nie mo¿na uzyskaæ aktualnego zestawu znakównie mo¿na zmieniæ nazwy plikucd [KATALOG]b³±d komunikacjiconnect HOST[:PORT]disconnectpobieranieexitnie powiod³o siêplikplikiplikówplik niedostêpny u zdalnego u¿ytkownikafind [PLIK ...]get PLIK ...grantslot [U¯YTKOWNIK ...]help [POLECENIE ...]hubnieprawid³owy parametr %s dla %snieprawid³owa opcja -- %cb³±d lokalnylookup HOST ...ls [OPCJA...] [PLIK...]proces g³ównypamiêæ wyczerpanabrak parametru host msg U¯YTKOWNIK WIADOMO¦Æ..brak danych do przes³anianie ma takiego udostêpnianego plikuwy³±czonew³±czoneopcja `--%s' nie zezwala na argumentopcja `--%s' jest niejednoznacznaopcja `--%s' wymaga argumentuopcja wymaga argumentu -- %cb³±d protoko³u: nieprawid³owy komunikat $FileLengthpwdqueue [U¯YTKOWNIK ...]raw DANE...zdalny u¿ytkownik nie przyj±³ plikub³±d zdalny: %szdalny u¿ytkownik jest wymaksowanyresults [INDEKS ...]offset wznowienia jest poza zakresemretry U¯YTKOWNIK ...say WIADOMO¦Æ..search WYRA¯ENIE...set [NAZWA [WARTO¦Æ...]]shell [POLECENIE [ARGUMENTY...]]statuspowiod³o siêzbyt wiele argumentów przesy³anie ukoñczoneprzes³anoprzes³anoprzes³anotransfersunalias NAZWA ...unqueue U¯YTKOWNIK [ZAKRES]nierozpoznana opcja `--%s'unsearch INDEKS ...wysy³anieu¿ytkowniku¿ytkownik (wynik wyszukiwania)proces u¿ytkownika %swho [U¯YTKOWNIK ...]PRIu64PRIu32Share size: % %s (%s) Bytes received: % %s (%s) Bytes sent: % %s (%s) Share Size: % %s (% MB) Downloading % %s in % %s unknown%%s: Starting %s of %s (% of % %s). %s: Starting %s of %s (% %s). Sharing % %s (%s) totally remote file is smaller than local (expected %, got % %s)%s: Resume offset % outside file Udostêpnianych zasobów: % %s (%s) Otrzymanych bajtów: % %s (%s) Wys³anych bajtów: % %s (%s) Udostêpnianych zasobów: % %s (% MB) Pobieranie % %s (% %s) nieznany%%s: Rozpoczêto %s pliku %s (% z % %s). %s: Rozpoczêto %s pliku %s (% bajtów %s). Udostêpniono ³±cznie % %s (%s) zdalny plik jest mniejszy ni¿ lokalny (spodziewane %, uzyskano % %s)%s: Offset wznowienia % jest poza plikiem microdc2-0.15.6/po/pl.po0100644000076500007500000016244210516626545014766 0ustar chugunovmicrodc# Polish translation for microdc. # Copyright (C) 2005 Jakub Jankowski # This file is distributed under the same license as the microdc package. # Jakub Jankowski , 2005. # msgid "" msgstr "" "Project-Id-Version: microdc 0.11.0\n" "Report-Msgid-Bugs-To: oskar@osk.mine.nu\n" "POT-Creation-Date: 2005-10-18 08:31+0200\n" "PO-Revision-Date: 2005-10-13 22:11+0200\n" "Last-Translator: Jakub Jankowski \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-2\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" #: lib/argmatch.c:137 #, c-format msgid "invalid argument %s for %s" msgstr "nieprawid³owy parametr %s dla %s" #: lib/argmatch.c:138 #, c-format msgid "ambiguous argument %s for %s" msgstr "niejednoznaczny parametr %s dla %s" #: lib/argmatch.c:157 #, c-format msgid "Valid arguments are:" msgstr "Poprawne parametry to:" #: lib/error.c:121 msgid "Unknown system error" msgstr "Nieznany b³±d systemowy" #: lib/gai_strerror.c:45 msgid "Address family for hostname not supported" msgstr "Rodzina adresów dla tej nazwy hosta nie jest obs³ugiwana" #: lib/gai_strerror.c:46 msgid "Temporary failure in name resolution" msgstr "Odwzorowanie nazwy jest chwilowo niemo¿liwe" #: lib/gai_strerror.c:47 msgid "Bad value for ai_flags" msgstr "B³êdna warto¶æ dla ai_flags" #: lib/gai_strerror.c:48 msgid "Non-recoverable failure in name resolution" msgstr "Wyst±pi³ krytyczny b³±d w odwzorowaniu nazw" #: lib/gai_strerror.c:49 msgid "ai_family not supported" msgstr "ai_family zawiera nie obs³ugiwan± rodzinê protoko³ów" #: lib/gai_strerror.c:50 msgid "Memory allocation failure" msgstr "Wyst±pi³ b³±d przydzielania pamiêci" #: lib/gai_strerror.c:51 msgid "No address associated with hostname" msgstr "Brak adresu zwi±zanego z nazw± hosta" #: lib/gai_strerror.c:52 msgid "Name or service not known" msgstr "Ta nazwa lub us³uga jest nieznana" #: lib/gai_strerror.c:53 msgid "Servname not supported for ai_socktype" msgstr "Nazwa nie obs³ugiwana dla ai_socktype" #: lib/gai_strerror.c:54 msgid "ai_socktype not supported" msgstr "ai_socktype zawiera nie obs³ugiwany typ gniazda" #: lib/gai_strerror.c:55 msgid "System error" msgstr "B³±d systemowy" #: lib/gai_strerror.c:57 msgid "Processing request in progress" msgstr "¯±danie przetworzenia jest ju¿ wykonywane" #: lib/gai_strerror.c:58 msgid "Request canceled" msgstr "¯±danie anulowane" #: lib/gai_strerror.c:59 msgid "Request not canceled" msgstr "¯±danie nie anulowane" #: lib/gai_strerror.c:60 msgid "All requests done" msgstr "Wszystkie ¿±dania wykonane" #: lib/gai_strerror.c:61 msgid "Interrupted by a signal" msgstr "Przerwane przez sygna³" #: lib/gai_strerror.c:62 msgid "Parameter string not correctly encoded" msgstr "£añcuch parametru niepoprawnie zakodowany" #: lib/gai_strerror.c:74 msgid "Unknown error" msgstr "Nieznany b³±d" #: lib/getopt.c:551 lib/getopt.c:570 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: opcja `%s' jest niejednoznaczna\n" #: lib/getopt.c:603 lib/getopt.c:607 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: opcja `--%s' nie zezwala na argument\n" #: lib/getopt.c:616 lib/getopt.c:621 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: opcja `%c%s' nie zezwala na argument\n" #: lib/getopt.c:667 lib/getopt.c:689 lib/getopt.c:1020 lib/getopt.c:1042 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: opcja `%s' wymaga argumentu\n" #: lib/getopt.c:727 lib/getopt.c:730 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: nierozpoznana opcja `--%s'\n" #: lib/getopt.c:738 lib/getopt.c:741 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: nierozpoznana opcja `%c%s'\n" #: lib/getopt.c:796 lib/getopt.c:799 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: niedozwolona opcja -- %c\n" #: lib/getopt.c:805 lib/getopt.c:808 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: nieprawid³owa opcja -- %c\n" #: lib/getopt.c:863 lib/getopt.c:882 lib/getopt.c:1095 lib/getopt.c:1116 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: opcja wymaga argumentu -- %c\n" #: lib/getopt.c:935 lib/getopt.c:954 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: opcja `-W %s' jest niejednoznaczna\n" #: lib/getopt.c:978 lib/getopt.c:999 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: opcja `-W %s' nie zezwala na argument\n" #: lib/human.c:486 msgid "block size" msgstr "wielko¶æ bloku" #. TRANSLATORS: #. Get translations for open and closing quotation marks. #. #. The message catalog should translate "`" to a left #. quotation mark suitable for the locale, and similarly for #. "'". If the catalog has no translation, #. locale_quoting_style quotes `like this', and #. clocale_quoting_style quotes "like this". #. #. For example, an American English Unicode locale should #. translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and #. should translate "'" to U+201D (RIGHT DOUBLE QUOTATION #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. #. #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. #: lib/quotearg.c:245 msgid "`" msgstr ",," #: lib/quotearg.c:246 msgid "'" msgstr "''" #. TRANSLATORS: Translate "(C)" to the copyright symbol #. (C-in-a-circle), if this symbol is available in the user's #. locale. Otherwise, do not translate "(C)"; leave it as-is. #: lib/version-etc.c:72 msgid "(C)" msgstr "(C)" #: lib/version-etc.c:74 msgid "" "\n" "This is free software. You may redistribute copies of it under the terms " "of\n" "the GNU General Public License .\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" "\n" "To jest wolne oprogramowanie. Mo¿esz rozpowszechniaæ jego kopie na zasadach\n" "Powszechnej Licencji Publicznej GNU .\n" "Nie ma ¯ADNEJ GWARANCJI, w granicach dozwolonych przez prawo.\n" "\n" #. TRANSLATORS: %s denotes an author name. #: lib/version-etc.c:90 #, c-format msgid "Written by %s.\n" msgstr "Autorem jest %s.\n" #. TRANSLATORS: Each %s denotes an author name. #: lib/version-etc.c:94 #, c-format msgid "Written by %s and %s.\n" msgstr "Autorami s± %s oraz %s.\n" #. TRANSLATORS: Each %s denotes an author name. #: lib/version-etc.c:98 #, c-format msgid "Written by %s, %s, and %s.\n" msgstr "Autorami s± %s, %s oraz %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:104 #, c-format msgid "" "Written by %s, %s, %s,\n" "and %s.\n" msgstr "" "Autorami s± %s, %s, %s\n" "oraz %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:110 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, and %s.\n" msgstr "" "Autorami s± %s, %s, %s,\n" "%s oraz %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:116 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, and %s.\n" msgstr "" "Autorami s± %s, %s, %s,\n" "%s, %s oraz %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:123 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, and %s.\n" msgstr "" "Autorami s± %s, %s, %s,\n" "%s, %s, %s oraz %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:130 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, %s,\n" "and %s.\n" msgstr "" "Autorami s± %s, %s, %s,\n" "%s, %s, %s, %s\n" "oraz %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:138 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s, and %s.\n" msgstr "" "Autorami s± %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s oraz %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:148 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s, %s, and others.\n" msgstr "" "Autorami s± %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s, %s i inni.\n" #: lib/xalloc-die.c:38 msgid "memory exhausted" msgstr "pamiêæ wyczerpana" #: src/command.c:177 msgid "browse [USER]" msgstr "browse [U¯YTKOWNIK]" #: src/command.c:178 msgid "" "If USER is specified, queue the file list for that user for download and " "start browsing the user's files as soon as the list is downloaded. With no " "arguments, stop browsing.\n" msgstr "" "Je¶li podano parametr U¯YTKOWNIK, umieszcza w kolejce do pobrania listê " "plików tego u¿ytkownika i rozpoczyna przegl±danie jego plików jak tylko " "lista zostanie pobrana. Bez parametrów -- koñczy przegl±danie.\n" #: src/command.c:182 msgid "cancel CONNECTION ..." msgstr "cancel PO£¡CZENIE ..." #: src/command.c:183 msgid "" "Close a user connection. Use the `transfers' command to get a list of " "connections.\n" msgstr "" "Zamyka po³±czenie z u¿ytkownikiem. Skorzystaj z komendy `transfers' aby " "uzyskaæ listê po³±czeñ.\n" #: src/command.c:186 msgid "cd [DIRECTORY]" msgstr "cd [KATALOG]" #: src/command.c:187 msgid "" "Change directory when browsing another user's files. If DIRECTORY is not " "specified, change to the root directory (`/').\n" msgstr "" "Zmienia katalog podczas przegl±dania plików innego u¿ytkownika. Je¶li nie " "podano parametru KATALOG, przechodzi do katalogu g³ównego (`/').\n" #: src/command.c:190 msgid "connect HOST[:PORT]" msgstr "connect HOST[:PORT]" #: src/command.c:191 msgid "Connect to a hub. If PORT is not specified, assume port 411.\n" msgstr "" "Ustanawia po³±czenie z hubem. Je¶li nie podano parametru PORT, u¿ywa portu " "411.\n" #: src/command.c:193 msgid "disconnect" msgstr "disconnect" #: src/command.c:194 msgid "Disconnect from the hub.\n" msgstr "Przerywa po³±czenie z hubem.\n" #: src/command.c:196 msgid "exit" msgstr "exit" #: src/command.c:197 msgid "Quit the program.\n" msgstr "Koñczy dzia³anie programu.\n" #: src/command.c:199 msgid "find [FILE ...]" msgstr "find [PLIK ...]" #: src/command.c:200 msgid "" "List files and directories recursively. Assume current directory if FILE is " "not specified. Must be browsing a user's files to use this command.\n" msgstr "" "Listuje rekursywnie pliki i katalogi. Je¶li parametr PLIK nie zosta³ podany, " "rozpoczyna od katalogu bie¿±cego. U¿ycie tego polecenia jest mo¿liwe tylko " "przy przegl±daniu plików u¿ytkownika.\n" #: src/command.c:203 msgid "get FILE ..." msgstr "get PLIK ..." #: src/command.c:204 msgid "" "Queue file for download. Must be browsing a user's files to use this " "command.\n" msgstr "" "Kolejkuje plik do pobrania. U¿ycie tego polecenia jest mo¿liwe tylko przy " "przegl±daniu plików u¿ytkownika.\n" #: src/command.c:207 msgid "grantslot [USER ...]" msgstr "grantslot [U¯YTKOWNIK ...]" #: src/command.c:208 msgid "" "Grant a download slot for the specified users, or remove granted slot if the " "user was already granted one. Without arguments, display a list of users " "with granted slots.\n" msgstr "" "Przydziela slot pobierania podanym u¿ytkownikom, lub usuwa przydzielony " "slot, je¶li u¿ytkownikowi slot taki zosta³ przydzielony wcze¶niej. Bez " "podanych parametrów, wy¶wietla listê u¿ytkowników z przydzielonymi slotami.\n" #: src/command.c:212 msgid "help [COMMAND ...]" msgstr "help [POLECENIE ...]" #: src/command.c:213 msgid "" "If COMMAND is specified, display help for that command. Otherwise list all " "available commands.\n" msgstr "" "Je¶li podano parametr POLECENIE, wy¶wietla tekst pomocy dotycz±cy tego " "polecenie. W przeciwnym wypadku wy¶wietla listê wszystkich dostêpnych " "poleceñ.\n" #: src/command.c:216 msgid "ls [OPTION...] [FILE...]" msgstr "ls [OPCJA...] [PLIK...]" #: src/command.c:217 msgid "" "List files and directories. Assume current directory if FILE is not\n" "specified.\n" "\n" "Options:\n" " -l, --long use a long listing format\n" msgstr "" "Listuje pliki i katalogi. Je¶li nie podano parametru PLIK, \n" "domy¶lnie u¿ywa bie¿±cego katalogu.\n" "\n" "Opcje:\n" " -l, --long u¿ywa obszernego formatu wy¶wietlania\n" #: src/command.c:223 msgid "retry USER ..." msgstr "retry U¯YTKOWNIK ..." #: src/command.c:224 msgid "Try to connect and download files from the specified users.\n" msgstr "Próbuje po³±czyæ siê i pobraæ pliki od podanych u¿ytkowników.\n" #: src/command.c:226 msgid "msg USER MESSAGE..." msgstr "msg U¯YTKOWNIK WIADOMO¦Æ.." #: src/command.c:227 msgid "" "Send a private message to USER. Note that characters such as semicolon " "(`;'), double quote (`\"') and number sign (`#') in MESSAGE need to be " "escaped or quoted. Therefore it is recommended to put MESSAGE in double " "quotes.\n" "\n" "Example:\n" " msg some_user \"hello, how are you?\"\n" msgstr "" "Wysy³a prywatn± wiadomo¶æ do U¯YTKOWNIK. Nale¿y pamiêtaæ, ¿e znaki takie jak " "¶rednik (`;'), cudzys³ów (`\"') oraz krzy¿yk (`#') w WIADOMO¦Æ musz± byæ " "eskejpowane lub brane w apostrofy. Z tego wzglêdu zalecane jest umieszczanie " "WIADOMO¦Æ w cudzys³owach.\n" "\n" "Przyk³ad:\n" " msg jaki¶_u¿ytkownik \"cze¶æ, co s³ychaæ?\"\n" #: src/command.c:235 msgid "pwd" msgstr "pwd" #: src/command.c:236 msgid "Display user being browsed and current directory.\n" msgstr "Wy¶wietla aktualnie przegl±danego u¿ytkownika i bie¿±cy katalog.\n" #: src/command.c:238 msgid "queue [USER ...]" msgstr "queue [U¯YTKOWNIK ...]" #: src/command.c:239 msgid "" "Display files queued for download from the specified users. Without " "arguments, display a list of users we have queued files for.\n" msgstr "" "Wy¶wietla listê plików oczekuj±cych na pobranie od podanych u¿ytkowników. " "Bez podanych parametrów, wy¶wietla listê u¿ytkowników, których pliki " "oczekuj± w kolejce.\n" #: src/command.c:242 msgid "raw DATA..." msgstr "raw DANE..." #: src/command.c:243 msgid "" "Send some raw data to the hub. Note that characters such as semicolon (`;'), " "double quote (`\"') and number sign (`#') in DATA need to be escaped or " "quoted. Therefore it is recommended to put DATA in double quotes.\n" msgstr "" "Wysy³a surowe dane do huba. Nale¿y pamiêtaæ, ¿e znaki takie jak ¶rednik " "(`;'), cudzys³ów (`\"') oraz krzy¿yk (`#') w DANE musz± byæ eskejpowane lub " "brane w apostrofy. Z tego wzglêdu zalecane jest umieszczanie DANE w " "cudzys³owach.\n" #: src/command.c:248 msgid "results [INDEX ...]" msgstr "results [INDEKS ...]" #: src/command.c:249 msgid "" "If INDEX is specified, display results for the search by that index. " "Otherwise, display a list of searches and statistics over those searches.\n" msgstr "" "Je¶li podano parametr INDEKS, wy¶wietla wyniki wyszukiwania dla tegoindeksu. " "W przeciwnym wypadku wy¶wietla listê wyszukiwañ i ich statystyki.\n" #: src/command.c:252 msgid "say MESSAGE..." msgstr "say WIADOMO¦Æ.." #: src/command.c:253 msgid "" "Send a public message to users on the hub. Note that characters such as " "semicolon (`;'), double quote (`\"') and number sign (`#') in MESSAGE need " "to be escaped or quoted. Therefore it is recommended to put MESSAGE in " "double quotes.\n" "\n" "Example:\n" " say \"hi everyone!\"\n" msgstr "" "Wysy³a publiczn± wiadomo¶æ do u¿ytkowników na hubie. Nale¿y pamiêtaæ, ¿e " "znaki takie jak ¶rednik (`;'), cudzys³ów (`\"') oraz krzy¿yk (`#') w " "WIADOMO¦Æ musz± byæ eskejpowane lub brane w apostrofy. Z tego wzglêdu " "zalecane jest umieszczanie WIADOMO¦Æ w cudzys³owach.\n" "\n" "Przyk³ad:\n" " msg \"siemanko wszystkim!\"\n" #: src/command.c:261 msgid "search WORD..." msgstr "search WYRA¯ENIE..." #: src/command.c:262 msgid "Issue a search for the specified search words.\n" msgstr "Rozpoczyna wyszukiwanie podanego wyra¿enia.\n" #: src/command.c:264 msgid "set [NAME [VALUE...]]" msgstr "set [NAZWA [WARTO¦Æ...]]" #: src/command.c:265 msgid "" "Without arguments, display a list of variables and their current values. " "With only NAME argument, display the value of that variable. With NAME and " "VALUE arguments, change the value of a variable.\n" msgstr "" "Bez podanych parametrów, wy¶wietla listê zmiennych i ich aktualne warto¶ci. " "Je¶li podany zosta³ jedynie parametr NAZWA, wy¶wietla warto¶æ tej zmiennej. " "Je¶li podane zosta³y parametry NAZWA i WARTO¦Æ, zmienia warto¶æ zmiennej.\n" #: src/command.c:269 msgid "status" msgstr "status" #: src/command.c:270 msgid "Display status information and some statistics.\n" msgstr "Wy¶wietla informacje o stanie i parê statystyk.\n" #: src/command.c:272 msgid "transfers" msgstr "transfers" #: src/command.c:273 msgid "Display a list of user connections.\n" msgstr "Wy¶wietla listê po³±czeñ z u¿ytkownikami.\n" #: src/command.c:275 msgid "unqueue USER [RANGE]" msgstr "unqueue U¯YTKOWNIK [ZAKRES]" #: src/command.c:276 msgid "" "Remove all or a range of queued files for USER. If RANGE is not specified, " "remove all files from the queue. Use dash (`-') and comma (`,') in RANGE. " "Open ranges are accepted (e.g. `1-' or `-2').\n" msgstr "" "Usuwa pliki z kolejki dla U¯YTKOWNIK. Je¶li parametr ZAKRES nie zosta³ " "podany, usuwa wszystkie pliki z kolejki. W parametrze ZAKRES mo¿na u¿ywaæ " "my¶lnika (`-') i przecinka (`,'). Dozwolone s± niedomkniête zakresy (np. " "`1-' czy `-2').\n" #: src/command.c:280 msgid "unsearch INDEX ..." msgstr "unsearch INDEKS ..." #: src/command.c:281 msgid "Remove a previously issued search and all results for that search.\n" msgstr "Usuwa wcze¶niej wykonane wyszukiwanie oraz wszystkie jego wyniki.\n" #: src/command.c:283 msgid "who [USER ...]" msgstr "who [U¯YTKOWNIK ...]" #: src/command.c:284 msgid "" "If USER is specified, display information on that user. Otherwise, display a " "table of users with some user details.\n" msgstr "" "Je¶li podany zosta³ parametr U¯YTKOWNIK, wy¶wietla informacje o tym " "u¿ytkowniku. W przeciwnym wypadku wy¶wietla tabelkê z u¿ytkownikami i kilka " "informacji o nich.\n" #: src/command.c:287 msgid "alias [NAME[=VALUE] ...]" msgstr "alias [NAZWA[=WARTO¦Æ] ...]" #: src/command.c:288 msgid "" "Without arguments, display the list of aliases. With NAME argument, display " "what value (command) that alias is set to. With both NAME and VALUE " "argument, change alias. Note that VALUE is a single argument - you need to " "use quotes for more complex commands.\n" "\n" "Example:\n" " alias ll \"ls -l\"\n" msgstr "" "Bez podanych parametrów, wy¶wietla aktualn± listê aliasów. Je¶li podano " "parametr NAZWA, wy¶wietla jak± warto¶æ (polecenie) ma przypisany alias. " "Je¶li podano parametry NAZWA i WARTO¦Æ, zmienia alias. Nale¿y pamiêtaæ, ¿e " "WARTO¦Æ jest pojedynczym argumentem -- nale¿y u¿yæ cudzys³owów dla bardziej " "z³o¿onych poleceñ.\n" "\n" "Przyk³ad:\n" " alias ll \"ls -l\"\n" #: src/command.c:296 msgid "unalias NAME ..." msgstr "unalias NAZWA ..." #: src/command.c:297 msgid "Remove aliases.\n" msgstr "Usuwa aliasy.\n" #: src/command.c:299 msgid "shell [COMMAND [ARGUMENTS...]]" msgstr "shell [POLECENIE [ARGUMENTY...]]" #: src/command.c:300 msgid "" "Execute a system command. If no arguments are specified, the current shell " "will be started (SHELL environment variable or `/bin/sh' if that is not " "set). microdc will continue in the background while the command is " "executing.\n" msgstr "" "Wykonuje polecenie pow³oki. Je¶li nie zostan± podane ¿adne parametry, " "uruchomiona bêdzie aktualna pow³oka (ze zmiennej ¶rodowiskowej SHELL, lub `/" "bin/sh', gdy zmienna ta nie jest ustawiona). microdc bêdzie dzia³aæ w tle " "podczas gdy polecenie bêdzie wykonywane.\n" #: src/command.c:305 msgid "lookup HOST ..." msgstr "lookup HOST ..." #: src/command.c:306 msgid "Lookup the IP address of specified hosts.\n" msgstr "Wyszukuje adres IP podanych hostów\n" #: src/command.c:496 #, c-format msgid "%s: Unknown command.\n" msgstr "%s: Nieznana komenda.\n" #: src/command.c:678 #, c-format msgid "Cannot create child process - %s\n" msgstr "Nie mo¿na utworzyæ procesu potomnego - %s\n" #: src/command.c:693 src/command.c:696 #, c-format msgid "%s: cannot execute - %s\n" msgstr "%s: nie mo¿na wykonaæ - %s\n" #: src/command.c:711 src/command.c:714 src/command.c:717 src/command.c:720 #: src/command.c:723 src/command.c:726 #, c-format msgid "Hub state: %s\n" msgstr "Stan huba: %s\n" #: src/command.c:711 msgid "Not connected" msgstr "Brak po³±czenia" #: src/command.c:714 msgid "Looking up IP address" msgstr "Wyszukiwanie adresu IP" #: src/command.c:717 msgid "Waiting for complete connection" msgstr "Oczekiwanie na zakoñczenie po³±czenia" #: src/command.c:720 msgid "Waiting for $Lock" msgstr "Oczekiwanie na $Lock" # #: src/command.c:723 msgid "Waiting for $Hello" msgstr "Oczekiwanie na $Hello" #: src/command.c:726 msgid "Logged in" msgstr "Zalogowany" #: src/command.c:731 src/command.c:733 #, c-format msgid "Hub users: %s\n" msgstr "U¿ytkownicy huba: %s\n" #: src/command.c:733 msgid "(not logged in)" msgstr "(niezalogowany)" # #: src/command.c:736 msgid "Pending user connections:\n" msgstr "Oczekuj±ce po³±czenia u¿ytkowników:\n" #: src/command.c:741 msgid " (none)\n" msgstr " (brak)\n" #: src/command.c:743 #, c-format msgid "Share size: % %s (%s)\n" msgstr "Udostêpnianych zasobów: % %s (%s)\n" #: src/command.c:745 src/command.c:749 src/command.c:753 src/command.c:1501 #: src/command.c:1898 src/main.c:616 src/main.c:623 src/main.c:860 #: src/user.c:421 msgid "byte" msgid_plural "bytes" msgstr[0] "bajt" msgstr[1] "bajty" msgstr[2] "bajtów" #: src/command.c:747 #, c-format msgid "Bytes received: % %s (%s)\n" msgstr "Otrzymanych bajtów: % %s (%s)\n" #: src/command.c:751 #, c-format msgid "Bytes sent: % %s (%s)\n" msgstr "Wys³anych bajtów: % %s (%s)\n" #: src/command.c:774 #, c-format msgid "Usage: %s MESSAGE..\n" msgstr "U¿ycie: %s WIADOMO¦Æ..\n" #: src/command.c:778 src/command.c:806 src/command.c:839 src/command.c:881 #: src/command.c:894 src/command.c:1267 src/command.c:1298 src/command.c:1414 #: src/command.c:1489 src/command.c:1619 msgid "Not connected.\n" msgstr "Brak po³±czenia.\n" #: src/command.c:802 #, c-format msgid "Usage: %s USER MESSAGE..\n" msgstr "U¿ycie: %s U¯YTKOWNIK WIADOMO¦Æ..\n" #: src/command.c:811 src/command.c:913 src/command.c:1010 src/command.c:1276 #: src/command.c:1319 src/command.c:1419 src/command.c:1499 #, c-format msgid "%s: No such user on this hub\n" msgstr "%s: Nie ma takiego u¿ytkownika na tym hubie\n" #: src/command.c:835 #, c-format msgid "Usage: %s DATA...\n" msgstr "U¿ycie: %s DANE...\n" #: src/command.c:855 #, c-format msgid "Usage: %s HOST[:PORT]\n" msgstr "U¿ycie: %s HOST[:PORT]\n" #: src/command.c:859 msgid "Connection in progress, disconnect first.\n" msgstr "Po³±czenie w trakcie nawi±zywania, najpierw siê roz³±cz.\n" #: src/command.c:867 #, c-format msgid "Invalid port number %s\n" msgstr "Nieprawid³owy numer portu %s\n" #: src/command.c:883 msgid "Disconnecting from hub.\n" msgstr "Roz³±czanie.\n" #: src/command.c:917 #, c-format msgid "%s has been granted a slot.\n" msgstr "Przydzielono slot dla %s.\n" #: src/command.c:919 #, c-format msgid "%s is no longer granted a slot.\n" msgstr "%s nie posiada ju¿ przydzielonego slotu.\n" #: src/command.c:971 #, c-format msgid "Now browsing %s.\n" msgstr "Przegl±dasz teraz %s.\n" #: src/command.c:989 src/command.c:1062 src/command.c:1078 src/command.c:1141 #: src/command.c:1213 src/command.c:1854 msgid "Not browsing any user.\n" msgstr "Nie przegl±dasz ¿adnego u¿ytkownika.\n" #: src/command.c:1017 src/filelist-in.c:240 src/fs.c:393 src/fs.c:470 #: src/main.c:1344 src/main.c:1362 src/user.c:531 src/util.c:109 #: src/variables.c:407 src/variables.c:427 src/variables.c:448 #, c-format msgid "%s: Cannot get file status - %s\n" msgstr "%s: Nie mo¿na wykonaæ operacji stat - %s\n" #: src/command.c:1036 msgid "No free connections. Queued file for download.\n" msgstr "Brak wolnych po³±czeñ. Plik zakolejkowano do pobrania.\n" #: src/command.c:1064 #, c-format msgid "(%s) Waiting for file list.\n" msgstr "(%s) Oczekiwanie na listê plików.\n" #: src/command.c:1067 #, c-format msgid "(%s) %s\n" msgstr "(%s) %s\n" #: src/command.c:1089 msgid "No previous path.\n" msgstr "Brak poprzedniej ¶cie¿ki.\n" #: src/command.c:1118 #, c-format msgid "%s: not a directory\n" msgstr "%s: nie jest katalogiem\n" #: src/command.c:1182 src/command.c:1255 #, c-format msgid "%s: No such file or directory\n" msgstr "%s: Nie ma takiego pliku ani katalogu\n" #: src/command.c:1282 #, c-format msgid "%s: Already connected to user.\n" msgstr "%s: Po³±czenie z u¿ytkownikiem ju¿ istnieje.\n" #: src/command.c:1402 #, c-format msgid "Usage: %s USER [RANGE]\n" msgstr "U¿ycie: %s U¯YTKOWNIK [ZAKRES]\n" #: src/command.c:1423 #, c-format msgid "%s: Invalid range, or index out of range (1-%d)\n" msgstr "%s: Nieprawid³owy zakres, lub indeks poza zakresem (1-%d)\n" #: src/command.c:1502 #, c-format msgid "Nick: %s\n" msgstr "Nick: %s\n" #: src/command.c:1503 #, c-format msgid "Description: %s\n" msgstr "Opis: %s\n" #: src/command.c:1504 #, c-format msgid "Speed: %s\n" msgstr "Prêdko¶æ: %s\n" #: src/command.c:1505 #, c-format msgid "Level: %d\n" msgstr "Poziom: %d\n" #: src/command.c:1506 #, c-format msgid "E-mail: %s\n" msgstr "Adres e-mail: %s\n" #: src/command.c:1507 #, c-format msgid "Operator: %d\n" msgstr "Operator: %d\n" #: src/command.c:1508 #, c-format msgid "Share Size: % %s (% MB)\n" msgstr "Udostêpnianych zasobów: % %s (% MB)\n" #: src/command.c:1570 src/command.c:1637 src/main.c:262 src/main.c:629 #: src/search.c:523 src/search.c:567 #, c-format msgid "Cannot get current time - %s\n" msgstr "Nie mo¿na uzyskaæ aktualnego czasu - %s\n" #: src/command.c:1582 #, c-format msgid "Upload slots: %d/%d Download slots: %d/unlimited\n" msgstr "Sloty upload: %d/%d Sloty download: %d/nieograniczone\n" #: src/command.c:1592 #, c-format msgid "Usage: %s CONNECTION ...\n" msgstr "U¿ycie: %s PO£¡CZENIE ...\n" #: src/command.c:1601 #, c-format msgid "%s: No such user connection.\n" msgstr "%s: Nie ma takiego po³±czenia z u¿ytkownikiem.\n" #: src/command.c:1615 #, c-format msgid "Usage: %s STRING...\n" msgstr "U¿ycie: %s WZORZEC...\n" #: src/command.c:1648 msgid "Closed" msgstr "Zamkniête" #: src/command.c:1648 msgid "Open" msgstr "Otwarte" #: src/command.c:1649 #, c-format msgid "%d. %s (%s) Results: %d\n" msgstr "%d. %s (%s) Wyników: %d\n" #: src/command.c:1660 src/command.c:1695 #, c-format msgid "%s: Invalid search index.\n" msgstr "%s: Nieprawid³owy indeks wyszukiwania.\n" #: src/command.c:1664 #, c-format msgid "Search %d:\n" msgstr "Wyszukiwanie %d:\n" #: src/command.c:1687 #, c-format msgid "Usage: %s INDEX\n" msgstr "U¿ycie: %s INDEKS\n" #: src/command.c:1735 src/command.c:1775 #, c-format msgid "%s: No such alias.\n" msgstr "%s: Nie ma takiego aliasu.\n" #: src/command.c:1741 #, c-format msgid "%s: Invalid alias name\n" msgstr "%s: Nieprawid³owa nazwa aliasu\n" #: src/command.c:1756 #, c-format msgid "%s: Cannot override built-in command.\n" msgstr "%s: Nie mo¿na nadpisaæ wewnêtrznej komendy.\n" #: src/command.c:1768 #, c-format msgid "Usage: %s NAME ...\n" msgstr "U¿ycie: %s NAZWA ...\n" #: src/command.c:1812 msgid "Queue already contains this file, ignoring\n" msgstr "Ten plik jest ju¿ w kolejce, pomijam\n" #: src/command.c:1850 #, c-format msgid "Usage: %s FILE ...\n" msgstr "U¿ycie: %s PLIK ...\n" #: src/command.c:1888 #, c-format msgid "Matched %s\n" msgstr "Dopasowano %s\n" #: src/command.c:1897 #, c-format msgid "Downloading % %s in % %s\n" msgstr "Pobieranie % %s (% %s)\n" #: src/command.c:1899 msgid "file" msgid_plural "files" msgstr[0] "plik" msgstr[1] "pliki" msgstr[2] "plików" #: src/command.c:1902 #, c-format msgid "%s: No files to download.\n" msgstr "%s: Brak plików do pobrania.\n" #: src/command.c:1910 msgid "No free connections. Queued files for download.\n" msgstr "Brak wolnych po³±czeñ. Pliki zakolejkowano do pobrania.\n" #: src/command.c:1940 msgid "missing host argument\n" msgstr "brak parametru host\n" #: src/connection.c:44 msgid "Invalid $Lock message: Key to short\n" msgstr "Nieprawid³owy komunikat $Lock: Zbyt krótki klucz\n" #: src/filelist-in.c:250 src/user.c:544 #, c-format msgid "%s: Cannot open file for reading - %s\n" msgstr "%s: Nie mo¿na otworzyæ pliku do czytania - %s\n" #: src/filelist-in.c:256 src/main.c:117 src/main.c:836 #, c-format msgid "%s: Cannot read from file - %s\n" msgstr "%s: Nie mo¿na czytaæ z pliku - %s\n" #: src/filelist-in.c:258 src/main.c:119 #, c-format msgid "%s: Premature end of file\n" msgstr "%s: Przedwczesny koniec pliku\n" #: src/filelist-in.c:261 src/filelist-in.c:265 src/fs.c:498 src/main.c:838 #: src/main.c:842 src/screen.c:125 src/user.c:314 #, c-format msgid "%s: Cannot close file - %s\n" msgstr "%s: Nie mo¿na zamkn±æ pliku - %s\n" #: src/filelist-in.c:269 #, c-format msgid "%s: Invalid data, cannot decode\n" msgstr "%s: Nieprawid³owe dane, nie mo¿na dekodowaæ\n" #: src/filelist-in.c:426 src/lookup.c:308 src/main.c:373 src/main.c:1146 #: src/user.c:1058 #, c-format msgid "Cannot create pipe pair - %s\n" msgstr "Nie mo¿na utworzyæ pary potoków - %s\n" #: src/filelist-in.c:431 src/hub.c:291 src/lookup.c:313 src/main.c:389 #: src/main.c:966 src/main.c:1007 src/user.c:1104 #, c-format msgid "Cannot set non-blocking flag - %s\n" msgstr "Nie mo¿na ustawiæ opcji nieblokowania - %s\n" #: src/filelist-in.c:437 src/lookup.c:319 src/main.c:379 #, c-format msgid "Cannot create process - %s\n" msgstr "Nie mo¿na utworzyæ procesu - %s\n" #: src/fs.c:379 #, c-format msgid "%s: Cannot open directory - %s\n" msgstr "%s: Nie mo¿na otworzyæ katalogu - %s\n" #: src/fs.c:408 #, c-format msgid "%s: Not a regular file or directory, ignoring\n" msgstr "%s: Nie jest zwyk³ym plikiem ani katalogiem, pomijam\n" #: src/fs.c:413 #, c-format msgid "%s: Cannot read directory - %s\n" msgstr "%s: Nie mo¿na przeczytaæ katalogu - %s\n" #: src/fs.c:415 #, c-format msgid "%s: Cannot close directory - %s\n" msgstr "%s: Nie mo¿na zamkn±æ katalogu - %s\n" #: src/fs.c:456 #, c-format msgid "Scanning directory %s\n" msgstr "Przeszukujê katalog %s\n" #: src/fs.c:473 src/main.c:1349 src/main.c:1367 #, c-format msgid "%s: Cannot remove file - %s\n" msgstr "%s: Nie mo¿na usun±æ pliku - %s\n" #: src/fs.c:481 src/user.c:436 #, c-format msgid "%s: Cannot open file for writing - %s\n" msgstr "%s: Nie mo¿na otworzyæ pliku do pisania - %s\n" #: src/fs.c:491 src/main.c:114 #, c-format msgid "%s: Cannot write to file - %s\n" msgstr "%s: Nie mo¿na pisaæ do pliku - %s\n" #: src/hub.c:166 src/main.c:230 msgid "UL" msgstr "UL" #: src/hub.c:171 src/main.c:230 msgid "DL" msgstr "DL" #: src/hub.c:223 #, c-format msgid "Cannot append to hub send queue - %s\n" msgstr "Nie mo¿na dodaæ do kolejki wysy³ania do huba - %s\n" #: src/hub.c:228 src/user.c:205 msgid "-->" msgstr "-->" #: src/hub.c:232 src/hub.c:823 src/hub.c:888 msgid "hub" msgstr "hub" #: src/hub.c:250 #, c-format msgid "%s: Cannot look up address - %s\n" msgstr "%s: Nieudane wyszukiwanie adresu - %s\n" #: src/hub.c:273 #, c-format msgid "Looking up IP address for %s\n" msgstr "Wyszukiwanie adresu IP dla %s\n" #: src/hub.c:284 src/main.c:961 src/main.c:1000 src/user.c:1093 #, c-format msgid "Cannot create socket - %s\n" msgstr "Nie mo¿na utworzyæ gniazda - %s\n" #: src/hub.c:296 #, c-format msgid "Connecting to hub on %s.\n" msgstr "£±czenie z hubem na %s.\n" #: src/hub.c:299 #, c-format msgid "%s: Cannot connect - %s\n" msgstr "%s: Nieudane po³±czenie - %s\n" #: src/hub.c:313 msgid "Shutting down hub connection.\n" msgstr "Zamykanie po³±czenia z hubem.\n" #: src/hub.c:322 src/main.c:392 src/main.c:946 src/main.c:1064 #, c-format msgid "Cannot close socket - %s\n" msgstr "Nie mo¿na zamkn±æ gniazda - %s\n" #: src/hub.c:348 src/user.c:149 src/user.c:754 #, c-format msgid "Received %s message in wrong state.\n" msgstr "Otrzymano komunikat %s w z³ym stanie.\n" #: src/hub.c:389 src/user.c:654 msgid "Invalid $Lock message: Missing Pk value\n" msgstr "Nieprawid³owy komunikat $Lock: Brak warto¶ci Pk\n" #: src/hub.c:421 msgid "Hub requires password.\n" msgstr "Hub wymaga has³a.\n" #: src/hub.c:425 msgid "Sending password to hub.\n" msgstr "Wysy³anie has³a do huba.\n" #: src/hub.c:430 msgid "Password not accepted.\n" msgstr "Has³o odrzucone.\n" #: src/hub.c:434 msgid "You have received operator status.\n" msgstr "Otrzyma³e¶ status operatora.\n" #: src/hub.c:439 #, c-format msgid "Hub name is %s.\n" msgstr "Nazwa huba: %s.\n" #: src/hub.c:451 msgid "Hub did not accept nick. Nick may be in use.\n" msgstr "Hub odrzuci³ Twój nick. Ten nick mo¿e juz byæ zajêty.\n" #: src/hub.c:459 msgid "Nick accepted. You are now logged in.\n" msgstr "Nick zaakceptowany. Jeste¶ zalogowany.\n" #: src/hub.c:464 #, c-format msgid "Nick accepted but modified to %s. You are now logged in.\n" msgstr "Nick zaakceptowany ale zmieniony na %s. Jeste¶ zalogowany.\n" #: src/hub.c:479 #, c-format msgid "User %s logged in.\n" msgstr "U¿ytkownik %s zalogowa³ siê.\n" #: src/hub.c:497 msgid "Invalid $MyINFO message: Missing $ALL parameter, ignoring\n" msgstr "Nieprawid³owy komunikat $MyINFO: Brak parametru $ALL, pomijam\n" #: src/hub.c:503 msgid "Invalid $MyINFO message: Missing nick parameter, ignoring\n" msgstr "Nieprawid³owy komunikat $MyINFO: Brak parametru nick, pomijam\n" #: src/hub.c:516 msgid "Invalid $MyINFO message: Missing description parameter, ignoring\n" msgstr "Nieprawid³owy komunikat $MyINFO: Brak parametru description, pomijam\n" #: src/hub.c:524 msgid "Invalid $MyINFO message: Missing description separator, ignoring\n" msgstr "Nieprawid³owy komunikat $MyINFO: Brak separatora opisu, pomijam\n" #: src/hub.c:530 msgid "Invalid $MyINFO message: Missing connection speed, ignoring\n" msgstr "" "Nieprawid³owy komunikat $MyINFO: Brak informacji o prêdko¶ci po³±czenia, " "pomijam\n" #: src/hub.c:545 msgid "Invalid $MyINFO message: Missing e-mail address, ignoring\n" msgstr "Nieprawid³owy komunikat $MyINFO: Brak adresu e-mail, pomijam\n" #: src/hub.c:553 msgid "Invalid $MyINFO message: Missing share size, ignoring\n" msgstr "" "Nieprawid³owy komunikat $MyINFO: Brak informacji o ilo¶ci udostepnianych " "zasobów, pomijam\n" #: src/hub.c:557 msgid "Invalid $MyINFO message: Invalid share size, ignoring\n" msgstr "" "Nieprawid³owy komunikat $MyINFO: Nieprawid³owa informacja o ilo¶ci " "udostêpnianych zasobów, pomijam\n" #: src/hub.c:567 msgid "Hub is full.\n" msgstr "Hub jest pe³ny.\n" #: src/hub.c:598 src/hub.c:601 #, c-format msgid "Public: %s\n" msgstr "Publicznie: %s\n" #: src/hub.c:598 src/hub.c:601 src/hub.c:634 src/hub.c:640 #, c-format msgid " | %s\n" msgstr " | %s\n" #: src/hub.c:613 msgid "Invalid $To message: Missing text separator, ignoring\n" msgstr "Nieprawid³owy komunikat $To: Brak separatora tekstu, pomijam\n" #: src/hub.c:631 src/hub.c:638 #, c-format msgid "Private: [%s] %s\n" msgstr "Prywatnie: [%s] %s\n" #: src/hub.c:649 msgid "Invalid $ConnectToMe message: Missing or invalid nick\n" msgstr "" "Nieprawid³owy komunikat $ConnectToMe: Brakuj±cy lub nieprawid³owy nick\n" #: src/hub.c:653 msgid "Invalid $ConnectToMe message: Invalid address specification.\n" msgstr "Nieprawid³owy komunikat $ConnectToMe: Nieprawid³owa postaæ adresu.\n" #: src/hub.c:657 #, c-format msgid "Connecting to user on %s\n" msgstr "£±czenie z u¿ytkownikiem na %s\n" #: src/hub.c:666 msgid "Invalid $RevConnectToMe message: Missing nick parameter\n" msgstr "Nieprawid³owy komunikat $RevConnectToMe: Brak parametru nick\n" #: src/hub.c:670 msgid "Invalid $RevConnectToMe message: Remote nick is our nick\n" msgstr "Nieprawid³owy komunikat $RevConnectToMe: Zdalny nick to nasz nick\n" #: src/hub.c:675 #, c-format msgid "Invalid $RevConnectToMe message: Unknown user %s, ignoring\n" msgstr "" "Nieprawid³owy komunikat $RevConnectToMe: Nieznany u¿ytkownik %s, pomijam\n" #: src/hub.c:680 src/main.c:199 src/main.c:213 #, c-format msgid "No more connections to user %s allowed.\n" msgstr "Wyczerpany limit po³±czeñ z u¿ytkownikiem %s.\n" #: src/hub.c:686 #, c-format msgid "User %s is also passive. Cannot establish connection.\n" msgstr "" "U¿ytkownik %s równie¿ pracuje w trybie pasywnym. Nie mo¿na nawi±zaæ " "po³±czenia.\n" #: src/hub.c:761 #, c-format msgid "Invalid $Quit message: Unknown user %s.\n" msgstr "Nieprawid³owy komunikat $Quit: Nieznany u¿ytkownik %s\n" #: src/hub.c:773 msgid "Invalid $Search message: Missing source specification.\n" msgstr "Nieprawid³owy komunikat $Search: Brak wyszczególnienia ¼ród³a.\n" #: src/hub.c:777 msgid "Invalid $Search message: Invalid search specification.\n" msgstr "Nieprawid³owy komunikat $Search: Nieprawid³owa postaæ wyszukiwania.\n" #: src/hub.c:783 #, c-format msgid "Invalid $Search message: Unknown user %s.\n" msgstr "Nieprawid³owy komunikat $Search: Nieznany u¿ytkownik %s.\n" #: src/hub.c:793 msgid "Invalid $Search message: Invalid address specification.\n" msgstr "Nieprawid³owy komunikat $Search: Nieprawid³owa postaæ adresu.\n" #: src/hub.c:832 src/user.c:848 msgid "<--" msgstr "<--" #: src/hub.c:856 src/user.c:873 #, c-format msgid "Cannot get error status - %s\n" msgstr "Nie mo¿na uzyskaæ informacji o b³êdzie - %s\n" #: src/hub.c:861 src/user.c:878 src/user.c:1115 #, c-format msgid "Cannot connect - %s\n" msgstr "Nieudane po³±czenie - %s\n" #: src/hub.c:869 src/main.c:1039 #, c-format msgid "Cannot get socket address - %s\n" msgstr "Nie mo¿na uzyskaæ adresu gniazda - %s\n" #: src/hub.c:876 #, c-format msgid "Connected to hub from %s.\n" msgstr "Pod³±czono do huba z %s.\n" #: src/hub.c:916 #, c-format msgid "ConnectToMe already sent to user %s. Waiting.\n" msgstr "ConnectToMe zosta³o ju¿ wys³ane do u¿ytkownika %s. Oczekiwanie.\n" #: src/hub.c:927 #, c-format msgid "RevConnectToMe already sent to user %s. Waiting.\n" msgstr "RevConnectToMe zosta³o ju¿ wys³ane do u¿ytkownika %s. Oczekiwanie.\n" #: src/hub.c:931 #, c-format msgid "User %s is also passive. Cannot communicate.\n" msgstr "" "U¿ytkownik %s równie¿ pracuje w trybie pasywnym. Brak mo¿liwo¶ci " "komunikacji.\n" #: src/huffman.c:332 msgid "Incorrect parity, ignoring\n" msgstr "Nieprawid³owa parzysto¶æ, pomijam\n" #: src/main.c:174 #, c-format msgid "User connection %s renamed to %s.\n" msgstr "Po³±czenie u¿ytkownika %s przemianowane na %s.\n" #: src/main.c:265 #, c-format msgid " in %s (%s/s)" msgstr " %s (%s/s)" #: src/main.c:279 #, c-format msgid "%s: %s of %s %s%s. %s %s%s.\n" msgstr "%s: %s %s %s%s. %s %s%s.\n" #: src/main.c:281 msgid "Upload" msgstr "Wysy³anie" #: src/main.c:281 msgid "Download" msgstr "Pobieranie" #: src/main.c:283 msgid "succeeded" msgstr "powiod³o siê" #: src/main.c:283 msgid "failed" msgstr "nie powiod³o siê" #: src/main.c:286 msgid "transferred" msgid_plural "transferred" msgstr[0] "przes³ano" msgstr[1] "przes³ano" msgstr[2] "przes³ano" #: src/main.c:342 #, c-format msgid "%s: Cannot rename file to %s - %s\n" msgstr "%s: Nie mo¿na zmieniæ nazwy pliku na %s - %s\n" #: src/main.c:343 msgid "cannot rename file" msgstr "nie mo¿na zmieniæ nazwy pliku" #: src/main.c:386 src/main.c:469 src/user.c:1055 src/user.c:1168 #: src/user.c:1170 #, c-format msgid "Cannot close pipe - %s\n" msgstr "Nie mo¿na zamkn±æ potoku - %s\n" #. TRANSLATORS: This represents the connection name used when #. * the user name is not yet known. It must not contains '|', #. * because that's used to distinguish between 'unknown' and #. * (perhaps partially) identified connections. #. #: src/main.c:419 #, c-format msgid "unknown%" msgstr "nieznany%" #: src/main.c:440 #, c-format msgid "Shutting down user connection process for %s.\n" msgstr "Zamykanie procesu po³±czenia z u¿ytkownikiem dla %s.\n" #: src/main.c:494 #, c-format msgid "Downloading %3d%% (at %5d kb/s) %s" msgstr "Pobieranie %3d%% (z prêdko¶ci± %5d kb/s) %s" #: src/main.c:495 #, c-format msgid "Uploading %3d%% (at %5d kb/s) %s" msgstr "Wysy³anie %3d%% (z prêdko¶ci± %5d kb/s) %s" #: src/main.c:498 msgid "Idle" msgstr "Bezczynny" #: src/main.c:520 src/main.c:535 #, c-format msgid "user process %s" msgstr "proces u¿ytkownika %s" #: src/main.c:549 #, c-format msgid "User %s: %s" msgstr "U¿ytkownik %s: %s" #: src/main.c:610 #, c-format msgid "%s: Starting %s of %s (% of % %s).\n" msgstr "%s: Rozpoczêto %s pliku %s (% z % %s).\n" #: src/main.c:612 src/main.c:620 msgid "upload" msgstr "wysy³anie" #: src/main.c:612 src/main.c:620 msgid "download" msgstr "pobieranie" #: src/main.c:618 #, c-format msgid "%s: Starting %s of %s (% %s).\n" msgstr "%s: Rozpoczêto %s pliku %s (% bajtów %s).\n" #: src/main.c:702 #, c-format msgid "Received unknown message %d from user process, shutting down process.\n" msgstr "" "Otrzymano nieznany komunikat %d od procesu u¿ytkownika, zamykanie procesu.\n" #: src/main.c:746 src/main.c:747 src/user.c:968 src/user.c:969 #, c-format msgid "Cannot write to signal pipe - %s\n" msgstr "Nie mo¿na pisaæ do potoku sygna³owego - %s\n" #: src/main.c:762 src/user.c:984 #, c-format msgid "Cannot read from signal pipe - %s\n" msgstr "Nie mo¿na czytaæ z potoku sygna³owego - %s\n" #: src/main.c:768 src/user.c:990 msgid "Received TERM signal, shutting down.\n" msgstr "Otrzymano sygna³ TERM, zamykanie.\n" #: src/main.c:784 msgid "Shell process" msgstr "Proces pow³oki" #: src/main.c:786 msgid "Lookup process" msgstr "Proces rozwi±zywania nazw" #: src/main.c:789 msgid "Parse process" msgstr "Proces parsowania" #: src/main.c:793 msgid "User process" msgstr "Proces u¿ytkownika" #: src/main.c:796 #, c-format msgid "%s exited with return code %d.\n" msgstr "%s zakoñczy³ siê w stanie %d.\n" #: src/main.c:802 #, c-format msgid "%s terminated by signal %s.\n" msgstr "%s zosta³ przerwany sygna³em %s.\n" #: src/main.c:806 #, c-format msgid "Cannot wait for processes - %s\n" msgstr "Nieudane oczekiwanie na proces - %s\n" #: src/main.c:825 #, c-format msgid "%s: Cannot open file - %s\n" msgstr "%s: Nie mo¿na otworzyæ pliku - %s\n" #: src/main.c:858 #, c-format msgid "Sharing % %s (%s) totally\n" msgstr "Udostêpniono ³±cznie % %s (%s)\n" #: src/main.c:875 src/main.c:906 src/main.c:928 msgid "user (search result)" msgstr "u¿ytkownik (wynik wyszukiwania)" #: src/main.c:910 msgid "<==" msgstr "<==" #: src/main.c:932 msgid "==>" msgstr "==>" #: src/main.c:972 src/main.c:1015 #, c-format msgid "Cannot enable address reusing - %s\n" msgstr "Nie mo¿na zastosowaæ ponownego u¿ywania adresu - %s\n" #: src/main.c:980 src/main.c:1024 #, c-format msgid "Cannot bind to address - %s\n" msgstr "Nie mo¿na dowi±zaæ adresu - %s\n" #: src/main.c:1032 #, c-format msgid "Cannot listen - %s\n" msgstr "Nie mo¿na nas³uchiwaæ - %s\n" #: src/main.c:1044 #, c-format msgid "Listening on %s.\n" msgstr "Nas³uchiwanie na %s.\n" #: src/main.c:1083 #, c-format msgid "Cannot accept user connection - %s\n" msgstr "Nie mo¿na przyj±æ po³±czenia u¿ytkownika - %s\n" #: src/main.c:1087 #, c-format msgid "User from %s connected.\n" msgstr "U¿ytkownik z %s po³±czony.\n" #: src/main.c:1103 #, c-format msgid "%s: Cannot set locale: %s\n" msgstr "%s: Nie mo¿na ustawiæ lokalizacji: %s\n" #: src/main.c:1106 #, c-format msgid "%s: Cannot bind message domain: %s\n" msgstr "%s: Nie mo¿na dowi±zaæ dziedziny komunikatów: %s\n" #: src/main.c:1108 #, c-format msgid "%s: Cannot set message domain: %s\n" msgstr "%s: Nie mo¿na ustawiæ dziedziny komunikatów: %s\n" #: src/main.c:1130 #, c-format msgid "Usage: %s [OPTION]...\n" msgstr "U¿ycie: %s [OPCJA]...\n" #: src/main.c:1131 msgid "Start microdc, a command-line based Direct Connect client.\n" msgstr "Uruchamia microdc, klienta Direct Connect z interfejsem tekstowym.\n" #: src/main.c:1132 #, c-format msgid " -n, --no-config do not read config file on startup\n" msgstr " -n, --no-config nie czytaj pliku konfiguracyjnego przy starcie\n" #: src/main.c:1133 #, c-format msgid " --help display this help and exit\n" msgstr " --help wy¶wietla ten tekst i koñczy program\n" #: src/main.c:1134 #, c-format msgid " --version output version information and exit\n" msgstr " --version wy¶wietla informacjê o wersji i koñczy program\n" #: src/main.c:1135 #, c-format msgid "" "\n" "Report bugs to <%s>.\n" msgstr "" "\n" "B³êdy proszê zg³aszaæ na adres <%s>.\n" #: src/main.c:1153 src/user.c:1063 #, c-format msgid "Cannot empty signal set - %s\n" msgstr "Nie mo¿na opró¿niæ zbioru sygna³ów - %s\n" #: src/main.c:1164 src/main.c:1168 src/main.c:1172 src/main.c:1176 #: src/main.c:1181 src/user.c:1076 src/user.c:1083 #, c-format msgid "Cannot register signal handler - %s\n" msgstr "Nie mo¿na zarejestrowaæ odbiornika sygna³ów - %s\n" #: src/main.c:1210 #, c-format msgid "Cannot find directory for temporary files - %s\n" msgstr "Nie mo¿na odnale¼æ katalogu na pliki tymczasowe - %s\n" #: src/main.c:1251 src/user.c:1133 #, c-format msgid "Cannot select - %s\n" msgstr "Nie mo¿na wykonaæ select - %s\n" #: src/main.c:1333 src/main.c:1335 src/variables.c:311 src/variables.c:313 #, c-format msgid "cannot close character convertor - %s\n" msgstr "nie mo¿na zamkn±æ konwertera znaków - %s\n" #: src/main.c:1374 #, c-format msgid "Cannot close search results socket - %s\n" msgstr "Nie mo¿na zamkn±æ gniazda wyników wyszukiwania - %s\n" #: src/main.c:1376 #, c-format msgid "Cannot close user connections socket - %s\n" msgstr "Nie mo¿na zamkn±æ gniazda po³±czeñ u¿ytkowników - %s\n" #: src/main.c:1378 src/main.c:1380 src/user.c:1164 src/user.c:1166 #, c-format msgid "Cannot close signal pipe - %s\n" msgstr "Nie mo¿na zamkn±æ potoku sygna³owego - %s\n" #: src/screen.c:132 msgid "No longer logging to file.\n" msgstr "Zaprzestano logowania do pliku.\n" #: src/screen.c:137 #, c-format msgid "%s: Cannot open file for appending - %s\n" msgstr "%s: Nie mo¿na otworzyæ pliku do dopisywania - %s\n" #: src/screen.c:142 #, c-format msgid "Logging to `%s'.\n" msgstr "Logowanie do `%s'.\n" #: src/screen.c:369 #, c-format msgid "%s: Cannot write history - %s\n" msgstr "%s: Nie mo¿na zapisaæ historii - %s\n" #: src/screen.c:568 #, c-format msgid "%s: Cannot read history - %s\n" msgstr "%s: Nie mo¿na odczytaæ historii - %s\n" #: src/search.c:322 src/search.c:324 #, c-format msgid "Sent %d/%d search results to %s.\n" msgstr "Wys³ano %d/%d wyników wyszukiwania do %s.\n" #: src/search.c:327 msgid "No search results.\n" msgstr "Brak wyników wyszukiwania.\n" #: src/search.c:512 msgid "No pattern to match.\n" msgstr "Brak wzorca do porównywania.\n" #: src/search.c:529 #, c-format msgid "Reissuing search %d.\n" msgstr "Powtarzanie wyszukiwania %d.\n" #: src/search.c:533 #, c-format msgid "Issuing new search with index %d.\n" msgstr "Wykonanie nowego wyszukiwania z indeksem %d.\n" #: src/search.c:573 #, c-format msgid "Unterminated or invalid $SR, discarding: %s\n" msgstr "Niezakoñczone lub nieprawid³owe $SR, odrzucam: %s\n" #: src/search.c:590 #, c-format msgid "Result has been added earlier to search %d.\n" msgstr "Wynik wyszukiwania zosta³ wcze¶niej dodany do wyszukiwania %d.\n" #: src/search.c:596 #, c-format msgid "Added result to search %d (now %d result).\n" msgid_plural "Added result to search %d (now %d results).\n" msgstr[0] "Dodano wynik do wyszukiwania %d (aktualnie %d wynik).\n" msgstr[1] "Dodano wynik do wyszukiwania %d (aktualnie %d wyniki).\n" msgstr[2] "Dodano wynik do wyszukiwania %d (aktualnie %d wyników).\n" #: src/user.c:124 msgid "main process" msgstr "proces g³ówny" #: src/user.c:209 src/user.c:828 src/user.c:922 src/user.c:942 msgid "user" msgstr "u¿ytkownik" #: src/user.c:255 msgid "Too many connections to user, or no free slots.\n" msgstr "Zbyt wiele po³±czeñ z u¿ytkownikiem, lub brak wolnych slotów.\n" #: src/user.c:297 #, c-format msgid "User %s not on hub, or too many connections to user.\n" msgstr "U¿ytkownik %s poza hubem, lub zbyt wiele po³±czeñ z u¿ytkownikiem.\n" #: src/user.c:365 msgid "No more files to download.\n" msgstr "Brak innych plików do pobrania.\n" #: src/user.c:377 #, c-format msgid "%s: Cannot get file status: %s\n" msgstr "%s: Nie mo¿na wykonaæ operacji stat: %s\n" #: src/user.c:378 src/user.c:387 src/user.c:437 src/user.c:443 src/user.c:533 #: src/user.c:546 src/user.c:552 src/user.c:611 src/user.c:912 msgid "local error" msgstr "b³±d lokalny" #: src/user.c:386 #, c-format msgid "%s: File exists and is not a regular file\n" msgstr "%s: Plik istnieje i nie jest zwyczajnym plikiem\n" #: src/user.c:397 src/user.c:449 src/user.c:557 src/user.c:923 msgid "communication error" msgstr "b³±d komunikacji" #: src/user.c:420 #, c-format msgid "" "remote file is smaller than local (expected %, got % %s)" msgstr "" "zdalny plik jest mniejszy ni¿ lokalny (spodziewane %, uzyskano %" " %s)" #: src/user.c:442 #, c-format msgid "%s: Cannot seek to resume position - %s\n" msgstr "%s: Nie mo¿na przewin±æ pliku do pozycji wznowienia - %s\n" #: src/user.c:462 src/user.c:584 msgid "no data to transfer" msgstr "brak danych do przes³ania" #: src/user.c:525 #, c-format msgid "%s: No such shared file\n" msgstr "%s: Nie ma takiego pliku wspó³dzielonego\n" #: src/user.c:527 msgid "no such shared file" msgstr "nie ma takiego udostêpnianego pliku" #: src/user.c:537 #, c-format msgid "%s: Resume offset % outside file\n" msgstr "%s: Offset wznowienia % jest poza plikiem\n" #: src/user.c:539 msgid "resume offset out of range" msgstr "offset wznowienia jest poza zakresem" #: src/user.c:550 #, c-format msgid "%s: Cannot seek in file - %s\n" msgstr "%s: Nie mo¿na wyszukiwaæ w pliku - %s\n" #: src/user.c:620 src/user.c:932 msgid "transfer complete" msgstr "przesy³anie ukoñczone" #: src/user.c:682 msgid "Invalid $Direction message: Missing direction parameter\n" msgstr "Nieprawid³owy komunikat $Direction: Brak parametru direction\n" #: src/user.c:691 msgid "Invalid $Direction message: Invalid direction parameter\n" msgstr "Nieprawid³owy komunikat $Direction: Nieprawid³owy parametr direction\n" #: src/user.c:698 msgid "Invalid $Direction message: Missing challenge parameter\n" msgstr "Nieprawid³owy komunikat $Direction: Brak parametru challenge\n" #: src/user.c:703 msgid "Invalid $Direction message: Invalid challenge parameter\n" msgstr "Nieprawid³owy komunikat $Direction: Nieprawid³owy parametr challenge\n" #: src/user.c:724 msgid "User does not want to download, nor do we.\n" msgstr "U¿ytkownik nie chce pobieraæ, my równie¿.\n" #: src/user.c:741 msgid "Invalid $Key message: Incorrect key, ignoring\n" msgstr "Nieprawid³owy komunikat $Key: Niew³a¶ciwy klucz, pomijam\n" #: src/user.c:760 msgid "Invalid $Get message: Missing offset, assuming start\n" msgstr "Nieprawid³owy komunikat $Get: Brak offsetu, zak³adam pocz±tek\n" #: src/user.c:765 msgid "Invalid $Get message: Offset not integer\n" msgstr "Nieprawid³owy komunikat $Get: Offset nie jest liczb± ca³kowit±\n" #: src/user.c:775 msgid "remote did not want file" msgstr "zdalny u¿ytkownik nie przyj±³ pliku" #: src/user.c:782 msgid "remote is maxed out" msgstr "zdalny u¿ytkownik jest wymaksowany" #: src/user.c:791 msgid "protocol error: invalid $FileLength message" msgstr "b³±d protoko³u: nieprawid³owy komunikat $FileLength" #: src/user.c:800 msgid "file not available on remote" msgstr "plik niedostêpny u zdalnego u¿ytkownika" # fixme #: src/user.c:802 #, c-format msgid "remote error: %s" msgstr "b³±d zdalny: %s" #: src/user.c:807 #, c-format msgid "Received error from user: %s\n" msgstr "Otrzymano b³±d od u¿ytkownika: %s\n" #: src/user.c:892 msgid "Connected to user.\n" msgstr "Po³±czono z u¿ytkownikiem.\n" #: src/user.c:993 #, c-format msgid "Idle timeout (%d seconds)\n" msgstr "Limit czasu bezczynno¶ci (%d sekund)\n" #: src/user.c:1024 msgid "Received unknown message from main process, shutting down process.\n" msgstr "Otrzymano nieznany komunikat od procesu g³ównego, zamykanie procesu.\n" #: src/user.c:1162 #, c-format msgid "Cannot close transfer file - %s\n" msgstr "Nie mo¿na zamkn±æ przesy³anego pliku - %s\n" #: src/user.c:1172 #, c-format msgid "Cannot close user connection - %s\n" msgstr "Nie mo¿na zamkn±æ po³±czenia z u¿ytkownikiem - %s\n" #: src/util.c:113 #, c-format msgid "%s: Cannot create directory - %s\n" msgstr "%s: Nie mo¿na utworzyæ katalogu - %s\n" #. TRANSLATORS: This comma-separated list specifies #. * all strings which are considered negative boolean #. * values for variables such as `active'. #. * Retain the default English strings and add the #. * localized ones. #. #: src/variables.c:52 msgid "0,off,no,false" msgstr "0,off,no,false,wy³±czone,nie,fa³sz" #. TRANSLATORS: This comma-separated list specifies #. * all strings which are considered positive boolean #. * values for variables such as `active'. #. * Retain the default English strings and add the #. * localized ones. #. #: src/variables.c:59 msgid "1,on,yes,true" msgstr "1,on,yes,true,w³±czone,tak,prawda" #: src/variables.c:288 src/variables.c:324 src/variables.c:359 #: src/variables.c:388 src/variables.c:403 src/variables.c:423 #: src/variables.c:444 src/variables.c:464 src/variables.c:546 #: src/variables.c:571 src/variables.c:690 src/variables.c:709 #: src/variables.c:733 msgid "too many arguments\n" msgstr "zbyt wiele argumentów\n" #: src/variables.c:296 msgid "cannot get current character set" msgstr "nie mo¿na uzyskaæ aktualnego zestawu znaków" #: src/variables.c:301 src/variables.c:306 #, c-format msgid "cannot create character set convertor - %s\n" msgstr "mie mo¿na utworzyæ konwertera zestawu znaków - %s\n" #: src/variables.c:326 msgid "Nick cannot be empty.\n" msgstr "Nick nie mo¿e byæ pusty.\n" #: src/variables.c:328 msgid "Nick is too long - max length is 35 characters.\n" msgstr "Zbyt d³ugi nick - maksymalna d³ugo¶æ to 35 znaków.\n" #: src/variables.c:330 msgid "Nick may not contain `$', `|' or space characters.\n" msgstr "Nick nie mo¿e zawieraæ znaków `$', `|', ani spacji.\n" #: src/variables.c:343 msgid "Description may not contain `$' or `|' characters.\n" msgstr "Opis nie mo¿e zawieraæ znaków `$' ani `|'.\n" #: src/variables.c:346 msgid "Description is too long - max length is 35 characters.\n" msgstr "Zbyt d³ugi opis - maksymalna d³ugo¶æ to 35 znaków.\n" #: src/variables.c:361 msgid "E-mail may not contain `$' or `|' characters.\n" msgstr "Adres e-mail nie mo¿e zawieraæ znaków `$' ani `|'.\n" #: src/variables.c:363 msgid "E-mail is too long - max length is 35 characters.\n" msgstr "Zbyt d³ugi adres e-mail - maksymalna d³ugo¶æ to 35 znaków.\n" #: src/variables.c:376 msgid "Tag may not contain `$' or `|' characters.\n" msgstr "Tag nie mo¿e zawieraæ znaków `$' ani `|'.\n" #: src/variables.c:390 msgid "Speed may not contain `$' or `|' characters.\n" msgstr "Prêdko¶æ nie mo¿e zawieraæ znaków `$' ani `|'.\n" #: src/variables.c:411 src/variables.c:431 src/variables.c:452 #, c-format msgid "%s: Not a directory\n" msgstr "%s: Nie jest katalogiem\n" #: src/variables.c:468 #, c-format msgid "Invalid slot number `%s'\n" msgstr "Nieprawid³owa liczba slotów `%s'\n" #: src/variables.c:550 msgid "Specify active as `0', `no', `off', `1', `yes', or `on'.\n" msgstr "" "Warto¶ci± zmiennej active musi byæ `0', `nie', `wy³±czone', `1', `tak' lub " "`w³±czone'.\n" #: src/variables.c:554 src/variables.c:702 msgid "Active setting not changed.\n" msgstr "Zmienna active nie zosta³a zmieniona.\n" #: src/variables.c:576 msgid "Removing listening address.\n" msgstr "Usuwam adres nas³uchiwania.\n" #: src/variables.c:581 #, c-format msgid "%s: Specify listen address as an IP address\n" msgstr "%s: Podaj adres nas³uchiwania w postaci adresu IP\n" #: src/variables.c:596 #, c-format msgid "Listening address set to %s.\n" msgstr "Adres nas³uchiwania ustawiony na %s.\n" #: src/variables.c:661 #, c-format msgid "No flag by the name %s, display flags not changed.\n" msgstr "Brak flagi o nazwie %s, flagi wy¶wietlania pozosta³y nie zmienione.\n" #: src/variables.c:668 msgid "Cannot set and add or delete flags at the same time.\n" msgstr "Nie mo¿na jednocze¶nie ustawiaæ oraz dodawaæ i kasowaæ flag.\n" #: src/variables.c:697 #, c-format msgid "Invalid value `%s' for port number.\n" msgstr "Nieprawid³owa warto¶æ `%s' dla numeru portu.\n" #: src/variables.c:726 msgid "on" msgstr "w³±czone" #: src/variables.c:726 msgid "off" msgstr "wy³±czone" #: src/variables.c:737 msgid "Removing current password.\n" msgstr "Usuwam obecne has³o.\n" #: src/variables.c:741 msgid "Password may not contain `|' characters.\n" msgstr "Has³o nie mo¿e zawieraæ znaków `|'.\n" #: src/variables.c:843 #, c-format msgid "No value is set for `%s'.\n" msgstr "Brak ustawionej warto¶ci dla `%s'.\n" #: src/variables.c:845 #, c-format msgid "" "Current value for `%s':\n" "%s\n" msgstr "" "Aktualna warto¶æ dla `%s':\n" "%s\n" #: src/common/optparser.c:93 #, c-format msgid "option `--%s' is ambiguous" msgstr "opcja `--%s' jest niejednoznaczna" #: src/common/optparser.c:101 #, c-format msgid "unrecognized option `--%s'" msgstr "nierozpoznana opcja `--%s'" #: src/common/optparser.c:181 src/common/optparser.c:186 #, c-format msgid "invalid option -- %c" msgstr "nieprawid³owa opcja -- %c" #: src/common/optparser.c:206 #, c-format msgid "option requires an argument -- %c" msgstr "opcja wymaga argumentu -- %c" #: src/common/optparser.c:258 #, c-format msgid "option `--%s' doesn't allow an argument" msgstr "opcja `--%s' nie zezwala na argument" #: src/common/optparser.c:266 #, c-format msgid "option `--%s' requires an argument" msgstr "opcja `--%s' wymaga argumentu" microdc2-0.15.6/po/quot.sed0100644000076500007500000000023110516626545015463 0ustar chugunovmicrodcs/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g microdc2-0.15.6/po/remove-potcdate.sin0100644000076500007500000000066010516626545017615 0ustar chugunovmicrodc# 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 } microdc2-0.15.6/po/stamp-po0100644000076500007500000000001210516626545015456 0ustar chugunovmicrodctimestamp microdc2-0.15.6/po/sv.gmo0100644000076500007500000011677110516626545015153 0ustar chugunovmicrodcÞ•‡0h  ! $!P!t#u#ÌŒ#.Y$7ˆ$ À$6Ê$ %%%/%O% l%%ª%Ç%#ç% &,&H&!a& ƒ&¤& Ä&å&'( '&I'&p'&—'¾'Þ'þ'("9(\((z(£("¾(á()*)J) b)0ƒ)´)Ï)ê)þ)*6*T*r*.‡*¶*,Ñ*þ*+-+G+a+,v+£+%Á+,ç+-, B,&c,Š,ª,Ê,Ì,Õ,ò,ö,- - -'-+-/-3-XP-)©-Ó-å-#ü-% .F.c.({.¤.Ã. Ý."þ.*!/L/!a/ƒ/¡/½/Ø/#ö//0J0h0†0¦0"º0$Ý0151"L1o1!1x±1S*2~2=…2.Ã2ò2 3!3;3*U3€3œ37Ÿ33×3 4464$O4t40ö42'5Z5"c52†5.¹5 è5áô5ªÖ6-7 ¯7½7Î7æ7õ78 8_$8„8t9®‰98:T:=l:6ª:8á:8;8S;8Œ;5Å;)û;.%<$T<(y<6¢<:Ù<<=AQ=A“=:Õ=:>6K>(‚>8«>9ä>;?8Z?7“?7Ë?*@6.@e@}@$—@/¼@"ì@ AAƒ«A/BMB _BiB{B‘B¯B*¾B éBõBC9)C&cCŠC0¡C3ÒC D#D34D/hD0˜DÉD(åDE*E@ESEgE*‚E­E ÅEÓEãEõE úE&F /F)=FgFFšF¬F ËF+×FNGRG$eG%ŠG°GFÎGCHYHCoH³HÃÄHˆI¤IÁIÒI,çI1JFJ ]J iJwKÖLVM!pM&’M ¹MÇM.æM9N-ON }N;ˆN ÄN+ÑN$ýN0"O<SOO “O¡O,¶OãO2êO"P@PZPmPP˜P©P¾PÒPçPQQ-0Q6^Q•Q5©Q ßQ"ëQ+R:R SR`RuRˆRšRźR€SŸT;¶T3òT/&U+VU'‚U#ªUÎUîU V#V>V@VXVrV‹V ¨V ³V ÁVÌV&âV+ W 5WVWiWxWŒW  W«W´W¹W ÀWËWèW øWXX-X1XLX aXmX}X –X£X´XËXßXóXY Y'Y6Y"QY!tY+–YÂYÆY ×YãYüY Z!Z5ZPZ_ZnZ}Z“Z²Z ¹ZÃZ×ZéZ [ [[1[L[_[f[k[€[[}Ÿ[S]äq]4V^8‹^ Ä^;Ï^ __ _9_(Y_(‚_«_Ê_$ç_( `!5`W`u` `#±`"Õ`!ø` a;a/Xa(ˆa*±a*Üab 'b Hbib,ˆbµb/Ób"c,&c"Sc"vc*™cÄc"ÜcHÿc Hd#idd%¦dÌd$èd' e5e2Je}e,™eÆeÛe÷ef-f&Bfif%‡f&­f'Ôf üf&gDg]gvgxgg›gg­g±gÇgÛgßgãg%çgk h"yhœh±h)Îh/øh (iIi+cii¯i$Ëi(ði4jNjej‚j¢j¿j&Új0k22k#ek‰k&©kÐk"æk) l!3lCUl0™l!Êl$ìlrma„mæm>ím=,njn‡n¡n¼n"Ûnþno2o6Ro‰ošo´o)Ço…ño+wpL£p ðp#üp3 q7TqŒqËžqØjr:Cs~ss¤sÁsØsês"ós^tput{æt«buv+v@AvL‚vBÏvAw@Tw?•w8Õw7x6Fx,}x,ªxD×x@yP]yG®yGöyH>zH‡zNÐz0{EP{N–{Bå{;(|9d|8ž|2×|: }E}^}z}*•}À} à}˜ê}‚ƒ~07GPcv‘'¡ ÉÖëC€.G€!v€4˜€CÍ€$#DH55Ãù7‚O‚o‚Š‚¢‚µ‚"Õ‚ø‚ ƒ"ƒ2ƒDƒ Jƒ$Xƒ}ƒ)Žƒ¸ƒ!Òƒôƒ„ !„*.„bY„¼„&Ñ„!ø„…+9…@e…¦…GÁ… †Û†õ†*‡>‡O‡0e‡@–‡ׇ í‡_ú‡OZ‰ªŠÁ‹$à‹#Œ)Œ"8Œ/[Œ8‹Œ4ÄŒùŒ= F/P&€B§?ê*Ž -Ž7Ž+GŽ sŽ>Ž#¾ŽâŽ1Mcš'´%Ü5=T’R­‘*‘4<‘q‘Œ‘œ‘±‘‘Ò‘Èð‘ ¹’Ú“9ñ“2+”.^”*”&¸”"ß”•!•<•!L•n•p•ƒ•˜•±• ϕܕ ï•ú•4–3E–+y–¥– À–Í–ß– ø– —— — !—-+—Y— h—t—Ž—¡—¦—Ä— Ù—ä—ô— ˜ ˜%˜:˜V˜n˜…˜ˆ˜!‹˜­˜ Ƙ!ç˜. ™8™<™ R™#^™ ‚™'™·™"˙š%š;šZšašjš~š“š ¦š°šÁšßšóš › ››4›G›­—WÌ]래·u¼#"pj7 ±x€D)~J õ¨G6M}pr°Sh ËbÇiYJ Ô)Ä€u©`%sgm?ù!î^U…v×›;¤3RAÚ Xý„‰RC\|oBÛ2/óéM<cb»Õh†Ò”@'³ŠL3w] Pãt%ß ~*SÓmBtÂɃ´Ï™½:Ø _‡¸- s;H$ª•V>„`äNKœ1àû÷ò9Ê⣮ê5U=!zO‚Z79Fç <úGCH*Ž“EI‹Ù¯vyoí\üÖ§[?0ܹW+Da@Ð#TÁµ‚Qïj=¡2öqè–Íwì(’ÈAcøP6yZðÃ[g «†eô.L+,Iizl:$}š5q¦QŸÿ>¥NV,O¬E¾ Y梈¶8_Œrn-ÑF¿eÞ²/d|&(4‘ ‡"40^þ…Xxá{ÆKdå8ÝÀnÅk.kñ'ºffaƒT1Î&l{[›b›|!!¤!¸!Ô!ð!" "4"H"d"x"Œ" "´"Ð"ì"##0#D#`#i› ÿÿÿÿ€› ÿÿÿÿ›› ÿÿÿÿ²› ÿÿÿÿË› ÿÿÿÿå›ÿÿÿÿî›ÿÿÿÿœÿÿÿÿ1œ ÿÿÿÿLœ-ÿÿÿÿ…œÿÿÿÿ§œ ÿÿÿÿÈœ ÿÿÿÿ㜠ÿÿÿÿþœÿÿÿÿ ÿÿÿÿ6ÿÿÿÿ=ÿÿÿÿ`ÿÿÿÿ~ÿÿÿÿ–0ÿÿÿÿÓÿÿÿÿ Report bugs to <%s>. This is free software. You may redistribute copies of it under the terms of the GNU General Public License . There is NO WARRANTY, to the extent permitted by law. --help display this help and exit --version output version information and exit (none) -n, --no-config do not read config file on startup in %s (%s/s) | %s %d. %s (%s) Results: %d %s exited with return code %d. %s has been granted a slot. %s is no longer granted a slot. %s terminated by signal %s. %s: %s of %s %s%s. %s %s%s. %s: Already connected to user. %s: Cannot bind message domain: %s %s: Cannot close directory - %s %s: Cannot close file - %s %s: Cannot connect - %s %s: Cannot create directory - %s %s: Cannot get file status - %s %s: Cannot get file status: %s %s: Cannot look up address - %s %s: Cannot open directory - %s %s: Cannot open file - %s %s: Cannot open file for appending - %s %s: Cannot open file for reading - %s %s: Cannot open file for writing - %s %s: Cannot override built-in command. %s: Cannot read directory - %s %s: Cannot read from file - %s %s: Cannot read history - %s %s: Cannot remove file - %s %s: Cannot rename file to %s - %s %s: Cannot seek in file - %s %s: Cannot seek to resume position - %s %s: Cannot set locale: %s %s: Cannot set message domain: %s %s: Cannot write history - %s %s: Cannot write to file - %s %s: File exists and is not a regular file %s: Invalid alias name %s: Invalid data, cannot decode %s: Invalid range, or index out of range (1-%d) %s: Invalid search index. %s: No files to download. %s: No such alias. %s: No such file or directory %s: No such shared file %s: No such user connection. %s: No such user on this hub %s: Not a directory %s: Not a regular file or directory, ignoring %s: Premature end of file %s: Specify listen address as an IP address %s: Unknown command. %s: cannot execute - %s %s: illegal option -- %c %s: invalid option -- %c %s: not a directory %s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: unrecognized option `%c%s' %s: unrecognized option `--%s' '(%s) %s (%s) Waiting for file list. (C)(not logged in)-->0,off,no,false1,on,yes,true<--<====>Active setting not changed. Added result to search %d (now %d result). Added result to search %d (now %d results). Address family for hostname not supportedAll requests doneBad value for ai_flagsCannot accept user connection - %s Cannot append to hub send queue - %s Cannot bind to address - %s Cannot close pipe - %s Cannot close search results socket - %s Cannot close signal pipe - %s Cannot close socket - %s Cannot close transfer file - %s Cannot close user connection - %s Cannot close user connections socket - %s Cannot connect - %s Cannot create child process - %s Cannot create pipe pair - %s Cannot create process - %s Cannot create socket - %s Cannot empty signal set - %s Cannot enable address reusing - %s Cannot find directory for temporary files - %s Cannot get current time - %s Cannot get error status - %s Cannot get socket address - %s Cannot listen - %s Cannot read from signal pipe - %s Cannot register signal handler - %s Cannot select - %s Cannot set and add or delete flags at the same time. Cannot set non-blocking flag - %s Cannot wait for processes - %s Cannot write to signal pipe - %s Change directory when browsing another user's files. If DIRECTORY is not specified, change to the root directory (`/'). Close a user connection. Use the `transfers' command to get a list of connections. ClosedConnect to a hub. If PORT is not specified, assume port 411. ConnectToMe already sent to user %s. Waiting. Connected to hub from %s. Connected to user. Connecting to hub on %s. Connecting to user on %s Connection in progress, disconnect first. Current value for `%s': %s DLDescription is too long - max length is 35 characters. Description may not contain `$' or `|' characters. Description: %s Disconnect from the hub. Disconnecting from hub. Display a list of user connections. Display files queued for download from the specified users. Without arguments, display a list of users we have queued files for. Display status information and some statistics. Display user being browsed and current directory. DownloadDownloading %3d%% (at %5d kb/s) %sE-mail is too long - max length is 35 characters. E-mail may not contain `$' or `|' characters. E-mail: %s Execute a system command. If no arguments are specified, the current shell will be started (SHELL environment variable or `/bin/sh' if that is not set). microdc will continue in the background while the command is executing. Grant a download slot for the specified users, or remove granted slot if the user was already granted one. Without arguments, display a list of users with granted slots. Hub did not accept nick. Nick may be in use. Hub is full. Hub name is %s. Hub requires password. Hub state: %s Hub users: %s IdleIdle timeout (%d seconds) If COMMAND is specified, display help for that command. Otherwise list all available commands. If INDEX is specified, display results for the search by that index. Otherwise, display a list of searches and statistics over those searches. If USER is specified, display information on that user. Otherwise, display a table of users with some user details. If USER is specified, queue the file list for that user for download and start browsing the user's files as soon as the list is downloaded. With no arguments, stop browsing. Incorrect parity, ignoring Interrupted by a signalInvalid $ConnectToMe message: Invalid address specification. Invalid $ConnectToMe message: Missing or invalid nick Invalid $Direction message: Invalid challenge parameter Invalid $Direction message: Invalid direction parameter Invalid $Direction message: Missing challenge parameter Invalid $Direction message: Missing direction parameter Invalid $Get message: Missing offset, assuming start Invalid $Get message: Offset not integer Invalid $Key message: Incorrect key, ignoring Invalid $Lock message: Key to short Invalid $Lock message: Missing Pk value Invalid $MyINFO message: Invalid share size, ignoring Invalid $MyINFO message: Missing $ALL parameter, ignoring Invalid $MyINFO message: Missing connection speed, ignoring Invalid $MyINFO message: Missing description parameter, ignoring Invalid $MyINFO message: Missing description separator, ignoring Invalid $MyINFO message: Missing e-mail address, ignoring Invalid $MyINFO message: Missing nick parameter, ignoring Invalid $MyINFO message: Missing share size, ignoring Invalid $Quit message: Unknown user %s. Invalid $RevConnectToMe message: Missing nick parameter Invalid $RevConnectToMe message: Remote nick is our nick Invalid $RevConnectToMe message: Unknown user %s, ignoring Invalid $Search message: Invalid address specification. Invalid $Search message: Invalid search specification. Invalid $Search message: Missing source specification. Invalid $Search message: Unknown user %s. Invalid $To message: Missing text separator, ignoring Invalid port number %s Invalid slot number `%s' Invalid value `%s' for port number. Issue a search for the specified search words. Issuing new search with index %d. Level: %d List files and directories recursively. Assume current directory if FILE is not specified. Must be browsing a user's files to use this command. List files and directories. Assume current directory if FILE is not specified. Options: -l, --long use a long listing format Listening address set to %s. Listening on %s. Logged inLogging to `%s'. Looking up IP addressLooking up IP address for %s Lookup processLookup the IP address of specified hosts. Matched %s Memory allocation failureName or service not knownNick accepted but modified to %s. You are now logged in. Nick accepted. You are now logged in. Nick cannot be empty. Nick is too long - max length is 35 characters. Nick may not contain `$', `|' or space characters. Nick: %s No address associated with hostnameNo flag by the name %s, display flags not changed. No free connections. Queued file for download. No free connections. Queued files for download. No longer logging to file. No more connections to user %s allowed. No more files to download. No pattern to match. No previous path. No search results. No value is set for `%s'. Non-recoverable failure in name resolutionNot browsing any user. Not connectedNot connected. Now browsing %s. OpenOperator: %d Parameter string not correctly encodedParse processPassword may not contain `|' characters. Password not accepted. Pending user connections: Private: [%s] %s Processing request in progressPublic: %s Queue already contains this file, ignoring Queue file for download. Must be browsing a user's files to use this command. Quit the program. Received %s message in wrong state. Received TERM signal, shutting down. Received error from user: %s Received unknown message %d from user process, shutting down process. Received unknown message from main process, shutting down process. Reissuing search %d. Remove a previously issued search and all results for that search. Remove aliases. Remove all or a range of queued files for USER. If RANGE is not specified, remove all files from the queue. Use dash (`-') and comma (`,') in RANGE. Open ranges are accepted (e.g. `1-' or `-2'). Removing current password. Removing listening address. Request canceledRequest not canceledResult has been added earlier to search %d. RevConnectToMe already sent to user %s. Waiting. Scanning directory %s Search %d: Send a private message to USER. Note that characters such as semicolon (`;'), double quote (`"') and number sign (`#') in MESSAGE need to be escaped or quoted. Therefore it is recommended to put MESSAGE in double quotes. Example: msg some_user "hello, how are you?" Send a public message to users on the hub. Note that characters such as semicolon (`;'), double quote (`"') and number sign (`#') in MESSAGE need to be escaped or quoted. Therefore it is recommended to put MESSAGE in double quotes. Example: say "hi everyone!" Send some raw data to the hub. Note that characters such as semicolon (`;'), double quote (`"') and number sign (`#') in DATA need to be escaped or quoted. Therefore it is recommended to put DATA in double quotes. Sending password to hub. Sent %d/%d search results to %s. Servname not supported for ai_socktypeShell processShutting down hub connection. Shutting down user connection process for %s. Specify active as `0', `no', `off', `1', `yes', or `on'. Speed may not contain `$' or `|' characters. Speed: %s Start microdc, a command-line based Direct Connect client. System errorTag may not contain `$' or `|' characters. Temporary failure in name resolutionToo many connections to user, or no free slots. Try to connect and download files from the specified users. ULUnknown errorUnknown system errorUnterminated or invalid $SR, discarding: %s UploadUpload slots: %d/%d Download slots: %d/unlimited Uploading %3d%% (at %5d kb/s) %sUsage: %s CONNECTION ... Usage: %s DATA... Usage: %s FILE ... Usage: %s HOST[:PORT] Usage: %s INDEX Usage: %s MESSAGE.. Usage: %s NAME ... Usage: %s STRING... Usage: %s USER MESSAGE.. Usage: %s USER [RANGE] Usage: %s [OPTION]... User %s is also passive. Cannot communicate. User %s is also passive. Cannot establish connection. User %s logged in. User %s not on hub, or too many connections to user. User %s: %sUser connection %s renamed to %s. User does not want to download, nor do we. User from %s connected. User processValid arguments are:Waiting for $HelloWaiting for $LockWaiting for complete connectionWithout arguments, display a list of variables and their current values. With only NAME argument, display the value of that variable. With NAME and VALUE arguments, change the value of a variable. Without arguments, display the list of aliases. With NAME argument, display what value (command) that alias is set to. With both NAME and VALUE argument, change alias. Note that VALUE is a single argument - you need to use quotes for more complex commands. Example: alias ll "ls -l" Written by %s and %s. Written by %s, %s, %s, %s, %s, %s, %s, %s, %s, and others. Written by %s, %s, %s, %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, %s, and %s. Written by %s, %s, %s, %s, and %s. Written by %s, %s, %s, and %s. Written by %s, %s, and %s. Written by %s. You have received operator status. `ai_family not supportedai_socktype not supportedalias [NAME[=VALUE] ...]ambiguous argument %s for %sblock sizebrowse [USER]bytebytescancel CONNECTION ...cannot close character convertor - %s cannot create character set convertor - %s cannot get current character setcannot rename filecd [DIRECTORY]communication errorconnect HOST[:PORT]disconnectdownloadexitfailedfilefilesfile not available on remotefind [FILE ...]get FILE ...grantslot [USER ...]help [COMMAND ...]hubinvalid argument %s for %sinvalid option -- %clocal errorlookup HOST ...ls [OPTION...] [FILE...]main processmemory exhaustedmissing host argument msg USER MESSAGE...no data to transferno such shared fileoffonoption `--%s' doesn't allow an argumentoption `--%s' is ambiguousoption `--%s' requires an argumentoption requires an argument -- %cprotocol error: invalid $FileLength messagepwdqueue [USER ...]raw DATA...remote did not want fileremote error: %sremote is maxed outresults [INDEX ...]resume offset out of rangeretry USER ...say MESSAGE...search WORD...set [NAME [VALUE...]]shell [COMMAND [ARGUMENTS...]]statussucceededtoo many arguments transfer completetransferredtransferredtransfersunalias NAME ...unqueue USER [RANGE]unrecognized option `--%s'unsearch INDEX ...uploaduseruser (search result)user process %swho [USER ...]Project-Id-Version: microdc 0.5.0 Report-Msgid-Bugs-To: oskar@osk.mine.nu POT-Creation-Date: 2005-10-18 08:31+0200 PO-Revision-Date: 2005-05-10 11:54+0200 Last-Translator: Oskar Liljeblad Language-Team: Swedish MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Rapportera fel till <%1$s>. Rapportera kommentarer om översättningen till <%1$s>. Detta är fri programvara. Du kan distribuera kopier av det under villkoren i GNU General Public License . Det finns INGEN garanti, utom sådan garanti som måste ges enligt tillämplig lag. --help visa denna hjälptext och avsluta --version visa versionsinformation och avsluta (ingen) -n, --no-config läs inte konfigurationsfil vid uppstart på %s (%s/s) | %s %d. %s (%s) Träffar: %d %s avslutades med returkod %d. %s har tilldelats en nedladdningsplats. %s har fråntagits en nedladdningsplats. %s avslutades av signalen %s. %s: %s av %s %s%s. %s %s%s. %s: Redan ansluten till användaren. %s: Kan inte binda meddelandedomän - %s %s: Kan inte stänga katalog - %s %s: Kan inte stänga fil - %s %s: Kan inte ansluta - %s %s: Kan inte skapa katalog - %s %s: Kan inte avläsa filstatus - %s %s: Kan inte avläsa filstatus: %s %s: Kan inte slå upp adress - %s %s: Kan inte öppna katalog - %s %s: Kan inte öppna fil - %s %s: Kan inte öppna fil för att lägga till - %s %s: Kan inte öppna fil för läsning - %s %s: Kan inte öppna fil för skrivning - %s %s: Kan inte överskrida inbyggt kommando. %s: Kan inte läsa katalog - %s %s: Kan inte läsa från fil - %s %s: Kan inte läsa historik - %s %s: Kan inte ta bort fil - %s %s: Kan inte ändra namn på fil till %s - %s %s: Kan inte söka i fil - %s %s: Kan inte söka till omstartspositionen - %s %s: Kan inte ställa in lokal - %s %s: Kan inte ställa in meddelandedomän - %s %s: Kan inte skriva historik - %s %s: Kan inte skriva till fil - %s %s: Filen finns och är inte en vanlig fil %s: Ogiltigt aliasnamn %s: Felaktig data, kan inte tolka %s: Felaktigt intervall, eller så är ett index utanför intervallet 1-%d %s: Felaktigt index på sökning. %s: Inga fler filer att ladda hem. %s: Inget sådant alias. %s: Filen eller katalogen finns inte %s: Ingen sådant delad fil %s: Ingen sådan användaranslutning. %s: Användaren finns inte på denna hub %s: Inte en katalog %s: Inte en normal fil eller katalogen, ignorerar %s: För tidigt slut av fil %s: Ange anslutningsadress som en IP-adress %s: Okänt kommando. %s: kan inte exekvera - %s %s: otillåten flagga -- %c %s: ogiltig flagga -- %c %s: inte en katalog %s: flaggan "%c%s" tar inget argument %s: flaggan "%s" är tvetydig %s: flaggan "%s" kräver ett argument %s: flaggan "--%s" tar inget argument %s: flaggan "-W %s" tar inget argument %s: flaggan "-W %s" är tvetydig %s: flaggan kräver ett argument -- %c %s: okänd flagga "%c%s" %s: okänd flagga "--%s" "(%s) %s (%s) Väntar på fillista. ©(inte inloggad)-->0,off,no,false,av,nej1,on,yes,true,på,ja<--<====>Inställning för aktiv ändrades inte. Nya resultat lades till sökning %d (nu %d resultat). Nya resultat lades till sökning %d (nu %d resultat). Adressfamilj för värdnamn stöds ejAlla begäran utfördaOtillåtet värde för ai_flagsKan inte ta emot användaranslutning - %s Kan inte lägga till data i hubbens sändkö - %s Kan inte binda till adress - %s Kan inte stänga rör - %s Kan inte stänga uttag för sökresultat - %s Kan inte stänga signalrör - %s Kan inte stänga uttag - %s Kan inte stänga överföringsfil - %s Kan inte stänga användaranslutning - %s Kan inte stänga uttag för användaranslutningar - %s Kan inte ansluta - %s Kan inte skapa process - %s Kan inte skapa par av rör - %s Kan inte skapa process - %s Kan inte skapa uttag - %s Kan inte tömma signaluppsättning - %s Kan inte aktivera återanvändning av adress - %s Kan inte hitta katalog för tillfälliga filer - %s Kan inte avläsa nuvarande tid - %s Kan inte avläsa felstatus - %s Kan inte avläsa adress för uttag - %s Kan inte lyssna - %s Kan inte läsa från signalrör - %s Kan inte registrera signalhanterare - %s select-anropet misslyckades - %s Kan inte ställa in och lägga till eller ta bort flaggor samtidigt. Kan inte ställa in icke-blockerande flagga - %s Kan inte vänta på processer - %s Kan inte skriva till signalrör - %s Ändra katalog när man utforskar en annan användares filer. Om KATALOG inte angavs, ändra till rotkatalogen ("/"). Stäng en användaranslutning. Använd "transfers"-kommandot för att få en lista över anslutningar. StängdAnslut till en hubb. Om PORT inte angavs, anslut på port 411. ConnectToMe har redan skickats till användaren %s. Avvaktar. Ansluten till hubb från %s. Ansluten till användare. Ansluter till hubb på %s. Ansluter till användare på %s Ansluter redan, koppla ned först. Nuvarande värde för "%s": %s NLBeskrivning är för lång - max längd är 35 tecken. Beskrivning får inte innehålla tecknen "$" eller "|". Beskrivning: %s Kopplar ned från hubben. Kopplar ned hubb. Visa en lista över användaranslutningar. Visa filer köade för nedladdning från den angivna användaren.Utan argument visas en lista över användare som vi har köat filer från. Visa statusinformation och lite statistik. Visa vilken användare som utforskas samt nuvarande katalog för utforskning. NedladdningLaddar hem %3d%% (med %5d kb/s) %sE-postadress är för lång - max längd är 35 tecken. E-postadress får inte innehålla tecknen "$" eller "|". E-postadress: %s Exekvera ett systemkommando. Om inga argument angavs kommer nuvarande skal att startas (miljövariabeln SHELL eller "/bin/sh" om den inte är satt). microdc fortsätter i bakgrunden medan kommandot utförs. Tilldela den specifika användaren en nedladdningsplats, eller ta bort tilldelad nedladdningsplats om användaren redan var tilldelad en. Utan argument, visa en lista över användare med tilldelade nedladdningsplatser. Hubben godtog inte användarnamnet. Det kan vara upptaget. Hubben är full. Hubbens namn är %s. Hubben kräver ett lösenord. Hubbens tillstånd: %s Hubbens namn: %s OverksamInaktivitetstimeout (%d sekunder) Visa hjälp för angivena kommandon. Om inget kommando anges, lisa alla tillgängliga kommandon. Visa resultat för en specifik sökning om INDEX angavs. Visa i annat fall en lista över sökningar med statistik. Om ANVÄNDARE angavs, visa information för den användaren. Visa annars en tabell över användare med vissa användardetaljer. Om ANVÄNDARE angavs, köa fillistan för användaren för nedladdning och börja utforska användarens filer så snart fillistan är nedladdad. Sluta utforksa om argument saknas. Felaktig paritet, ignorerar Avbruten av en signalFelaktigt $ConnectToMe-meddelande: Felaktig adresspecifikation. Felaktigt $ConnectToMe-meddelande: Användarnamnet saknas eller är felaktigt Felaktigt $Direction-meddelande: Felaktig parameter för utmaning. Felaktigt $Direction-meddelande: Felaktig parameter för riktning Felaktigt $Direction-meddelande: Saknar parameter för utmaning. Felaktigt $Direction-meddelande: Saknar parameter för riktning Felaktigt $Get-meddelande: Saknar position, antar start Felaktigt $Get-meddelande: Position är inte ett heltal Felaktigt $Key-meddelande: Felaktig nyckel, ignorerar Felaktigt $Lock-meddelande: Nyckel för kort Felaktigt $Lock-meddelande: Pk-värde saknas Felaktigt $MyINFO-meddelande: Felaktig utdelningsstorlek, ignorerar Felaktigt $MyINFO-meddelande: Saknar parametern $ALL, ignorerar Felaktigt $MyINFO-meddelande: Saknar parametern anslutningshastighet, ignorerar Felaktigt $MyINFO-meddelande: Saknar parametern beskrivning, ignorerar Felaktigt $MyINFO-meddelande: Saknars beskrivningsseparator, ignorerar Felaktigt $MyINFO-meddelande: Saknar parametern e-postadress, ignorerar Felaktigt $MyINFO-meddelande: Saknar parametern användarnamn, ignorerar Felaktigt $MyINFO-meddelande: Saknare parametern utdelningsstorlek, ignorerar Felaktigt $Quit-meddelande: Okänd användare %s. Felaktigt $RevConnectToMe-meddelande: Saknar parametern användarnamn Felaktigt $RevConnectToMe-meddelande: Fjärranvändarens namn är samma som vårt Invalid $RevConnectToMe-meddelande: Okänd användare %s, ignorerar Felaktigt $Search-meddelande: Felaktig adresspecifikation. Felaktigt $Search-meddelande: Felaktig sökspecifikation. Felaktigt $Search-meddelande: Saknar källspecifikation. Felaktigt $Search-meddelande: Okänd användare %s. Felaktigt $To-meddelande: Saknar textseparator, ignorerar Felaktigt portnummer %s Felaktigt platsnummer "%s" Felaktigt portnummer "%s" Utför en sökning med de angivna sökorden. Utför ny sökning med index %d. Nivå: %d Lista filer och kataloger rekursivt. Nuvarande katalog antas om FIL inte anges. Måste utforksa en användares filer för att kunna använda detta kommand. Lista filer och kataloger. Om FIL inte anges, lista nuvarande katalog. Flaggor: -l, --long använd ett långt listningsformat Manuell adress för anslutningar ändrad till %s. Lyssnar på %s. InloggadLoggar till "%s". Slår upp IP-adressSlår upp IP-adress för %s UppslagsprocessSlår upp IP-adress för angivna värdar. Matchade %s MinnesallokeringsfelNamn eller tjänst okändAnvändarnamnet godtogs men ändrades till %s. Du har nu loggats in. Användarnamnet godtogs. Du har nu loggats in. Användarnamn kan inte vara tomt. Användarnamn är för långt - max längd är 35 tecken. Användarnamn får inte innehålla tecknen "$", "|" eller mellanslag. Användarnamn: %s Ingen adress associerad med värdnamnIngen flagga med namnet %s finns, visningsflaggor har inte ändrats. Inga lediga anslutningar. Köade fil för nedladdning. Inga lediga anslutningar. Köade fil för nedladdning. Loggar inte längre till fil. Inga fler anslutningar till användaren %s är tillåtna. Inga fler filer att ladda hem. Inget mönster att matcha. Ingen tidigare sökväg. Inga sökresultat. Inget värde har sats för "%s". Oreparerbart fel i namnuppslagningUtforskar ingen användare. Inte anslutenInte ansluten. Utforskar nu %s. ÖppenOperatör: %d Parametersträngen inte korrekt kodadTolkningsprocessLösenord får inte innehålla tecknet "|". Lösenordet godtogs inte. Avvaktande användaranslutningar: Privat: [%s] %s Behandling av begäran pågårPublikt: %s Kön innehåller redan denna fil, ignorerar Köa fil för nedladdning. Måste utforska en användares filer för att kunna använda detta kommando. Avsluta programmet. Mottog meddelande %s i fel tillstånd. Mottog TERM-signal, stänger ned. Mottog fel från användare: %s Mottog meddelande %d från användarprocess. Mottog okänt meddelande från huvudprocess, stänger ner process. Utför sökning %d på nytt. Ta bort en tidigare utför sökning och alla resultat för den sökningen. Ta bort alias. Ta bort alla eller ett intervall av köade filer för ANVÄNDARE. Om INTERVALL inte angavs, ta bort alla filer från kön. Använd streck ("-") och komma (",") i INTERVALL. Öppna intervall accepteras (t.ex. "1-" eller "-2"). Tar bort nuvarande lösenord. Tar bort manuell adress för anslutningar. Begäran avbrutenBegäran inte avbrutenResultat hade tidigare lagts till i sökning %d. RevConnectToMe har redan skickats till användaren %s. Avvaktar. Skannar katalogen %s Sökning %d: Skicka ett privat meddelande till ANVÄNDARE. Notera att tecken såsom semikolon (";"), citationstecken (") och nummertecken ("#") i MEDDELANDE måste föregås av bakåtvänt snedstreck ("\") eller sättas inom citationstecken. Därför rekommenderas det alltid sätta MEDDELANDE inom citationstecken. Exempel: msg någon_användare "hej, hur står det till?" Skicka ett publikt meddelande till användare på hubben. Notera att tecken såsom semikolon (";"), citationstecken (") och nummertecken ("#") i MEDDELANDE måste föregås av bakåtvänt snedstreck ("\") eller sättas inom citationstecken. Därför rekommenderas det alltid sätta MEDDELANDE inom citationstecken. Exempel: say "hej allihopa!" Skicka obehandlat data till hubben. Notera att tecken såsom semikolon (";"), citationstecken (") och nummertecken ("#") i MEDDELANDE måste föregås av bakåtvänt snedstreck ("\") eller sättas inom citationstecken. Därför rekommenderas det alltid sätta DATA inom citationstecken. Skickar lösenord till hubben. Skickade %d/%d sökresultat till %s. Servname stöds inte för ai_socktypeProgramprocessStänger ner anslutning till hubb. Stänger ner process för användaranslutning %s. Ange aktiv som "0", "nej", "av", "1", "ja", eller "på". Hastighet får inte innehålla tecknen "$" eller "|". Hastighet: %s Starar microdc, en kommandoradbaserad Direct Connect-klient. SystemfelTagg får inte innehålla tecknen "$" eller "|". Namnuppslagning misslyckades temporärtFör många anslutningar till användare, eller inga lediga platser. Försök att ansluta och ladda hem filer från angivna användare. ULOkänt felOkänt systemfelOterminerad eller felaktig $SR, kastar: %s UppladdningUppladdningsplatser: %d/%d Nedladningsplatser: %d/obegränsat Laddar upp %3d%% (med %5d kb/s) %sAnvändning: %s ANSLUTNING ... Användning: %s DATA... Användning: %s FIL ... Användning: %s VÄRD[:PORT] Användning: %s INDEX Användning: %s MEDDELANDE... Användning: %s NAMN ... Användning: %s STRÄNG... Användning: %s ANVÄNDARE MEDDELANDE... Användning: %s ANVÄNDARE [INTERVALL] Användning: %s [FLAGGA]... Användaren %s är också passiv. Kan inte kommunicera. Användaren %s är också passiv. Kan inte upprätta anslutning. Användaren %s loggade in. Användaren %s finns inte på hubben, eller för många anslutningar till användaren. Användare %s: %sAnvändaranslutning %s bytte namn till %s. Användaren vill inte ladda ner, och inte vi heller. Användare från %s anslöt. AnvändarprocessGiltiga argument är:Väntar på $HelloVäntar på $LockVäntar på komplett anslutningUtan argument, vista en lista över variabler och deras nuvarande värde. Med enbart NAMN-argument, visa värdet på variabeln med det namnet. Med både NAMN-och VÄRDE-argument, ändra värdet på variabeln. Utan argument, visa en lista över alias. Med NAMN-argument, visa vilket värde (kommando) det aliaset är satt till. Med både NAMN- och VÄRDE-argument, ändra aliaset. Notera att VÄRDE är ett argument - du måste användare citationstecken för komplexa kommandon. Exempel: alias ll "ls -l" Skrivet av %s och %s. Skrivet av %s, %s, %s, %s, %s, %s, %s, %s, %s med flera. Skrivet av %s, %s, %s, %s, %s, %s, %s, %s och %s. Skrivet av %s, %s, %s, %s, %s, %s, %s och %s. Skrivet av %s, %s, %s, %s, %s, %s och %s. Skrivet av %s, %s, %s, %s, %s och %s. Skrivet av %s, %s, %s, %s och %s. Skrivet av %s, %s, %s och %s. Skrivet av %s, %s och %s. Skrivet av %s. Du har fått operatörsbehörighet. "ai_family stöds ejai_socktype stöds ejalias [NAMN[=VÄRDE] ...]tvetydigt argument %s till %sblockstorlekbrowse [ANVÄNDARE]bytebytencancel ANSLUTNING ...kan inte stänga teckenuppsättningskonverterare - %s kan inte skapa teckenuppsättningskonverterare - %s kan inte avläsa nuvarande teckenuppsättningkan inte ändra namn på filcd [KATALOG]kommunikationsfelconnect VÄRDDATOR[:PORT]disconnectnedladdningexitmisslyckadesfilfilerfilen är inte tillgänglig hos fjärranvändarenfind [FIL ...]get FIL ...grantslot [ANVÄNDARE ...]help [KOMMAND ...]hubbfelaktigt argument %s till %sogiltig flagga -- %clokalt fellookup VÄRD ...ls [FLAGGA...] [FIL...]huvudprocessminnet slutsaknar värdargument msg ANVÄNDARE MEDDELANDE...ingen data att överföraingen sådant delad filavpåflaggan "--%s" tar inget argumentflaggan "%s" är tvetydigflaggan "%s" kräver ett argumentflaggan kräver ett argument -- %cprotokollfel: felaktigt $FileLength-meddelandepwdqueue [ANVÄNDARE ...]raw DATA...fjärranvändaren ville inte ha filenfjärrfel: %sfjärranvändaren har inga lediga platserresults [INDEX ...]återstartsposition utanför områdetretry ANVÄNDARE ...say MEDDELANDE...search SÖKORD...set [NAMN [VÄRDE...]]shell [KOMMANDO [ARGUMENT...]]statuslyckadesför många argument överföringar färdigaöverförtöverfördatransfersunalias NAMN ...unqueue ANVÄNDARE [INTERVALL]okänd flagga "--%s"unsearch INDEX ...uppladdninganvändareanvändare (sökresultat)användarprocess %swho [ANVÄNDARE ...]PRIu64PRIu32Share size: % %s (%s) Bytes received: % %s (%s) Bytes sent: % %s (%s) Share Size: % %s (% MB) Downloading % %s in % %s unknown%%s: Starting %s of %s (% of % %s). %s: Starting %s of %s (% %s). Sharing % %s (%s) totally remote file is smaller than local (expected %, got % %s)%s: Resume offset % outside file Utdelningens storlek: % %s (%s) Byten mottagna: % %s (%s) Byten skickade: % %s (%s) Utdelningsstorlek: % %s (% MB) Laddar hem % %s i % %s okänd%%s: Startar %s av %s (% av % %s). %s: Startar %s av %s (% %s). Delar % %s (%s) totalt fjärrfilen är mindre än den lokala (förväntade %, fick % %s)%s: Omstartsposition % utanför filen microdc2-0.15.6/po/sv.po0100644000076500007500000016313410516626545015002 0ustar chugunovmicrodc# Swedish messages for microdc. # Copyright © 2005 Oskar Liljeblad # This file is distributed under the same license as the microdc package. # # Some messages may have been copied from the translations of GNU Core # Utilities and GNU C Library, especially the messages in files in the # lib directory. Such translations are # Copyright © 1997, 2002, 2003, 2004 Free Software Foundation, Inc. # See the files of those projects for author information. # # Oskar Liljeblad , 2005. # msgid "" msgstr "" "Project-Id-Version: microdc 0.5.0\n" "Report-Msgid-Bugs-To: oskar@osk.mine.nu\n" "POT-Creation-Date: 2005-10-18 08:31+0200\n" "PO-Revision-Date: 2005-05-10 11:54+0200\n" "Last-Translator: Oskar Liljeblad \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/argmatch.c:137 #, c-format msgid "invalid argument %s for %s" msgstr "felaktigt argument %s till %s" #: lib/argmatch.c:138 #, c-format msgid "ambiguous argument %s for %s" msgstr "tvetydigt argument %s till %s" #: lib/argmatch.c:157 #, c-format msgid "Valid arguments are:" msgstr "Giltiga argument är:" #: lib/error.c:121 msgid "Unknown system error" msgstr "Okänt systemfel" #: lib/gai_strerror.c:45 msgid "Address family for hostname not supported" msgstr "Adressfamilj för värdnamn stöds ej" #: lib/gai_strerror.c:46 msgid "Temporary failure in name resolution" msgstr "Namnuppslagning misslyckades temporärt" #: lib/gai_strerror.c:47 msgid "Bad value for ai_flags" msgstr "Otillåtet värde för ai_flags" #: lib/gai_strerror.c:48 msgid "Non-recoverable failure in name resolution" msgstr "Oreparerbart fel i namnuppslagning" #: lib/gai_strerror.c:49 msgid "ai_family not supported" msgstr "ai_family stöds ej" #: lib/gai_strerror.c:50 msgid "Memory allocation failure" msgstr "Minnesallokeringsfel" #: lib/gai_strerror.c:51 msgid "No address associated with hostname" msgstr "Ingen adress associerad med värdnamn" #: lib/gai_strerror.c:52 msgid "Name or service not known" msgstr "Namn eller tjänst okänd" #: lib/gai_strerror.c:53 msgid "Servname not supported for ai_socktype" msgstr "Servname stöds inte för ai_socktype" #: lib/gai_strerror.c:54 msgid "ai_socktype not supported" msgstr "ai_socktype stöds ej" #: lib/gai_strerror.c:55 msgid "System error" msgstr "Systemfel" #: lib/gai_strerror.c:57 msgid "Processing request in progress" msgstr "Behandling av begäran pågår" #: lib/gai_strerror.c:58 msgid "Request canceled" msgstr "Begäran avbruten" #: lib/gai_strerror.c:59 msgid "Request not canceled" msgstr "Begäran inte avbruten" #: lib/gai_strerror.c:60 msgid "All requests done" msgstr "Alla begäran utförda" #: lib/gai_strerror.c:61 msgid "Interrupted by a signal" msgstr "Avbruten av en signal" #: lib/gai_strerror.c:62 msgid "Parameter string not correctly encoded" msgstr "Parametersträngen inte korrekt kodad" #: lib/gai_strerror.c:74 msgid "Unknown error" msgstr "Okänt fel" #: lib/getopt.c:551 lib/getopt.c:570 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: flaggan \"%s\" är tvetydig\n" #: lib/getopt.c:603 lib/getopt.c:607 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: flaggan \"--%s\" tar inget argument\n" #: lib/getopt.c:616 lib/getopt.c:621 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: flaggan \"%c%s\" tar inget argument\n" #: lib/getopt.c:667 lib/getopt.c:689 lib/getopt.c:1020 lib/getopt.c:1042 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: flaggan \"%s\" kräver ett argument\n" #: lib/getopt.c:727 lib/getopt.c:730 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: okänd flagga \"--%s\"\n" #: lib/getopt.c:738 lib/getopt.c:741 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: okänd flagga \"%c%s\"\n" #: lib/getopt.c:796 lib/getopt.c:799 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: otillåten flagga -- %c\n" #: lib/getopt.c:805 lib/getopt.c:808 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: ogiltig flagga -- %c\n" #: lib/getopt.c:863 lib/getopt.c:882 lib/getopt.c:1095 lib/getopt.c:1116 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: flaggan kräver ett argument -- %c\n" #: lib/getopt.c:935 lib/getopt.c:954 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: flaggan \"-W %s\" är tvetydig\n" #: lib/getopt.c:978 lib/getopt.c:999 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: flaggan \"-W %s\" tar inget argument\n" #: lib/human.c:486 msgid "block size" msgstr "blockstorlek" #. TRANSLATORS: #. Get translations for open and closing quotation marks. #. #. The message catalog should translate "`" to a left #. quotation mark suitable for the locale, and similarly for #. "'". If the catalog has no translation, #. locale_quoting_style quotes `like this', and #. clocale_quoting_style quotes "like this". #. #. For example, an American English Unicode locale should #. translate "`" to U+201C (LEFT DOUBLE QUOTATION MARK), and #. should translate "'" to U+201D (RIGHT DOUBLE QUOTATION #. MARK). A British English Unicode locale should instead #. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and #. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. #. #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. #: lib/quotearg.c:245 msgid "`" msgstr "\"" #: lib/quotearg.c:246 msgid "'" msgstr "\"" #. TRANSLATORS: Translate "(C)" to the copyright symbol #. (C-in-a-circle), if this symbol is available in the user's #. locale. Otherwise, do not translate "(C)"; leave it as-is. #: lib/version-etc.c:72 msgid "(C)" msgstr "©" #: lib/version-etc.c:74 msgid "" "\n" "This is free software. You may redistribute copies of it under the terms " "of\n" "the GNU General Public License .\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" "\n" "Detta är fri programvara. Du kan distribuera kopier av det under villkoren " "i GNU General Public License .\n" "Det finns INGEN garanti, utom sådan garanti som måste ges enligt tillämplig " "lag.\n" "\n" #. TRANSLATORS: %s denotes an author name. #: lib/version-etc.c:90 #, c-format msgid "Written by %s.\n" msgstr "Skrivet av %s.\n" #. TRANSLATORS: Each %s denotes an author name. #: lib/version-etc.c:94 #, c-format msgid "Written by %s and %s.\n" msgstr "Skrivet av %s och %s.\n" #. TRANSLATORS: Each %s denotes an author name. #: lib/version-etc.c:98 #, c-format msgid "Written by %s, %s, and %s.\n" msgstr "Skrivet av %s, %s och %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:104 #, c-format msgid "" "Written by %s, %s, %s,\n" "and %s.\n" msgstr "" "Skrivet av %s, %s, %s\n" "och %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:110 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, and %s.\n" msgstr "" "Skrivet av %s, %s, %s,\n" "%s och %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:116 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, and %s.\n" msgstr "" "Skrivet av %s, %s, %s,\n" "%s, %s och %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:123 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, and %s.\n" msgstr "" "Skrivet av %s, %s, %s,\n" "%s, %s, %s och %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:130 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, %s,\n" "and %s.\n" msgstr "" "Skrivet av %s, %s, %s,\n" "%s, %s, %s, %s\n" "och %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:138 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s, and %s.\n" msgstr "" "Skrivet av %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s och %s.\n" #. TRANSLATORS: Each %s denotes an author name. #. You can use line breaks, estimating that each author name occupies #. ca. 16 screen columns and that a screen line has ca. 80 columns. #: lib/version-etc.c:148 #, c-format msgid "" "Written by %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s, %s, and others.\n" msgstr "" "Skrivet av %s, %s, %s,\n" "%s, %s, %s, %s,\n" "%s, %s med flera.\n" #: lib/xalloc-die.c:38 msgid "memory exhausted" msgstr "minnet slut" #: src/command.c:177 msgid "browse [USER]" msgstr "browse [ANVÄNDARE]" #: src/command.c:178 msgid "" "If USER is specified, queue the file list for that user for download and " "start browsing the user's files as soon as the list is downloaded. With no " "arguments, stop browsing.\n" msgstr "" "Om ANVÄNDARE angavs, köa fillistan för användaren för nedladdning och börja " "utforska användarens filer så snart fillistan är nedladdad. Sluta utforksa " "om argument saknas.\n" #: src/command.c:182 msgid "cancel CONNECTION ..." msgstr "cancel ANSLUTNING ..." #: src/command.c:183 msgid "" "Close a user connection. Use the `transfers' command to get a list of " "connections.\n" msgstr "" "Stäng en användaranslutning. Använd \"transfers\"-kommandot för att få en " "lista över anslutningar.\n" #: src/command.c:186 msgid "cd [DIRECTORY]" msgstr "cd [KATALOG]" #: src/command.c:187 msgid "" "Change directory when browsing another user's files. If DIRECTORY is not " "specified, change to the root directory (`/').\n" msgstr "" "Ändra katalog när man utforskar en annan användares filer. Om KATALOG inte " "angavs, ändra till rotkatalogen (\"/\").\n" #: src/command.c:190 msgid "connect HOST[:PORT]" msgstr "connect VÄRDDATOR[:PORT]" #: src/command.c:191 msgid "Connect to a hub. If PORT is not specified, assume port 411.\n" msgstr "Anslut till en hubb. Om PORT inte angavs, anslut på port 411.\n" #: src/command.c:193 msgid "disconnect" msgstr "disconnect" #: src/command.c:194 msgid "Disconnect from the hub.\n" msgstr "Kopplar ned från hubben.\n" #: src/command.c:196 msgid "exit" msgstr "exit" #: src/command.c:197 msgid "Quit the program.\n" msgstr "Avsluta programmet.\n" #: src/command.c:199 msgid "find [FILE ...]" msgstr "find [FIL ...]" #: src/command.c:200 msgid "" "List files and directories recursively. Assume current directory if FILE is " "not specified. Must be browsing a user's files to use this command.\n" msgstr "" "Lista filer och kataloger rekursivt. Nuvarande katalog antas om FIL inte " "anges. Måste utforksa en användares filer för att kunna använda detta " "kommand.\n" #: src/command.c:203 msgid "get FILE ..." msgstr "get FIL ..." #: src/command.c:204 msgid "" "Queue file for download. Must be browsing a user's files to use this " "command.\n" msgstr "" "Köa fil för nedladdning. Måste utforska en användares filer för att kunna " "använda detta kommando.\n" #: src/command.c:207 msgid "grantslot [USER ...]" msgstr "grantslot [ANVÄNDARE ...]" #: src/command.c:208 msgid "" "Grant a download slot for the specified users, or remove granted slot if the " "user was already granted one. Without arguments, display a list of users " "with granted slots.\n" msgstr "" "Tilldela den specifika användaren en nedladdningsplats, eller ta bort " "tilldelad nedladdningsplats om användaren redan var tilldelad en. Utan " "argument, visa en lista över användare med tilldelade nedladdningsplatser.\n" #: src/command.c:212 msgid "help [COMMAND ...]" msgstr "help [KOMMAND ...]" #: src/command.c:213 msgid "" "If COMMAND is specified, display help for that command. Otherwise list all " "available commands.\n" msgstr "" "Visa hjälp för angivena kommandon. Om inget kommando anges, lisa alla " "tillgängliga kommandon.\n" #: src/command.c:216 msgid "ls [OPTION...] [FILE...]" msgstr "ls [FLAGGA...] [FIL...]" #: src/command.c:217 msgid "" "List files and directories. Assume current directory if FILE is not\n" "specified.\n" "\n" "Options:\n" " -l, --long use a long listing format\n" msgstr "" "Lista filer och kataloger. Om FIL inte anges, lista nuvarande katalog.\n" "\n" "Flaggor:\n" " -l, --long använd ett långt listningsformat\n" #: src/command.c:223 msgid "retry USER ..." msgstr "retry ANVÄNDARE ..." #: src/command.c:224 msgid "Try to connect and download files from the specified users.\n" msgstr "Försök att ansluta och ladda hem filer från angivna användare.\n" #: src/command.c:226 msgid "msg USER MESSAGE..." msgstr "msg ANVÄNDARE MEDDELANDE..." #: src/command.c:227 msgid "" "Send a private message to USER. Note that characters such as semicolon " "(`;'), double quote (`\"') and number sign (`#') in MESSAGE need to be " "escaped or quoted. Therefore it is recommended to put MESSAGE in double " "quotes.\n" "\n" "Example:\n" " msg some_user \"hello, how are you?\"\n" msgstr "" "Skicka ett privat meddelande till ANVÄNDARE. Notera att tecken såsom " "semikolon (\";\"), citationstecken (\") och nummertecken (\"#\") i " "MEDDELANDE måste föregås av bakåtvänt snedstreck (\"\\\") eller sättas inom " "citationstecken. Därför rekommenderas det alltid sätta MEDDELANDE inom " "citationstecken.\n" "\n" "Exempel:\n" " msg någon_användare \"hej, hur står det till?\"\n" #: src/command.c:235 msgid "pwd" msgstr "pwd" #: src/command.c:236 msgid "Display user being browsed and current directory.\n" msgstr "" "Visa vilken användare som utforskas samt nuvarande katalog för utforskning.\n" #: src/command.c:238 msgid "queue [USER ...]" msgstr "queue [ANVÄNDARE ...]" #: src/command.c:239 msgid "" "Display files queued for download from the specified users. Without " "arguments, display a list of users we have queued files for.\n" msgstr "" "Visa filer köade för nedladdning från den angivna användaren.Utan argument " "visas en lista över användare som vi har köat filer från.\n" #: src/command.c:242 msgid "raw DATA..." msgstr "raw DATA..." #: src/command.c:243 msgid "" "Send some raw data to the hub. Note that characters such as semicolon (`;'), " "double quote (`\"') and number sign (`#') in DATA need to be escaped or " "quoted. Therefore it is recommended to put DATA in double quotes.\n" msgstr "" "Skicka obehandlat data till hubben. Notera att tecken såsom semikolon (\";" "\"), citationstecken (\") och nummertecken (\"#\") i MEDDELANDE måste " "föregås av bakåtvänt snedstreck (\"\\\") eller sättas inom citationstecken. " "Därför rekommenderas det alltid sätta DATA inom citationstecken.\n" #: src/command.c:248 msgid "results [INDEX ...]" msgstr "results [INDEX ...]" #: src/command.c:249 msgid "" "If INDEX is specified, display results for the search by that index. " "Otherwise, display a list of searches and statistics over those searches.\n" msgstr "" "Visa resultat för en specifik sökning om INDEX angavs. Visa i annat fall en " "lista över sökningar med statistik.\n" #: src/command.c:252 msgid "say MESSAGE..." msgstr "say MEDDELANDE..." #: src/command.c:253 msgid "" "Send a public message to users on the hub. Note that characters such as " "semicolon (`;'), double quote (`\"') and number sign (`#') in MESSAGE need " "to be escaped or quoted. Therefore it is recommended to put MESSAGE in " "double quotes.\n" "\n" "Example:\n" " say \"hi everyone!\"\n" msgstr "" "Skicka ett publikt meddelande till användare på hubben. Notera att tecken " "såsom semikolon (\";\"), citationstecken (\") och nummertecken (\"#\") i " "MEDDELANDE måste föregås av bakåtvänt snedstreck (\"\\\") eller sättas inom " "citationstecken. Därför rekommenderas det alltid sätta MEDDELANDE inom " "citationstecken.\n" "\n" "Exempel:\n" " say \"hej allihopa!\"\n" #: src/command.c:261 msgid "search WORD..." msgstr "search SÖKORD..." #: src/command.c:262 msgid "Issue a search for the specified search words.\n" msgstr "Utför en sökning med de angivna sökorden.\n" #: src/command.c:264 msgid "set [NAME [VALUE...]]" msgstr "set [NAMN [VÄRDE...]]" #: src/command.c:265 msgid "" "Without arguments, display a list of variables and their current values. " "With only NAME argument, display the value of that variable. With NAME and " "VALUE arguments, change the value of a variable.\n" msgstr "" "Utan argument, vista en lista över variabler och deras nuvarande värde. Med " "enbart NAMN-argument, visa värdet på variabeln med det namnet. Med både NAMN-" "och VÄRDE-argument, ändra värdet på variabeln.\n" #: src/command.c:269 msgid "status" msgstr "status" #: src/command.c:270 msgid "Display status information and some statistics.\n" msgstr "Visa statusinformation och lite statistik.\n" #: src/command.c:272 msgid "transfers" msgstr "transfers" #: src/command.c:273 msgid "Display a list of user connections.\n" msgstr "Visa en lista över användaranslutningar.\n" #: src/command.c:275 msgid "unqueue USER [RANGE]" msgstr "unqueue ANVÄNDARE [INTERVALL]" #: src/command.c:276 msgid "" "Remove all or a range of queued files for USER. If RANGE is not specified, " "remove all files from the queue. Use dash (`-') and comma (`,') in RANGE. " "Open ranges are accepted (e.g. `1-' or `-2').\n" msgstr "" "Ta bort alla eller ett intervall av köade filer för ANVÄNDARE. Om INTERVALL " "inte angavs, ta bort alla filer från kön. Använd streck (\"-\") och komma " "(\",\") i INTERVALL. Öppna intervall accepteras (t.ex. \"1-\" eller \"-2" "\").\n" #: src/command.c:280 msgid "unsearch INDEX ..." msgstr "unsearch INDEX ..." #: src/command.c:281 msgid "Remove a previously issued search and all results for that search.\n" msgstr "" "Ta bort en tidigare utför sökning och alla resultat för den sökningen.\n" #: src/command.c:283 msgid "who [USER ...]" msgstr "who [ANVÄNDARE ...]" #: src/command.c:284 msgid "" "If USER is specified, display information on that user. Otherwise, display a " "table of users with some user details.\n" msgstr "" "Om ANVÄNDARE angavs, visa information för den användaren. Visa annars en " "tabell över användare med vissa användardetaljer.\n" #: src/command.c:287 msgid "alias [NAME[=VALUE] ...]" msgstr "alias [NAMN[=VÄRDE] ...]" #: src/command.c:288 msgid "" "Without arguments, display the list of aliases. With NAME argument, display " "what value (command) that alias is set to. With both NAME and VALUE " "argument, change alias. Note that VALUE is a single argument - you need to " "use quotes for more complex commands.\n" "\n" "Example:\n" " alias ll \"ls -l\"\n" msgstr "" "Utan argument, visa en lista över alias. Med NAMN-argument, visa vilket " "värde (kommando) det aliaset är satt till. Med både NAMN- och VÄRDE-" "argument, ändra aliaset. Notera att VÄRDE är ett argument - du måste " "användare citationstecken för komplexa kommandon.\n" "\n" "Exempel:\n" " alias ll \"ls -l\"\n" #: src/command.c:296 msgid "unalias NAME ..." msgstr "unalias NAMN ..." #: src/command.c:297 msgid "Remove aliases.\n" msgstr "Ta bort alias.\n" #: src/command.c:299 msgid "shell [COMMAND [ARGUMENTS...]]" msgstr "shell [KOMMANDO [ARGUMENT...]]" #: src/command.c:300 msgid "" "Execute a system command. If no arguments are specified, the current shell " "will be started (SHELL environment variable or `/bin/sh' if that is not " "set). microdc will continue in the background while the command is " "executing.\n" msgstr "" "Exekvera ett systemkommando. Om inga argument angavs kommer nuvarande skal " "att startas (miljövariabeln SHELL eller \"/bin/sh\" om den inte är satt). " "microdc fortsätter i bakgrunden medan kommandot utförs.\n" #: src/command.c:305 msgid "lookup HOST ..." msgstr "lookup VÄRD ..." #: src/command.c:306 msgid "Lookup the IP address of specified hosts.\n" msgstr "Slår upp IP-adress för angivna värdar.\n" #: src/command.c:496 #, c-format msgid "%s: Unknown command.\n" msgstr "%s: Okänt kommando.\n" #: src/command.c:678 #, c-format msgid "Cannot create child process - %s\n" msgstr "Kan inte skapa process - %s\n" #: src/command.c:693 src/command.c:696 #, c-format msgid "%s: cannot execute - %s\n" msgstr "%s: kan inte exekvera - %s\n" #: src/command.c:711 src/command.c:714 src/command.c:717 src/command.c:720 #: src/command.c:723 src/command.c:726 #, c-format msgid "Hub state: %s\n" msgstr "Hubbens tillstånd: %s\n" #: src/command.c:711 msgid "Not connected" msgstr "Inte ansluten" #: src/command.c:714 msgid "Looking up IP address" msgstr "Slår upp IP-adress" #: src/command.c:717 msgid "Waiting for complete connection" msgstr "Väntar på komplett anslutning" #: src/command.c:720 msgid "Waiting for $Lock" msgstr "Väntar på $Lock" #: src/command.c:723 msgid "Waiting for $Hello" msgstr "Väntar på $Hello" #: src/command.c:726 msgid "Logged in" msgstr "Inloggad" #: src/command.c:731 src/command.c:733 #, c-format msgid "Hub users: %s\n" msgstr "Hubbens namn: %s\n" #: src/command.c:733 msgid "(not logged in)" msgstr "(inte inloggad)" #: src/command.c:736 msgid "Pending user connections:\n" msgstr "Avvaktande användaranslutningar:\n" #: src/command.c:741 msgid " (none)\n" msgstr " (ingen)\n" #: src/command.c:743 #, c-format msgid "Share size: % %s (%s)\n" msgstr "Utdelningens storlek: % %s (%s)\n" #: src/command.c:745 src/command.c:749 src/command.c:753 src/command.c:1501 #: src/command.c:1898 src/main.c:616 src/main.c:623 src/main.c:860 #: src/user.c:421 msgid "byte" msgid_plural "bytes" msgstr[0] "byte" msgstr[1] "byten" #: src/command.c:747 #, c-format msgid "Bytes received: % %s (%s)\n" msgstr "Byten mottagna: % %s (%s)\n" #: src/command.c:751 #, c-format msgid "Bytes sent: % %s (%s)\n" msgstr "Byten skickade: % %s (%s)\n" #: src/command.c:774 #, c-format msgid "Usage: %s MESSAGE..\n" msgstr "Användning: %s MEDDELANDE...\n" #: src/command.c:778 src/command.c:806 src/command.c:839 src/command.c:881 #: src/command.c:894 src/command.c:1267 src/command.c:1298 src/command.c:1414 #: src/command.c:1489 src/command.c:1619 msgid "Not connected.\n" msgstr "Inte ansluten.\n" #: src/command.c:802 #, c-format msgid "Usage: %s USER MESSAGE..\n" msgstr "Användning: %s ANVÄNDARE MEDDELANDE...\n" #: src/command.c:811 src/command.c:913 src/command.c:1010 src/command.c:1276 #: src/command.c:1319 src/command.c:1419 src/command.c:1499 #, c-format msgid "%s: No such user on this hub\n" msgstr "%s: Användaren finns inte på denna hub\n" #: src/command.c:835 #, c-format msgid "Usage: %s DATA...\n" msgstr "Användning: %s DATA...\n" #: src/command.c:855 #, c-format msgid "Usage: %s HOST[:PORT]\n" msgstr "Användning: %s VÄRD[:PORT]\n" #: src/command.c:859 msgid "Connection in progress, disconnect first.\n" msgstr "Ansluter redan, koppla ned först.\n" #: src/command.c:867 #, c-format msgid "Invalid port number %s\n" msgstr "Felaktigt portnummer %s\n" #: src/command.c:883 msgid "Disconnecting from hub.\n" msgstr "Kopplar ned hubb.\n" #: src/command.c:917 #, c-format msgid "%s has been granted a slot.\n" msgstr "%s har tilldelats en nedladdningsplats.\n" #: src/command.c:919 #, c-format msgid "%s is no longer granted a slot.\n" msgstr "%s har fråntagits en nedladdningsplats.\n" #: src/command.c:971 #, c-format msgid "Now browsing %s.\n" msgstr "Utforskar nu %s.\n" #: src/command.c:989 src/command.c:1062 src/command.c:1078 src/command.c:1141 #: src/command.c:1213 src/command.c:1854 msgid "Not browsing any user.\n" msgstr "Utforskar ingen användare.\n" #: src/command.c:1017 src/filelist-in.c:240 src/fs.c:393 src/fs.c:470 #: src/main.c:1344 src/main.c:1362 src/user.c:531 src/util.c:109 #: src/variables.c:407 src/variables.c:427 src/variables.c:448 #, c-format msgid "%s: Cannot get file status - %s\n" msgstr "%s: Kan inte avläsa filstatus - %s\n" #: src/command.c:1036 msgid "No free connections. Queued file for download.\n" msgstr "Inga lediga anslutningar. Köade fil för nedladdning.\n" #: src/command.c:1064 #, c-format msgid "(%s) Waiting for file list.\n" msgstr "(%s) Väntar på fillista.\n" #: src/command.c:1067 #, c-format msgid "(%s) %s\n" msgstr "(%s) %s\n" #: src/command.c:1089 msgid "No previous path.\n" msgstr "Ingen tidigare sökväg.\n" #: src/command.c:1118 #, c-format msgid "%s: not a directory\n" msgstr "%s: inte en katalog\n" #: src/command.c:1182 src/command.c:1255 #, c-format msgid "%s: No such file or directory\n" msgstr "%s: Filen eller katalogen finns inte\n" #: src/command.c:1282 #, c-format msgid "%s: Already connected to user.\n" msgstr "%s: Redan ansluten till användaren.\n" #: src/command.c:1402 #, c-format msgid "Usage: %s USER [RANGE]\n" msgstr "Användning: %s ANVÄNDARE [INTERVALL]\n" #: src/command.c:1423 #, c-format msgid "%s: Invalid range, or index out of range (1-%d)\n" msgstr "" "%s: Felaktigt intervall, eller så är ett index utanför intervallet 1-%d\n" #: src/command.c:1502 #, c-format msgid "Nick: %s\n" msgstr "Användarnamn: %s\n" #: src/command.c:1503 #, c-format msgid "Description: %s\n" msgstr "Beskrivning: %s\n" #: src/command.c:1504 #, c-format msgid "Speed: %s\n" msgstr "Hastighet: %s\n" #: src/command.c:1505 #, c-format msgid "Level: %d\n" msgstr "Nivå: %d\n" #: src/command.c:1506 #, c-format msgid "E-mail: %s\n" msgstr "E-postadress: %s\n" #: src/command.c:1507 #, c-format msgid "Operator: %d\n" msgstr "Operatör: %d\n" #: src/command.c:1508 #, c-format msgid "Share Size: % %s (% MB)\n" msgstr "Utdelningsstorlek: % %s (% MB)\n" #: src/command.c:1570 src/command.c:1637 src/main.c:262 src/main.c:629 #: src/search.c:523 src/search.c:567 #, c-format msgid "Cannot get current time - %s\n" msgstr "Kan inte avläsa nuvarande tid - %s\n" #: src/command.c:1582 #, c-format msgid "Upload slots: %d/%d Download slots: %d/unlimited\n" msgstr "Uppladdningsplatser: %d/%d Nedladningsplatser: %d/obegränsat\n" #: src/command.c:1592 #, c-format msgid "Usage: %s CONNECTION ...\n" msgstr "Användning: %s ANSLUTNING ...\n" #: src/command.c:1601 #, c-format msgid "%s: No such user connection.\n" msgstr "%s: Ingen sådan användaranslutning.\n" #: src/command.c:1615 #, c-format msgid "Usage: %s STRING...\n" msgstr "Användning: %s STRÄNG...\n" #: src/command.c:1648 msgid "Closed" msgstr "Stängd" #: src/command.c:1648 msgid "Open" msgstr "Öppen" #: src/command.c:1649 #, c-format msgid "%d. %s (%s) Results: %d\n" msgstr "%d. %s (%s) Träffar: %d\n" #: src/command.c:1660 src/command.c:1695 #, c-format msgid "%s: Invalid search index.\n" msgstr "%s: Felaktigt index på sökning.\n" #: src/command.c:1664 #, c-format msgid "Search %d:\n" msgstr "Sökning %d:\n" #: src/command.c:1687 #, c-format msgid "Usage: %s INDEX\n" msgstr "Användning: %s INDEX\n" #: src/command.c:1735 src/command.c:1775 #, c-format msgid "%s: No such alias.\n" msgstr "%s: Inget sådant alias.\n" #: src/command.c:1741 #, c-format msgid "%s: Invalid alias name\n" msgstr "%s: Ogiltigt aliasnamn\n" #: src/command.c:1756 #, c-format msgid "%s: Cannot override built-in command.\n" msgstr "%s: Kan inte överskrida inbyggt kommando.\n" #: src/command.c:1768 #, c-format msgid "Usage: %s NAME ...\n" msgstr "Användning: %s NAMN ...\n" #: src/command.c:1812 msgid "Queue already contains this file, ignoring\n" msgstr "Kön innehåller redan denna fil, ignorerar\n" #: src/command.c:1850 #, c-format msgid "Usage: %s FILE ...\n" msgstr "Användning: %s FIL ...\n" #: src/command.c:1888 #, c-format msgid "Matched %s\n" msgstr "Matchade %s\n" #: src/command.c:1897 #, c-format msgid "Downloading % %s in % %s\n" msgstr "Laddar hem % %s i % %s\n" #: src/command.c:1899 msgid "file" msgid_plural "files" msgstr[0] "fil" msgstr[1] "filer" #: src/command.c:1902 #, c-format msgid "%s: No files to download.\n" msgstr "%s: Inga fler filer att ladda hem.\n" #: src/command.c:1910 msgid "No free connections. Queued files for download.\n" msgstr "Inga lediga anslutningar. Köade fil för nedladdning.\n" #: src/command.c:1940 msgid "missing host argument\n" msgstr "saknar värdargument\n" #: src/connection.c:44 msgid "Invalid $Lock message: Key to short\n" msgstr "Felaktigt $Lock-meddelande: Nyckel för kort\n" #: src/filelist-in.c:250 src/user.c:544 #, c-format msgid "%s: Cannot open file for reading - %s\n" msgstr "%s: Kan inte öppna fil för läsning - %s\n" #: src/filelist-in.c:256 src/main.c:117 src/main.c:836 #, c-format msgid "%s: Cannot read from file - %s\n" msgstr "%s: Kan inte läsa från fil - %s\n" #: src/filelist-in.c:258 src/main.c:119 #, c-format msgid "%s: Premature end of file\n" msgstr "%s: För tidigt slut av fil\n" #: src/filelist-in.c:261 src/filelist-in.c:265 src/fs.c:498 src/main.c:838 #: src/main.c:842 src/screen.c:125 src/user.c:314 #, c-format msgid "%s: Cannot close file - %s\n" msgstr "%s: Kan inte stänga fil - %s\n" #: src/filelist-in.c:269 #, c-format msgid "%s: Invalid data, cannot decode\n" msgstr "%s: Felaktig data, kan inte tolka\n" #: src/filelist-in.c:426 src/lookup.c:308 src/main.c:373 src/main.c:1146 #: src/user.c:1058 #, c-format msgid "Cannot create pipe pair - %s\n" msgstr "Kan inte skapa par av rör - %s\n" #: src/filelist-in.c:431 src/hub.c:291 src/lookup.c:313 src/main.c:389 #: src/main.c:966 src/main.c:1007 src/user.c:1104 #, c-format msgid "Cannot set non-blocking flag - %s\n" msgstr "Kan inte ställa in icke-blockerande flagga - %s\n" #: src/filelist-in.c:437 src/lookup.c:319 src/main.c:379 #, c-format msgid "Cannot create process - %s\n" msgstr "Kan inte skapa process - %s\n" #: src/fs.c:379 #, c-format msgid "%s: Cannot open directory - %s\n" msgstr "%s: Kan inte öppna katalog - %s\n" #: src/fs.c:408 #, c-format msgid "%s: Not a regular file or directory, ignoring\n" msgstr "%s: Inte en normal fil eller katalogen, ignorerar\n" #: src/fs.c:413 #, c-format msgid "%s: Cannot read directory - %s\n" msgstr "%s: Kan inte läsa katalog - %s\n" #: src/fs.c:415 #, c-format msgid "%s: Cannot close directory - %s\n" msgstr "%s: Kan inte stänga katalog - %s\n" #: src/fs.c:456 #, c-format msgid "Scanning directory %s\n" msgstr "Skannar katalogen %s\n" #: src/fs.c:473 src/main.c:1349 src/main.c:1367 #, c-format msgid "%s: Cannot remove file - %s\n" msgstr "%s: Kan inte ta bort fil - %s\n" #: src/fs.c:481 src/user.c:436 #, c-format msgid "%s: Cannot open file for writing - %s\n" msgstr "%s: Kan inte öppna fil för skrivning - %s\n" #: src/fs.c:491 src/main.c:114 #, c-format msgid "%s: Cannot write to file - %s\n" msgstr "%s: Kan inte skriva till fil - %s\n" #: src/hub.c:166 src/main.c:230 msgid "UL" msgstr "UL" #: src/hub.c:171 src/main.c:230 msgid "DL" msgstr "NL" #: src/hub.c:223 #, c-format msgid "Cannot append to hub send queue - %s\n" msgstr "Kan inte lägga till data i hubbens sändkö - %s\n" #: src/hub.c:228 src/user.c:205 msgid "-->" msgstr "-->" #: src/hub.c:232 src/hub.c:823 src/hub.c:888 msgid "hub" msgstr "hubb" #: src/hub.c:250 #, c-format msgid "%s: Cannot look up address - %s\n" msgstr "%s: Kan inte slå upp adress - %s\n" #: src/hub.c:273 #, c-format msgid "Looking up IP address for %s\n" msgstr "Slår upp IP-adress för %s\n" #: src/hub.c:284 src/main.c:961 src/main.c:1000 src/user.c:1093 #, c-format msgid "Cannot create socket - %s\n" msgstr "Kan inte skapa uttag - %s\n" #: src/hub.c:296 #, c-format msgid "Connecting to hub on %s.\n" msgstr "Ansluter till hubb på %s.\n" #: src/hub.c:299 #, c-format msgid "%s: Cannot connect - %s\n" msgstr "%s: Kan inte ansluta - %s\n" #: src/hub.c:313 msgid "Shutting down hub connection.\n" msgstr "Stänger ner anslutning till hubb.\n" #: src/hub.c:322 src/main.c:392 src/main.c:946 src/main.c:1064 #, c-format msgid "Cannot close socket - %s\n" msgstr "Kan inte stänga uttag - %s\n" #: src/hub.c:348 src/user.c:149 src/user.c:754 #, c-format msgid "Received %s message in wrong state.\n" msgstr "Mottog meddelande %s i fel tillstånd.\n" #: src/hub.c:389 src/user.c:654 msgid "Invalid $Lock message: Missing Pk value\n" msgstr "Felaktigt $Lock-meddelande: Pk-värde saknas\n" #: src/hub.c:421 msgid "Hub requires password.\n" msgstr "Hubben kräver ett lösenord.\n" #: src/hub.c:425 msgid "Sending password to hub.\n" msgstr "Skickar lösenord till hubben.\n" #: src/hub.c:430 msgid "Password not accepted.\n" msgstr "Lösenordet godtogs inte.\n" #: src/hub.c:434 msgid "You have received operator status.\n" msgstr "Du har fått operatörsbehörighet.\n" #: src/hub.c:439 #, c-format msgid "Hub name is %s.\n" msgstr "Hubbens namn är %s.\n" #: src/hub.c:451 msgid "Hub did not accept nick. Nick may be in use.\n" msgstr "Hubben godtog inte användarnamnet. Det kan vara upptaget.\n" #: src/hub.c:459 msgid "Nick accepted. You are now logged in.\n" msgstr "Användarnamnet godtogs. Du har nu loggats in.\n" #: src/hub.c:464 #, c-format msgid "Nick accepted but modified to %s. You are now logged in.\n" msgstr "Användarnamnet godtogs men ändrades till %s. Du har nu loggats in.\n" #: src/hub.c:479 #, c-format msgid "User %s logged in.\n" msgstr "Användaren %s loggade in.\n" #: src/hub.c:497 msgid "Invalid $MyINFO message: Missing $ALL parameter, ignoring\n" msgstr "Felaktigt $MyINFO-meddelande: Saknar parametern $ALL, ignorerar\n" #: src/hub.c:503 msgid "Invalid $MyINFO message: Missing nick parameter, ignoring\n" msgstr "" "Felaktigt $MyINFO-meddelande: Saknar parametern användarnamn, ignorerar\n" #: src/hub.c:516 msgid "Invalid $MyINFO message: Missing description parameter, ignoring\n" msgstr "" "Felaktigt $MyINFO-meddelande: Saknar parametern beskrivning, ignorerar\n" #: src/hub.c:524 msgid "Invalid $MyINFO message: Missing description separator, ignoring\n" msgstr "" "Felaktigt $MyINFO-meddelande: Saknars beskrivningsseparator, ignorerar\n" #: src/hub.c:530 msgid "Invalid $MyINFO message: Missing connection speed, ignoring\n" msgstr "" "Felaktigt $MyINFO-meddelande: Saknar parametern anslutningshastighet, " "ignorerar\n" #: src/hub.c:545 msgid "Invalid $MyINFO message: Missing e-mail address, ignoring\n" msgstr "" "Felaktigt $MyINFO-meddelande: Saknar parametern e-postadress, ignorerar\n" #: src/hub.c:553 msgid "Invalid $MyINFO message: Missing share size, ignoring\n" msgstr "" "Felaktigt $MyINFO-meddelande: Saknare parametern utdelningsstorlek, " "ignorerar\n" #: src/hub.c:557 msgid "Invalid $MyINFO message: Invalid share size, ignoring\n" msgstr "Felaktigt $MyINFO-meddelande: Felaktig utdelningsstorlek, ignorerar\n" #: src/hub.c:567 msgid "Hub is full.\n" msgstr "Hubben är full.\n" #: src/hub.c:598 src/hub.c:601 #, c-format msgid "Public: %s\n" msgstr "Publikt: %s\n" #: src/hub.c:598 src/hub.c:601 src/hub.c:634 src/hub.c:640 #, c-format msgid " | %s\n" msgstr " | %s\n" #: src/hub.c:613 msgid "Invalid $To message: Missing text separator, ignoring\n" msgstr "Felaktigt $To-meddelande: Saknar textseparator, ignorerar\n" #: src/hub.c:631 src/hub.c:638 #, c-format msgid "Private: [%s] %s\n" msgstr "Privat: [%s] %s\n" #: src/hub.c:649 msgid "Invalid $ConnectToMe message: Missing or invalid nick\n" msgstr "" "Felaktigt $ConnectToMe-meddelande: Användarnamnet saknas eller är felaktigt\n" #: src/hub.c:653 msgid "Invalid $ConnectToMe message: Invalid address specification.\n" msgstr "Felaktigt $ConnectToMe-meddelande: Felaktig adresspecifikation.\n" #: src/hub.c:657 #, c-format msgid "Connecting to user on %s\n" msgstr "Ansluter till användare på %s\n" #: src/hub.c:666 msgid "Invalid $RevConnectToMe message: Missing nick parameter\n" msgstr "Felaktigt $RevConnectToMe-meddelande: Saknar parametern användarnamn\n" #: src/hub.c:670 msgid "Invalid $RevConnectToMe message: Remote nick is our nick\n" msgstr "" "Felaktigt $RevConnectToMe-meddelande: Fjärranvändarens namn är samma som " "vårt\n" #: src/hub.c:675 #, c-format msgid "Invalid $RevConnectToMe message: Unknown user %s, ignoring\n" msgstr "Invalid $RevConnectToMe-meddelande: Okänd användare %s, ignorerar\n" #: src/hub.c:680 src/main.c:199 src/main.c:213 #, c-format msgid "No more connections to user %s allowed.\n" msgstr "Inga fler anslutningar till användaren %s är tillåtna.\n" #: src/hub.c:686 #, c-format msgid "User %s is also passive. Cannot establish connection.\n" msgstr "Användaren %s är också passiv. Kan inte upprätta anslutning.\n" #: src/hub.c:761 #, c-format msgid "Invalid $Quit message: Unknown user %s.\n" msgstr "Felaktigt $Quit-meddelande: Okänd användare %s.\n" #: src/hub.c:773 msgid "Invalid $Search message: Missing source specification.\n" msgstr "Felaktigt $Search-meddelande: Saknar källspecifikation.\n" #: src/hub.c:777 msgid "Invalid $Search message: Invalid search specification.\n" msgstr "Felaktigt $Search-meddelande: Felaktig sökspecifikation.\n" #: src/hub.c:783 #, c-format msgid "Invalid $Search message: Unknown user %s.\n" msgstr "Felaktigt $Search-meddelande: Okänd användare %s.\n" #: src/hub.c:793 msgid "Invalid $Search message: Invalid address specification.\n" msgstr "Felaktigt $Search-meddelande: Felaktig adresspecifikation.\n" #: src/hub.c:832 src/user.c:848 msgid "<--" msgstr "<--" #: src/hub.c:856 src/user.c:873 #, c-format msgid "Cannot get error status - %s\n" msgstr "Kan inte avläsa felstatus - %s\n" #: src/hub.c:861 src/user.c:878 src/user.c:1115 #, c-format msgid "Cannot connect - %s\n" msgstr "Kan inte ansluta - %s\n" #: src/hub.c:869 src/main.c:1039 #, c-format msgid "Cannot get socket address - %s\n" msgstr "Kan inte avläsa adress för uttag - %s\n" #: src/hub.c:876 #, c-format msgid "Connected to hub from %s.\n" msgstr "Ansluten till hubb från %s.\n" #: src/hub.c:916 #, c-format msgid "ConnectToMe already sent to user %s. Waiting.\n" msgstr "ConnectToMe har redan skickats till användaren %s. Avvaktar.\n" #: src/hub.c:927 #, c-format msgid "RevConnectToMe already sent to user %s. Waiting.\n" msgstr "RevConnectToMe har redan skickats till användaren %s. Avvaktar.\n" #: src/hub.c:931 #, c-format msgid "User %s is also passive. Cannot communicate.\n" msgstr "Användaren %s är också passiv. Kan inte kommunicera.\n" #: src/huffman.c:332 msgid "Incorrect parity, ignoring\n" msgstr "Felaktig paritet, ignorerar\n" #: src/main.c:174 #, c-format msgid "User connection %s renamed to %s.\n" msgstr "Användaranslutning %s bytte namn till %s.\n" #: src/main.c:265 #, c-format msgid " in %s (%s/s)" msgstr " på %s (%s/s)" #: src/main.c:279 #, c-format msgid "%s: %s of %s %s%s. %s %s%s.\n" msgstr "%s: %s av %s %s%s. %s %s%s.\n" #: src/main.c:281 msgid "Upload" msgstr "Uppladdning" #: src/main.c:281 msgid "Download" msgstr "Nedladdning" #: src/main.c:283 msgid "succeeded" msgstr "lyckades" #: src/main.c:283 msgid "failed" msgstr "misslyckades" #: src/main.c:286 msgid "transferred" msgid_plural "transferred" msgstr[0] "överfört" msgstr[1] "överförda" #: src/main.c:342 #, c-format msgid "%s: Cannot rename file to %s - %s\n" msgstr "%s: Kan inte ändra namn på fil till %s - %s\n" #: src/main.c:343 msgid "cannot rename file" msgstr "kan inte ändra namn på fil" #: src/main.c:386 src/main.c:469 src/user.c:1055 src/user.c:1168 #: src/user.c:1170 #, c-format msgid "Cannot close pipe - %s\n" msgstr "Kan inte stänga rör - %s\n" #. TRANSLATORS: This represents the connection name used when #. * the user name is not yet known. It must not contains '|', #. * because that's used to distinguish between 'unknown' and #. * (perhaps partially) identified connections. #. #: src/main.c:419 #, c-format msgid "unknown%" msgstr "okänd%" #: src/main.c:440 #, c-format msgid "Shutting down user connection process for %s.\n" msgstr "Stänger ner process för användaranslutning %s.\n" #: src/main.c:494 #, c-format msgid "Downloading %3d%% (at %5d kb/s) %s" msgstr "Laddar hem %3d%% (med %5d kb/s) %s" #: src/main.c:495 #, c-format msgid "Uploading %3d%% (at %5d kb/s) %s" msgstr "Laddar upp %3d%% (med %5d kb/s) %s" #: src/main.c:498 msgid "Idle" msgstr "Overksam" #: src/main.c:520 src/main.c:535 #, c-format msgid "user process %s" msgstr "användarprocess %s" #: src/main.c:549 #, c-format msgid "User %s: %s" msgstr "Användare %s: %s" #: src/main.c:610 #, c-format msgid "%s: Starting %s of %s (% of % %s).\n" msgstr "%s: Startar %s av %s (% av % %s).\n" #: src/main.c:612 src/main.c:620 msgid "upload" msgstr "uppladdning" #: src/main.c:612 src/main.c:620 msgid "download" msgstr "nedladdning" #: src/main.c:618 #, c-format msgid "%s: Starting %s of %s (% %s).\n" msgstr "%s: Startar %s av %s (% %s).\n" #: src/main.c:702 #, c-format msgid "Received unknown message %d from user process, shutting down process.\n" msgstr "Mottog meddelande %d från användarprocess.\n" #: src/main.c:746 src/main.c:747 src/user.c:968 src/user.c:969 #, c-format msgid "Cannot write to signal pipe - %s\n" msgstr "Kan inte skriva till signalrör - %s\n" #: src/main.c:762 src/user.c:984 #, c-format msgid "Cannot read from signal pipe - %s\n" msgstr "Kan inte läsa från signalrör - %s\n" #: src/main.c:768 src/user.c:990 msgid "Received TERM signal, shutting down.\n" msgstr "Mottog TERM-signal, stänger ned.\n" #: src/main.c:784 msgid "Shell process" msgstr "Programprocess" #: src/main.c:786 msgid "Lookup process" msgstr "Uppslagsprocess" #: src/main.c:789 msgid "Parse process" msgstr "Tolkningsprocess" #: src/main.c:793 msgid "User process" msgstr "Användarprocess" #: src/main.c:796 #, c-format msgid "%s exited with return code %d.\n" msgstr "%s avslutades med returkod %d.\n" #: src/main.c:802 #, c-format msgid "%s terminated by signal %s.\n" msgstr "%s avslutades av signalen %s.\n" #: src/main.c:806 #, c-format msgid "Cannot wait for processes - %s\n" msgstr "Kan inte vänta på processer - %s\n" #: src/main.c:825 #, c-format msgid "%s: Cannot open file - %s\n" msgstr "%s: Kan inte öppna fil - %s\n" #: src/main.c:858 #, c-format msgid "Sharing % %s (%s) totally\n" msgstr "Delar % %s (%s) totalt\n" #: src/main.c:875 src/main.c:906 src/main.c:928 msgid "user (search result)" msgstr "användare (sökresultat)" #: src/main.c:910 msgid "<==" msgstr "<==" #: src/main.c:932 msgid "==>" msgstr "==>" #: src/main.c:972 src/main.c:1015 #, c-format msgid "Cannot enable address reusing - %s\n" msgstr "Kan inte aktivera återanvändning av adress - %s\n" #: src/main.c:980 src/main.c:1024 #, c-format msgid "Cannot bind to address - %s\n" msgstr "Kan inte binda till adress - %s\n" #: src/main.c:1032 #, c-format msgid "Cannot listen - %s\n" msgstr "Kan inte lyssna - %s\n" #: src/main.c:1044 #, c-format msgid "Listening on %s.\n" msgstr "Lyssnar på %s.\n" #: src/main.c:1083 #, c-format msgid "Cannot accept user connection - %s\n" msgstr "Kan inte ta emot användaranslutning - %s\n" #: src/main.c:1087 #, c-format msgid "User from %s connected.\n" msgstr "Användare från %s anslöt.\n" #: src/main.c:1103 #, c-format msgid "%s: Cannot set locale: %s\n" msgstr "%s: Kan inte ställa in lokal - %s\n" #: src/main.c:1106 #, c-format msgid "%s: Cannot bind message domain: %s\n" msgstr "%s: Kan inte binda meddelandedomän - %s\n" #: src/main.c:1108 #, c-format msgid "%s: Cannot set message domain: %s\n" msgstr "%s: Kan inte ställa in meddelandedomän - %s\n" #: src/main.c:1130 #, c-format msgid "Usage: %s [OPTION]...\n" msgstr "Användning: %s [FLAGGA]...\n" #: src/main.c:1131 msgid "Start microdc, a command-line based Direct Connect client.\n" msgstr "Starar microdc, en kommandoradbaserad Direct Connect-klient.\n" #: src/main.c:1132 #, c-format msgid " -n, --no-config do not read config file on startup\n" msgstr " -n, --no-config läs inte konfigurationsfil vid uppstart\n" #: src/main.c:1133 #, c-format msgid " --help display this help and exit\n" msgstr " --help visa denna hjälptext och avsluta\n" #: src/main.c:1134 #, c-format msgid " --version output version information and exit\n" msgstr " --version visa versionsinformation och avsluta\n" #: src/main.c:1135 #, c-format msgid "" "\n" "Report bugs to <%s>.\n" msgstr "" "\n" "Rapportera fel till <%1$s>.\n" "Rapportera kommentarer om översättningen till <%1$s>.\n" #: src/main.c:1153 src/user.c:1063 #, c-format msgid "Cannot empty signal set - %s\n" msgstr "Kan inte tömma signaluppsättning - %s\n" #: src/main.c:1164 src/main.c:1168 src/main.c:1172 src/main.c:1176 #: src/main.c:1181 src/user.c:1076 src/user.c:1083 #, c-format msgid "Cannot register signal handler - %s\n" msgstr "Kan inte registrera signalhanterare - %s\n" #: src/main.c:1210 #, c-format msgid "Cannot find directory for temporary files - %s\n" msgstr "Kan inte hitta katalog för tillfälliga filer - %s\n" #: src/main.c:1251 src/user.c:1133 #, c-format msgid "Cannot select - %s\n" msgstr "select-anropet misslyckades - %s\n" #: src/main.c:1333 src/main.c:1335 src/variables.c:311 src/variables.c:313 #, c-format msgid "cannot close character convertor - %s\n" msgstr "kan inte stänga teckenuppsättningskonverterare - %s\n" #: src/main.c:1374 #, c-format msgid "Cannot close search results socket - %s\n" msgstr "Kan inte stänga uttag för sökresultat - %s\n" #: src/main.c:1376 #, c-format msgid "Cannot close user connections socket - %s\n" msgstr "Kan inte stänga uttag för användaranslutningar - %s\n" #: src/main.c:1378 src/main.c:1380 src/user.c:1164 src/user.c:1166 #, c-format msgid "Cannot close signal pipe - %s\n" msgstr "Kan inte stänga signalrör - %s\n" #: src/screen.c:132 msgid "No longer logging to file.\n" msgstr "Loggar inte längre till fil.\n" #: src/screen.c:137 #, c-format msgid "%s: Cannot open file for appending - %s\n" msgstr "%s: Kan inte öppna fil för att lägga till - %s\n" #: src/screen.c:142 #, c-format msgid "Logging to `%s'.\n" msgstr "Loggar till \"%s\".\n" #: src/screen.c:369 #, c-format msgid "%s: Cannot write history - %s\n" msgstr "%s: Kan inte skriva historik - %s\n" #: src/screen.c:568 #, c-format msgid "%s: Cannot read history - %s\n" msgstr "%s: Kan inte läsa historik - %s\n" #: src/search.c:322 src/search.c:324 #, c-format msgid "Sent %d/%d search results to %s.\n" msgstr "Skickade %d/%d sökresultat till %s.\n" #: src/search.c:327 msgid "No search results.\n" msgstr "Inga sökresultat.\n" #: src/search.c:512 msgid "No pattern to match.\n" msgstr "Inget mönster att matcha.\n" #: src/search.c:529 #, c-format msgid "Reissuing search %d.\n" msgstr "Utför sökning %d på nytt.\n" #: src/search.c:533 #, c-format msgid "Issuing new search with index %d.\n" msgstr "Utför ny sökning med index %d.\n" #: src/search.c:573 #, c-format msgid "Unterminated or invalid $SR, discarding: %s\n" msgstr "Oterminerad eller felaktig $SR, kastar: %s\n" #: src/search.c:590 #, c-format msgid "Result has been added earlier to search %d.\n" msgstr "Resultat hade tidigare lagts till i sökning %d.\n" #: src/search.c:596 #, c-format msgid "Added result to search %d (now %d result).\n" msgid_plural "Added result to search %d (now %d results).\n" msgstr[0] "Nya resultat lades till sökning %d (nu %d resultat).\n" msgstr[1] "Nya resultat lades till sökning %d (nu %d resultat).\n" #: src/user.c:124 msgid "main process" msgstr "huvudprocess" #: src/user.c:209 src/user.c:828 src/user.c:922 src/user.c:942 msgid "user" msgstr "användare" #: src/user.c:255 msgid "Too many connections to user, or no free slots.\n" msgstr "För många anslutningar till användare, eller inga lediga platser.\n" #: src/user.c:297 #, c-format msgid "User %s not on hub, or too many connections to user.\n" msgstr "" "Användaren %s finns inte på hubben, eller för många anslutningar till " "användaren.\n" #: src/user.c:365 msgid "No more files to download.\n" msgstr "Inga fler filer att ladda hem.\n" #: src/user.c:377 #, c-format msgid "%s: Cannot get file status: %s\n" msgstr "%s: Kan inte avläsa filstatus: %s\n" #: src/user.c:378 src/user.c:387 src/user.c:437 src/user.c:443 src/user.c:533 #: src/user.c:546 src/user.c:552 src/user.c:611 src/user.c:912 msgid "local error" msgstr "lokalt fel" #: src/user.c:386 #, c-format msgid "%s: File exists and is not a regular file\n" msgstr "%s: Filen finns och är inte en vanlig fil\n" #: src/user.c:397 src/user.c:449 src/user.c:557 src/user.c:923 msgid "communication error" msgstr "kommunikationsfel" #: src/user.c:420 #, c-format msgid "" "remote file is smaller than local (expected %, got % %s)" msgstr "" "fjärrfilen är mindre än den lokala (förväntade %, fick % %s)" #: src/user.c:442 #, c-format msgid "%s: Cannot seek to resume position - %s\n" msgstr "%s: Kan inte söka till omstartspositionen - %s\n" #: src/user.c:462 src/user.c:584 msgid "no data to transfer" msgstr "ingen data att överföra" #: src/user.c:525 #, c-format msgid "%s: No such shared file\n" msgstr "%s: Ingen sådant delad fil\n" #: src/user.c:527 msgid "no such shared file" msgstr "ingen sådant delad fil" #: src/user.c:537 #, c-format msgid "%s: Resume offset % outside file\n" msgstr "%s: Omstartsposition % utanför filen\n" #: src/user.c:539 msgid "resume offset out of range" msgstr "återstartsposition utanför området" #: src/user.c:550 #, c-format msgid "%s: Cannot seek in file - %s\n" msgstr "%s: Kan inte söka i fil - %s\n" #: src/user.c:620 src/user.c:932 msgid "transfer complete" msgstr "överföringar färdiga" #: src/user.c:682 msgid "Invalid $Direction message: Missing direction parameter\n" msgstr "Felaktigt $Direction-meddelande: Saknar parameter för riktning\n" #: src/user.c:691 msgid "Invalid $Direction message: Invalid direction parameter\n" msgstr "Felaktigt $Direction-meddelande: Felaktig parameter för riktning\n" #: src/user.c:698 msgid "Invalid $Direction message: Missing challenge parameter\n" msgstr "Felaktigt $Direction-meddelande: Saknar parameter för utmaning.\n" #: src/user.c:703 msgid "Invalid $Direction message: Invalid challenge parameter\n" msgstr "Felaktigt $Direction-meddelande: Felaktig parameter för utmaning.\n" #: src/user.c:724 msgid "User does not want to download, nor do we.\n" msgstr "Användaren vill inte ladda ner, och inte vi heller.\n" #: src/user.c:741 msgid "Invalid $Key message: Incorrect key, ignoring\n" msgstr "Felaktigt $Key-meddelande: Felaktig nyckel, ignorerar\n" #: src/user.c:760 msgid "Invalid $Get message: Missing offset, assuming start\n" msgstr "Felaktigt $Get-meddelande: Saknar position, antar start\n" #: src/user.c:765 msgid "Invalid $Get message: Offset not integer\n" msgstr "Felaktigt $Get-meddelande: Position är inte ett heltal\n" #: src/user.c:775 msgid "remote did not want file" msgstr "fjärranvändaren ville inte ha filen" #: src/user.c:782 msgid "remote is maxed out" msgstr "fjärranvändaren har inga lediga platser" #: src/user.c:791 msgid "protocol error: invalid $FileLength message" msgstr "protokollfel: felaktigt $FileLength-meddelande" #: src/user.c:800 msgid "file not available on remote" msgstr "filen är inte tillgänglig hos fjärranvändaren" #: src/user.c:802 #, c-format msgid "remote error: %s" msgstr "fjärrfel: %s" #: src/user.c:807 #, c-format msgid "Received error from user: %s\n" msgstr "Mottog fel från användare: %s\n" #: src/user.c:892 msgid "Connected to user.\n" msgstr "Ansluten till användare.\n" #: src/user.c:993 #, c-format msgid "Idle timeout (%d seconds)\n" msgstr "Inaktivitetstimeout (%d sekunder)\n" #: src/user.c:1024 msgid "Received unknown message from main process, shutting down process.\n" msgstr "Mottog okänt meddelande från huvudprocess, stänger ner process.\n" #: src/user.c:1162 #, c-format msgid "Cannot close transfer file - %s\n" msgstr "Kan inte stänga överföringsfil - %s\n" #: src/user.c:1172 #, c-format msgid "Cannot close user connection - %s\n" msgstr "Kan inte stänga användaranslutning - %s\n" #: src/util.c:113 #, c-format msgid "%s: Cannot create directory - %s\n" msgstr "%s: Kan inte skapa katalog - %s\n" #. TRANSLATORS: This comma-separated list specifies #. * all strings which are considered negative boolean #. * values for variables such as `active'. #. * Retain the default English strings and add the #. * localized ones. #. #: src/variables.c:52 msgid "0,off,no,false" msgstr "0,off,no,false,av,nej" #. TRANSLATORS: This comma-separated list specifies #. * all strings which are considered positive boolean #. * values for variables such as `active'. #. * Retain the default English strings and add the #. * localized ones. #. #: src/variables.c:59 msgid "1,on,yes,true" msgstr "1,on,yes,true,på,ja" #: src/variables.c:288 src/variables.c:324 src/variables.c:359 #: src/variables.c:388 src/variables.c:403 src/variables.c:423 #: src/variables.c:444 src/variables.c:464 src/variables.c:546 #: src/variables.c:571 src/variables.c:690 src/variables.c:709 #: src/variables.c:733 msgid "too many arguments\n" msgstr "för många argument\n" #: src/variables.c:296 msgid "cannot get current character set" msgstr "kan inte avläsa nuvarande teckenuppsättning" #: src/variables.c:301 src/variables.c:306 #, c-format msgid "cannot create character set convertor - %s\n" msgstr "kan inte skapa teckenuppsättningskonverterare - %s\n" #: src/variables.c:326 msgid "Nick cannot be empty.\n" msgstr "Användarnamn kan inte vara tomt.\n" #: src/variables.c:328 msgid "Nick is too long - max length is 35 characters.\n" msgstr "Användarnamn är för långt - max längd är 35 tecken.\n" #: src/variables.c:330 msgid "Nick may not contain `$', `|' or space characters.\n" msgstr "" "Användarnamn får inte innehålla tecknen \"$\", \"|\" eller mellanslag.\n" #: src/variables.c:343 msgid "Description may not contain `$' or `|' characters.\n" msgstr "Beskrivning får inte innehålla tecknen \"$\" eller \"|\".\n" #: src/variables.c:346 msgid "Description is too long - max length is 35 characters.\n" msgstr "Beskrivning är för lång - max längd är 35 tecken.\n" #: src/variables.c:361 msgid "E-mail may not contain `$' or `|' characters.\n" msgstr "E-postadress får inte innehålla tecknen \"$\" eller \"|\".\n" #: src/variables.c:363 msgid "E-mail is too long - max length is 35 characters.\n" msgstr "E-postadress är för lång - max längd är 35 tecken.\n" #: src/variables.c:376 msgid "Tag may not contain `$' or `|' characters.\n" msgstr "Tagg får inte innehålla tecknen \"$\" eller \"|\".\n" #: src/variables.c:390 msgid "Speed may not contain `$' or `|' characters.\n" msgstr "Hastighet får inte innehålla tecknen \"$\" eller \"|\".\n" #: src/variables.c:411 src/variables.c:431 src/variables.c:452 #, c-format msgid "%s: Not a directory\n" msgstr "%s: Inte en katalog\n" #: src/variables.c:468 #, c-format msgid "Invalid slot number `%s'\n" msgstr "Felaktigt platsnummer \"%s\"\n" #: src/variables.c:550 msgid "Specify active as `0', `no', `off', `1', `yes', or `on'.\n" msgstr "Ange aktiv som \"0\", \"nej\", \"av\", \"1\", \"ja\", eller \"på\".\n" #: src/variables.c:554 src/variables.c:702 msgid "Active setting not changed.\n" msgstr "Inställning för aktiv ändrades inte.\n" #: src/variables.c:576 msgid "Removing listening address.\n" msgstr "Tar bort manuell adress för anslutningar.\n" #: src/variables.c:581 #, c-format msgid "%s: Specify listen address as an IP address\n" msgstr "%s: Ange anslutningsadress som en IP-adress\n" #: src/variables.c:596 #, c-format msgid "Listening address set to %s.\n" msgstr "Manuell adress för anslutningar ändrad till %s.\n" #: src/variables.c:661 #, c-format msgid "No flag by the name %s, display flags not changed.\n" msgstr "Ingen flagga med namnet %s finns, visningsflaggor har inte ändrats.\n" #: src/variables.c:668 msgid "Cannot set and add or delete flags at the same time.\n" msgstr "Kan inte ställa in och lägga till eller ta bort flaggor samtidigt.\n" #: src/variables.c:697 #, c-format msgid "Invalid value `%s' for port number.\n" msgstr "Felaktigt portnummer \"%s\"\n" #: src/variables.c:726 msgid "on" msgstr "på" #: src/variables.c:726 msgid "off" msgstr "av" #: src/variables.c:737 msgid "Removing current password.\n" msgstr "Tar bort nuvarande lösenord.\n" #: src/variables.c:741 msgid "Password may not contain `|' characters.\n" msgstr "Lösenord får inte innehålla tecknet \"|\".\n" #: src/variables.c:843 #, c-format msgid "No value is set for `%s'.\n" msgstr "Inget värde har sats för \"%s\".\n" #: src/variables.c:845 #, c-format msgid "" "Current value for `%s':\n" "%s\n" msgstr "" "Nuvarande värde för \"%s\":\n" "%s\n" #: src/common/optparser.c:93 #, c-format msgid "option `--%s' is ambiguous" msgstr "flaggan \"%s\" är tvetydig" #: src/common/optparser.c:101 #, c-format msgid "unrecognized option `--%s'" msgstr "okänd flagga \"--%s\"" #: src/common/optparser.c:181 src/common/optparser.c:186 #, c-format msgid "invalid option -- %c" msgstr "ogiltig flagga -- %c" #: src/common/optparser.c:206 #, c-format msgid "option requires an argument -- %c" msgstr "flaggan kräver ett argument -- %c" #: src/common/optparser.c:258 #, c-format msgid "option `--%s' doesn't allow an argument" msgstr "flaggan \"--%s\" tar inget argument" #: src/common/optparser.c:266 #, c-format msgid "option `--%s' requires an argument" msgstr "flaggan \"%s\" kräver ett argument" #~ msgid "%s|UL" #~ msgstr "%s|UL" #~ msgid "%s|DL" #~ msgstr "%s|DL" #~ msgid "Hub state %s\n" #~ msgstr "Hubbens tillstånd %s\n" #~ msgid "User %s validated as %s\n" #~ msgstr "Användaren %s validerades som %s\n" #~ msgid "Logical communication error with user process (during message %d).\n" #~ msgstr "" #~ "Logiskt kommunikationsfel med användarprocess (vid meddelande %d).\n" #~ msgid "%s: Download of %s %s (%s). % %s.\n" #~ msgstr "%s: Nedladdning av %s %s (%s). % %s.\n" #~ msgid "%s: Download of %s %s but unqueued (%s). % %s.\n" #~ msgstr "%s: Nedladdning av %s %s men ej längre i kö (%s). % %s.\n" #~ msgid "Cannot create socket pair - %s\n" #~ msgstr "Kan inte skapa par av uttag - %s\n" #~ msgid "User %s: Shutting down user connection.\n" #~ msgstr "Användare %s: Stänger ner användaranslutning.\n" #~ msgid "Disconnecting user.\n" #~ msgstr "Kopplar ned användare.\n" #~ msgid "Logical communication error with main process (during message %d).\n" #~ msgstr "Logiskt kommunikationsfel med huvudprocess (vid meddelande %d).\n" #~ msgid "Cannot append to user send queue - %s\n" #~ msgstr "Kan inte lägga till data i användarens sändkö - %s\n" #~ msgid "Cannot close main process socket - %s\n" #~ msgstr "Kan inte stänga uttag till huvudprocess - %s\n" microdc2-0.15.6/rpm/0040755000076500007500000000000010543546024014156 5ustar chugunovmicrodcmicrodc2-0.15.6/rpm/CVS/0040755000076500007500000000000010527341105014604 5ustar chugunovmicrodcmicrodc2-0.15.6/rpm/CVS/Root0100644000076500007500000000003610527341105015446 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/rpm/CVS/Repository0100644000076500007500000000001410527341105016676 0ustar chugunovmicrodcmicrodc/rpm microdc2-0.15.6/rpm/CVS/Entries0100644000076500007500000000011510527341105016132 0ustar chugunovmicrodc/microdc.spec.in/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/rpm/CVS/Tag0100644000076500007500000000003010527341105015230 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/rpm/microdc.spec.in0100644000076500007500000000275210516626545017071 0ustar chugunovmicrodc%define package @PACKAGE@ %define version @VERSION@ %define release 1 Summary: A command-line based Direct Connect client Name: %{package} Version: %{version} Release: %{release} License: GPL Group: Applications/Internet Source: http://savannah.nongnu.org/download/%{package}/%{package}-%{version}.tar.gz URL: http://www.nongnu.org/%{package}/ Packager: Oskar Liljeblad Vendor: Oskar Liljeblad BuildRoot: %{_tmppath}/%{package}-%{version}-%{release}-root %description microdc is a command-line based Direct Connect client that uses the GNU Readline library for user interaction. It was developed from ground up and does not depend on any other program. Despite the command-line user interface, microdc was designed to be user friendly and simple to use. microdc is currently in beta state - there may be many bugs not yet discovered. It also lacks some features that other clients support, such as file hashing, multiple hub connections, and hub list support. %prep %setup -q %build ./configure --prefix=%{_prefix} # This hack is necessary on some Red Hat/Fedora systems where readline # doesn't link with a termcap library. # See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=162023 make LIBS=-lncurses %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc README AUTHORS COPYING NEWS doc/TODO doc/INTERNALS %{_prefix}/bin/* %{_prefix}/man/*/* %{_prefix}/share/locale/*/*/* microdc2-0.15.6/slackware/0040755000076500007500000000000010543546024015334 5ustar chugunovmicrodcmicrodc2-0.15.6/slackware/CVS/0040755000076500007500000000000010527341105015762 5ustar chugunovmicrodcmicrodc2-0.15.6/slackware/CVS/Root0100644000076500007500000000003610527341105016624 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/slackware/CVS/Repository0100644000076500007500000000002210527341105020053 0ustar chugunovmicrodcmicrodc/slackware microdc2-0.15.6/slackware/CVS/Entries0100644000076500007500000000012310527341105017307 0ustar chugunovmicrodc/microdc.SlackBuild.in/1.1.1.1/Sun Oct 22 08:35:49 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/slackware/CVS/Tag0100644000076500007500000000003010527341105016406 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/slackware/microdc.SlackBuild.in0100644000076500007500000000527210516626545021332 0ustar chugunovmicrodc#! /bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PACKAGE=@PACKAGE@ VERSION=@VERSION@ if [ "$ARCH" = "" ]; then ARCH="`arch`" if [ "$ARCH" = "" ]; then ARCH="i486" fi fi BUILD=1 # |-----handy-ruler------------------------------------------------------|" DESC="\ microdc: microdc (a command-line based Direct Connect client) microdc: microdc: microdc is a command-line based Direct Connect client that uses the microdc: GNU Readline library for user interaction. It was developed from microdc: ground up and does not depend on any other program. Despite the microdc: command-line user interface, microdc was designed to be user microdc: friendly and simple to use. microdc: microdc: microdc is currently in beta state - there may be many bugs not yet microdc: discovered. It also lacks some features that other clients support, microdc: such as file hashing, multiple hub connections, and hub list support. microdc: microdc: microdc homepage: http://www.nongnu.org/microdc/" PKG=$TMP/package-$PACKAGE if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mcpu=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "powerpc" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2 -march=$ARCH" fi if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi rm -rf $PKG if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi cd $TMP || exit 1 rm -rf $PACKAGE-$VERSION tar xzvf $CWD/$PACKAGE-$VERSION.tar.gz cd $PACKAGE-$VERSION || exit 1 chown -R root:root . CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --sysconfdir=/etc \ --libdir=/usr/lib$LIBDIRSUFFIX \ $ARCH-slackware-linux || exit 1 make || exit 1 make install DESTDIR=$PKG gzip -9 $PKG/usr/man/man?/*.? mkdir -p $PKG/usr/doc/$PACKAGE-$VERSION cp -a \ ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL INTERNALS NEWS README TODO \ $PKG/usr/doc/$PACKAGE-$VERSION/ rm -rf $PKG/usr/share/doc chmod 644 $PKG/usr/doc/$PACKAGE-$VERSION/* chown -R root:root $PKG/ chgrp -R bin $PKG/usr/bin ( cd $PKG || exit 1 find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) mkdir -p $PKG/install echo "$DESC" > $PKG/install/slack-desc # Build the package: cd $PKG || exit 1 makepkg --linkadd y --chown n $CWD/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi microdc2-0.15.6/src/0040755000076500007500000000000010543546024014147 5ustar chugunovmicrodcmicrodc2-0.15.6/src/CVS/0040755000076500007500000000000010543546032014601 5ustar chugunovmicrodcmicrodc2-0.15.6/src/CVS/Root0100644000076500007500000000003610527341105015437 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/src/CVS/Repository0100644000076500007500000000001410527341105016667 0ustar chugunovmicrodcmicrodc/src microdc2-0.15.6/src/CVS/Entries0100644000076500007500000000353110543546032016134 0ustar chugunovmicrodc/connection.c/1.2/Thu Nov 16 07:48:30 2006//Tmicrodc2_0_13_1_locale /hash.c/1.5/Thu Nov 16 11:21:43 2006//Tmicrodc2_0_13_1_locale /huffman.c/1.2/Thu Nov 16 07:34:19 2006//Tmicrodc2_0_13_1_locale /lookup.c/1.3/Thu Nov 16 08:18:14 2006//Tmicrodc2_0_13_1_locale /microdc.1/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /microdc.pl.1/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /tth_file.c/1.1/Tue Oct 24 05:00:28 2006//Tmicrodc2_0_13_1_locale /tth_file.h/1.1/Tue Oct 24 05:00:28 2006//Tmicrodc2_0_13_1_locale /util.c/1.2/Wed Nov 8 19:42:42 2006//Tmicrodc2_0_13_1_locale D/bzip2//// D/common//// D/tth//// /screen.c/1.6.2.4/Mon Nov 27 14:13:44 2006//Tmicrodc2_0_13_1_locale /filelist-in.c/1.5.2.3/Tue Nov 28 12:49:09 2006//Tmicrodc2_0_13_1_locale /Makefile.am/1.5.2.7/Wed Nov 29 13:02:50 2006//Tmicrodc2_0_13_1_locale /microdc_tth.c/1.6.2.1/Wed Nov 29 09:38:03 2006//Tmicrodc2_0_13_1_locale /tth.c/1.1.2.2/Wed Nov 29 09:40:09 2006//Tmicrodc2_0_13_1_locale /fs.c/1.11.2.6/Thu Nov 30 10:00:40 2006//Tmicrodc2_0_13_1_locale /user.c/1.7.2.9/Thu Nov 30 10:00:40 2006//Tmicrodc2_0_13_1_locale /local_flist.c/1.7.2.13/Sat Dec 9 09:01:22 2006//Tmicrodc2_0_13_1_locale /search.c/1.5.2.3/Fri Dec 1 19:37:37 2006//Tmicrodc2_0_13_1_locale /charsets.h/1.1.2.7/Thu Dec 14 14:00:38 2006//Tmicrodc2_0_13_1_locale /xml_flist.c/1.5.2.9/Sun Dec 24 16:54:36 2006//Tmicrodc2_0_13_1_locale /charsets.c/1.1.2.10/Thu Dec 14 19:47:04 2006//Tmicrodc2_0_13_1_locale /main.c/1.14.2.11/Sun Dec 24 18:23:51 2006//Tmicrodc2_0_13_1_locale /command.c/1.6.2.9/Sun Dec 24 18:32:37 2006//Tmicrodc2_0_13_1_locale /microdc.h/1.10.2.15/Sun Dec 24 18:27:15 2006//Tmicrodc2_0_13_1_locale /hub.c/1.7.2.12/Sun Dec 24 18:41:44 2006//Tmicrodc2_0_13_1_locale /variables.c/1.6.2.14/Sun Dec 24 18:42:07 2006//Tmicrodc2_0_13_1_locale /Makefile.in/1.5.2.7/Sun Dec 24 18:44:47 2006//Tmicrodc2_0_13_1_locale microdc2-0.15.6/src/CVS/Tag0100644000076500007500000000003010527341105015221 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/src/Makefile.am0100664000076500007500000000173110533302372016177 0ustar chugunovmicrodcSUBDIRS = common bzip2 tth AM_CFLAGS = \ -Wall \ $(LIBXML2_CFLAGS) AM_CPPFLAGS = \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib bin_PROGRAMS = microdc2 tthsum microdc2_SOURCES = \ command.c \ connection.c \ variables.c \ fs.c \ xml_flist.c \ hub.c \ huffman.c \ main.c \ lookup.c \ filelist-in.c \ screen.c \ search.c \ user.c \ util.c \ tth_file.c \ tth_file.h \ local_flist.c \ hash.c \ charsets.c \ charsets.h \ microdc.h tthsum_SOURCES = \ tth.c #microdc_tth_SOURCES = \ # tth_file.c \ # tth_file.h \ # microdc_tth.c microdc2_LDADD = \ common/libcommon.a \ bzip2/libbzip2.a \ tth/libtth.a \ ../lib/libgnu.a \ $(READLINE_LIBS) \ $(LIBINTL) \ $(LIBICONV) \ $(LIBXML2_LIBS) tthsum_LDADD = \ tth/libtth.a \ ../lib/libgnu.a \ $(LIBINTL) #microdc_tth_LDADD = \ # tth/libtth.a \ # ../lib/libgnu.a # $(LIBICONV) - not yet used man_MANS = \ microdc.1 \ microdc.pl.1 EXTRA_DIST = \ $(man_MANS) microdc2-0.15.6/src/Makefile.in0100644000076500007500000005745210543545237016233 0ustar chugunovmicrodc# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = microdc2$(EXEEXT) tthsum$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/ac_lib_readline.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/alloca.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/free.m4 \ $(top_srcdir)/m4/getaddrinfo.m4 $(top_srcdir)/m4/getdelim.m4 \ $(top_srcdir)/m4/gethostname.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/human.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconvme.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes.m4 \ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memmem.m4 $(top_srcdir)/m4/minmax.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/sig2str.m4 \ $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stdbool.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strtoimax.m4 \ $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoll.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strtoull.m4 \ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtol.m4 $(top_srcdir)/m4/xstrtoumax.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_microdc2_OBJECTS = command.$(OBJEXT) connection.$(OBJEXT) \ variables.$(OBJEXT) fs.$(OBJEXT) xml_flist.$(OBJEXT) \ hub.$(OBJEXT) huffman.$(OBJEXT) main.$(OBJEXT) \ lookup.$(OBJEXT) filelist-in.$(OBJEXT) screen.$(OBJEXT) \ search.$(OBJEXT) user.$(OBJEXT) util.$(OBJEXT) \ tth_file.$(OBJEXT) local_flist.$(OBJEXT) hash.$(OBJEXT) \ charsets.$(OBJEXT) microdc2_OBJECTS = $(am_microdc2_OBJECTS) am__DEPENDENCIES_1 = microdc2_DEPENDENCIES = common/libcommon.a bzip2/libbzip2.a \ tth/libtth.a ../lib/libgnu.a $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_tthsum_OBJECTS = tth.$(OBJEXT) tthsum_OBJECTS = $(am_tthsum_OBJECTS) tthsum_DEPENDENCIES = tth/libtth.a ../lib/libgnu.a \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(microdc2_SOURCES) $(tthsum_SOURCES) DIST_SOURCES = $(microdc2_SOURCES) $(tthsum_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FNMATCH_H = @FNMATCH_H@ GETOPT_H = @GETOPT_H@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ HAVE_LONG_64BIT = @HAVE_LONG_64BIT@ HAVE_LONG_LONG_64BIT = @HAVE_LONG_LONG_64BIT@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LOCALEDIR = @LOCALEDIR@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TR = @TR@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XML_CONFIG = @XML_CONFIG@ ac_ct_CC = @ac_ct_CC@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = common bzip2 tth AM_CFLAGS = \ -Wall \ $(LIBXML2_CFLAGS) AM_CPPFLAGS = \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib microdc2_SOURCES = \ command.c \ connection.c \ variables.c \ fs.c \ xml_flist.c \ hub.c \ huffman.c \ main.c \ lookup.c \ filelist-in.c \ screen.c \ search.c \ user.c \ util.c \ tth_file.c \ tth_file.h \ local_flist.c \ hash.c \ charsets.c \ charsets.h \ microdc.h tthsum_SOURCES = \ tth.c #microdc_tth_SOURCES = \ # tth_file.c \ # tth_file.h \ # microdc_tth.c microdc2_LDADD = \ common/libcommon.a \ bzip2/libbzip2.a \ tth/libtth.a \ ../lib/libgnu.a \ $(READLINE_LIBS) \ $(LIBINTL) \ $(LIBICONV) \ $(LIBXML2_LIBS) tthsum_LDADD = \ tth/libtth.a \ ../lib/libgnu.a \ $(LIBINTL) #microdc_tth_LDADD = \ # tth/libtth.a \ # ../lib/libgnu.a # $(LIBICONV) - not yet used man_MANS = \ microdc.1 \ microdc.pl.1 EXTRA_DIST = \ $(man_MANS) all: all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) microdc2$(EXEEXT): $(microdc2_OBJECTS) $(microdc2_DEPENDENCIES) @rm -f microdc2$(EXEEXT) $(LINK) $(microdc2_LDFLAGS) $(microdc2_OBJECTS) $(microdc2_LDADD) $(LIBS) tthsum$(EXEEXT): $(tthsum_OBJECTS) $(tthsum_DEPENDENCIES) @rm -f tthsum$(EXEEXT) $(LINK) $(tthsum_LDFLAGS) $(tthsum_OBJECTS) $(tthsum_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charsets.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filelist-in.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/huffman.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local_flist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/screen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/search.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tth_file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/user.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variables.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml_flist.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man install-exec-am: install-binPROGRAMS install-info: install-info-recursive install-man: install-man1 installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man1 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-binPROGRAMS clean-generic clean-recursive ctags \ ctags-recursive distclean distclean-compile distclean-generic \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-man1 \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am uninstall-man \ uninstall-man1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: microdc2-0.15.6/src/charsets.c0100664000076500007500000001212010540325070016113 0ustar chugunovmicrodc#include #include #include /* C89 */ #include /* POSIX (XSI) */ #include "xalloc.h" #include "iconvme.h" /* Gnulib */ #include "microdc.h" #include "charsets.h" DECLARE_CHARSET(hub); DECLARE_CHARSET(fs); DECLARE_CHARSET(main); DECLARE_CHARSET(log); DECLARE_CONST_CHARSET(utf8, "UTF-8"); /* conversion functions */ DECLARE_ICONV_CONVERSION(main, hub); DECLARE_ICONV_CONVERSION(hub, main); DECLARE_ICONV_CONVERSION(main, fs); DECLARE_ICONV_CONVERSION(fs, main); DECLARE_ICONV_CONVERSION(hub, fs); DECLARE_ICONV_CONVERSION(fs, hub); DECLARE_ICONV_CONVERSION(main, log); DECLARE_ICONV_CONVERSION(log, main); #if defined(HAVE_LIBXML2) DECLARE_ICONV_CONVERSION(utf8, fs); DECLARE_ICONV_CONVERSION(fs, utf8); DECLARE_ICONV_CONVERSION(utf8, main); DECLARE_ICONV_CONVERSION(main, utf8); DECLARE_ICONV_CONVERSION(utf8, hub); DECLARE_ICONV_CONVERSION(hub, utf8); #endif /* charset update functions */ void set_main_charset(const char* charset); void set_hub_charset(const char* charset); void set_fs_charset(const char* charset); void set_main_charset(const char* charset) { if ((charset == NULL && main_charset == NULL) || (charset != NULL && main_charset != NULL && strcasecmp(charset, main_charset) == 0)) { return; } else { /* clearing the conversion to/from this charset */ ICONV_CLOSE(main, hub); ICONV_CLOSE(hub, main); ICONV_CLOSE(main, fs); ICONV_CLOSE(fs, main); ICONV_CLOSE(main, log); ICONV_CLOSE(log, main); #if defined(HAVE_LIBXML2) ICONV_CLOSE(main, utf8); ICONV_CLOSE(utf8, main); #endif if (main_charset != NULL) { free(main_charset); main_charset = NULL; } if (charset != NULL) { if (*charset == '\0') { main_charset = xstrdup(nl_langinfo(CODESET)); } else { main_charset = xstrdup(charset); } ICONV_OPEN(main, hub); ICONV_OPEN(hub, main); ICONV_OPEN(main, fs); ICONV_OPEN(fs, main); ICONV_OPEN(main, log); ICONV_OPEN(log, main); #if defined(HAVE_LIBXML2) ICONV_OPEN(main, utf8); ICONV_OPEN(utf8, main); #endif } } } void set_hub_charset(const char* charset) { if ((charset == NULL && hub_charset == NULL) || (charset != NULL && hub_charset != NULL && strcasecmp(charset, hub_charset) == 0)) { return; } else { /* clearing the conversion to/from this charset */ ICONV_CLOSE(main, hub); ICONV_CLOSE(hub, main); ICONV_CLOSE(hub, fs); ICONV_CLOSE(fs, hub); #if defined(HAVE_LIBXML2) ICONV_CLOSE(hub, utf8); ICONV_CLOSE(utf8, hub); #endif if (hub_charset != NULL) { free(hub_charset); hub_charset = NULL; } if (charset != NULL) { if (*charset == '\0') { hub_charset = xstrdup(nl_langinfo(CODESET)); } else { hub_charset = xstrdup(charset); } ICONV_OPEN(main, hub); ICONV_OPEN(hub, main); ICONV_OPEN(hub, fs); ICONV_OPEN(fs, hub); #if defined(HAVE_LIBXML2) ICONV_OPEN(hub, utf8); ICONV_OPEN(utf8, hub); #endif } } } void set_fs_charset(const char* charset) { if ((charset == NULL && fs_charset == NULL) || (charset != NULL && fs_charset != NULL && strcasecmp(charset, fs_charset) == 0)) { return; } else { /* clearing the conversion to/from this charset */ ICONV_CLOSE(fs, hub); ICONV_CLOSE(hub, fs); ICONV_CLOSE(main, fs); ICONV_CLOSE(fs, main); #if defined(HAVE_LIBXML2) ICONV_CLOSE(fs, utf8); ICONV_CLOSE(utf8, fs); #endif if (fs_charset != NULL) { free(fs_charset); fs_charset = NULL; } if (charset != NULL) { if (*charset == '\0') { fs_charset = xstrdup(nl_langinfo(CODESET)); } else { fs_charset = xstrdup(charset); } ICONV_OPEN(fs, hub); ICONV_OPEN(hub, fs); ICONV_OPEN(main, fs); ICONV_OPEN(fs, main); #if defined(HAVE_LIBXML2) ICONV_OPEN(fs, utf8); ICONV_OPEN(utf8, fs); #endif } } } void set_log_charset(const char* charset) { if ((charset == NULL && log_charset == NULL) || (charset != NULL && log_charset != NULL && strcasecmp(charset, log_charset) == 0)) { return; } else { /* clearing the conversion to/from this charset */ ICONV_CLOSE(main, log); ICONV_CLOSE(log, main); if (log_charset != NULL) { free(log_charset); log_charset = NULL; } if (charset != NULL) { if (*charset == '\0') { log_charset = xstrdup(nl_langinfo(CODESET)); } else { log_charset = xstrdup(charset); } ICONV_OPEN(main, log); ICONV_OPEN(log, main); } } } microdc2-0.15.6/src/charsets.h0100644000076500007500000001134210540254406016127 0ustar chugunovmicrodc#ifndef __CHARSETS_H #define __CHARSETS_H //#define DEBUG_DUMP_TRANSLATION #if defined(DEBUG_DUMP_TRANSLATION) #include #define DUMP_TRANSLATION(from, to, from_str, to_str) \ fprintf(stderr, "%08lX: %s -> %s: %s -> %s\n", (unsigned long)from##_to_##to##_iconv, from##_charset, to##_charset, from_str, to_str); \ fflush(stderr) #define ERROR_TRANSLATION_OPEN(from, to) \ if (from##_to_##to##_iconv == (iconv_t)-1) { \ fprintf(stderr, "%s:%d: cannot create translation from %s to %s\n", __FUNCTION__, __LINE__, from##_charset, to##_charset); \ fflush(stderr); \ } #else #define DUMP_TRANSLATION(from, to, from_str, to_str) #define ERROR_TRANSLATION_OPEN(from, to) #endif #if !HAVE_ICONV typedef int iconv_t; #endif #define no_iconv ((const iconv_t) -1) #define EXPORT_CHARSET(set) extern char* set##_charset #define EXPORT_CONST_CHARSET(set) extern const char* set##_charset #define DECLARE_CHARSET(set) char* set##_charset = 0 #define DECLARE_CONST_CHARSET(set, value) const char* set##_charset = value #define EXPORT_CONVERSION(from, to) \ char* from##_to_##to##_string(const char* str); \ char* try_##from##_to_##to##_string(const char* str); #if HAVE_ICONV #define DECLARE_CONVERSION(from, to) \ char* from##_to_##to##_string(const char* str) \ { \ char *converted = 0; \ if (str != 0) { \ if (from##_to_##to##_iconv != (iconv_t)-1) { \ converted = iconv_alloc(from##_to_##to##_iconv, str); \ } \ if (converted == 0) { \ converted = xstrdup(str); \ DUMP_TRANSLATION(from, to, str, "FAILED"); \ } else { \ DUMP_TRANSLATION(from, to, str, converted); \ } \ } \ return converted; \ } \ char* try_##from##_to_##to##_string(const char* str) \ { \ char *converted = 0; \ if (str != 0) { \ if (from##_to_##to##_iconv != (iconv_t)-1) { \ converted = iconv_alloc(from##_to_##to##_iconv, str); \ } \ } \ return converted; \ } #else #define DECLARE_CONVERSION(from, to) \ char* from##_to_##to##_string(const char* str) \ { \ return xstrdup(str); \ } \ char* try_##from##_to_##to##_string(const char* str) \ { \ return 0; \ } #endif #define EXPORT_ICONV_CONVERSION(from, to) \ EXPORT_CONVERSION(from, to) #define DECLARE_ICONV_CONVERSION(from, to) \ iconv_t from##_to_##to##_iconv = (iconv_t)no_iconv; \ DECLARE_CONVERSION(from, to) #if HAVE_ICONV #define ICONV_OPEN(from, to) \ if (from##_charset != 0 && to##_charset != 0) { \ from##_to_##to##_iconv = iconv_open(to##_charset, from##_charset); \ ERROR_TRANSLATION_OPEN(from, to); \ } #define ICONV_CLOSE(from, to) \ if (from##_to_##to##_iconv != no_iconv) { \ iconv_close(from##_to_##to##_iconv); \ from##_to_##to##_iconv = no_iconv; \ } #else // HAVE_ICONV #define ICONV_OPEN(from, to) #define ICONV_CLOSE(from, to) #endif // HAVE_ICONV #endif // ifndef __CHARSETS_H microdc2-0.15.6/src/command.c0100664000076500007500000020066310543543705015742 0ustar chugunovmicrodc/* command.c - Command input and basic commands * * Copyright (C) 2004, 2005 Oskar Liljeblad * Copyright (C) 2006 Alexey Illarionov * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* C89 */ #include /* C89 */ #include /* POSIX.1: stat */ #include /* POSIX.1: fork */ #include /* POSIX.1: gethostbyname, h_errno, ?hstrerror? */ #include /* BSD 4.3: inet_aton */ #include /* ? */ #include /* POSIX.1 (CX): PRI* */ #include "iconvme.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "xalloc.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #include "quotearg.h" /* Gnulib */ #include "human.h" /* Gnulib */ #include "fnmatch.h" /* Gnulib/GNU Libc */ #include "quote.h" /* Gnulib */ #include "stpcpy.h" /* Gnulib/GNU Libc */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/tmap.h" #include "common/error.h" #include "common/strleftcmp.h" #include "common/intutil.h" #include "common/minmaxonce.h" #include "common/strbuf.h" #include "common/range.h" #include "common/quoting.h" #include "common/comparison.h" #include "common/bksearch.h" #include "common/swap.h" #include "common/optparser.h" #include "microdc.h" //#define _TRACE #if defined(_TRACE) #include #define TRACE(x) printf x; fflush(stdout); #else #define TRACE(x) #endif static void cmd_retry(int argc, char **argv); static void cmd_help(int argc, char **argv); static void cmd_exit(int argc, char **argv); static void cmd_say(int argc, char **argv); static void cmd_msg(int argc, char **argv); static void cmd_raw(int argc, char **argv); static void cmd_disconnect(int argc, char **argv); static void cmd_connect(int argc, char **argv); static void cmd_grantslot(int argc, char **argv); static void cmd_browse(int argc, char **argv); static void cmd_pwd(int argc, char **argv); static void cmd_find(int argc, char **argv); static void cmd_ls(int argc, char **argv); static void cmd_cd(int argc, char **argv); static void cmd_get(int argc, char **argv); static void cmd_queue(int argc, char **argv); static void cmd_unqueue(int argc, char **argv); static void cmd_who(int argc, char **argv); static void cmd_transfers(int argc, char **argv); static void cmd_cancel(int argc, char **argv); static void cmd_search(int argc, char **argv); static void cmd_status(int argc, char **argv); static void cmd_results(int argc, char **argv); static void cmd_unsearch(int argc, char **argv); static void cmd_alias(int argc, char **argv); static void cmd_unalias(int argc, char **argv); static void cmd_shell(int argc, char **argv); static void cmd_lookup(int argc, char **argv); static void cmd_share(int argc, char **argv); static void cmd_unshare(int argc, char **argv); static void shell_command_completion_selector(DCCompletionInfo *ci); static void executable_completion_generator(DCCompletionInfo *ci); static void alias_completion_generator(DCCompletionInfo *ci); static void command_completion_generator(DCCompletionInfo *ci); static void alias_command_completion_selector(DCCompletionInfo *ci); typedef enum { DC_CMD_BUILTIN, DC_CMD_ALIAS, } DCCommandType; typedef struct _DCGetData DCGetData; typedef struct _DCCommand DCCommand; typedef struct _DCAliasCommand DCAliasCommand; typedef struct _DCBuiltinCommand DCBuiltinCommand; struct _DCGetData { DCUserInfo *ui; char *base_path; uint64_t byte_count; uint32_t file_count; }; struct _DCCommand { char *name; DCCommandType type; }; struct _DCAliasCommand { DCCommand cmd; char *alias_spec; }; struct _DCBuiltinCommand { DCCommand cmd; DCBuiltinCommandHandler handler; DCCompletorFunction completor; const char *usage_msg; const char *help_msg; }; static TMap *commands; /* initialized in command_init */ static void add_builtin_command(const char *name, DCBuiltinCommandHandler handler, DCCompletorFunction completor, const char *usage_msg, const char *help_msg) { DCBuiltinCommand *builtin = xmalloc(sizeof(DCBuiltinCommand)); builtin->cmd.name = xstrdup(name); /* XXX: this should be avoidable (pass char *name instead) */ builtin->cmd.type = DC_CMD_BUILTIN; builtin->handler = handler; builtin->completor = completor; builtin->usage_msg = usage_msg; builtin->help_msg = help_msg; tmap_put(commands, builtin->cmd.name, builtin); } static void add_alias_command(const char *name, const char *alias_spec) { DCAliasCommand *alias = xmalloc(sizeof(DCAliasCommand)); alias->cmd.name = xstrdup(name); alias->cmd.type = DC_CMD_ALIAS; alias->alias_spec = xstrdup(alias_spec); tmap_put(commands, alias->cmd.name, alias); } static void free_command(DCCommand *cmd) { if (cmd->type == DC_CMD_ALIAS) { DCAliasCommand *alias = (DCAliasCommand *) cmd; free(alias->alias_spec); } free(cmd->name); free(cmd); } void command_finish(void) { tmap_foreach_value(commands, free_command); tmap_free(commands); } void command_init(void) { commands = tmap_new(); tmap_set_compare_fn(commands, (comparison_fn_t) strcmp); /* Note: The algorithm in cmd_help that displays the help message * requires that the help message is terminated by a newline. * Otherwise the last line will not be shown. */ add_builtin_command("browse", cmd_browse, user_or_myself_completion_generator, _("browse [USER]"), _("If USER is specified, queue the file list for that user for download and " "start browsing the user's files as soon as the list is downloaded. With no " "arguments, stop browsing.\n")); add_builtin_command("cancel", cmd_cancel, transfer_completion_generator, _("cancel CONNECTION ..."), _("Close a user connection. Use the `transfers' command to get a list of " "connections.\n")); add_builtin_command("cd", cmd_cd, remote_dir_completion_generator, _("cd [DIRECTORY]"), _("Change directory when browsing another user's files. If DIRECTORY is not " "specified, change to the root directory (`/').\n")); add_builtin_command("connect", cmd_connect, NULL, _("connect HOST[:PORT]"), _("Connect to a hub. If PORT is not specified, assume port 411.\n")); add_builtin_command("disconnect", cmd_disconnect, NULL, _("disconnect"), _("Disconnect from the hub.\n")); add_builtin_command("exit", cmd_exit, NULL, _("exit"), _("Quit the program.\n")); add_builtin_command("find", cmd_find, remote_path_completion_generator, _("find [FILE ...]"), _("List files and directories recursively. Assume current directory if FILE is " "not specified. Must be browsing a user's files to use this command.\n")); add_builtin_command("get", cmd_get, remote_path_completion_generator, _("get FILE ..."), _("Queue file for download. Must be browsing a user's files to use this " "command.\n")); add_builtin_command("grantslot", cmd_grantslot, user_completion_generator, _("grantslot [USER ...]"), _("Grant a download slot for the specified users, or remove granted slot if the " "user was already granted one. Without arguments, display a list of users with " "granted slots.\n")); add_builtin_command("help", cmd_help, command_completion_generator, _("help [COMMAND ...]"), _("If COMMAND is specified, display help for that command. Otherwise list all " "available commands.\n")); add_builtin_command("ls", cmd_ls, remote_path_completion_generator, _("ls [OPTION...] [FILE...]"), _("List files and directories. Assume current directory if FILE is not\n" "specified.\n" "\n" "Options:\n" " -l, --long use a long listing format\n")); add_builtin_command("retry", cmd_retry, user_with_queue_completion_generator, _("retry USER ..."), _("Try to connect and download files from the specified users.\n")); add_builtin_command("msg", cmd_msg, user_completion_generator, _("msg USER MESSAGE..."), _("Send a private message to USER. Note that characters such as semicolon " "(`;'), double quote (`\"') and number sign (`#') in MESSAGE need to be " "escaped or quoted. Therefore it is recommended to put MESSAGE in double " "quotes.\n" "\n" "Example:\n" " msg some_user \"hello, how are you?\"\n")); add_builtin_command("pwd", cmd_pwd, NULL, _("pwd"), _("Display user being browsed and current directory.\n")); add_builtin_command("queue", cmd_queue, user_with_queue_completion_generator, _("queue [USER ...]"), _("Display files queued for download from the specified users. Without " "arguments, display a list of users we have queued files for.\n")); add_builtin_command("raw", cmd_raw, NULL, _("raw DATA..."), _("Send some raw data to the hub. Note that characters such as semicolon " "(`;'), double quote (`\"') and number sign (`#') in DATA need to be " "escaped or quoted. Therefore it is recommended to put DATA in double " "quotes.\n")); add_builtin_command("results", cmd_results, NULL, _("results [INDEX ...]"), _("If INDEX is specified, display results for the search by that index. " "Otherwise, display a list of searches and statistics over those searches.\n")); add_builtin_command("say", cmd_say, say_user_completion_generator, _("say MESSAGE..."), _("Send a public message to users on the hub. Note that characters such as " "semicolon (`;'), double quote (`\"') and number sign (`#') in MESSAGE need " "to be escaped or quoted. Therefore it is recommended to put MESSAGE in " "double quotes.\n" "\n" "Example:\n" " say \"hi everyone!\"\n")); add_builtin_command("search", cmd_search, NULL, _("search WORD..."), _("Issue a search for the specified search words.\n")); add_builtin_command("set", cmd_set, set_command_completion_selector, _("set [NAME [VALUE...]]"), _("Without arguments, display a list of variables and their current values. With " "only NAME argument, display the value of that variable. With NAME and VALUE " "arguments, change the value of a variable.\n")); add_builtin_command("status", cmd_status, NULL, _("status"), _("Display status information and some statistics.\n")); add_builtin_command("transfers", cmd_transfers, NULL, _("transfers"), _("Display a list of user connections.\n")); add_builtin_command("unqueue", cmd_unqueue, user_with_queue_completion_generator, _("unqueue USER [RANGE]"), _("Remove all or a range of queued files for USER. If RANGE is not specified, " "remove all files from the queue. Use dash (`-') and comma (`,') in RANGE. " "Open ranges are accepted (e.g. `1-' or `-2').\n")); add_builtin_command("unsearch", cmd_unsearch, NULL, _("unsearch INDEX ..."), _("Remove a previously issued search and all results for that search.\n")); add_builtin_command("who", cmd_who, user_completion_generator, _("who [USER ...]"), _("If USER is specified, display information on that user. Otherwise, " "display a table of users with some user details.\n")); add_builtin_command("alias", cmd_alias, alias_command_completion_selector, _("alias [NAME[=VALUE] ...]"), _("Without arguments, display the list of aliases. With NAME argument, " "display what value (command) that alias is set to. With both NAME and " "VALUE argument, change alias. Note that VALUE is a single argument - " "you need to use quotes for more complex commands.\n" "\n" "Example:\n" " alias ll \"ls -l\"\n")); add_builtin_command("unalias", cmd_unalias, alias_completion_generator, _("unalias NAME ..."), _("Remove aliases.\n")); add_builtin_command("shell", cmd_shell, shell_command_completion_selector, _("shell [COMMAND [ARGUMENTS...]]"), _("Execute a system command. If no arguments are specified, the current " "shell will be started (SHELL environment variable or `/bin/sh' if that " "is not set). microdc will continue in the background while the command " "is executing.\n")); add_builtin_command("lookup", cmd_lookup, NULL, _("lookup HOST ..."), _("Lookup the IP address of specified hosts.\n")); add_builtin_command("share", cmd_share, local_path_completion_generator, _("share DIR"), _("Add share directory to the processing list\n")); add_builtin_command("unshare", cmd_unshare, local_path_completion_generator, _("unshare DIR"), _("Remove share directory from the processing list\n")); add_alias_command("ll", "ls -l"); } void default_completion_selector(DCCompletionInfo *ci) { DCCompletionInfo ci2; const char *newline; if (find_unquoted_leading_char(ci->line, ci->line + ci->we, '#') != NULL) return; /* completing in commented out text */ newline = find_last_unquoted_char(ci->line, ci->line + ci->we, ';'); if (newline != NULL) { ci2.line = find_word_start(newline+1, ci->line + ci->we); ci2.ws = ci->ws - (ci2.line - ci->line); ci2.we = ci->we - (ci2.line - ci->line); ci2.results = ci->results; fill_completion_info(&ci2); } else { ci2 = *ci; } if (ci2.word_index == 0) { command_completion_generator(&ci2); } else { DCCommand *cmd; char *name; name = get_word_dequoted(ci2.line, 0); cmd = tmap_get(commands, name); free(name); if (cmd != NULL) { if (cmd->type == DC_CMD_BUILTIN) { DCBuiltinCommand *builtin = (DCBuiltinCommand *) cmd; if (builtin->completor != NULL) builtin->completor(&ci2); } else if (cmd->type == DC_CMD_ALIAS) { DCAliasCommand *alias = (DCAliasCommand *) cmd; int sizemod; char *newline; newline = xasprintf("%s%s", alias->alias_spec, find_word_end(ci2.line, NULL)); ci2.line = newline; sizemod = strlen(alias->alias_spec) - strlen(cmd->name); ci2.ws += sizemod; ci2.we += sizemod; default_completion_selector(&ci2); free(newline); } } } if (newline != NULL) { free(ci2.word_full); free(ci2.word); } } static void alias_command_completion_selector(DCCompletionInfo *ci) { /* XXX not implemented yet */ #if 0 char *newline; char *newword; int newwe; int newws; bool quoted; /*printf("\nOLD: %2d:%2d [%s:%s]\n", ws, we, word, line);*/ newline = word; newwe = strlen(word); newws = find_completion_word_start(newline, newwe); /*newword = dequote_word(newline+newws, false, NULL);*/ newword = get_completion_word_dequoted(newline, newwe); // printf("NEW: %2d:%2d [%s:%s]\n", newws, newwe, newword, newline); quoted = newline[newws] == '"'; default_completion_selector(newline, newws, newwe, newword, results); if (results->cur == 1) { DCCompletionEntry *entry = results->buf[0]; char *match; char *match2; if (entry->input_single_full_format != NULL && strcmp(newword, entry->input) == 0) { match = xasprintf(entry->input_single_full_format, entry->input); } else if (entry->input_single_format != NULL) { match = xasprintf(entry->input_single_format, entry->input); } else { match = xasprintf(entry->input_format, entry->input); } if (entry->input != entry->display) free(entry->input); match2 = quote_word_full(match, quoted, true, ";", "#", false, true, true, true); free(match); entry->input = replace_substr(newline, newws, newwe, match2); // printf(">>[%s]\n", entry->input); free(match2); entry->input_format = "%s"; entry->input_single_format = NULL; entry->input_single_full_format = NULL; entry->inhibit_quote = true; } else if (results->cur > 1) { uint32_t c; for (c = 0; c < results->cur; c++) { DCCompletionEntry *entry = results->buf[c]; char *match; match = quote_word_full(entry->input, quoted, true, ";", "#", false, true, true, true); if (entry->input != entry->display) free(entry->input); entry->input = replace_substr(newline, newws, newwe, match); free(match); } } free(newword); #endif } static void alias_completion_generator(DCCompletionInfo *ci) { TMapIterator it; tmap_iterator_partial(commands, &it, ci->word, (comparison_fn_t) strleftcmp); while (it.has_next(&it)) { DCCommand *cmd = it.next(&it); if (cmd->type == DC_CMD_ALIAS) ptrv_append(ci->results, new_completion_entry(cmd->name, NULL)); } } static void command_completion_generator(DCCompletionInfo *ci) { TMapIterator it; tmap_iterator_partial(commands, &it, ci->word, (comparison_fn_t) strleftcmp); while (it.has_next(&it)) { DCCommand *cmd = it.next(&it); ptrv_append(ci->results, new_completion_entry(cmd->name, NULL)); } } void command_execute(const char *line) { for (;;) { PtrV *args; DCCommand *cmd; char *name; line = find_word_start(line, NULL); if (*line == '\0' || *line == '#') break; if (*line == ';') { line++; continue; } name = get_word_dequoted_termchar(line, 0, ';'); /* won't return NULL */ cmd = tmap_get(commands, name); if (cmd != NULL && cmd->type == DC_CMD_ALIAS) { DCAliasCommand *alias = (DCAliasCommand *) cmd; char *newline; newline = xasprintf("%s%s", alias->alias_spec, find_word_end(line, NULL)); free(name); command_execute(newline); free(newline); return; } /* Process arguments until ";" or "#" or end of line. */ args = ptrv_new(); ptrv_append(args, name); for (;;) { line = find_word_start(find_word_end_termchar(line, NULL, ';'), NULL); if (*line == '\0' || *line == '#' || *line == ';') break; ptrv_append(args, get_word_dequoted_termchar(line, 0, ';')); } ptrv_append(args, NULL); if (cmd == NULL) { warn(_("%s: Unknown command.\n"), quotearg(name)); } else { DCBuiltinCommand *builtin = (DCBuiltinCommand *) cmd; /*int c; screen_putf("Execute: <%s>", cmd->name); for (c = 0; c < args->cur-1; c++) screen_putf(" [%s]", (char *) args->buf[c]); screen_putf("\n");*/ builtin->handler(args->cur-1, (char **) args->buf); } ptrv_foreach(args, free); /* will free(name) as that is args->buf[0] */ ptrv_free(args); } } /* This is not exactly the same as bash, I consider it better: * * [1] Allow completion of dirs relative to CWD always (bash: only in * last resort, when there are no exefile matches). * [2] When a dir has been completed (dirpath!=NULL, line contains at * least one /), then allow completion of any dirs+exefiles relative * to that dir. * [3] Only allow completion of exefiles relative to CWD if PATH * contains `.'. * * Bash completes like [2] and [3]. But bash deals with things differently * when it comes to [1]: When PATH does not contain ., then completion of * directories in CWD is only used as a last resort if there are no * executable matches in other dirs in PATH. */ static void executable_completion_generator(DCCompletionInfo *ci) { char *path; char *p1; char *p; const char *file_part; char *dir_part; char *conv_word; bool path_has_cwd = false; conv_word = main_to_fs_string(ci->word); get_file_dir_part(conv_word, &dir_part, &file_part); path = getenv("PATH"); if (path == NULL) { /*path = xconfstr(_CS_PATH); if (path == NULL || *path == '\0')*/ free(conv_word); return; } else { path = xstrdup(path); } for (p1 = path; (p = strsep(&p1, ":")) != NULL; ) { DIR *dh; if (strcmp(p, ".") == 0) path_has_cwd = true; dh = opendir(p); /* ignore errors */ if (dh != NULL) { struct dirent *ent; while ((ent = readdir(dh)) != NULL) { /* ignore errors */ if (strleftcmp(conv_word, ent->d_name) == 0) { char *full; full = catfiles(p, ent->d_name); if (access(full, X_OK) == 0) { /* ignore errors */ struct stat sb; if (stat(full, &sb) >= 0 && S_ISREG(sb.st_mode)) { DCCompletionEntry *ce; char *conv_fname; conv_fname = fs_to_main_string(ent->d_name); ce = new_completion_entry(conv_fname, conv_fname); free(conv_fname); ce->sorting.file_type = DC_TYPE_REG; ptrv_append(ci->results, ce); } } /* XXX: use is_directory instead of that stat above */ free(full); } } closedir(dh); } } free(conv_word); /* local_fs_completion_generator will sort the results. */ if (*dir_part != '\0' || path_has_cwd) { local_fs_completion_generator(ci,DC_CPL_DIR|DC_CPL_EXE|DC_CPL_DOT); } else if (ci->results->cur == 0) { local_fs_completion_generator(ci,DC_CPL_DIR|DC_CPL_DOT); } free(dir_part); free(path); } static void shell_command_completion_selector(DCCompletionInfo *ci) { if (ci->word_index == 1) { executable_completion_generator(ci); } else { local_path_completion_generator(ci); } } static void cmd_help(int argc, char **argv) { uint32_t c; int width; screen_get_size(NULL, &width); if (argc == 1) { TMapIterator it; StrBuf *buf; buf = strbuf_new(); for (tmap_iterator(commands, &it); it.has_next(&it); ) { DCCommand *cmd = it.next(&it); if (cmd->type == DC_CMD_BUILTIN) { DCBuiltinCommand *builtin = (DCBuiltinCommand *) cmd; if (strlen(builtin->usage_msg) < width/2) { if (strbuf_is_empty(buf)) { strbuf_append(buf, builtin->usage_msg); strbuf_append_char_n(buf, width/2-strbuf_length(buf), ' '); } else { screen_putf("%s%s\n", strbuf_buffer(buf), builtin->usage_msg); strbuf_clear(buf); } } else { if (strbuf_is_empty(buf)) { screen_putf("%s\n", builtin->usage_msg); } else { screen_putf("%s\n%s\n", strbuf_buffer(buf), builtin->usage_msg); strbuf_clear(buf); } } } } if (!strbuf_is_empty(buf)) screen_putf("%s\n", strbuf_buffer(buf)); strbuf_free(buf); return; } for (c = 1; c < argc; c++) { DCCommand *cmd; cmd = tmap_get(commands, argv[c]); if (cmd == NULL) { warn("%s: Unknown command.\n", quotearg(argv[c])); } else { if (cmd->type == DC_CMD_ALIAS) { DCAliasCommand *alias = (DCAliasCommand *) cmd; screen_putf("%s: aliased to `%s'.\n", quotearg_n(0, cmd->name), quotearg_n(1, alias->alias_spec)); } else { DCBuiltinCommand *builtin = (DCBuiltinCommand *) cmd; const char *p0; const char *p1; screen_putf("%s: %s\n", cmd->name, builtin->usage_msg); for (p0 = builtin->help_msg; (p1 = strchr(p0, '\n')) != NULL; p0 = p1+1) { PtrV *msgs; uint32_t d; msgs = wordwrap(p0, p1-p0, width-5-4, width-5-4); for (d = 0; d < msgs->cur; d++) screen_putf(" %s\n", (char *) msgs->buf[d]); if (d == 0) screen_putf("\n"); ptrv_free(msgs); } } } } } static void cmd_shell(int argc, char **argv) { screen_suspend(); shell_child = fork(); if (shell_child < 0) { warn(_("Cannot create child process - %s\n"), errstr); return; } if (shell_child == 0) { warn_writer = default_warn_writer; if (argc <= 1) { char *args[2] = { NULL, NULL }; char *shell; shell = getenv("SHELL"); if (shell != NULL) args[0] = shell; else args[0] = "/bin/sh"; if (execvp(args[0], args) < 0) die(_("%s: cannot execute - %s\n"), quotearg(args[0]), errstr); /* die OK */ } else { if (execvp(argv[1], argv+1) < 0) die(_("%s: cannot execute - %s\n"), quotearg(argv[1]), errstr); /* die OK */ } exit(EXIT_FAILURE); /* shouldn't get here */ } } static void cmd_status(int argc, char **argv) { HMapIterator it; uint32_t c; char sizebuf[LONGEST_HUMAN_READABLE+1]; switch (hub_state) { case DC_HUB_DISCONNECTED: screen_putf(_("Hub state: %s\n"), _("Not connected")); break; case DC_HUB_LOOKUP: screen_putf(_("Hub state: %s\n"), _("Looking up IP address")); break; case DC_HUB_CONNECT: screen_putf(_("Hub state: %s\n"), _("Waiting for complete connection")); break; case DC_HUB_LOCK: screen_putf(_("Hub state: %s\n"), _("Waiting for $Lock")); break; case DC_HUB_HELLO: screen_putf(_("Hub state: %s\n"), _("Waiting for $Hello")); break; case DC_HUB_LOGGED_IN: screen_putf(_("Hub state: %s\n"), _("Logged in")); break; } if (hub_state >= DC_HUB_LOGGED_IN) { screen_putf(_("Hub users: %s\n"), uint32_str(hmap_size(hub_users))); } else { screen_putf(_("Hub users: %s\n"), _("(not logged in)")); } /* screen_putf(_("Pending user connections:\n")); hmap_iterator(pending_userinfo, &it); for (c = 0; it.has_next(&it); c++) { DCUserInfo* ui = it.next(&it); if (ui != NULL && ui->nick != NULL) { screen_putf(" %s\n", quotearg(ui->nick)); } else { screen_putf(" (null)\n"); } } if (c == 0) screen_putf(_(" (none)\n")); */ c = 0; screen_putf(_("Shared directories:\n")); if (our_filelist != NULL) { hmap_iterator(our_filelist->dir.children, &it); while (it.has_next(&it)) { DCFileList *node = it.next(&it); char* screen_path = fs_to_main_string(node->dir.real_path); screen_putf(_(" %s - %" PRIu64" %s (%s)\n"), screen_path, node->size, ngettext("byte", "bytes", node->size), human_readable(node->size, sizebuf, human_suppress_point_zero|human_autoscale|human_base_1024|human_SI|human_B, 1, 1)); free(screen_path); c++; } } if (c == 0) { screen_putf(_(" (none)\n")); } screen_putf(_("Total share size: %" PRIu64" %s (%s)\n"), my_share_size, ngettext("byte", "bytes", my_share_size), human_readable(my_share_size, sizebuf, human_suppress_point_zero|human_autoscale|human_base_1024|human_SI|human_B, 1, 1)); screen_putf(_("FileList was updated last time on %s\n"), ctime(&our_filelist_last_update)); screen_putf(_("Bytes received: %" PRIu64 " %s (%s)\n"), bytes_received, ngettext("byte", "bytes", bytes_received), human_readable(bytes_received, sizebuf, human_suppress_point_zero|human_autoscale|human_base_1024|human_SI|human_B, 1, 1)); screen_putf(_("Bytes sent: %" PRIu64 " %s (%s)\n"), bytes_sent, ngettext("byte", "bytes", bytes_sent), human_readable(bytes_sent, sizebuf, human_suppress_point_zero|human_autoscale|human_base_1024|human_SI|human_B, 1, 1)); if (update_status != NULL) { screen_putf(_("%s\n"), update_status); } } static void cmd_exit(int argc, char **argv) { /*if (argc > 1) { warn(_("%s: too many arguments\n"), argv[0]); return; }*/ running = false; } static void cmd_say(int argc, char **argv) { char *t1; char *t2; char *hub_my_nick; char *hub_t2; bool utf8 = false; if (argc <= 1) { screen_putf(_("Usage: %s MESSAGE..\n"), argv[0]); return; } if (hub_state < DC_HUB_LOGGED_IN) { screen_putf(_("Not connected.\n")); return; } t1 = join_strings(argv+1, argc-1, ' '); if (t1 == NULL) return; t2 = escape_message(t1); free(t1); if (t2 == NULL) return; /* Don't print on screen - hub will send us the message back. */ /* hub_my_nick = main_to_hub_string(my_nick); hub_t2 = main_to_hub_string(t2); */ hub_my_nick = try_main_to_hub_string(my_nick); if (hub_my_nick == NULL) { hub_my_nick = main_to_utf8_string(my_nick); utf8 = true; } hub_t2 = try_main_to_hub_string(t2); if (hub_t2 == NULL) { hub_t2 = main_to_utf8_string(t2); utf8 = true; } hub_putf("<%s>%c%s|", hub_my_nick, (utf8 ? '\xA0' : ' '), hub_t2); /* Ignore error */ free(hub_my_nick); free(hub_t2); free(t2); } static void cmd_msg(int argc, char **argv) { char *t1; char *t2; DCUserInfo *ui; if (argc <= 2) { screen_putf(_("Usage: %s USER MESSAGE..\n"), argv[0]); return; } if (hub_state < DC_HUB_LOGGED_IN) { screen_putf(_("Not connected.\n")); return; } ui = hmap_get(hub_users, argv[1]); if (ui == NULL) { screen_putf(_("%s: No such user on this hub\n"), quotearg(argv[1])); return; } t1 = join_strings(argv+2, argc-2, ' '); if ( t1 == NULL) return; screen_putf("Private to %s: <%s> %s\n", quotearg_n(0, ui->nick), quotearg_n(1, my_nick), t1); /* XXX: quotearg_n(2, t1)? */ t2 = escape_message(t1); free(t1); if (t2 == NULL) return; char *hub_my_nick = main_to_hub_string(my_nick); char *hub_to_nick = main_to_hub_string(ui->nick); char *hub_t2 = main_to_hub_string(t2); free(t2); hub_putf("$To: %s From: %s $<%s> %s|", hub_to_nick, hub_my_nick, hub_my_nick, hub_t2); /* Ignore error */ free(hub_to_nick); free(hub_my_nick); free (hub_t2); } static void cmd_raw(int argc, char **argv) { char *msg; if (argc <= 1) { screen_putf(_("Usage: %s DATA...\n"), argv[0]); return; } if (hub_state < DC_HUB_LOCK) { screen_putf(_("Not connected.\n")); return; } msg = join_strings(argv+1, argc-1, ' '); screen_putf("Raw to hub: %s\n", msg); hub_putf("%s", msg); /* Ignore error */ free(msg); } static void cmd_connect(int argc, char **argv) { char *portstr; uint16_t port; if (argc == 1) { screen_putf(_("Usage: %s HOST[:PORT]\n"), argv[0]); return; } if (hub_state != DC_HUB_DISCONNECTED) { screen_putf(_("Connection in progress, disconnect first.\n")); return; } portstr = strchr(argv[1], ':'); if (portstr != NULL) { *portstr = '\0'; if (!parse_uint16(portstr+1, &port)) { screen_putf(_("Invalid port number %s\n"), quote(portstr+1)); return; } } else { port = DC_HUB_TCP_PORT; } hub_new(argv[1], port); } static void cmd_disconnect(int argc, char **argv) { if (hub_state == DC_HUB_DISCONNECTED) { warn(_("Not connected.\n")); } else { warn(_("Disconnecting from hub.\n")); hub_disconnect(); hub_set_connected(false); } } static void cmd_grantslot(int argc, char **argv) { uint32_t c; if (hub_state != DC_HUB_LOGGED_IN) { screen_putf(_("Not connected.\n")); return; } if (argc == 1) { HMapIterator it; hmap_iterator(hub_users, &it); while (it.has_next(&it)) { DCUserInfo *ui = it.next(&it); if (ui->slot_granted) screen_putf("%s\n", ui->nick); } return; } for (c = 1; c < argc; c++) { DCUserInfo *ui; ui = hmap_get(hub_users, argv[c]); if (ui == NULL) { screen_putf(_("%s: No such user on this hub\n"), quotearg(argv[c])); return; } if (ui->slot_granted) { screen_putf(_("%s has been granted a slot.\n"), ui->nick); } else { screen_putf(_("%s is no longer granted a slot.\n"), ui->nick); } ui->slot_granted = !ui->slot_granted; } } /* XXX: move queue.c/browse.c? */ void browse_none(void) { /* Clean up previous browse. */ if (browse_list != NULL) { if (!browsing_myself) filelist_free(browse_list); browse_list = NULL; free(browse_path); browse_path = NULL; free(browse_path_previous); browse_path_previous = NULL; } if (browse_user != NULL) { user_info_free(browse_user); browse_user = NULL; } browsing_myself = false; } /* XXX: move to queue.c */ static int queued_file_cmp(const char *filename, DCQueuedFile *qf) { return strcmp(filename, qf->filename); } void browse_list_parsed(DCFileList *node, void *data) { char *nick = data; /* These checks are to protect from the case when * the user is already browsing the user the file * list was parsed for. */ if (browse_list == NULL && browse_user != NULL && strcmp(nick, browse_user->nick) == 0) { browse_list = node; browse_path = xstrdup("/"); browse_path_previous = NULL; update_prompt(); /* browse_list_parsed will never be called when browsing ourselves, * because our filelist is already parsed and always available. */ screen_putf(_("Now browsing %s.\n"), quotearg(browse_user->nick)); } else { filelist_free(node); } free(nick); } /* XXX: move queue.c/browse.c? */ static void cmd_browse(int argc, char **argv) { DCUserInfo *ui; char *filename = NULL, *xml_filename = NULL, *bzxml_filename = NULL; struct stat st; if (argc == 1) { if (!browsing_myself && browse_user == NULL) { screen_putf(_("Not browsing any user.\n")); return; } browse_none(); update_prompt(); return; } if (strcmp(my_nick, argv[1]) == 0) { browse_none(); browse_list = our_filelist; browse_path = xstrdup("/"); browse_path_previous = NULL; browse_user = NULL; browsing_myself = true; update_prompt(); return; } ui = hmap_get(hub_users, argv[1]); if (ui == NULL) { screen_putf(_("%s: No such user on this hub\n"), quotearg(argv[1])); return; } filename = xasprintf("%s/%s.MyList.DcLst", listing_dir, ui->nick); xml_filename = xasprintf("%s/%s.files.xml", listing_dir, ui->nick); bzxml_filename = xasprintf("%s/%s.files.xml", listing_dir, ui->nick); if (stat(filename, &st) >= 0) { unlink(filename); } if (stat(filename, &st) >= 0) { unlink(filename); } if (stat(filename, &st) >= 0) { unlink(filename); } if (stat(filename, &st) < 0 && stat(xml_filename, &st) < 0 && stat(bzxml_filename, &st) < 0) { if (errno != ENOENT) { screen_putf(_("%s: Cannot get file status - %s\n"), quotearg(filename), errstr); free(filename); free(xml_filename); free(bzxml_filename); return; } free(filename); free(xml_filename); free(bzxml_filename); if (ptrv_find(ui->download_queue, "/MyList.DcLst", (comparison_fn_t) queued_file_cmp) < 0 && ptrv_find(ui->download_queue, "/files.xml", (comparison_fn_t) queued_file_cmp) < 0 && ptrv_find(ui->download_queue, "/files.xml.bz2", (comparison_fn_t) queued_file_cmp) < 0) { DCQueuedFile *queued = xmalloc(sizeof(DCQueuedFile)); TRACE(("%s:%d: enqueue a new file list to download\n", __FUNCTION__, __LINE__)); queued->filename = xstrdup("/MyList.DcLst"); /* just to have something here */ queued->base_path = xstrdup("/"); queued->flag = DC_TF_LIST; queued->status = DC_QS_QUEUED; queued->length = UINT64_MAX; /* UINT64_MAX means that the size is unknown */ ptrv_prepend(ui->download_queue, queued); } else { TRACE(("%s:%d: there is already filelist in download queue\n", __FUNCTION__, __LINE__)); } if (!has_user_conn(ui, DC_DIR_RECEIVE) && ui->conn_count < DC_USER_MAX_CONN) hub_connect_user(ui); /* Ignore errors */ else screen_putf(_("No free connections. Queued file for download.\n")); browse_none(); browse_user = ui; browsing_myself = false; ui->refcount++; update_prompt(); return; } browse_none(); browse_user = ui; browsing_myself = false; ui->refcount++; update_prompt(); add_parse_request(browse_list_parsed, filename, xstrdup(ui->nick)); free(filename); free(xml_filename); free(bzxml_filename); } /* XXX: move queue.c/browse.c? */ static void cmd_pwd(int argc, char **argv) { if (browse_list == NULL) { if (browse_user == NULL) { screen_putf(_("Not browsing any user.\n")); } else { screen_putf(_("(%s) Waiting for file list.\n"), quotearg(browse_user->nick)); } } else { screen_putf(_("(%s) %s\n"), quotearg_n(0, browsing_myself ? my_nick : browse_user->nick), quotearg_n(1, browse_path)); /* XXX: print as %s:%s instead */ } } /* XXX: move queue.c/browse.c? */ static void cmd_cd(int argc, char **argv) { if (browse_list == NULL) { screen_putf(_("Not browsing any user.\n")); return; } if (argc == 1) { free(browse_path_previous); browse_path_previous = browse_path; browse_path = filelist_get_path(browse_list); update_prompt(); } else if (strcmp(argv[1], "-") == 0) { if (browse_path_previous == NULL) { warn(_("No previous path.\n")); } else { swap(browse_path, browse_path_previous); update_prompt(); } } else { bool quoted = false; PtrV *results; DCFileList *basenode; char *basedir; results = ptrv_new(); if (has_leading_slash(argv[1])) { basenode = browse_list; basedir = "/"; } else { basenode = filelist_lookup(browse_list, browse_path); basedir = ""; } remote_wildcard_expand(argv[1], "ed, basedir, basenode, results); if (results->cur >= 1) { char *name = results->buf[0]; char *fullname; DCFileList *node; fullname = apply_cwd(name); node = filelist_lookup(browse_list, fullname); if (node != NULL) { /* Technically, this shouldn't fail */ if (node->type != DC_TYPE_DIR) { warn(_("%s: not a directory\n"), quotearg(name)); } else { free(browse_path_previous); browse_path_previous = browse_path; browse_path = filelist_get_path(node); update_prompt(); } } free(fullname); ptrv_foreach(results, free); } ptrv_free(results); } } /* XXX: move queue.c/browse.c? */ static void cmd_find(int argc, char **argv) { uint32_t c; if (browse_list == NULL) { screen_putf(_("Not browsing any user.\n")); return; } if (argc == 1) { DCFileList *node; node = filelist_lookup(browse_list, browse_path); /* At the moment, node cannot be NULL here. */ if (node != NULL) filelist_list_recursively(node, ""); } for (c = 1; c < argc; c++) { bool quoted = false; PtrV *results; DCFileList *basenode; char *basedir; uint32_t d; results = ptrv_new(); if (has_leading_slash(argv[c])) { basenode = browse_list; basedir = "/"; } else { basenode = filelist_lookup(browse_list, browse_path); basedir = ""; } remote_wildcard_expand(argv[c], "ed, basedir, basenode, results); for (d = 0; d < results->cur; d++) { char *name = results->buf[d]; char *fullname; DCFileList *node; fullname = apply_cwd(name); node = filelist_lookup(browse_list, fullname); if (node != NULL) /* Technically, this shouldn't fail */ filelist_list_recursively(node, name); free(fullname); free(name); } if (d == 0) screen_putf(_("%s: No such file or directory\n"), quotearg(argv[c])); ptrv_free(results); } } /* XXX: move queue.c/browse.c? */ static void cmd_ls(int argc, char **argv) { OptDetail long_opts[] = { { "l", OPTP_NO_ARG, 'l' }, { "t", OPTP_NO_ARG, 'l' }, { NULL }, }; OptParser *p; int mode = 0; p = optparser_new(long_opts, -1, 0); optparser_parse(p, argc, argv); while (optparser_has_next(p)) { switch (optparser_next(p)) { case 'l': mode |= DC_LS_LONG_MODE; break; case 't': mode |= DC_LS_TTH_MODE; break; } } if (optparser_error(p) != NULL) { screen_putf("%s: %s\n", argv[0], optparser_error(p)); optparser_free(p); return; } if (browse_list == NULL) { screen_putf(_("Not browsing any user.\n")); optparser_free(p); return; } if (!optparser_has_next_arg(p)) { DCFileList *node; node = filelist_lookup(browse_list, browse_path); /* At the moment, node cannot be NULL here. */ if (node != NULL) filelist_list(node, mode); } while (optparser_has_next_arg(p)) { char *arg = optparser_next_arg(p); bool quoted = false; char *basedir; PtrV *results; DCFileList *basenode; uint32_t d; results = ptrv_new(); if (has_leading_slash(arg)) { basenode = browse_list; basedir = "/"; } else { basenode = filelist_lookup(browse_list, browse_path); basedir = ""; } remote_wildcard_expand(arg, "ed, basedir, basenode, results); for (d = 0; d < results->cur; d++) { char *name = results->buf[d]; char *fullname; DCFileList *node; fullname = apply_cwd(name); node = filelist_lookup(browse_list, fullname); if (node != NULL) /* Technically, this shouldn't fail */ filelist_list(node, mode); free(fullname); free(name); } if (d == 0) screen_putf(_("%s: No such file or directory\n"), quotearg(arg)); ptrv_free(results); } optparser_free(p); } static void cmd_retry(int argc, char **argv) { uint32_t c; if (hub_state < DC_HUB_LOGGED_IN) { screen_putf(_("Not connected.\n")); return; } for (c = 1; c < argc; c++) { DCUserInfo *ui; ui = hmap_get(hub_users, argv[c]); if (ui == NULL) { screen_putf(_("%s: No such user on this hub\n"), quotearg(argv[c])); continue; } if (!has_user_conn(ui, DC_DIR_RECEIVE) && ui->conn_count < DC_USER_MAX_CONN) { hub_connect_user(ui); } else { screen_putf(_("%s: Already connected to user.\n"), quotearg(ui->nick)); } } } /* XXX: move to download.c/queue.c/browse.c? */ static void cmd_queue(int argc, char **argv) { uint32_t d; /*if (argc == 1) { screen_putf(_("Usage: %s USER\n"), argv[0]); return; }*/ if (hub_state < DC_HUB_LOGGED_IN) { screen_putf(_("Not connected.\n")); return; } if (argc == 1) { HMapIterator it; hmap_iterator(hub_users, &it); while (it.has_next(&it)) { DCUserInfo *ui = it.next(&it); if (ui->download_queue->cur > 0) screen_putf("%3d %s\n", ui->download_queue->cur, ui->nick); } return; } for (d = 1; d < argc; d++) { uint32_t c; DCUserInfo *ui; ui = hmap_get(hub_users, argv[d]); if (ui == NULL) { screen_putf(_("%s: No such user on this hub\n"), quotearg(argv[d])); continue; } screen_putf("%s:\n", quotearg(ui->nick)); for (c = 0; c < ui->download_queue->cur; c++) { DCQueuedFile *queued = ui->download_queue->buf[c]; char *status; switch (queued->status) { case DC_QS_QUEUED: status = "queued"; break; case DC_QS_PROCESSING: status = "processing"; break; case DC_QS_DONE: status = "done"; break; case DC_QS_ERROR: default: status = "error"; break; } screen_putf("%d. (%s) [%s] %s\n", c+1, status, quotearg_n(0, queued->base_path), quotearg_n(1, queued->filename + strlen(queued->base_path))); } } } /* XXX: move to download.c/queue.c/browse.c? */ static void removed_queued_by_range(uint32_t sp, uint32_t ep, void *userdata) { DCUserInfo *user = userdata; uint32_t c; for (c = sp-1; c < ep; c++) { if (user->download_queue->buf[c] != NULL) { free_queued_file(user->download_queue->buf[c]); user->download_queue->buf[c] = NULL; } } } /* XXX: move to download.c/queue.c/browse.c? */ static void compact_queue_ptrv(DCUserInfo *user) { int32_t first_free = -1; uint32_t c; for (c = 0; c < user->download_queue->cur; c++) { if (user->download_queue->buf[c] == NULL) { if (first_free == -1) first_free = c; } else { if (first_free != -1) { user->download_queue->buf[first_free] = user->download_queue->buf[c]; user->download_queue->buf[c] = NULL; for (first_free++; first_free < c; first_free++) { if (user->download_queue->buf[first_free] == NULL) break; } } } } if (first_free != -1) user->download_queue->cur = first_free; } /* XXX: move to download.c/queue.c/browse.c? */ static void cmd_unqueue(int argc, char **argv) { DCUserInfo *user; const char *range; if (argc == 1) { screen_putf(_("Usage: %s USER [RANGE]\n"), argv[0]); return; } /* XXX: parse each argument, allow RANGE RANGE2 .. */ if (argc > 2) { range = argv[2]; } else { range = "1-"; } if (hub_state < DC_HUB_LOGGED_IN) { screen_putf(_("Not connected.\n")); return; } user = hmap_get(hub_users, argv[1]); if (user == NULL) { screen_putf(_("%s: No such user on this hub\n"), quotearg(argv[1])); return; } if (!foreach_in_range(range, 1, user->download_queue->cur, NULL, NULL)) { screen_putf(_("%s: Invalid range, or index out of range (1-%d)\n"), quotearg(range), user->download_queue->cur); return; } foreach_in_range(range, 1, user->download_queue->cur, removed_queued_by_range, user); if (has_user_conn(user, DC_DIR_RECEIVE)) { DCUserConn *uc = NULL; uint32_t c; for (c = 0; c < user->conn_count; c++) { if (user->conn[c]->dir == DC_DIR_RECEIVE) { uc = user->conn[c]; break; } } if (uc->queue_pos < user->download_queue->cur) { uint32_t rank = 0; if (user->download_queue->buf[uc->queue_pos] == NULL) { /* Possible actions to take on unqueue of file currently * being downloaded: * - abort download, discard file (keep partial) * - wait until download finishes, and leave as .part * - wait until download finishes, rename and report * - not possible to remove such queued file * The current implementation does (2), which probably * isn't optimal, but works. */ uc->queued_valid = false; } for (c = 0; c < uc->queue_pos; c++) { if (user->download_queue->buf[c] != NULL) rank++; } uc->queue_pos = rank; /* uc->queue_pos may be uc->download_queue->cur after * compact_queue_ptrv, but this is OK. */ } } compact_queue_ptrv(user); } static int user_info_compare(const void *i1, const void *i2) { const DCUserInfo *f1 = *(const DCUserInfo **) i1; const DCUserInfo *f2 = *(const DCUserInfo **) i2; return strcoll(f1->nick, f2->nick); } #define IFNULL(a,x) ((a) == NULL ? (x) : (a)) static void cmd_who(int argc, char **argv) { uint32_t maxlen; HMapIterator it; uint32_t c; DCUserInfo **items; uint32_t count; int cols; StrBuf *out; if (hub_state < DC_HUB_LOGGED_IN) { screen_putf(_("Not connected.\n")); return; } if (argc > 1) { for (c = 1; c < argc; c++) { DCUserInfo *ui; ui = hmap_get(hub_users, argv[c]); if (ui == NULL) { screen_putf(_("%s: No such user on this hub\n"), quotearg(argv[c])); } else { char *fmt1 = ngettext("byte", "bytes", ui->share_size); screen_putf(_("Nick: %s\n"), quotearg(ui->nick)); screen_putf(_("Description: %s\n"), quotearg(IFNULL(ui->description, ""))); screen_putf(_("Speed: %s\n"), quotearg(IFNULL(ui->speed, ""))); screen_putf(_("Level: %d\n"), ui->level); screen_putf(_("E-mail: %s\n"), quotearg(IFNULL(ui->email, ""))); screen_putf(_("Operator: %d\n"), ui->is_operator); screen_putf(_("Share Size: %" PRIu64 " %s (%" PRIu64 " MB)\n"), /* " */ ui->share_size, fmt1, ui->share_size/(1024*1024)); } } return; } maxlen = 0; for (hmap_iterator(hub_users, &it); it.has_next(&it); ) { DCUserInfo *ui = it.next(&it); maxlen = max(maxlen, strlen(quotearg(ui->nick))); } count = hmap_size(hub_users); items = xmalloc(count * sizeof(DCUserInfo *)); hmap_iterator(hub_users, &it); for (c = 0; c < count; c++) items[c] = it.next(&it); qsort(items, count, sizeof(DCUserInfo *), user_info_compare); screen_get_size(NULL, &cols); out = strbuf_new(); for (c = 0; c < count; c++) { DCUserInfo *ui = items[c]; char *nick = quotearg(ui->nick); strbuf_clear(out); strbuf_append(out, nick); strbuf_append_char_n(out, maxlen+1-strlen(nick), ' '); strbuf_appendf(out, " %7" PRIu64 "M", ui->share_size / (1024*1024)); /* " */ strbuf_append(out, ui->is_operator ? " op" : " "); if (ui->download_queue->cur > 0) strbuf_appendf(out, " (%3d)", ui->download_queue->cur); else strbuf_append(out, " "); strbuf_appendf(out, " %s", quotearg(ui->description ? ui->description : "")); if (strbuf_length(out) > cols) strbuf_set_length(out, cols); screen_putf("%s\n", strbuf_buffer(out)); } free(items); strbuf_free(out); } static void cmd_transfers(int argc, char **argv) { char *format; HMapIterator it; uint32_t maxlen = 0; time_t now; hmap_iterator(user_conns, &it); while (it.has_next(&it)) { DCUserConn *uc = it.next(&it); maxlen = max(maxlen, strlen(uc->name)); } format = xasprintf("%%-%ds %%s\n", maxlen); now = time(NULL); if (now == (time_t) -1) warn(_("Cannot get current time - %s\n"), errstr); hmap_iterator(user_conns, &it); while (it.has_next(&it)) { DCUserConn *uc = it.next(&it); char *status; status = user_conn_status_to_string(uc, now); screen_putf(format, quotearg(uc->name), status); free(status); } screen_putf(_("Upload slots: %d/%d Download slots: %d/unlimited\n"), used_ul_slots, my_ul_slots, used_dl_slots); free(format); } static void cmd_cancel(int argc, char **argv) { uint32_t c; if (argc == 1) { screen_putf(_("Usage: %s CONNECTION ...\n"), argv[0]); return; } for (c = 1; c < argc; c++) { DCUserConn *uc; uc = hmap_get(user_conns, argv[c]); if (uc == NULL) { screen_putf(_("%s: No such user connection.\n"), quotearg(argv[c])); } else { user_conn_cancel(uc); } } } static void cmd_search(int argc, char **argv) { char *tmp; if (argc == 1) { screen_putf(_("Usage: %s STRING...\n"), argv[0]); return; } if (hub_state < DC_HUB_LOGGED_IN) { screen_putf(_("Not connected.\n")); return; } tmp = join_strings(argv+1, argc-1, ' '); add_search_request(tmp); /* Ignore errors */ free(tmp); } static void cmd_results(int argc, char **argv) { uint32_t d; if (argc == 1) { time_t now; if (time(&now) == (time_t) -1) { warn(_("Cannot get current time - %s\n"), errstr); return; } for (d = 0; d < our_searches->cur; d++) { DCSearchRequest *sd = our_searches->buf[d]; char *status; char *spec; spec = search_selection_to_string(&sd->selection); status = sd->issue_time + SEARCH_TIME_THRESHOLD <= now ? _("Closed") : _("Open"); screen_putf(_("%d. %s (%s) Results: %d\n"), d+1, quotearg(spec), status, sd->responses->cur); } return; } for (d = 1; d < argc; d++) { DCSearchRequest *sd; uint32_t c; if (!parse_uint32(argv[d], &c) || c == 0 || c-1 >= our_searches->cur) { screen_putf(_("%s: Invalid search index.\n"), quotearg(argv[d])); continue; } sd = our_searches->buf[c-1]; screen_putf(_("Search %d:\n"), c); for (c = 0; c < sd->responses->cur; c++) { DCSearchResponse *sr = sd->responses->buf[c]; char *n; char *t; n = translate_remote_to_local(sr->filename); if (sr->filetype == DC_TYPE_DIR) /* XXX: put into some function */ t = "/"; else t = ""; screen_putf("%d. %s %s%s\n", c+1, quotearg(sr->userinfo->nick), n, t); free(n); } } } static void cmd_unsearch(int argc, char **argv) { uint32_t c; if (argc == 1) { screen_putf(_("Usage: %s INDEX\n"), argv[0]); return; } for (c = 1; c < argc; c++) { DCSearchRequest *sd; uint32_t index; if (!parse_uint32(argv[c], &index) || index == 0 || index-1 >= our_searches->cur) { screen_putf(_("%s: Invalid search index.\n"), quotearg(argv[c])); return; } sd = our_searches->buf[index-1]; ptrv_remove_range(our_searches, index-1, index); free_search_request(sd); } } static void cmd_alias(int argc, char **argv) { uint32_t c; if (argc == 1) { TMapIterator it; for (tmap_iterator(commands, &it); it.has_next(&it); ) { DCCommand *cmd = it.next(&it); if (cmd->type == DC_CMD_ALIAS) { DCAliasCommand *alias = (DCAliasCommand *) cmd; screen_putf("alias %s \"%s\"\n" /*no translation */, cmd->name, quotearg(alias->alias_spec)); } } return; } for (c = 1; c < argc; c++) { char *name = argv[c]; char *value; DCCommand *cmd; value = strchr(name, '='); if (value == NULL) { cmd = tmap_get(commands, name); if (cmd != NULL && cmd->type == DC_CMD_ALIAS) { DCAliasCommand *alias = (DCAliasCommand *) cmd; screen_putf("alias %s=\"%s\"\n" /*no translation */, name, quotearg(alias->alias_spec)); } else { warn(_("%s: No such alias.\n"), quotearg(name)); } } else { *value = '\0'; value++; if (strpbrk(name, " \"#;") != NULL) { warn(_("%s: Invalid alias name\n"), quotearg(name)); continue; } cmd = tmap_get(commands, name); if (cmd == NULL) { DCAliasCommand *alias = xmalloc(sizeof(DCAliasCommand)); alias->cmd.name = xstrdup(name); alias->cmd.type = DC_CMD_ALIAS; alias->alias_spec = xstrdup(value); tmap_put(commands, alias->cmd.name, alias); } else if (cmd->type == DC_CMD_ALIAS) { DCAliasCommand *alias = (DCAliasCommand *) cmd; free(alias->alias_spec); alias->alias_spec = xstrdup(value); } else { warn(_("%s: Cannot override built-in command.\n"), quotearg(cmd->name)); } } } } static void cmd_unalias(int argc, char **argv) { uint32_t c; if (argc == 1) { screen_putf(_("Usage: %s NAME ...\n"), argv[0]); return; } for (c = 0; c < argc; c++) { DCCommand *cmd = tmap_get(commands, argv[c]); if (cmd == NULL || cmd->type != DC_CMD_ALIAS) { warn(_("%s: No such alias.\n"), quotearg(argv[c])); } else { DCAliasCommand *alias = (DCAliasCommand *) cmd; tmap_remove(commands, cmd->name); free(alias->cmd.name); free(alias->alias_spec); free(alias); } } } void update_prompt(void) { if (browsing_myself || browse_user != NULL) { char *nick = browsing_myself ? my_nick : browse_user->nick; if (browse_list == NULL) { set_screen_prompt("%s:(%s)> ", PACKAGE, quotearg(nick)); } else { set_screen_prompt("%s:%s:%s> ", PACKAGE, quotearg_n(0, nick), quotearg_n(1, browse_path)); } } else { set_screen_prompt("%s> ", PACKAGE); } } static void append_download_file(DCUserInfo *ui, DCFileList *node, DCFileList *basenode, uint32_t *file_count, uint64_t *byte_count) { if (node->type == DC_TYPE_REG) { DCQueuedFile *queued; char *path; if (ui != NULL) { /* if NULL then we're browsing ourselves */ path = filelist_get_path(node); if (ptrv_find(ui->download_queue, path, (comparison_fn_t) queued_file_cmp) >= 0) { screen_putf(_("Queue already contains this file, ignoring\n")); free(path); return; } queued = xmalloc(sizeof(DCQueuedFile)); queued->filename = path; queued->base_path = filelist_get_path_with_trailing_slash(basenode); queued->flag = DC_TF_NORMAL; queued->status = DC_QS_QUEUED; queued->length = node->size; ptrv_append(ui->download_queue, queued); } (*byte_count) += node->size; (*file_count)++; } else if (node->type == DC_TYPE_DIR) { HMapIterator it; hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) append_download_file(ui, it.next(&it), basenode, file_count, byte_count); } } /* Note: This command assumes that we are browsing some user. * If we in the future would allow browse-less getting, * i.e. get NICK FILE, then we must here add additional checks * found in cmd_browse, such as strcmp(my_nick, nick)==0 etc. */ static void cmd_get(int argc, char **argv) { uint32_t c; bool dl_some = false; if (argc == 1) { screen_putf(_("Usage: %s FILE ...\n"), argv[0]); return; } if (browse_list == NULL) { screen_putf(_("Not browsing any user.\n")); return; } /*if (browsing_myself) { screen_putf(_("Cannot download files from myself.\n")); return; }*/ for (c = 1; c < argc; c++) { DCFileList *basenode; bool quoted = false; char *basedir; uint64_t byte_count = 0; uint32_t file_count = 0; PtrV *results; int d; results = ptrv_new(); if (has_leading_slash(argv[c])) { basenode = browse_list; basedir = "/"; } else { basenode = filelist_lookup(browse_list, browse_path); basedir = ""; } remote_wildcard_expand(argv[c], "ed, basedir, basenode, results); for (d = 0; d < results->cur; d++) { char *name = results->buf[d]; char *fullname; DCFileList *node; fullname = apply_cwd(name); node = filelist_lookup(browse_list, fullname); if (node != NULL) { /* Technically, this shouldn't fail */ screen_putf(_("Matched %s\n"), quotearg(name)); append_download_file(browse_user, node, basenode, &file_count, &byte_count); } free(fullname); free(name); } ptrv_free(results); if (file_count > 0) { screen_putf(_("Downloading %" PRIu64 " %s in %" PRIu32 " %s\n"), byte_count, ngettext("byte", "bytes", byte_count), file_count, ngettext("file", "files", file_count)); dl_some = true; } else { screen_putf(_("%s: No files to download.\n"), quotearg(argv[c])); } } if (dl_some && !browsing_myself) { if (!has_user_conn(browse_user, DC_DIR_RECEIVE) && browse_user->conn_count < DC_USER_MAX_CONN) { hub_connect_user(browse_user); /* Ignore errors */ } else { screen_putf(_("No free connections. Queued files for download.\n")); } } } static void lookup_address_looked_up(int rc, struct addrinfo *ai, void *data) { char *host = data; screen_putf("%s:", quotearg(host)); if (rc == 0) { for (; ai != NULL; ai = ai->ai_next) { struct sockaddr_in *addr = (struct sockaddr_in *) ai->ai_addr; screen_putf(" %s", inet_ntoa(addr->sin_addr)); } } else { screen_putf(" %s", gai_strerror(rc)); } screen_putf("\n"); free(host); } static void cmd_lookup(int argc, char **argv) { int c; if (argc == 1) { screen_putf(_("missing host argument\n")); return; } for (c = 1; c < argc; c++) { struct addrinfo hints = { 0, PF_INET, SOCK_STREAM, 0, }; add_lookup_request(argv[c], NULL, &hints, lookup_address_looked_up, xstrdup(argv[c])); } } static void cmd_share(int argc, char **argv) { struct stat st; char *dir_fs; if (argc > 2) { warn(_("too many arguments\n")); return; } if (argc == 1) { screen_putf(_("missing directory argument\n")); return; } dir_fs = main_to_fs_string(argv[1]); if (stat(dir_fs, &st) < 0) { screen_putf(_("%s: Cannot get file status - %s\n"), quotearg(argv[1]), errstr); free(dir_fs); return; } if (!S_ISDIR(st.st_mode)) { screen_putf(_("%s: Not a directory\n"), quotearg(argv[1])); free(dir_fs); return; } if (update_request_mq != NULL) { if (!update_request_add_shared_dir(dir_fs)) { screen_putf(_("%s: Cannot process directory - %s\n"), quotearg(argv[1]), errstr); } } free(dir_fs); } static void cmd_unshare(int argc, char **argv) { struct stat st; char *dir_fs; if (argc > 2) { warn(_("too many arguments\n")); return; } if (argc == 1) { screen_putf(_("missing directory argument\n")); return; } dir_fs = main_to_fs_string(argv[1]); if (stat(dir_fs, &st) < 0) { screen_putf(_("%s: Cannot get file status - %s\n"), quotearg(argv[1]), errstr); free(dir_fs); return; } if (!S_ISDIR(st.st_mode)) { screen_putf(_("%s: Not a directory\n"), quotearg(argv[1])); free(dir_fs); return; } if (update_request_mq != NULL) { if (!update_request_del_shared_dir(dir_fs)) { screen_putf(_("%s: Cannot process directory - %s\n"), quotearg(argv[1]), errstr); } } free(dir_fs); } microdc2-0.15.6/src/connection.c0100644000076500007500000001040210527013716016443 0ustar chugunovmicrodc/* connection.c - Functions generic to hub and user connections * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* C89 */ #include "xalloc.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/strbuf.h" #include "microdc.h" /* Decode data from a $Lock command sent by either a client or a hub. * The returned value must be freed using free(). The length of the * returned key can be retrieved using strlen. * * XXX: this should be generalized and the error message removed. */ char * decode_lock(const char *lock, size_t locklen, uint32_t basekey) { uint8_t key[locklen]; char *outkey; int c; int d; if (locklen < 3) { screen_putf(_("Invalid $Lock message: Key to short\n")); return xstrdup(""); } key[0] = lock[0] ^ basekey; key[0] = (key[0] << 4) | (key[0] >> 4); for (c = 1; c < locklen; c++) { key[c] = lock[c] ^ lock[c-1]; key[c] = (key[c] << 4) | (key[c] >> 4); } key[0] = key[0] ^ key[locklen-1]; d = 1; /* 1 for nullbyte at end */ for (c = 0; c < locklen; c++) { switch (key[c]) { case 0: case 5: case 36: case 96: case 124: case 126: d += 10; break; default: d++; break; } } outkey = xmalloc(sizeof(char) * d); d = 0; for (c = 0; c < locklen; c++) { switch (key[c]) { case 0: case 5: case 36: case 96: case 124: case 126: sprintf(outkey+d, "/%%DCN%03d%%/", key[c]); d += 10; break; default: outkey[d++] = key[c]; break; } } outkey[d] = '\0'; return outkey; } /* XXX: This is somewhat crude... Generalize for all HTML/SGML escaping? */ char * unescape_message(const char *str) { char *out; char *cur; cur = out = xmalloc(strlen(str)+1); while (*str != '\0') { if (str[0] == '&') { if (str[1] == 'a' && str[2] == 'm' && str[3] == 'p' && str[4] == ';') { *cur++ = '&'; str += 5; continue; } else if (str[1] == '#' && str[2] == '3' && str[3] == '6' && str[4] == ';') { *cur++ = '$'; str += 5; continue; } else if (str[1] == '#' && str[2] == '1' && str[3] == '2' && str[4] == '4' && str[5] == ';') { *cur++ = '|'; str += 6; continue; } } *cur++ = *str++; } *cur = '\0'; return out; } /* Escape a string for putting in a command. The returned string must be * freed with free. */ char * escape_message(const char *str) { StrBuf *out; out = strbuf_new(); for (; *str != '\0'; str++) { switch (*str) { case '$': strbuf_append(out, "$"); break; case '&': strbuf_append(out, "&"); break; case '|': strbuf_append(out, "|"); break; default: strbuf_append_char(out, *str); break; } } return strbuf_free_to_string(out); } /* Dump a received or sent piece of data. */ void dump_command(const char *header, const char *buf, size_t len)/* XXX: uint32_t=>size_t, same for byteq */ { const unsigned char *ubuf; StrBuf *out; uint32_t c; ubuf = (const unsigned char *)buf; out = strbuf_new(); for (c = 0; c < len; c++) { if (isprint(ubuf[c])) strbuf_appendf(out, "%c", ubuf[c]); else strbuf_appendf(out, "\\x%02x", ubuf[c] & 0xFF); } flag_putf(DC_DF_DEBUG, "%s %s\n", header, out->buf); strbuf_free(out); } microdc2-0.15.6/src/filelist-in.c0100644000076500007500000003471410533030105016523 0ustar chugunovmicrodc/* filelist.c - File list parsing * * Copyright (C) 2004, 2005 Oskar Liljeblad * Copyright (C) 2006 Alexey Illarionov * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include /* POSIX.1 */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "xalloc.h" /* Gnulib */ #include "quotearg.h" /* Gnulib */ #include "full-read.h" /* Gnulib */ #include "iconvme.h" #include "common/msgq.h" #include "common/byteq.h" #include "common/ptrv.h" #include "common/intutil.h" #include "microdc.h" //#define _TRACE #include #if defined(_TRACE) #define TRACE(x) printf x; fflush(stdout); #else #define TRACE(x) #endif struct _DCFileListParse { DCFileListParseCallback callback; void *data; bool cancelled; }; static PtrV *pending_parses; MsgQ *parse_request_mq = NULL; MsgQ *parse_result_mq = NULL; pid_t parse_child; static size_t calculate_filelist_data_size(DCFileList *node) { size_t size; HMapIterator it; if (node->type == DC_TYPE_REG) return sizeof(DCFileType) + strlen(node->name)+1 + sizeof(uint64_t) + 1 + sizeof(node->reg.tth) + sizeof(time_t); size = sizeof(DCFileType) + strlen(node->name)+1 + 1 + (node->dir.real_path != NULL ? strlen(node->dir.real_path)+1 : 0) + sizeof(size_t); hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *child_node = it.next(&it); size += calculate_filelist_data_size(child_node); } return size; } static char * copy_filelist_to_data(DCFileList *node, char *data) { memcpy(data, &node->type, sizeof(node->type)); data += sizeof(node->type); memcpy(data, node->name, strlen(node->name)+1); data += strlen(node->name)+1; if (node->type == DC_TYPE_REG) { memcpy(data, &node->size, sizeof(uint64_t)); data += sizeof(uint64_t); *data = node->reg.has_tth; data += 1; memcpy(data, node->reg.tth, sizeof(node->reg.tth)); data += sizeof(node->reg.tth); memcpy(data, &node->reg.mtime, sizeof(time_t)); data += sizeof(time_t); } else { size_t children; HMapIterator it; *data = node->dir.real_path != NULL ? 1 : 0; data += 1; if (node->dir.real_path != NULL) { memcpy(data, node->dir.real_path, strlen(node->dir.real_path)+1); data += strlen(node->dir.real_path)+1; } children = hmap_size(node->dir.children); memcpy(data, &children, sizeof(size_t)); data += sizeof(size_t); hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *child_node = it.next(&it); data = copy_filelist_to_data(child_node, data); } } return data; } void filelist_to_data(DCFileList *node, void **dataptr, size_t *sizeptr) { size_t size; char *data; if (node == NULL) { *dataptr = NULL; *sizeptr = 0; return; } size = calculate_filelist_data_size(node); data = xmalloc(size); *dataptr = data; *sizeptr = size; copy_filelist_to_data(node, data); } /* This assumes that dataptr contains data that is complete and valid. */ void * data_to_filelist(void *dataptr, DCFileList **outnode) { DCFileList *node; DCFileType node_type; char *node_name; char *data = dataptr; if (dataptr == NULL) { *outnode = NULL; return NULL; } memcpy(&node_type, data, sizeof(node_type)); data += sizeof(node_type); node_name = data; data += strlen(node_name) + 1; node = new_file_node(node_name, node_type, NULL); if (node_type == DC_TYPE_DIR) { size_t count; if (*data == 1) { node->dir.real_path = xstrdup(data+1); data += strlen(node->dir.real_path) + 1; } data += 1; memcpy(&count, data, sizeof(count)); data += sizeof(count); for (; count > 0; count--) { DCFileList *child_node; data = data_to_filelist(data, &child_node); hmap_put(node->dir.children, child_node->name, child_node); child_node->parent = node; node->size += child_node->size; } } else { memcpy(&node->size, data, sizeof(node->size)); data += sizeof(node->size); node->reg.has_tth = *data; data += 1; memcpy(node->reg.tth, data, sizeof(node->reg.tth)); data += sizeof(node->reg.tth); memcpy(&node->reg.mtime, data, sizeof(time_t)); data += sizeof(time_t); } *outnode = node; return data; } static DCFileList * parse_decoded_dclst(char *decoded, uint32_t decoded_len) { DCFileList *node; uint32_t c; PtrV *dirs; char *conv_name; dirs = ptrv_new(); node = new_file_node("", DC_TYPE_DIR, NULL); ptrv_append(dirs, node); for (c = 0; c < decoded_len; c++) { DCFileList *oldnode; char *name; int depth; for (; c < decoded_len && decoded[c] == '\n'; c++); depth = 1; for (; c < decoded_len && decoded[c] == '\t'; c++) depth++; if (c >= decoded_len) break; /* Premature end */ if (decoded[c] == '\r') { c++; /* skip LF */ continue; /* Skipping bad line */ } name = decoded + c; for (; c < decoded_len && decoded[c] != '\r' && decoded[c] != '|'; c++); if (c >= decoded_len) break; if (depth < dirs->cur) ptrv_remove_range(dirs, depth, dirs->cur); oldnode = dirs->buf[dirs->cur-1]; if (decoded[c] == '|') { char *sizestr; uint64_t size; decoded[c] = '\0'; sizestr = decoded+c+1; for (c++; c < decoded_len && decoded[c] != '\r'; c++); if (c >= decoded_len) break; /* Premature end */ decoded[c] = '\0'; decoded[++c]='\0'; /* skip LF */ /*?????????????????????????*/ if (!parse_uint64(sizestr, &size)) continue; /* Skipping bad line */ /* convert name from hub (other clients) charset to local charset*/ conv_name = hub_to_main_string(name); node = new_file_node(conv_name, DC_TYPE_REG, oldnode); free(conv_name); node->size = size; } else { decoded[c] = '\0'; decoded[++c]='\0'; /* skip LF */ /*????????????????????????????????????*/ conv_name = hub_to_main_string(name); node = new_file_node( conv_name, DC_TYPE_DIR, oldnode); free(conv_name); } if (node->type == DC_TYPE_REG) { DCFileList *up_node; for (up_node = oldnode; up_node != NULL; up_node = up_node->parent) up_node->size += node->size; } if (node->type == DC_TYPE_DIR) ptrv_append(dirs, node); } node = dirs->buf[0]; ptrv_free(dirs); /* ignore non-empty */ return node; } static DCFileList * filelist_open(const char *filename) { struct stat st; uint8_t *contents; char *decoded; uint32_t decoded_len; int fd; DCFileList *root; ssize_t res; if (stat(filename, &st) < 0) { screen_putf(_("%s: Cannot get file status - %s\n"), quotearg(filename), errstr); return NULL; } contents = malloc(st.st_size); if (contents == NULL) { screen_putf("%s: %s\n", quotearg(filename), errstr); return NULL; } fd = open(filename, O_RDONLY); if (fd < 0) { screen_putf(_("%s: Cannot open file for reading - %s\n"), quotearg(filename), errstr); return NULL; } res = full_read(fd, contents, st.st_size); if (res < st.st_size) { if (res < 0) screen_putf(_("%s: Cannot read from file - %s\n"), quotearg(filename), errstr); else screen_putf(_("%s: Premature end of file\n"), quotearg(filename)); /* XXX: really: file was truncated? */ free(contents); if (close(fd) < 0) screen_putf(_("%s: Cannot close file - %s\n"), quotearg(filename), errstr); return NULL; } if (close(fd) < 0) screen_putf(_("%s: Cannot close file - %s\n"), quotearg(filename), errstr); decoded = huffman_decode(contents, st.st_size, &decoded_len); free(contents); if (decoded == NULL) { screen_putf(_("%s: Invalid data, cannot decode\n"), quotearg(filename)); return NULL; } root = parse_decoded_dclst(decoded, decoded_len); free(decoded); return root; } static void __attribute__((noreturn)) parse_main(int request_fd[2], int result_fd[2]) { MsgQ *request_mq; MsgQ *result_mq; struct sigaction sigact; close(request_fd[1]); close(result_fd[0]); request_mq = msgq_new(request_fd[0]); result_mq = msgq_new(result_fd[1]); /* Inability to register these signals is not a fatal error. */ sigact.sa_flags = SA_RESTART; sigact.sa_handler = SIG_IGN; #ifdef HAVE_STRUCT_SIGACTION_SA_RESTORER sigact.sa_restorer = NULL; #endif sigaction(SIGINT, &sigact, NULL); sigaction(SIGTERM, &sigact, NULL); sigaction(SIGUSR1, &sigact, NULL); sigaction(SIGCHLD, &sigact, NULL); sigaction(SIGPIPE, &sigact, NULL); while (msgq_read_complete_msg(request_mq) > 0) { DCFileList *node; char *filename; char *main_hub_charset; void *data; size_t size; size_t filename_len = 0; msgq_get(request_mq, MSGQ_STR, &filename, MSGQ_STR, &main_hub_charset, MSGQ_END); set_hub_charset(main_hub_charset); free(main_hub_charset); filename_len = strlen(filename); if (strcmp(filename+filename_len-6, ".DcLst") == 0) { node = filelist_open(filename); } else if (strcmp(filename+filename_len-4, ".xml") == 0) { node = filelist_xml_open(filename); } else if (strcmp(filename+filename_len-8, ".xml.bz2") == 0) { node = filelist_bzxml_open(filename); } else { node = NULL; } filelist_to_data(node, &data, &size); filelist_free(node); free(filename); msgq_put(result_mq, MSGQ_BLOB, data, size, MSGQ_END); free(data); if (msgq_write_all(result_mq) < 0) break; } /* msgq_read_complete_msg may have failed if it returned < 0. * But we can't print any errors from this process (it would * interfere with the readline-managed display, so just exit * gracefully. */ msgq_free(request_mq); msgq_free(result_mq); close(request_fd[0]); close(result_fd[1]); exit(EXIT_SUCCESS); } void parse_request_fd_writable(void) { int res; res = msgq_write(parse_request_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, true, "parse request pipe"); running = false; return; } if (!msgq_has_partial_msg(parse_request_mq)) FD_CLR(parse_request_mq->fd, &write_fds); } void parse_result_fd_readable(void) { int res; res = msgq_read(parse_result_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, false, "parse result pipe"); running = false; return; } while (msgq_has_complete_msg(parse_result_mq)) { DCFileListParse *parse; void *data; size_t size; msgq_get(parse_result_mq, MSGQ_BLOB, &data, &size, MSGQ_END); parse = ptrv_remove_first(pending_parses); if (!parse->cancelled) { DCFileList *node; data_to_filelist(data, &node); /* XXX: error reporting! */ parse->callback(node, parse->data); /* It is the responsibility of the callback to free node * when appropriate. */ } free(data); free(parse); } } /* Note that this function is currently not needed. * Cancelling of parse requests is not done - instead * the callback that is called when the parsing is done * handle the case when the browsing was cancelled (see * command.c:browse_list_parsed). */ void cancel_parse_request(DCFileListParse *parse) { int c; for (c = 0; c < pending_parses->cur; c++) { if (parse == pending_parses->buf[c]) { if (c == 0) { parse->cancelled = true; } else { ptrv_remove_range(pending_parses, c, c+1); } break; } } } DCFileListParse * add_parse_request(DCFileListParseCallback callback, const char *filename, void *userdata) { DCFileListParse *parse; msgq_put(parse_request_mq, MSGQ_STR, filename, MSGQ_STR, hub_charset ? hub_charset : "", MSGQ_END); FD_SET(parse_request_mq->fd, &write_fds); parse = xmalloc(sizeof(DCFileListParse)); parse->callback = callback; parse->data = userdata; parse->cancelled = false; ptrv_append(pending_parses, parse); return parse; } bool file_list_parse_init(void) { int request_fd[2]; int result_fd[2]; if (pipe(request_fd) != 0 || pipe(result_fd) != 0) { warn(_("Cannot create pipe pair - %s\n"), errstr); return false; } if (!fd_set_nonblock_flag(request_fd[1], true) || !fd_set_nonblock_flag(result_fd[0], true)) { warn(_("Cannot set non-blocking flag - %s\n"), errstr); return false; } parse_child = fork(); if (parse_child < 0) { warn(_("Cannot create process - %s\n"), errstr); return false; } if (parse_child == 0) parse_main(request_fd, result_fd); pending_parses = ptrv_new(); close(request_fd[0]); close(result_fd[1]); parse_request_mq = msgq_new(request_fd[1]); parse_result_mq = msgq_new(result_fd[0]); FD_SET(parse_result_mq->fd, &read_fds); return true; } void file_list_parse_finish(void) { if (pending_parses != NULL) { ptrv_foreach(pending_parses, free); ptrv_free(pending_parses); } if (parse_request_mq != NULL) { close(parse_request_mq->fd); msgq_free(parse_request_mq); } if (parse_result_mq != NULL) { close(parse_result_mq->fd); msgq_free(parse_result_mq); } } microdc2-0.15.6/src/fs.c0100644000076500007500000013414410533525710014725 0ustar chugunovmicrodc/* fs.c - Local and remote file system management * * Copyright (C) 2004, 2005 Oskar Liljeblad * Copyright (C) 2006 Alexey Illarionov * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* ? */ #include #include /* ? */ #include /* ? */ #include /* POSIX */ #include /* ? */ #include /* C89 */ #include /* ? */ #include /* ? */ #include /* ? */ #include "full-read.h" /* Gnulib */ #include "xalloc.h" /* Gnulib */ #include "minmax.h" /* Gnulib */ #include "full-write.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "quotearg.h" /* Gnulib */ #include "fnmatch.h" /* Gnulib */ #include "dirname.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/minmaxonce.h" #include "common/error.h" #include "common/intutil.h" #include "common/strbuf.h" #include "common/strleftcmp.h" #include "common/substrcmp.h" #include "common/comparison.h" #include "iconvme.h" #include "microdc.h" //#define _TRACE #if defined(_TRACE) #define TRACE(x) printf x; fflush(stdout); #else #define TRACE(x) #endif #define MAX_DIR_DEPTH 32 #define IS_OCT_DIGIT(d) ( (d) >= '0' && (d) <= '7' ) typedef struct _DCFileListIterator DCFileListIterator; struct _DCFileListIterator { DCFileList *node; HMapIterator it; uint32_t c; }; DCFileList *our_filelist = NULL; time_t our_filelist_last_update = 0; static int mkdirs_for_temp_file(char *filename) { char *t; for (t = filename; *t == '/'; t++); while ((t = strchr(t, '/')) != NULL) { struct stat st; *t = '\0'; if (stat(filename, &st) < 0) { if (errno != ENOENT) { warn(_("%s: Cannot get file status - %s\n"), quotearg(filename), errstr); return -1; } else { if (mkdir(filename, 0777) < 0) { warn(_("%s: Cannot create directory - %s\n"), quotearg(filename), errstr); return -1; } else { if (ptrv_find(delete_dirs, filename, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_dirs, xstrdup(filename)); } } } *t = '/'; for (; *t == '/'; t++); } return 0; } static int fs_completion_entry_compare(const void *e1, const void *e2) { const DCCompletionEntry *ce1 = *(const DCCompletionEntry **) e1; const DCCompletionEntry *ce2 = *(const DCCompletionEntry **) e2; if (ce1->sorting.file_type == ce2->sorting.file_type) { char *s1 = xasprintf(ce1->display_fmt, ce1->display); /* XXX: this is really slow */ char *s2 = xasprintf(ce2->display_fmt, ce2->display); /* XXX: this is really slow */ int cmp = strcoll(s1, s2); free(s1); free(s2); return cmp; } return ce1->sorting.file_type - ce2->sorting.file_type; } DCFileList * new_file_node(const char *name, DCFileType type, DCFileList *parent) { DCFileList *node; node = xmalloc(sizeof(DCFileList)); node->name = xstrdup(name); node->type = type; node->parent = parent; if (parent != NULL) hmap_put(parent->dir.children, node->name, node); node->size = 0; switch (node->type) { case DC_TYPE_DIR: node->dir.real_path = NULL; node->dir.children = hmap_new(); break; case DC_TYPE_REG: node->reg.has_tth = false; memset(node->reg.tth, 0, sizeof(node->reg.tth)); node->reg.mtime = 0; /* No more operation at the moment! */ break; } return node; } void rename_node(DCFileList *node, const char* new_name) { char* node_name; if (node == NULL || new_name == NULL) { return; } node_name = node->name; node->name = xstrdup(new_name); if (node->parent != NULL) { hmap_remove(node->parent->dir.children, node_name); hmap_put(node->parent->dir.children, node->name, node); } free(node_name); } void set_child_node(DCFileList *parent, DCFileList *child) { if (parent == NULL || child == NULL || parent->type != DC_TYPE_DIR) { return; } child->parent = parent; hmap_put(parent->dir.children, child->name, child); } static DCFileList * get_child_node(DCFileList *node, const char *path) { if (IS_CURRENT_DIR(path)) return node; if (IS_PARENT_DIR(path)) return node->parent == NULL ? node : node->parent; return hmap_get(node->dir.children, path); } void filelist_free(DCFileList *node) { if (node != NULL) { switch (node->type) { case DC_TYPE_REG: break; case DC_TYPE_DIR: if (node->dir.real_path != NULL) free(node->dir.real_path); hmap_foreach_value(node->dir.children, filelist_free); hmap_free(node->dir.children); break; } free(node->name); free(node); } } static DCFileList * filelist_lookup_tth(DCFileList *node, const char *tth) { if (node->type == DC_TYPE_REG) { unsigned n; if (!node->reg.has_tth) return NULL; for (n = 0; n < sizeof(node->reg.tth); n++) { if ( tolower(node->reg.tth[n]) != tolower(tth[n])) return NULL; } return node; }else { HMapIterator it; DCFileList *res; hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *subnode = it.next(&it); res = filelist_lookup_tth( subnode, tth); if (res) return res; } } return NULL; } DCFileList * filelist_lookup(DCFileList *node, const char *filename) { const char *end; char *name; if (*filename != '/') return NULL; for (filename++; *filename == '/'; filename++); end = strchr(filename, '/'); if (end == NULL) { if (!*filename) return node; end = filename + strlen(filename); } if (node->type != DC_TYPE_DIR) return NULL; name = xstrndup(filename, end-filename); /* XXX: strndupa? */ node = get_child_node(node, name); free(name); if (node != NULL) return (*end == '\0' ? node : filelist_lookup(node, end)); return NULL; } char * filelist_get_path_with_trailing_slash(DCFileList *node) { StrBuf *sb; sb = strbuf_new(); while (node->parent != NULL) { strbuf_prepend(sb, node->name); strbuf_prepend_char(sb, '/'); node = node->parent; } if (node->type == DC_TYPE_DIR) strbuf_append_char(sb, '/'); return strbuf_free_to_string(sb); } /* Return the path of the node relative to the share root directory. */ char * filelist_get_path(DCFileList *node) { StrBuf *sb; if (node->parent == NULL) return xstrdup("/"); /* root */ sb = strbuf_new(); while (node->parent != NULL) { strbuf_prepend(sb, node->name); strbuf_prepend_char(sb, '/'); node = node->parent; } return strbuf_free_to_string(sb); } /* Return the physical path of the node, by prepending the share directory path. */ static char * filelist_get_real_path(DCFileList *node) { char *p2; /* char *p1; p1 = filelist_get_path(node); p2 = catfiles(share_dir, p1+1); / * p1[0] == '/', we don't want that * / free(p1); */ if (node->parent != NULL) { /* parent may be only directory */ assert(node->parent->dir.real_path != NULL); p2 = catfiles(node->parent->dir.real_path, node->name); } else { p2 = xstrdup(node->name); } return p2; } /*static int filelist_completion_compare(const void *i1, const void *i2) { const DCCompletionEntry *ce1 = *(const DCCompletionEntry **) i1; const DCCompletionEntry *ce2 = *(const DCCompletionEntry **) i2; return strcmp(ce1->input, ce2->input); } */ static int file_node_compare(const void *i1, const void *i2) { const DCFileList *f1 = *(const DCFileList **) i1; const DCFileList *f2 = *(const DCFileList **) i2; unsigned char *str1, *str2; unsigned char s1[2], s2[2]; int res; if (f1->type != f2->type) return f1->type - f2->type; str1 = (unsigned char *)f1->name; str2 = (unsigned char *)f2->name; s1[1] = s2[1] = '\0'; for (; *str1 && *str2; str1++, str2++) { if ((*str1 != *str2) && (tolower(*str1) != tolower(*str2))) { s1[0] = tolower(*str1); s2[0] = tolower(*str2); res = strcoll(s1, s2); if (res != 0) return res; } } if ( *str1 ) return 1; if ( *str2) return -1; return 0; } static DCFileList ** get_sorted_file_list(DCFileList *node, uint32_t *out_count) { HMapIterator it; DCFileList **items; uint32_t count; uint32_t c; assert(node->type == DC_TYPE_DIR); count = hmap_size(node->dir.children); items = xmalloc((count+1) * sizeof(DCFileList *)); hmap_iterator(node->dir.children, &it); for (c = 0; c < count; c++) items[c] = it.next(&it); items[count] = NULL; qsort(items, count, sizeof(DCFileList *), file_node_compare); if (out_count != NULL) *out_count = count; return items; } void filelist_list_recursively(DCFileList *node, char *basepath) { if (node->type == DC_TYPE_DIR) { DCFileList **items; uint32_t c; items = get_sorted_file_list(node, NULL); for (c = 0; items[c] != NULL; c++) { char *path = catfiles(basepath, items[c]->name); filelist_list_recursively(items[c], path); free(path); } free(items); } else { screen_putf("%7" PRIu64 "M %s\n", (uint64_t) (node->size/(1024*1024)), quotearg(basepath)); /* " */ } } void filelist_list(DCFileList *node, int mode) { uint32_t maxlen; uint64_t maxsize; if (node->type == DC_TYPE_DIR) { HMapIterator it; maxlen = 0; maxsize = 0; hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *subnode = it.next(&it); switch (subnode->type) { case DC_TYPE_REG: maxsize = max(maxsize, subnode->size); maxlen = max(maxlen, strlen(subnode->name)); break; case DC_TYPE_DIR: maxsize = max(maxsize, subnode->size); maxlen = max(maxlen, strlen(subnode->name)+1); break; } } } else { maxsize = node->size; maxlen = strlen(node->name); } if ((mode & DC_LS_LONG_MODE) != 0) { char *format; format = xasprintf("%%%d" PRIu64 "M %%s%%s\n", ilog10(max(1, maxsize/(1024*1024)))); if (node->type == DC_TYPE_DIR) { DCFileList **items; uint32_t c; items = get_sorted_file_list(node, NULL); for (c = 0; items[c] != NULL; c++) { switch (items[c]->type) { case DC_TYPE_REG: screen_putf(format, (uint64_t) (items[c]->size/(1024*1024)), quotearg(items[c]->name), ""); break; case DC_TYPE_DIR: screen_putf(format, (uint64_t) (items[c]->size/(1024*1024)), quotearg(items[c]->name), "/"); break; } } free(items); } else { screen_putf(format, (uint64_t) (node->size/(1024*1024)), quotearg(node->name), ""); } free(format); } else { if (node->type == DC_TYPE_DIR) { DCFileList **items; int cols; int rows; int row; int per_row; uint32_t count; items = get_sorted_file_list(node, &count); screen_get_size(NULL, &cols); per_row = MAX(1, (cols+2)/(maxlen+2)); rows = (count/per_row) + (count%per_row != 0); for (row = 0; row < rows; row++) { uint32_t c; for (c = row; c < count; c += rows) { DCFileList *item = items[c]; int extlen = 0; int d; switch (item->type) { case DC_TYPE_REG: extlen = 0; screen_putf("%s", quotearg(item->name)); break; case DC_TYPE_DIR: extlen = 1; screen_putf("%s/", quotearg(item->name)); break; } if (c+rows < count) { for (d = maxlen-strlen(items[c]->name)-extlen+2; d > 0; d--) screen_putf(" "); } } screen_putf("\n"); } free(items); } else { screen_putf("%s\n", quotearg(node->name)); } } } void dir_to_filelist(DCFileList *parent, const char *path) { struct dirent *ep; DIR *dp; /* char* tth_path = NULL; */ dp = opendir(path); if (dp == NULL) { screen_putf(_("%s: Cannot open directory - %s\n"), quotearg(path), errstr); return; } parent->dir.real_path = xstrdup(path); /* tth_path = catfiles(path, tth_directory_name); */ while ((ep = xreaddir(dp)) != NULL) { struct stat st; char *fullname; if (IS_SPECIAL_DIR(ep->d_name)) continue; /* If we ran into looped symlinked dirs, stat will stop (errno=ELOOP). */ fullname = catfiles(path, ep->d_name); if (stat(fullname, &st) < 0) { screen_putf(_("%s: Cannot get file status - %s\n"), quotearg(fullname), errstr); free(fullname); continue; } if (S_ISDIR(st.st_mode)) { DCFileList *node = new_file_node(ep->d_name, DC_TYPE_DIR, parent); dir_to_filelist(node, fullname); parent->size += node->size; } else if (S_ISREG(st.st_mode)) { /* char *tth_fname = NULL; int tth_fd = -1; */ DCFileList *node = new_file_node(ep->d_name, DC_TYPE_REG, parent); node->size = st.st_size; node->reg.has_tth = 0; memset(node->reg.tth, 0, sizeof(node->reg.tth)); node->reg.mtime = st.st_mtime; parent->size += node->size; /* tth_fname = xasprintf("%s%s%s%s", tth_path, tth_path[0] == '\0' || tth_path[strlen(tth_path)-1] == '/' ? "" : "/", ep->d_name, ".tth"); //flag_putf(DC_DF_DEBUG, _("Opening TTH file <%s> for <%s>\n"), tth_fname, ep->d_name); tth_fd = open(tth_fname, O_RDONLY); if (tth_fd >= 0) { uint64_t fsize; time_t mtime, ctime; char tth[39]; if (read(tth_fd, &fsize, sizeof(fsize)) == sizeof(fsize) && st.st_size == fsize && read(tth_fd, &mtime, sizeof(mtime)) == sizeof(mtime) && st.st_mtime == mtime && read(tth_fd, &ctime, sizeof(ctime)) == sizeof(ctime) && st.st_ctime == ctime && read(tth_fd, tth, sizeof(tth)) == sizeof(tth)) { node->reg.has_tth = 1; memcpy(node->reg.tth, tth, sizeof(node->reg.tth)); //fprintf(stderr, "File <%s> has TTH\n", ep->d_name); } close(tth_fd); } free(tth_fname); */ } else { screen_putf(_("%s: Not a regular file or directory, ignoring\n"), quotearg(fullname)); } free(fullname); } /* free(tth_path); */ if (errno != 0) screen_putf(_("%s: Cannot read directory - %s\n"), quotearg(path), errstr); if (closedir(dp) < 0) screen_putf(_("%s: Cannot close directory - %s\n"), quotearg(path), errstr); } static void filelist_to_string(DCFileList *node, StrBuf *sb, int level) { char *fname; if (level != 0) strbuf_append_char_n(sb, level-1, '\t'); /* convert filenames from filesystem charset to hub charset */ fname = fs_to_hub_string(node->name); if (node->type == DC_TYPE_REG) { strbuf_appendf(sb, "%s|%" PRIu64 "\r\n", fname, node->size); /* " joe sh bug */ free(fname); } else { HMapIterator it; if (level != 0) strbuf_appendf(sb, "%s\r\n", fname); free(fname); hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *subnode = it.next(&it); filelist_to_string(subnode, sb, level+1); } } } bool write_filelist_file(DCFileList* root, const char* prefix) { StrBuf *sb; char *indata; char *outdata; int fd, xml_fd, bzxml_fd; char *filename; char *xml_filename; char *bzxml_filename; uint32_t len; struct stat st; int i, failed_count; int max_failed_count = 1; #if defined(HAVE_LIBXML2) max_failed_count = 3; #endif if (root != NULL) { sb = strbuf_new(); filelist_to_string(root, sb, 0); len = strbuf_length(sb); indata = strbuf_free_to_string(sb); outdata = huffman_encode((uint8_t *) indata, len, &len); free(indata); filename = xasprintf("%s%s%sMyList.DcLst", listing_dir, listing_dir[0] == '\0' || listing_dir[strlen(listing_dir)-1] == '/' ? "" : "/", prefix == NULL ? "" : prefix); mkdirs_for_temp_file(filename); /* Ignore errors */ if (stat(filename, &st) < 0) { if (errno != ENOENT) warn(_("%s: Cannot get file status - %s\n"), filename, errstr); } else { if (unlink(filename) < 0) warn(_("%s: Cannot remove file - %s\n"), filename, errstr); } i = ptrv_find(delete_files, filename, (comparison_fn_t) strcmp); if (i >= 0) ptrv_remove_range(delete_files, i, i+1); #if defined(HAVE_LIBXML2) xml_filename = xasprintf("%s%s%sfiles.xml", listing_dir, listing_dir[0] == '\0' || listing_dir[strlen(listing_dir)-1] == '/' ? "" : "/", prefix == NULL ? "" : prefix); mkdirs_for_temp_file(xml_filename); /* Ignore errors */ if (stat(xml_filename, &st) < 0) { if (errno != ENOENT) warn(_("%s: Cannot get file status - %s\n"), xml_filename, errstr); } else { if (unlink(xml_filename) < 0) warn(_("%s: Cannot remove file - %s\n"), xml_filename, errstr); } i = ptrv_find(delete_files, xml_filename, (comparison_fn_t) strcmp); if (i >= 0) ptrv_remove_range(delete_files, i, i+1); bzxml_filename = xasprintf("%s%s%sfiles.xml.bz2", listing_dir, listing_dir[0] == '\0' || listing_dir[strlen(listing_dir)-1] == '/' ? "" : "/", prefix == NULL ? "" : prefix); mkdirs_for_temp_file(bzxml_filename); /* Ignore errors */ if (stat(bzxml_filename, &st) < 0) { if (errno != ENOENT) warn(_("%s: Cannot get file status - %s\n"), bzxml_filename, errstr); } else { if (unlink(bzxml_filename) < 0) warn(_("%s: Cannot remove file - %s\n"), bzxml_filename, errstr); } i = ptrv_find(delete_files, bzxml_filename, (comparison_fn_t) strcmp); if (i >= 0) ptrv_remove_range(delete_files, i, i+1); #endif failed_count = 0; fd = open(filename, O_CREAT|O_EXCL|O_WRONLY, 0666); if (fd < 0) { screen_putf(_("%s: Cannot open file for writing - %s\n"), quotearg(filename), errstr); failed_count++; } #if defined(HAVE_LIBXML2) xml_fd = open(xml_filename, O_CREAT|O_EXCL|O_WRONLY, 0666); if (xml_fd < 0) { screen_putf(_("%s: Cannot open file for writing - %s\n"), quotearg(xml_filename), errstr); failed_count++; } bzxml_fd = open(bzxml_filename, O_CREAT|O_EXCL|O_WRONLY, 0666); if (bzxml_fd < 0) { screen_putf(_("%s: Cannot open file for writing - %s\n"), quotearg(bzxml_filename), errstr); failed_count++; } #endif if (failed_count == max_failed_count) { filelist_free(root); free(outdata); free(filename); #if defined(HAVE_LIBXML2) free(xml_filename); free(bzxml_filename); #endif return false; } /* if (ptrv_find(delete_files, filename, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_files, xstrdup(filename)); #if defined(HAVE_LIBXML2) if (ptrv_find(delete_files, xml_filename, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_files, xstrdup(xml_filename)); if (ptrv_find(delete_files, bzxml_filename, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_files, xstrdup(bzxml_filename)); #endif */ failed_count = 0; if (fd < 0 || full_write(fd, outdata, len) < len) { if (fd >= 0) screen_putf(_("%s: Cannot write to file - %s\n"), quotearg(filename), errstr); failed_count++; } free(outdata); #if defined(HAVE_LIBXML2) if (xml_fd < 0 || write_xml_filelist(xml_fd, root) < 0) { if (xml_fd >= 0) { screen_putf(_("%s: Cannot write to file - %s\n"), quotearg(xml_filename), errstr); } failed_count++; } if (bzxml_fd < 0 || write_bzxml_filelist(bzxml_fd, root) < 0) { if (bzxml_fd >= 0) { screen_putf(_("%s: Cannot write to file - %s\n"), quotearg(bzxml_filename), errstr); } failed_count++; } #endif if (failed_count == max_failed_count) { filelist_free(root); free(filename); #if defined(HAVE_LIBXML2) free(xml_filename); free(bzxml_filename); #endif return false; } if (close(fd) < 0) screen_putf(_("%s: Cannot close file - %s\n"), quotearg(filename), errstr); free(filename); #if defined(HAVE_LIBXML2) if (close(xml_fd) < 0) screen_putf(_("%s: Cannot close file - %s\n"), quotearg(xml_filename), errstr); free(xml_filename); // we don't need to close this file - it was closed by write_bzxml_filelist() function. free(bzxml_filename); #endif return true; } return false; } bool filelist_create(const char *basedir) { char* conv_basedir; DCFileList *root = new_file_node("", DC_TYPE_DIR, NULL); if (basedir != NULL) { screen_putf(_("Scanning directory %s\n"), quotearg(basedir)); //screen_sync(); dir_to_filelist(root, basedir); } /* basedir for dir_to_filelist must be in filesystem encoding */ conv_basedir = main_to_fs_string(basedir); dir_to_filelist(root, conv_basedir); free(conv_basedir); if (our_filelist != NULL) filelist_free(our_filelist); our_filelist = root; my_share_size = our_filelist->size; return write_filelist_file(root, NULL); } /* Find the physical path of a file that the remote end * wants to download from us. */ char * resolve_upload_file(DCUserInfo *ui, DCAdcgetType ul_type, const char *name, DCTransferFlag* flag, uint64_t* size) { DCFileList *node; if (ul_type == DC_ADCGET_FILE) { /* Note: 'name' will have been translated to local slashes * by a call to translate_remote_to_local prior to calling * this function. */ /* Skip leading slashes, all but one */ if (name[0] != '/') return NULL; for (; name[1] == '/'; name++); if (strcmp(name, "/MyList.DcLst") == 0 #if defined(HAVE_LIBXML2) || strcmp(name, "/files.xml") == 0 || strcmp(name, "/files.xml.bz2") == 0 #endif ) { char* filename = catfiles(listing_dir, name); if (flag != NULL) { *flag = DC_TF_LIST; } if (size != NULL) { struct stat st; if (stat(filename, &st) == 0) { *size = st.st_size; } else { *size = 0; } } return filename; } } if (our_filelist == NULL) return NULL; if (ul_type == DC_ADCGET_FILE) node = filelist_lookup(our_filelist, name); else node = filelist_lookup_tth(our_filelist, name); if (node == NULL) return NULL; if (ul_type == DC_ADCGET_TTHL) { return NULL; /* StrBuf *sb; sb = strbuf_new(); strbuf_append_char(sb, '/'); strbuf_append(sb, tth_directory_name); if ( tth_directory_name[strlen(tth_directory_name) - 1] != '/' ) strbuf_append_char(sb, '/'); strbuf_append(sb, node->name); strbuf_append(sb, ".tth"); node = node->parent; while (node != NULL) { strbuf_prepend(sb, node->name); strbuf_prepend_char(sb, '/'); node = node->parent; } strbuf_prepend(sb, share_dir); return strbuf_free_to_string(sb); */ } else { if (flag != NULL) { *flag = DC_TF_NORMAL; } if (size != NULL) { *size = node->size; } } return filelist_get_real_path(node); } char * resolve_download_file(DCUserInfo *ui, DCQueuedFile *queued) { char *filename; char *tmp, *tmp2; if (queued->flag == DC_TF_LIST) { tmp = xasprintf("%s", ui->nick); tmp2 = catfiles(listing_dir, tmp); free(tmp); filename = main_to_fs_string(tmp2); free(tmp2); if (filename) { mkdirs_for_temp_file(filename); /* Ignore errors */ } } else { tmp = catfiles(download_dir, queued->filename + strlen(queued->base_path)); tmp2 = xasprintf("%s.part", tmp); free(tmp); filename = main_to_fs_string(tmp2); free(tmp2); if (filename) mkdirs_for_file(filename); /* Ignore errors */ } return filename; } char * translate_remote_to_local(const char *remotename) { StrBuf *sb; sb = strbuf_new(); strbuf_append_char(sb, '/'); for (; *remotename != '\0'; remotename++) { if (*remotename == '\\') strbuf_append_char(sb, '/'); else strbuf_append_char(sb, *remotename); } return strbuf_free_to_string(sb); } char * translate_local_to_remote(const char *localname) { StrBuf *sb; sb = strbuf_new(); localname++; for (; *localname != '\0'; localname++) { if (*localname == '/') strbuf_append_char(sb, '\\'); else strbuf_append_char(sb, *localname); } return strbuf_free_to_string(sb); } char * apply_cwd(const char *path) { if (*path == '/') { return xstrdup(path); } else { return catfiles(browse_path, path); } } /* Concatenate two file name components, taking in consideration trailing * slash in the first component P1. * An empty file name component ("") can be specified as well. It is a * special case which is treated as "no directory component". * "." is returned if both P1 and P2 are empty file name components. * Note that consecutive sequences of slashes ("/") in P1 and P2 are * untouched. Only the trailing slash of P1 is considered when concatenating * P1 and P2. * The returned value should be freed when no longer needed. * P1 or P2 may not be NULL. */ char * concat_filenames(const char *p1, const char *p2) { size_t l1; size_t l2; char *out; if (*p1 == '\0' && *p2 == '\0') return xstrdup("."); if (*p1 == '\0') return xstrdup(p2); if (*p2 == '\0') return xstrdup(p1); l1 = strlen(p1); l2 = strlen(p2); if (p1[l1-1] == '/') l1--; out = xmalloc(l1+1+l2+1); memcpy(out, p1, l1); out[l1] = '/'; memcpy(out+l1+1, p2, l2+1); return out; } /* Return true if the string BUF (which may contain quotes and * escapes) starts with a slash. * This is equivalent to dequoting BUF, and testing if the first * character of the result is '/', only that with this function * no memory is actually allocated. * This function could also be implemented as * return skip_slashes(&buf, "ed); */ bool has_leading_slash(const char *buf) { for (; buf[0] == '"'; buf++); /* Begins and ends empty strings */ return buf[0] == '/' || (buf[0] == '\\' && buf[1] == '/'); } /* Find the first non-slash character, not including * quotes. Return true if a slash was found. * Update *BUFPTR to point to the first non-slash character. * Also update *QUOTEDPTR to reflect quoted state; */ /* rename: skip_leading_slashes */ static bool skip_slashes(char **bufptr, bool *quotedptr) { char *buf = *bufptr; bool quoted = *quotedptr; bool slash = false; for (; ; buf++) { if (buf[0] == '"') { quoted = !quoted; } else if (buf[0] == '/') { slash = true; } else if (buf[0] == '\\' && buf[1] == '/') { slash = true; buf++; } else { break; } } *bufptr = buf; *quotedptr = quoted; return slash; } /* Extract the first file name component of *BUFPTR and place the * newly allocated string into *OUTPTR. Update *BUFPTR to point * to the first character not in this component (excluding quotes). * Also update *QUOTEDPTR. A file component is not supposed to contain * slashes, so all leading slashes of *BUFPTR are ignored. Note that * if *BUFPTR is the empty string (possibly after leading slashes have * been ignored), then *OUTPTR will be an empty string. You should * free *OUTPTR when it is no longer needed. * * This function combines many operations: * - stop matching when a slash is encountered * - determine if there are unquoted and unescaped wildcards * - escape quoted wildcards for fnmatch, if there were wildcards * - remove quotes and escapes */ static bool dircomp_to_fnmatch_str(char **bufptr, bool *quotedptr, char **outptr) { StrBuf *out; char *buf; bool quoted; bool wildcards = false; skip_slashes(bufptr, quotedptr); out = strbuf_new(); quoted = *quotedptr; for (buf = *bufptr; *buf != '\0' && *buf != '/'; buf++) { if (*buf == '"') quoted = !quoted; else if (*buf == '\\' && buf[1] != '\0') buf++; else if ((*buf == '*' || *buf == '?') && !quoted) wildcards = true; } quoted = *quotedptr; for (buf = *bufptr; *buf != '\0' && *buf != '/'; buf++) { if (*buf == '"') { quoted = !quoted; } else if (*buf == '\\') { buf++; if (*buf == '\0') break; /*if (*buf == 'a') { strbuf_append_char(out, '\a'); } else if (*buf == 'b') { strbuf_append_char(out, '\b'); } else if (*buf == 'f') { strbuf_append_char(out, '\f'); } else if (*buf == 'n') { strbuf_append_char(out, '\n'); } else if (*buf == 'r') { strbuf_append_char(out, '\r'); } else if (*buf == 't') { strbuf_append_char(out, '\t'); } else if (*buf == 'v') { strbuf_append_char(out, '\v'); } else*/ if (IS_OCT_DIGIT(*buf)) { int chr = *buf - '0'; buf++; if (*buf != '\0' && IS_OCT_DIGIT(*buf)) { chr = (chr * 8) + (*buf - '0'); buf++; if (*buf != '\0' && IS_OCT_DIGIT(*buf)) { chr = (chr * 8) + (*buf - '0'); buf++; } } buf--; strbuf_append_char(out, chr); } else if (*buf == '*' || *buf == '?') { if (quoted || !wildcards) strbuf_append_char(out, '\\'); /* escape wildcard for fnmatch */ strbuf_append_char(out, *buf); } else { strbuf_append_char(out, *buf); } } else { if (wildcards && quoted && (*buf == '*' || *buf == '?')) strbuf_append_char(out, '\\'); /* escape wildcard for fnmatch */ strbuf_append_char(out, *buf); } } *bufptr = buf; *quotedptr = quoted; *outptr = strbuf_free_to_string(out); return wildcards; } static void add_remote_wildcard_result(char *name, DCFileList *node, DCFSCompletionFlags flags, DCCompletionInfo *ci) { DCCompletionEntry *entry = NULL; char *input; input = filename_quote_string(name, ci->word_full[0] == '"', true); if (node->type == DC_TYPE_DIR) { if (flags & DC_CPL_DIR) entry = new_completion_entry_full(input, name, "%s/", "%s/", false, true); } else { if (flags & DC_CPL_REG) entry = new_completion_entry_full(input, name, "%s", "%s", true, true); } if (entry != NULL) { entry->sorting.file_type = node->type; ptrv_append(ci->results, entry); } else { free(input); free(name); } } /* Note that NAME will never be "/" for this function. * It is not possible for a complete operation to have the bare result "/". */ static void add_local_wildcard_result(char *name, DCFSCompletionFlags flags, DCCompletionInfo *ci) { struct stat st; char *name_fs; name_fs = main_to_fs_string(name); if (lstat(name_fs, &st) == 0) { DCCompletionEntry *entry = NULL; char *input; bool dquoted = (ci->word_full[0] == '"'); input = filename_quote_string(name, dquoted, true); if (S_ISDIR(st.st_mode)) { if (flags & DC_CPL_DIR) { entry = new_completion_entry_full(input, name, "%s/", "%s/", false, true); entry->sorting.file_type = DC_TYPE_DIR; } } else if (S_ISLNK(st.st_mode)) { if (stat(name_fs, &st) == 0 && S_ISDIR(st.st_mode)) { if (flags & DC_CPL_DIR) { entry = new_completion_entry_full(input, name, "%s", "%s@", false, true); if (dquoted) input[strlen(input)-1] = '\0'; if (strcmp(ci->word_full, input) == 0) entry->input_single_fmt = "%s/"; if (dquoted) input[strlen(input)] = '"'; entry->sorting.file_type = DC_TYPE_DIR; } } else { if (flags & DC_CPL_REG) { entry = new_completion_entry_full(input, name, "%s", "%s@", true, true); entry->sorting.file_type = DC_TYPE_REG; } } } else if (S_ISREG(st.st_mode)) { if ((flags & DC_CPL_REG) || (flags & DC_CPL_EXE)) { if ((access(name_fs, X_OK) == 0) == ((flags & DC_CPL_EXE) != 0)) { entry = new_completion_entry_full(input, name, "%s", "%s", true, true); entry->sorting.file_type = DC_TYPE_REG; } else if ((flags & DC_CPL_EXE) == 0) { entry = new_completion_entry_full(input, name, "%s", "%s*", true, true); entry->sorting.file_type = DC_TYPE_REG; } } } free(name_fs); if (entry != NULL) { ptrv_append(ci->results, entry); } else { free(input); free(name); } } } static void filelist_iterator(DCFileList *node, DCFileListIterator *it) { hmap_iterator(node->dir.children, &it->it); it->node = node; it->c = 0; } static bool filelist_get_next(DCFileListIterator *it, DCFileList **node, char **name) { it->c++; if (it->c == 1) { *node = it->node; *name = "."; return true; } if (it->c == 2) { *node = it->node->parent == NULL ? it->node : it->node->parent; *name = ".."; return true; } if (it->it.has_next(&it->it)) { *node = it->it.next(&it->it); *name = (*node)->name; return true; } return false; } void remote_wildcard_expand(char *matchpath, bool *quotedptr, const char *basedir, DCFileList *basenode, PtrV *results) { char *matchcomp; char *fullpath; char *nodename; DCFileList *node; DCFileListIterator it; if (dircomp_to_fnmatch_str(&matchpath, quotedptr, &matchcomp)) { filelist_iterator(basenode, &it); while (filelist_get_next(&it, &node, &nodename)) { if (fnmatch(matchcomp, nodename, FNM_PERIOD) == 0) { if (*matchpath != '\0') { if (node->type == DC_TYPE_DIR) { fullpath = concat_filenames(basedir, nodename); remote_wildcard_expand(matchpath, quotedptr, fullpath, node, results); free(fullpath); } } else { ptrv_append(results, concat_filenames(basedir, nodename)); /*ptrv_append(results, node);*/ } } } } else { if (*matchcomp == '\0') { ptrv_append(results, concat_filenames(basedir, matchcomp)); } else { node = get_child_node(basenode, matchcomp); if (node != NULL) { if (*matchpath != '\0') { fullpath = concat_filenames(basedir, matchcomp); remote_wildcard_expand(matchpath, quotedptr, fullpath, node, results); free(fullpath); } else { ptrv_append(results, concat_filenames(basedir, matchcomp)); /*ptrv_append(results, node);*/ } } } } free(matchcomp); } static void remote_wildcard_complete(char *matchpath, bool *quotedptr, char *basedir, DCFileList *basenode, DCFSCompletionFlags flags, DCCompletionInfo *ci, bool found_wc) { char *matchcomp; char *fullpath; char *nodename; DCFileList *node; DCFileListIterator it; if (dircomp_to_fnmatch_str(&matchpath, quotedptr, &matchcomp)) { filelist_iterator(basenode, &it); while (filelist_get_next(&it, &node, &nodename)) { if (fnmatch(matchcomp, nodename, FNM_PERIOD) == 0) { if (*matchpath != '\0') { if (node->type == DC_TYPE_DIR) { fullpath = concat_filenames(basedir, nodename); remote_wildcard_complete(matchpath, quotedptr, fullpath, node, flags, ci, true); free(fullpath); } } else { add_remote_wildcard_result(concat_filenames(basedir, node->name), node, flags, ci); } } } } else { fullpath = concat_filenames(basedir, matchcomp); if (*matchpath != '\0') { /* more components follow after this one? */ node = get_child_node(basenode, matchcomp); if (node != NULL) remote_wildcard_complete(matchpath, quotedptr, fullpath, node, flags, ci, found_wc); } else { /* If the string we are completing had wild cards, attempt to expand the string * first rather than generating multiple possible completion results. * This behavior is similar to that of GNU readline. */ if (found_wc) { if (*matchcomp == '\0') { /* completion word ends in slash */ add_remote_wildcard_result(concat_filenames(basedir, matchcomp), basenode, flags, ci); } else { node = get_child_node(basenode, matchcomp); if (node != NULL) add_remote_wildcard_result(concat_filenames(basedir, matchcomp), node, flags, ci); } } else { filelist_iterator(basenode, &it); while (filelist_get_next(&it, &node, &nodename)) { if ((nodename[0] == '.') != (matchcomp[0] == '.')) continue; if (strleftcmp(matchcomp, nodename) == 0) add_remote_wildcard_result(concat_filenames(basedir, nodename), node, flags, ci); } } } free(fullpath); } free(matchcomp); } static void local_wildcard_complete(char *matchpath, bool *quotedptr, char *basedir, DCFSCompletionFlags flags, DCCompletionInfo *ci, bool found_wc) { char *matchcomp; struct stat sb; char *fullpath_fs, *fullpath; DIR *dh; struct dirent *de; char *basedir_fs; char *fname_loc; basedir_fs = main_to_fs_string(basedir); if (dircomp_to_fnmatch_str(&matchpath, quotedptr, &matchcomp)) { dh = opendir(*basedir_fs == '\0' ? "." : basedir_fs); if (dh != NULL) { while ((de = readdir(dh)) != NULL) { /* convert filename from filesystem charset for fnmatch*/ fname_loc = fs_to_main_string(de->d_name); if (fnmatch(matchcomp, fname_loc, FNM_PERIOD) == 0) { if (*matchpath != '\0') { fullpath_fs = concat_filenames(basedir_fs, de->d_name); fullpath = concat_filenames(basedir, fname_loc); if (stat(fullpath_fs, &sb) == 0 && S_ISDIR(sb.st_mode)) local_wildcard_complete(matchpath, quotedptr, fullpath, flags, ci, true); free(fullpath_fs); free(fullpath); } else { add_local_wildcard_result(concat_filenames(basedir, fname_loc), flags, ci); } } free(fname_loc); } closedir(dh); } } else { fullpath = concat_filenames(basedir, matchcomp); fullpath_fs = main_to_fs_string(fullpath); if (*matchpath != '\0') { if (lstat(fullpath_fs, &sb) == 0) local_wildcard_complete(matchpath, quotedptr, fullpath, flags, ci, found_wc); } else { /* If the string we are completing had wild cards, attempt to expand the string * first rather than generating multiple possible completion results. * This behavior is similar to that of GNU readline. */ if (found_wc) { if (*matchcomp == '\0') { /* completion word ends in slash */ add_local_wildcard_result(concat_filenames(basedir, matchcomp), flags, ci); } else if (/*strcmp(basedir, "/") != 0 &&*/ lstat(fullpath_fs ? fullpath_fs : fullpath, &sb) == 0) { add_local_wildcard_result(concat_filenames(basedir, matchcomp), flags, ci); } } else { dh = opendir(*basedir_fs == '\0' ? "." : basedir_fs); if (dh != NULL) { while ((de = readdir(dh)) != NULL) { if ((de->d_name[0] == '.') != (matchcomp[0] == '.')) continue; fname_loc = fs_to_main_string(de->d_name); if (strleftcmp(matchcomp, fname_loc ? fname_loc : de->d_name) == 0) add_local_wildcard_result(concat_filenames(basedir, fname_loc), flags, ci); free(fname_loc); } closedir(dh); } } } free(fullpath); free(fullpath_fs); } free(basedir_fs); free(matchcomp); } static void fixup_wildcard_completion_results(DCCompletionInfo *ci) { if (ci->results->cur > 1) { DCCompletionEntry *ce; char *s1, *s2; int c, d; int min; /* This differs from GNU readline. Readline always displays * the base name of every result, even if the directory part * differs. Find longest common leading string, then find last * '/' and strip everything before and including the slash. */ ce = ci->results->buf[0]; s1 = xasprintf(ce->display_fmt, ce->display); min = strlen(s1); for (c = 1; c < ci->results->cur; c++) { char c1, c2; ce = ci->results->buf[c]; s2 = xasprintf(ce->display_fmt, ce->display); for (d = 0; (c1 = s1[d]) != '\0' && (c2 = s2[d]) != '\0'; d++) { if (c1 != c2) break; } min = MIN(min, d); free(s2); } if (min > 0) { s1[min] = '\0'; s2 = strrchr(s1, '/'); if (s2 != NULL) { min = s2-s1+1; for (c = 0; c < ci->results->cur; c++) { ce = ci->results->buf[c]; s2 = strdup(ce->display + min); if (ce->display != ce->input) free(ce->display); ce->display = s2; } } } free(s1); ptrv_sort(ci->results, fs_completion_entry_compare); } } void local_fs_completion_generator(DCCompletionInfo *ci, DCFSCompletionFlags flags) { bool quoted = false; local_wildcard_complete(ci->word_full, "ed, has_leading_slash(ci->word_full) ? "/" : "", flags, ci, false); fixup_wildcard_completion_results(ci); } void local_path_completion_generator(DCCompletionInfo *ci) { local_fs_completion_generator(ci, DC_CPL_REG|DC_CPL_DIR); } void local_dir_completion_generator(DCCompletionInfo *ci) { local_fs_completion_generator(ci, DC_CPL_DIR); } void remote_fs_completion_generator(DCCompletionInfo *ci, DCFSCompletionFlags flags) { bool quoted = false; char *basedir; DCFileList *basenode; if (browse_list == NULL) return; if (has_leading_slash(ci->word_full)) { basenode = filelist_lookup(browse_list, "/"); basedir = "/"; } else { basenode = filelist_lookup(browse_list, browse_path); basedir = ""; } if (basenode != NULL) { remote_wildcard_complete(ci->word_full, "ed, basedir, basenode, flags, ci, false); fixup_wildcard_completion_results(ci); } } void remote_path_completion_generator(DCCompletionInfo *ci) { return remote_fs_completion_generator(ci, DC_CPL_REG|DC_CPL_DIR); } void remote_dir_completion_generator(DCCompletionInfo *ci) { return remote_fs_completion_generator(ci, DC_CPL_DIR); } microdc2-0.15.6/src/hash.c0100644000076500007500000001057410527044707015245 0ustar chugunovmicrodc/* lookup.c - Performing name lookup with getaddrinfo * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "xalloc.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "common/msgq.h" #include "common/byteq.h" #include "common/ptrv.h" #include "microdc.h" #include "tth/tth.h" MsgQ *hash_request_mq = NULL; MsgQ *hash_result_mq = NULL; pid_t hash_child; static void __attribute__((noreturn)) hash_main(int request_fd[2], int result_fd[2]) { MsgQ *request_mq; MsgQ *result_mq; struct sigaction sigact; close(request_fd[1]); close(result_fd[0]); request_mq = msgq_new(request_fd[0]); result_mq = msgq_new(result_fd[1]); /* Inability to register these signals is not a fatal error. */ sigact.sa_flags = SA_RESTART; sigact.sa_handler = SIG_IGN; #ifdef HAVE_STRUCT_SIGACTION_SA_RESTORER sigact.sa_restorer = NULL; #endif sigaction(SIGINT, &sigact, NULL); sigaction(SIGTERM, &sigact, NULL); sigaction(SIGUSR1, &sigact, NULL); sigaction(SIGCHLD, &sigact, NULL); sigaction(SIGPIPE, &sigact, NULL); while (msgq_read_complete_msg(request_mq) > 0) { char *filename, *hash; struct stat st; msgq_get(request_mq, MSGQ_STR, &filename, MSGQ_END); /* fprintf(stderr, "HASH: begin processing %s\n", filename); fflush(stderr); */ if (stat(filename, &st) < 0) { hash = xasprintf("FAILED"); } else { char* tthl = NULL; size_t tthl_size; hash = tth(filename, &tthl, &tthl_size); if (tthl != NULL) free(tthl); } /* fprintf(stderr, "HASH: %s: %s\n", filename, hash); fflush(stderr); */ msgq_put(result_mq, MSGQ_STR, hash, MSGQ_END); free(hash); if (msgq_write_all(result_mq) < 0) { /* fprintf(stderr, "HASH: msgq_write_all error: %d, %s\n", errno, errstr); fflush(stderr); */ break; } } /* msgq_read_complete_msg may have failed if it returned < 0. * But we can't print any errors from this process (it would * interfere with the readline-managed display, so just exit * gracefully. */ msgq_free(request_mq); msgq_free(result_mq); close(request_fd[0]); close(result_fd[1]); exit(EXIT_SUCCESS); } bool hash_init(void) { int request_fd[2]; int result_fd[2]; if (pipe(request_fd) != 0 || pipe(result_fd) != 0) { warn(_("Cannot create pipe pair - %s\n"), errstr); return false; } if (!fd_set_nonblock_flag(request_fd[1], true) || !fd_set_nonblock_flag(result_fd[0], true)) { warn(_("Cannot set non-blocking flag - %s\n"), errstr); return false; } hash_child = fork(); if (hash_child < 0) { warn(_("Cannot create process - %s\n"), errstr); return false; } if (hash_child == 0) { setpriority(PRIO_PROCESS, 0, 16); hash_main(request_fd, result_fd); } close(request_fd[0]); close(result_fd[1]); hash_request_mq = msgq_new(request_fd[1]); hash_result_mq = msgq_new(result_fd[0]); return true; } void hash_finish(void) { if (hash_request_mq != NULL) { close(hash_request_mq->fd); msgq_free(hash_request_mq); } if (hash_result_mq != NULL) { close(hash_result_mq->fd); msgq_free(hash_result_mq); } } microdc2-0.15.6/src/hub.c0100664000076500007500000010624410543544750015103 0ustar chugunovmicrodc/* hub.c - Hub communication * * Copyright (C) 2004, 2005 Oskar Liljeblad * Copyright (C) 2006 Alexey Illarionov * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* C89 */ #include /* C89 */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* POSIX */ #include #include /* POSIX */ #include "iconvme.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "xalloc.h" /* Gnulib */ #include "quotearg.h" /* Gnulib */ #include "memmem.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/error.h" #include "common/intutil.h" #include "common/strleftcmp.h" #include "microdc.h" #define DEFAULT_HUB_RECVQ_SIZE 128 #define DEFAULT_HUB_SENDQ_SIZE 128 typedef enum { HUB_EXT_NOGETINFO = 1 << 0, HUB_EXT_NOHELLO = 1 << 1, } DCHubExtension; ByteQ *hub_recvq = NULL; ByteQ *hub_sendq = NULL; int hub_socket = -1; DCHubState hub_state = DC_HUB_DISCONNECTED; HMap *hub_users = NULL; /* all users on the current hub (UserInfo->nick => UserInfo) */ DCLookup *hub_lookup = NULL; struct sockaddr_in hub_addr; static uint32_t hub_recvq_last = 0; char *hub_name = NULL; static DCHubExtension hub_extensions = 0; bool hub_connected = false; time_t hub_activity_check_interval = 150; time_t hub_reconnect_interval = 10; time_t hub_last_activity = 0; void hub_set_connected(bool state) { hub_connected = state; } void update_hub_activity() { hub_last_activity = time(NULL); } void check_hub_activity() { if (hub_connected) { time_t now = time(NULL); if (hub_state == DC_HUB_LOGGED_IN && hub_last_activity + hub_activity_check_interval <= now) { hub_putf("|"); } else if (hub_state == DC_HUB_DISCONNECTED && (hub_last_activity + hub_reconnect_interval) <= now && running && auto_reconnect) { warn(_("Automatically reconnecting to hub\n")); hub_connect(&hub_addr); } } } void hub_reconnect() { hub_disconnect(); hub_connect(&hub_addr); } bool send_my_info(void) { char *conv_nick = main_to_hub_string(my_nick); char *conv_desc = main_to_hub_string(my_description); char *conv_email = main_to_hub_string(my_email); bool res; /* XXX: hm, H:1/0/0 should be Normal/Registered/Op, calculate this value. */ res = hub_putf("$MyINFO $ALL %s %s<%s,M:%c,H:1/0/0,S:%d>$ $%s%c$%s$%" PRIu64 "$|", /* " */ conv_nick, conv_desc, my_tag, is_active ? 'A':'P', my_ul_slots, my_speed, 1, /* level, '1' means normal, see DCTC Documentation/Documentation/VAR */ conv_email, my_share_size); free(conv_nick); free(conv_desc); free(conv_email); return res; } void say_user_completion_generator(DCCompletionInfo *ci) { HMapIterator it; /* XXX: perhaps hub_users should be made a tmap? to speed up things */ hmap_iterator(hub_users, &it); while (it.has_next(&it)) { DCUserInfo *ui = it.next(&it); if (strleftcmp(ci->word, ui->nick) == 0) { DCCompletionEntry *entry; entry = new_completion_entry_full( quote_string(ui->nick, ci->word_full[0] == '"', true), xstrdup(ui->nick), "%s", "%s", false, true); /* entry->input and _single_fmt are already quoted */ entry->input_single_fmt = "%s: "; ptrv_append(ci->results, entry); } } ptrv_sort(ci->results, completion_entry_display_compare); } void user_or_myself_completion_generator(DCCompletionInfo *ci) { if (strleftcmp(ci->word, my_nick) == 0) ptrv_append(ci->results, new_completion_entry(my_nick, NULL)); user_completion_generator(ci); } void user_completion_generator(DCCompletionInfo *ci) { HMapIterator it; /* XXX: what if we are self found in this list? conflict with user_or_myself_completion_generator */ hmap_iterator(hub_users, &it); while (it.has_next(&it)) { DCUserInfo *ui = it.next(&it); if (strleftcmp(ci->word, ui->nick) == 0) ptrv_append(ci->results, new_completion_entry(ui->nick, NULL)); } ptrv_sort(ci->results, completion_entry_display_compare); } void user_with_queue_completion_generator(DCCompletionInfo *ci) { HMapIterator it; /* XXX: for completion speed, maintain a separate TMap for users with queue? */ hmap_iterator(hub_users, &it); while (it.has_next(&it)) { DCUserInfo *ui = it.next(&it); if (ui->download_queue->cur > 0 && strleftcmp(ci->word, ui->nick) == 0) ptrv_append(ci->results, new_completion_entry(ui->nick, NULL)); } ptrv_sort(ci->results, completion_entry_display_compare); } /* Create a new user info structure, representing a user on the hub. */ DCUserInfo * user_info_new(const char *nick) { DCUserInfo *info; char *ucname; info = xmalloc(sizeof(DCUserInfo)); info->nick = xstrdup(nick); info->description = NULL; info->speed = NULL; info->level = 0; info->email = NULL; info->share_size = 0; info->active_state = DC_ACTIVE_UNKNOWN; info->download_queue = ptrv_new(); info->slot_granted = false; info->refcount = 1; info->is_operator = false; info->info_quered = false; info->conn_count = 0; /* XXX Find existing connections to this user... */ ucname = xasprintf("%s|%s", nick, _("UL")); info->conn[info->conn_count] = hmap_get(user_conns, ucname); if (info->conn[info->conn_count] != NULL) info->conn_count++; free(ucname); ucname = xasprintf("%s|%s", nick, _("DL")); info->conn[info->conn_count] = hmap_get(user_conns, ucname); if (info->conn[info->conn_count] != NULL) info->conn_count++; free(ucname); ucname = xasprintf("%s|", nick); info->conn[info->conn_count] = hmap_get(user_conns, ucname); if (info->conn[info->conn_count] != NULL) info->conn_count++; free(ucname); return info; } void free_queued_file(DCQueuedFile *qf) { free(qf->filename); free(qf->base_path); free(qf); } void user_info_free(DCUserInfo *ui) { ui->refcount--; if (ui->refcount == 0) { free(ui->nick); free(ui->description); free(ui->speed); free(ui->email); ptrv_foreach(ui->download_queue, (PtrVForeachCallback) free_queued_file); ptrv_free(ui->download_queue); free(ui); } } /* Put some data onto the connection, printf style. */ bool hub_putf(const char *format, ...) { va_list args; size_t oldcur; int res; oldcur = hub_sendq->cur; va_start(args, format); res = byteq_vappendf(hub_sendq, format, args); va_end(args); if (res < 0) { warn(_("Cannot append to hub send queue - %s\n"), errstr); hub_disconnect(); return false; } dump_command(_("-->"), hub_sendq->buf+oldcur, hub_sendq->cur-oldcur); res = byteq_write(hub_sendq, hub_socket); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, true, _("hub")); hub_disconnect(); return false; } if (oldcur == 0 && hub_sendq->cur > 0) FD_SET(hub_socket, &write_fds); update_hub_activity(); return true; } static void hub_address_looked_up(int rc, struct addrinfo *ai, void *data) { char *hostname = data; hub_lookup = NULL; if (rc != 0) { screen_putf(_("%s: Cannot look up address - %s\n"), quotearg(hostname), gai_strerror(rc)); free(data); return; } hub_set_connected(true); hub_connect((struct sockaddr_in *) ai->ai_addr); free(data); } /* port must be valid */ void hub_new(const char *hostname, uint16_t port) { struct sockaddr_in addr; if (inet_aton(hostname, &addr.sin_addr)) { addr.sin_family = AF_INET; addr.sin_port = htons(port); hub_set_connected(true); hub_connect(&addr); /* Ignore errors */ } else { char portstr[6]; sprintf(portstr, "%" PRIu16, port); screen_putf(_("Looking up IP address for %s\n"), quotearg(hostname)); hub_lookup = add_lookup_request(hostname, portstr, NULL, hub_address_looked_up, xstrdup(hostname)); hub_state = DC_HUB_LOOKUP; } } void hub_connect(struct sockaddr_in *addr) { hub_socket = socket(PF_INET, SOCK_STREAM, 0); if (hub_socket < 0) { warn(_("Cannot create socket - %s\n"), errstr); hub_disconnect(); return; } /* Set non-blocking I/O on socket. */ if (!fd_set_nonblock_flag(hub_socket, true)) { warn(_("Cannot set non-blocking flag - %s\n"), errstr); hub_disconnect(); return; } screen_putf(_("Connecting to hub on %s.\n"), sockaddr_in_str(addr)); if (connect(hub_socket, (struct sockaddr *) addr, sizeof(struct sockaddr_in)) < 0 && errno != EINPROGRESS) { warn(_("%s: Cannot connect - %s\n"), sockaddr_in_str(addr), errstr); hub_disconnect(); return; } if (&hub_addr != addr) hub_addr = *addr; FD_SET(hub_socket, &write_fds); hub_state = DC_HUB_CONNECT; } void hub_disconnect(void) { if (hub_state > DC_HUB_DISCONNECTED) screen_putf(_("Shutting down hub connection.\n")); if (hub_lookup != NULL) { cancel_lookup_request(hub_lookup); hub_lookup = NULL; } if (hub_socket >= 0) { FD_CLR(hub_socket, &read_fds); FD_CLR(hub_socket, &write_fds); if (close(hub_socket) < 0) warn(_("Cannot close socket - %s\n"), errstr); hub_socket = -1; } if (hub_users != NULL) { hmap_foreach_value(hub_users, user_info_free); hmap_clear(hub_users); } if (hub_sendq != NULL) byteq_clear(hub_sendq); if (hub_recvq != NULL) byteq_clear(hub_recvq); hub_recvq_last = 0; if (pending_userinfo != NULL) { hmap_foreach_value(pending_userinfo, user_info_free); hmap_clear(pending_userinfo); } free(hub_name); hub_name = NULL; hub_extensions = 0; hub_state = DC_HUB_DISCONNECTED; update_hub_activity(); } static bool check_state(char *buf, DCUserState state) { if (hub_state != state) { warn(_("Received %s message in wrong state.\n"), strtok(buf, " ")); hub_disconnect(); return false; } return true; } static void parse_hub_extension(const char *ext) { if (strcmp(ext, "NoGetINFO") == 0) { hub_extensions |= HUB_EXT_NOGETINFO; } else if (strcmp(ext, "NoHello") == 0) { hub_extensions |= HUB_EXT_NOHELLO; } } static char * prepare_chat_string_for_display(const char *str) { char *t1, *t2; if (str[0] == '<' && 0 != (t1 = strstr(str, ">\0xA0"))) { // flag for unicode utf8 support *(t1+1) = ' '; } t1 = try_utf8_to_main_string(str); if (t1 == 0) { t1 = hub_to_main_string(str); } t2 = unescape_message(t1); free(t1); /* t1 = unescape_message(str); t2 = hub_to_main_string(t1); free(t1); */ return t2; } static void hub_handle_command(char *buf, uint32_t len) { char *hub_my_nick; /* XXX */ hub_my_nick = main_to_hub_string(my_nick); if (len >= 6 && strncmp(buf, "$Lock ", 6) == 0) { char *key; if (!check_state(buf, DC_HUB_LOCK)) goto hub_handle_command_cleanup; key = memmem(buf+6, len-6, " Pk=", 4); if (key == NULL) { warn(_("Invalid $Lock message: Missing Pk value\n")); key = buf+len; } key = decode_lock(buf+6, key-buf-6, DC_CLIENT_BASE_KEY); if (strleftcmp("EXTENDEDPROTOCOL", buf+6) == 0) { if (!hub_putf("$Supports TTHSearch NoGetINFO NoHello|")) { free(key); goto hub_handle_command_cleanup; } } if (!hub_putf("$Key %s|", key)) { free(key); goto hub_handle_command_cleanup; } free(key); if (!hub_putf("$ValidateNick %s|", hub_my_nick)) goto hub_handle_command_cleanup; hub_state = DC_HUB_HELLO; } else if (len >= 10 && strncmp(buf, "$Supports ", 10) == 0) { char *p0, *p1; hub_extensions = 0; for (p0 = buf+10; (p1 = strchr(p0, ' ')) != NULL; p0 = p1+1) { *p1 = '\0'; parse_hub_extension(p0); } if (*p0 != '\0') parse_hub_extension(p0); } else if (strcmp(buf, "$GetPass") == 0) { if (my_password == NULL) { screen_putf(_("Hub requires password.\n")); hub_disconnect(); goto hub_handle_command_cleanup; } screen_putf(_("Sending password to hub.\n")); if (!hub_putf("$MyPass %s|", my_password)) goto hub_handle_command_cleanup; } else if (strcmp(buf, "$BadPass") == 0) { warn(_("Password not accepted.\n")); hub_disconnect(); } else if (strcmp(buf, "$LogedIn") == 0) { screen_putf(_("You have received operator status.\n")); } else if (len >= 9 && strncmp(buf, "$HubName ", 9) == 0) { free(hub_name); hub_name = hub_to_main_string(buf + 9); screen_putf(_("Hub name is %s.\n"), quotearg(hub_name)); } else if (strcmp(buf, "$GetNetInfo") == 0) { hub_putf("$NetInfo %d$1$%c|", my_ul_slots, is_active ? 'A' : 'P'); } else if (strcmp(buf, "$ValidateDenide") == 0) { if (!check_state(buf, DC_HUB_HELLO)) goto hub_handle_command_cleanup; /* DC++ disconnects immediately if this is received. * But shouldn't we give the client a chance to change the nick? * Also what happens if we receive this when correctly logged in? */ warn(_("Hub did not accept nick. Nick may be in use.\n")); hub_disconnect(); } else if (len >= 7 && strncmp(buf, "$Hello ", 7) == 0) { DCUserInfo *ui; char *conv_nick; conv_nick = hub_to_main_string(buf + 7); if (hub_state == DC_HUB_HELLO) { if (strcmp(buf+7, hub_my_nick) == 0) { screen_putf(_("Nick accepted. You are now logged in.\n")); } else { /* This probably won't happen, but better safe... */ free(my_nick); my_nick = xstrdup(conv_nick); free(hub_my_nick); hub_my_nick = xstrdup(buf + 7); screen_putf(_("Nick accepted but modified to %s. You are now logged in.\n"), quotearg(my_nick)); } ui = user_info_new(conv_nick); ui->info_quered = true; /* Hub is sending this automaticly */ hmap_put(hub_users, ui->nick, ui); free (conv_nick); if (!hub_putf("$Version 1,0091|")) goto hub_handle_command_cleanup; if (!hub_putf("$GetNickList|")) goto hub_handle_command_cleanup; if (!send_my_info()) goto hub_handle_command_cleanup; hub_state = DC_HUB_LOGGED_IN; } else { flag_putf(DC_DF_JOIN_PART, _("User %s logged in.\n"), quotearg(conv_nick)); ui = user_info_new(conv_nick); hmap_put(hub_users, ui->nick, ui); free (conv_nick); if ((hub_extensions & HUB_EXT_NOGETINFO) == 0) { if (!hub_putf("$GetINFO %s %s|", buf+7, hub_my_nick)) goto hub_handle_command_cleanup; ui->info_quered = true; } } } else if (len >= 8 && strncmp(buf, "$MyINFO ", 8) == 0) { DCUserInfo *ui; char *token; uint32_t len; char* conv_buf; char *work_buf; buf += 8; work_buf = conv_buf = hub_to_main_string(buf); token = strsep(&work_buf, " "); if (strcmp(token, "$ALL") != 0) { warn(_("Invalid $MyINFO message: Missing $ALL parameter, ignoring\n")); free(conv_buf); goto hub_handle_command_cleanup; } token = strsep(&work_buf, " "); if (token == NULL) { warn(_("Invalid $MyINFO message: Missing nick parameter, ignoring\n")); free(conv_buf); goto hub_handle_command_cleanup; } ui = hmap_get(hub_users, token); if (ui == NULL) { /* * if the full buf has not been converted from hub to local charset, * we should try to convert nick only */ /* char *conv_nick = hub_to_main_string(token); if ((ui = hmap_get(hub_users, conv_nick)) == NULL) { */ ui = user_info_new(token); ui->info_quered = true; hmap_put(hub_users, ui->nick, ui); /* } free(conv_nick); */ } token = strsep(&work_buf, "$"); if (token == NULL) { warn(_("Invalid $MyINFO message: Missing description parameter, ignoring\n")); free(conv_buf); goto hub_handle_command_cleanup; } free(ui->description); ui->description = xstrdup(token); token = strsep(&work_buf, "$"); if (token == NULL) { warn(_("Invalid $MyINFO message: Missing description separator, ignoring\n")); free(conv_buf); goto hub_handle_command_cleanup; } token = strsep(&work_buf, "$"); if (token == NULL) { warn(_("Invalid $MyINFO message: Missing connection speed, ignoring\n")); free(conv_buf); goto hub_handle_command_cleanup; } len = strlen(token); free(ui->speed); if (len == 0) { ui->speed = xstrdup(""); ui->level = 0; /* XXX: or 1? acceptable level? */ } else { ui->speed = xstrndup(token, len-1); ui->level = token[len-1]; } token = strsep(&work_buf, "$"); if (token == NULL) { warn(_("Invalid $MyINFO message: Missing e-mail address, ignoring\n")); free(conv_buf); goto hub_handle_command_cleanup; } free(ui->email); ui->email = xstrdup(token); token = strsep(&work_buf, "$"); if (token == NULL) { warn(_("Invalid $MyINFO message: Missing share size, ignoring\n")); free(conv_buf); goto hub_handle_command_cleanup; } if (!parse_uint64(token, &ui->share_size)) { warn(_("Invalid $MyINFO message: Invalid share size, ignoring\n")); free(conv_buf); goto hub_handle_command_cleanup; } if (ui->active_state == DC_ACTIVE_RECEIVED_PASSIVE || ui->active_state == DC_ACTIVE_KNOWN_ACTIVE) ui->active_state = DC_ACTIVE_UNKNOWN; /* XXX: Now that user's active_state may have changed, try queue again? */ free(conv_buf); } else if (strcmp(buf, "$HubIsFull") == 0) { warn(_("Hub is full.\n")); /* DC++ does not disconnect immediately. So I guess we won't either. */ /* Maybe we should be expecting an "hub follow" message? */ /* hub_disconnect(); */ } else if (len >= 3 && (buf[0] == '<' || strncmp(buf, " * ", 3) == 0)) { char *head; char *tail; char *msg; bool first = true; /* int scrwidth; size_t firstlen; size_t otherlen; screen_get_size(NULL, &scrwidth); firstlen = scrwidth - strlen(_("Public:")); otherlen = scrwidth - strlen(_(" | ")); */ msg = prepare_chat_string_for_display(buf); for (head = msg; (tail = strchr(head, '\n')) != NULL; head = tail+1) { /*PtrV *wrapped;*/ if (tail[-1] == '\r') /* end > buf here, buf[0] == '<' or ' ' */ tail[-1] = '\0'; else tail[0] = '\0'; /*wrapped = wordwrap(quotearg(buf), first ? firstlen : otherlen, otherlen); for (c = 0; c < wrapped->cur; c++) flag_putf(DC_DF_PUBLIC_CHAT, first ? _("Public: %s\n") : _(" | %s\n"), ); ptrv_foreach(wrapped, free); ptrv_free(wrapped);*/ flag_putf(DC_DF_PUBLIC_CHAT, first ? _("Public: %s\n") : _(" | %s\n"), quotearg(head)); first = false; } flag_putf(DC_DF_PUBLIC_CHAT, first ? _("Public: %s\n") : _(" | %s\n"), quotearg(head)); free(msg); } else if (len >= 5 && strncmp(buf, "$To: ", 5) == 0) { char *msg; char *tail; char *frm; char *head; bool first = true; msg = strchr(buf+5, '$'); if (msg == NULL) { warn(_("Invalid $To message: Missing text separator, ignoring\n")); goto hub_handle_command_cleanup; } *msg = '\0'; msg++; /* FIXME: WTF is this? Remove multiple "From: "? Why!? */ frm = buf+5; while ((tail = strstr(msg, "From: ")) != NULL && tail < msg) frm = tail+6; msg = prepare_chat_string_for_display(msg); frm = prepare_chat_string_for_display(frm); for (head = msg; (tail = strchr(head, '\n')) != NULL; head = tail+1) { if (tail[-1] == '\r') /* tail > buf here because head[0] == '<' or ' ' */ tail[-1] = '\0'; else tail[0] = '\0'; if (first) { screen_putf(_("Private: [%s] %s\n"), quotearg_n(0, frm), quotearg_n(1, head)); first = false; } else { screen_putf(_(" | %s\n"), quotearg(head)); } } if (first) { screen_putf(_("Private: [%s] %s\n"), quotearg_n(0, frm), quotearg_n(1, head)); } else { screen_putf(_(" | %s\n"), quotearg(head)); } free(msg); free(frm); } else if (len >= 13 && strncmp(buf, "$ConnectToMe ", 13) == 0) { struct sockaddr_in addr; buf += 13; if (strsep(&buf, " ") == NULL) { warn(_("Invalid $ConnectToMe message: Missing or invalid nick\n")); goto hub_handle_command_cleanup; } if (!parse_ip_and_port(buf, &addr, 0)) { warn(_("Invalid $ConnectToMe message: Invalid address specification.\n")); goto hub_handle_command_cleanup; } flag_putf(DC_DF_CONNECTIONS, _("Connecting to user on %s\n"), sockaddr_in_str(&addr)); user_connection_new(&addr, -1); } else if (len >= 16 && strncmp(buf, "$RevConnectToMe ", 16) == 0) { char *nick; char *local_nick; DCUserInfo *ui; nick = strtok(buf+16, " "); if (nick == NULL) { warn(_("Invalid $RevConnectToMe message: Missing nick parameter\n")); goto hub_handle_command_cleanup; } if (strcmp(nick, hub_my_nick) == 0) { warn(_("Invalid $RevConnectToMe message: Remote nick is our nick\n")); goto hub_handle_command_cleanup; } local_nick = hub_to_main_string(nick); ui = hmap_get(hub_users, local_nick); if (ui == NULL) { warn(_("Invalid $RevConnectToMe message: Unknown user %s, ignoring\n"), quotearg(local_nick)); free(local_nick); goto hub_handle_command_cleanup; } free(local_nick); if (ui->conn_count >= DC_USER_MAX_CONN) { warn(_("No more connections to user %s allowed.\n"), quotearg(ui->nick)); goto hub_handle_command_cleanup; } if (!is_active) { if (ui->active_state == DC_ACTIVE_SENT_PASSIVE) { warn(_("User %s is also passive. Cannot establish connection.\n"), quotearg(ui->nick)); /* We could set this to DC_ACTIVE_UNKNOWN too. This would mean * we would keep sending RevConnectToMe next time the download * queue is modified or some timer expired and told us to retry * download. The remote would then send back RevConnectToMe * and this would happen again. This way we would try again - * maybe remote has become active since last time we checked? * But no - DC++ only replies with RevConnectToMe to our first * RevConnectToMe. After that it ignores them all. */ ui->active_state = DC_ACTIVE_RECEIVED_PASSIVE; if (hmap_remove(pending_userinfo, ui->nick) != NULL) ui->refcount--; goto hub_handle_command_cleanup; } if (ui->active_state != DC_ACTIVE_RECEIVED_PASSIVE) { /* Inform remote that we are also passive. */ if (!hub_putf("$RevConnectToMe %s %s|", hub_my_nick, nick)) goto hub_handle_command_cleanup; } } ui->active_state = DC_ACTIVE_RECEIVED_PASSIVE; if (!hub_connect_user(ui)) goto hub_handle_command_cleanup; } else if ( (len >= 10 && strncmp(buf, "$NickList ", 10) == 0) || (len >= 8 && strncmp(buf, "$OpList ", 8) == 0) ) { char *nick; char *end; int oplist; char *conv_nick; if ( strncmp(buf, "$NickList ", 10) == 0) { nick = buf + 10; oplist = 0; }else { nick = buf + 8; oplist = 1; } for (; (end = strstr(nick, "$$")) != NULL; nick = end+2) { DCUserInfo *ui; *end = '\0'; conv_nick = hub_to_main_string(nick); ui = hmap_get(hub_users, conv_nick); if (ui == NULL) { ui = user_info_new(conv_nick); hmap_put(hub_users, ui->nick, ui); } free(conv_nick); if (!ui->info_quered && (hub_extensions & HUB_EXT_NOGETINFO) == 0) { if (!hub_putf("$GetINFO %s %s|", nick, hub_my_nick)) { goto hub_handle_command_cleanup; } ui->info_quered = true; } if (oplist) ui->is_operator = true; } } else if (len >= 6 && strncmp(buf, "$Quit ", 6) == 0) { DCUserInfo *ui; char *conv_nick = hub_to_main_string(buf+6); flag_putf(DC_DF_JOIN_PART, "User %s quits.\n", quotearg(conv_nick)); ui = hmap_remove(hub_users, conv_nick); if (ui == NULL) { /* Some hubs print quit messages for users that never joined, * so print this as debug only. */ flag_putf(DC_DF_DEBUG, _("Invalid $Quit message: Unknown user %s.\n"), quotearg(conv_nick)); } else user_info_free(ui); free(conv_nick); } else if (len >= 8 && strncmp(buf, "$Search ", 8) == 0) { char *source; int parse_result = 0; DCSearchSelection sel; sel.patterns = NULL; buf += 8; source = strsep(&buf, " "); if (source == NULL) { warn(_("Invalid $Search message: Missing source specification.\n")); goto hub_handle_command_cleanup; } /* charset handling is in parse_search_selection */ parse_result = parse_search_selection(buf, &sel); if (parse_result != 1) { if (sel.patterns != NULL) { int i = 0; for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } if (parse_result == 0) warn(_("Invalid $Search message: %s: Invalid search specification.\n"), buf); goto hub_handle_command_cleanup; } if (strncmp(source, "Hub:", 4) == 0) { DCUserInfo *ui; char *conv_nick = hub_to_main_string(source+4); ui = hmap_get(hub_users, conv_nick); if (ui == NULL) { warn(_("Invalid $Search message: Unknown user %s.\n"), quotearg(conv_nick)); if (sel.patterns != NULL) { int i = 0; for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } free(conv_nick); goto hub_handle_command_cleanup; } free(conv_nick); if (strcmp(ui->nick, my_nick) == 0) { if (sel.patterns != NULL) { int i = 0; for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } goto hub_handle_command_cleanup; } perform_inbound_search(&sel, ui, NULL); if (sel.patterns != NULL) { int i = 0; for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } } else { struct sockaddr_in addr; if (!parse_ip_and_port(source, &addr, DC_CLIENT_UDP_PORT)) { warn(_("Invalid $Search message: Invalid address specification.\n")); if (sel.patterns != NULL) { int i = 0; for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } goto hub_handle_command_cleanup; } if (local_addr.sin_addr.s_addr == addr.sin_addr.s_addr && listen_port == ntohs(addr.sin_port)) { if (sel.patterns != NULL) { int i = 0; for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } goto hub_handle_command_cleanup; } perform_inbound_search(&sel, NULL, &addr); if (sel.patterns != NULL) { int i = 0; for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } } } else if (len >= 4 && strncmp(buf, "$SR ", 4) == 0) { handle_search_result(buf, len); } else if (len == 0) { /* Ignore empty commands. */ } hub_handle_command_cleanup: free(hub_my_nick); } /* This function is called by handle_connection_fd_event when there is input * available on the connection socket. */ void hub_input_available(void) { int start = 0; int c; int res; res = byteq_read(hub_recvq, hub_socket); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, false, _("hub")); hub_disconnect(); return; } for (c = hub_recvq_last; c < hub_recvq->cur; c++) { if (hub_recvq->buf[c] == '|') { /* Got a complete command. */ if (c - start > 0) dump_command(_("<--"), hub_recvq->buf + start, c - start + 1); hub_recvq->buf[c] = '\0'; /* Just to be on the safe side... */ hub_handle_command(hub_recvq->buf + start, c - start); start = c+1; if (hub_socket < 0) return; } } if (start != 0) byteq_remove(hub_recvq, start); hub_recvq_last = hub_recvq->cur; update_hub_activity(); } void hub_now_writable(void) { if (hub_state == DC_HUB_CONNECT) { int error; socklen_t size = sizeof(error); socklen_t addr_len; if (getsockopt(hub_socket, SOL_SOCKET, SO_ERROR, &error, &size) < 0) { warn(_("Cannot get error status - %s\n"), errstr); hub_disconnect(); return; } if (error != 0) { /* The connect call on the socket failed. */ warn(_("Cannot connect - %s\n"), strerror(error) /* not errno! */); /* XXX: need to know hub address to put in error message */ hub_disconnect(); return; } addr_len = sizeof(local_addr); if (getsockname(hub_socket, (struct sockaddr *) &local_addr, &addr_len) < 0) { warn(_("Cannot get socket address - %s\n"), errstr); hub_disconnect(); return; } if (force_listen_addr.s_addr != INADDR_NONE) local_addr.sin_addr = force_listen_addr; screen_putf(_("Connected to hub from %s.\n"), sockaddr_in_str(&local_addr)); update_hub_activity(); FD_CLR(hub_socket, &write_fds); FD_SET(hub_socket, &read_fds); hub_state = DC_HUB_LOCK; } else { int res; if (hub_sendq->cur > 0) { res = byteq_write(hub_sendq, hub_socket); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, true, _("hub")); hub_disconnect(); return; } } if (hub_sendq->cur == 0) FD_CLR(hub_socket, &write_fds); } } /* This function tries to make a connection to a user, or ask them to * connect to us. * * Before calling this function, make sure we are not connected to the * user already. * * This function makes sure an unanswerred (Rev)ConnectToMe hasn't been * sent previously. * * This function is the only place that is allowed to send $ConnectToMe. * $RevConnectToMe may be set by one other place (when $RevConnectToMe * was received and we did not previously send $RevConnectToMe). */ bool hub_connect_user(DCUserInfo *ui) { char *hub_my_nick; char *hub_ui_nick; bool connect = false; hub_my_nick = main_to_hub_string(my_nick); hub_ui_nick = main_to_hub_string(ui->nick); if (is_active) { if (ui->active_state == DC_ACTIVE_SENT_ACTIVE) { warn(_("ConnectToMe already sent to user %s. Waiting.\n"), ui->nick); connect = true; goto cleanup; } if (!hub_putf("$ConnectToMe %s %s:%u|", hub_ui_nick, inet_ntoa(local_addr.sin_addr), listen_port)) goto cleanup; ui->active_state = DC_ACTIVE_SENT_ACTIVE; } else { if (ui->active_state == DC_ACTIVE_SENT_PASSIVE) { warn(_("RevConnectToMe already sent to user %s. Waiting.\n"), quotearg(ui->nick)); connect = true; goto cleanup; } if (ui->active_state == DC_ACTIVE_RECEIVED_PASSIVE) { warn(_("User %s is also passive. Cannot communicate.\n"), quotearg(ui->nick)); connect = true; goto cleanup; } if (!hub_putf("$RevConnectToMe %s %s|", hub_my_nick, hub_ui_nick)) { goto cleanup; } ui->active_state = DC_ACTIVE_SENT_PASSIVE; } /* hmap_put returns the old value */ if (hmap_put(pending_userinfo, ui->nick, ui) == NULL) ui->refcount++; connect = true; cleanup: free(hub_ui_nick); free(hub_my_nick); return connect; } void hub_reload_users() { if (hub_putf("$GetNickList|")) { if (hub_users != NULL) { hmap_foreach_value(hub_users, user_info_free); hmap_clear(hub_users); } } } microdc2-0.15.6/src/huffman.c0100644000076500007500000002074110527012173015733 0ustar chugunovmicrodc/* huffman.c - Encoding and decoding of huffman data * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* Gnulib/POSIX/C99 */ #include /* C89 */ #include /* C89 */ #include "xalloc.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/error.h" #include "common/strbuf.h" #include "common/ptrv.h" #include "common/comparison.h" #include "microdc.h" #define BIT_POS_INIT(pos) ((pos)*8) #define GET_BIT(data,pos) (data[(pos)/8] & (1 << ((pos)%8))) #define SET_BIT(data,pos) (data[(pos)/8] |= (1 << ((pos)%8))) #define BYTE_BOUNDARY(pos) (((pos) + 7) & ~7) typedef struct _BranchNode BranchNode; typedef struct _LeafNode LeafNode; typedef struct _EncodeNode EncodeNode; typedef struct _BitsNode BitsNode; struct _BitsNode { uint32_t data; uint8_t bitcount; }; struct _EncodeNode { uint32_t count; EncodeNode *left; EncodeNode *right; uint8_t value; }; struct _BranchNode { BranchNode *left; BranchNode *right; int16_t chr; }; struct _LeafNode { uint8_t chr; uint8_t len; }; /* Allocate a new branch node for use in the Huffman decompression code. */ static BranchNode * new_branch_node(void) { BranchNode *node; node = xmalloc(sizeof(BranchNode)); node->left = NULL; node->right = NULL; node->chr = -1; return node; } /* Free branch node used in the Huffman decompression code. */ static void free_branch_node(BranchNode *node) { if (node != NULL) { free_branch_node(node->left); free_branch_node(node->right); free(node); } } static void free_encode_node(EncodeNode *node) { if (node != NULL) { free_encode_node(node->left); free_encode_node(node->right); free(node); } } static int compare_encode_node(EncodeNode *a, EncodeNode *b) { if (a->count != b->count) return a->count - b->count; if (a->left == NULL && b->left == NULL) return -1; if (a->left == NULL) return -1; return 1; } static void make_huffman_bits(BitsNode bitnodes[256], EncodeNode *node, uint32_t bitcount, uint32_t data) { if (node->left != NULL) { make_huffman_bits(bitnodes, node->left, bitcount+1, (data<<1) | 0); make_huffman_bits(bitnodes, node->right, bitcount+1, (data<<1) | 1); } else { bitnodes[node->value].bitcount = bitcount; bitnodes[node->value].data = data; } } static void add_bits(uint8_t *data, uint64_t *bit_pos, uint32_t bits, uint8_t bitcount) { uint32_t c; for (c = 0; c < bitcount; c++) { if ((bits >> (bitcount-c-1)) & 1) SET_BIT(data, *bit_pos); (*bit_pos) ++; } } char * huffman_encode(const uint8_t *data, uint32_t data_size, uint32_t *out_size) { uint32_t c; uint32_t counts[256]; BitsNode bitnodes[256]; EncodeNode *rootnode; uint8_t parity; StrBuf *out; uint16_t distinctchars = 0; PtrV *tree; uint64_t bits; uint64_t keybits; uint64_t bit_pos; uint8_t *bitdata; if (data_size == 0) { char *outdata = xmemdup("HE3\xD\0\0\0\0\0\0\0", 11); *out_size = 11; return outdata; } tree = ptrv_new(); memset(counts, 0, sizeof(counts)); for (c = 0; c < data_size; c++) counts[data[c]]++; for (c = 0; c < 256; c++) { if (counts[c] > 0) { EncodeNode *node; node = xmalloc(sizeof(EncodeNode)); node->count = counts[c]; node->left = NULL; node->right = NULL; node->value = c; ptrv_insort(tree, node, (comparison_fn_t) compare_encode_node); distinctchars++; } } while (tree->cur > 1) { EncodeNode *node; node = xmalloc(sizeof(EncodeNode)); node->left = ptrv_remove_first(tree); node->right = ptrv_remove_first(tree); node->count = node->left->count + node->right->count; node->value = 0; ptrv_insort(tree, node, (comparison_fn_t) compare_encode_node); } rootnode = ptrv_remove_first(tree); ptrv_free(tree); memset(bitnodes, 0, sizeof(bitnodes)); make_huffman_bits(bitnodes, rootnode, 0, 0); parity = 0; for (c = 0; c < data_size; c++) parity ^= data[c]; out = strbuf_new(); strbuf_append(out, "HE3\xD"); strbuf_append_char(out, parity); strbuf_append_data(out, &data_size, sizeof(uint32_t)); strbuf_append_data(out, &distinctchars, sizeof(uint16_t)); bits = 0; keybits = 0; for (c = 0; c < 256; c++) { if (counts[c] != 0) { strbuf_append_char(out, c); strbuf_append_char(out, bitnodes[c].bitcount); bits += bitnodes[c].bitcount * counts[c]; keybits += bitnodes[c].bitcount; } } bits = BYTE_BOUNDARY(bits) + BYTE_BOUNDARY(keybits); bitdata = (uint8_t *)calloc(1, bits/8); if (!bitdata) return NULL; bit_pos = 0; for (c = 0; c < 256; c++) { if (counts[c] != 0) add_bits(bitdata, &bit_pos, bitnodes[c].data, bitnodes[c].bitcount); } bit_pos = BYTE_BOUNDARY(bit_pos); for (c = 0; c < data_size; c++) { int ch = data[c]; add_bits(bitdata, &bit_pos, bitnodes[ch].data, bitnodes[ch].bitcount); } strbuf_append_data(out, bitdata, bits/8); free_encode_node(rootnode); *out_size = strbuf_length(out); free(bitdata); return strbuf_free_to_string(out); } /* Decompress a Huffman compressed stream of data. * The returned string should be freed with free. */ char * huffman_decode(const uint8_t *data, uint32_t data_size, uint32_t *out_size) { uint32_t data_pos; uint32_t unpack_size; uint16_t leaf_count; uint8_t *output; uint32_t output_pos; uint32_t bit_pos; uint32_t leaf_data_len; uint8_t parity; BranchNode *root; int c; if (data_size < 11) return NULL; if (data[0] != 'H' || data[1] != 'E') return NULL; if (data[2] != '3' && data[2] != '0') return NULL; unpack_size = *(uint32_t *) (data+5); leaf_count = *(uint16_t *) (data+9); if (data_size < 11 + leaf_count*2) return NULL; LeafNode leaves[leaf_count]; data_pos = 11; leaf_data_len = 0; for (c = 0; c < leaf_count; c++) { leaves[c].chr = data[data_pos++]; leaves[c].len = data[data_pos++]; leaf_data_len += leaves[c].len; } if (data_size < data_pos + BYTE_BOUNDARY(leaf_data_len)/8) return NULL; root = new_branch_node(); bit_pos = BIT_POS_INIT(data_pos); for (c = 0; c < leaf_count; c++) { BranchNode *node = root; int d; for (d = 0; d < leaves[c].len; d++) { if (GET_BIT(data, bit_pos)) { if (node->right == NULL) node->right = new_branch_node(); node = node->right; } else { if (node->left == NULL) node->left = new_branch_node(); node = node->left; } bit_pos++; } node->chr = leaves[c].chr; } bit_pos = BYTE_BOUNDARY(bit_pos); output = xmalloc(unpack_size+1); output_pos = 0; parity = 0; for (c = 0; c < unpack_size; c++) { BranchNode *node = root; while (node->chr == -1) { if (BYTE_BOUNDARY(bit_pos)/8 > data_size) { free(output); return NULL; } if (GET_BIT(data, bit_pos)) { node = node->right; } else { node = node->left; } bit_pos++; if (node == NULL) { free(output); free_branch_node(root); return NULL; } } output[output_pos++] = node->chr; parity ^= node->chr; } output[output_pos] = '\0'; if (parity != data[4]) warn(_("Incorrect parity, ignoring\n")); free_branch_node(root); if (out_size != NULL) *out_size = unpack_size; return (char *) output; } microdc2-0.15.6/src/local_flist.c0100664000076500007500000011060510536475542016620 0ustar chugunovmicrodc#include #include /* ? */ #include #include #include #include #include #include #include #include #include #include /* ? */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "xvasprintf.h" /* Gnulib */ #include "xalloc.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "human.h" /* Gnulib */ #include "minmax.h" /* Gnulib */ #include "dirname.h" /* Gnulib */ #include "common/msgq.h" #include "common/byteq.h" #include "microdc.h" //#define _TRACE #if defined(_TRACE) #define TRACE(x) printf x; fflush(stdout); #else #define TRACE(x) #endif /* hash.c */ extern MsgQ *hash_request_mq; extern MsgQ *hash_result_mq; extern pid_t hash_child; bool hash_init(void); void hash_finish(void); typedef enum { FILELIST_UPDATE_COMPLETE = 0, /* RESPONSE ONLY complete filelist - we have to replace the previous one (if any) with a new one */ FILELIST_UPDATE_ADD_DIR_NAME, /* REQUEST/RESPONSE insert the new shared directory to the directory list */ FILELIST_UPDATE_DEL_DIR_NAME, /* REQUEST/RESPONSE remove the shared directory from the directory list */ FILELIST_UPDATE_STATUS, /* RESPONSE ONLY report the status to the main application */ FILELIST_UPDATE_ERROR, /* RESPONSE ONLY report the error to the main application */ FILELIST_UPDATE_LISTING_DIR, /* REQUEST ONLY main application informs about listing_dir change */ FILELIST_UPDATE_MAIN_CHARSET, /* REQUEST ONLY main application informs about main_charset change */ FILELIST_UPDATE_HUB_CHARSET, /* REQUEST ONLY main application informs about hub_charset change */ FILELIST_UPDATE_FS_CHARSET, /* REQUEST ONLY main application informs about fs_charset change */ FILELIST_UPDATE_REFRESH_INTERVAL, /* REQUEST ONLY main application informs about filelist_refresh_timeout change */ FILELIST_UPDATE_INSERT, /* RESPONSE ONLY NOT USED add new entries to the existing filelist */ FILELIST_UPDATE_DELETE, /* RESPONSE ONLY NOT USED delete the entries from the existing filelist */ } UpdateType; time_t filelist_refresh_timeout = 600; time_t filelist_hash_refresh_timeout = 600; MsgQ *update_request_mq = NULL; MsgQ *update_result_mq = NULL; pid_t update_child; int incoming_update_type = -1; char* update_status = NULL; static const char* filelist_name = "filelist"; static const char* new_filelist_name = "new-filelist"; static const char* filelist_prefix = "new-"; static const uint32_t filelist_signature = ('M') | ('D' << 8) | ('C' << 16) | ('2' << 24); static const uint32_t filelist_min_supported_version = 1; static const uint32_t filelist_max_supported_version = 1; #define ENOTFILELIST (1 << 16) #define EWRONGVERSION (ENOTFILELIST + 1) int compare_pointers(void* p1, void* p2) { return p1 != p2; } bool is_already_shared_inode(DCFileList* root, dev_t dev, ino_t ino) { HMapIterator it; bool result = false; if (root->dir.real_path != NULL) { struct stat st; if (stat(root->dir.real_path, &st) < 0) { /* fprintf(stderr, "cannot stat %s\n", root->dir.real_path); */ } else if (dev == st.st_dev && ino == st.st_ino) { /* this directory is already in the our filelist */ return true; } } hmap_iterator(root->dir.children, &it); while (it.has_next(&it) && !result) { DCFileList *node = it.next(&it); if (node->type == DC_TYPE_DIR) { result = is_already_shared_inode(node, dev, ino); } } return result; } bool is_already_shared(DCFileList* root, const char* dir) { struct stat st; if (stat(dir, &st) < 0) { /* fprintf(stderr, "cannot stat %s\n", root->dir.real_path); */ return false; } return is_already_shared_inode(root, st.st_dev, st.st_ino); } DCFileList* read_local_file_list(const char* path) { struct stat st; DCFileList *root = NULL; if (stat(path, &st) < 0) { if (errno != ENOENT) { TRACE(("cannot stat %s: %d, %s\n", path, errno, errstr)); return NULL; } } else if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) { return NULL; } int fd = open(path, O_RDONLY); if (fd >= 0) { void* mapped = mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); unsigned char* data = mapped; if (*((uint32_t*)data) != filelist_signature) { errno = ENOTFILELIST; } else { data += sizeof(uint32_t); if (*((uint32_t*)data) < filelist_min_supported_version || *((uint32_t*)data) > filelist_max_supported_version) { errno = EWRONGVERSION; } else { data += sizeof(uint32_t); data_to_filelist(data, &root); } } munmap(mapped, st.st_size); close(fd); } else { // file not found - just create empty root root = new_file_node("", DC_TYPE_DIR, NULL); } return root; } bool write_local_file_list(const char* path, DCFileList* root) { bool result = false; int fd = open(path, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); if (fd >= 0) { unsigned char* data = NULL; size_t data_size = 0; size_t offset = 0; size_t size = sizeof(filelist_signature); if (write(fd, &filelist_signature, sizeof(filelist_signature)) != sizeof(filelist_signature) || write(fd, &filelist_max_supported_version, sizeof(filelist_max_supported_version)) != sizeof(filelist_max_supported_version)) goto cleanup; filelist_to_data(root, (void**)&data, &data_size); offset = 0; size = data_size; /* do { size_t written = write(fd, data + offset, size); if (written >= 0) { offset += written; size -= written; } } while ((size < data_size) && (errno == 0 || errno == EAGAIN || errno == EINTR)); */ size = write(fd, data + offset, size); free(data); result = (size == data_size); cleanup: close(fd); } return result; } /* translate file name from filesystem charset to main charset */ static void fs_to_main_filelist(DCFileList* node) { HMapIterator it; hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *child = it.next(&it); char* main_name = fs_to_main_string(child->name); rename_node(child, main_name); free(main_name); if (child->type == DC_TYPE_DIR) { fs_to_main_filelist(child); } } } static bool lookup_filelist_changes(DCFileList* node, PtrV* hash_files) { struct stat st; bool result = false; /* initially no chages detected */ HMapIterator it; if (node->type == DC_TYPE_DIR) { if (node->dir.real_path != NULL) { PtrV* deleted = NULL; int i; struct dirent *ep = NULL; DIR *dp = NULL; hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *child = it.next(&it); char* fullname = catfiles(node->dir.real_path, child->name); if (stat(fullname, &st) < 0) { if (errno == ENOENT) { /* file was removed we have to delete from the file list */ if (deleted == NULL) { deleted = ptrv_new(); } ptrv_append(deleted, child->name); } } free(fullname); } if (deleted != NULL) { for (i = 0; i < deleted->cur; i++) { DCFileList* child = hmap_remove(node->dir.children, (const char*)deleted->buf[i]); node->size -= child->size; /* TRACE((stderr, "removing 0x%08X (%s)\n", child, child == NULL ? "null" : child->name)); */ filelist_free(child); result = true; } ptrv_free(deleted); deleted = NULL; } /* now we are looking for new items */ dp = opendir(node->dir.real_path); if (dp != NULL) { while ((ep = xreaddir(dp)) != NULL) { char* fullname; DCFileList* child; if (IS_SPECIAL_DIR(ep->d_name)) continue; fullname = catfiles(node->dir.real_path, ep->d_name); if (stat(fullname, &st) < 0) { /* fprintf(stderr, "%s: Cannot get file status - %s\n", fullname, errstr); */ free(fullname); continue; } child = hmap_get(node->dir.children, ep->d_name); if (child != NULL) { if (child->type == DC_TYPE_REG) { if (st.st_mtime != child->reg.mtime || child->size != st.st_size) { child->reg.has_tth = false; child->reg.mtime = st.st_mtime; child->size = st.st_size; if (ptrv_find(hash_files, child, (comparison_fn_t)compare_pointers) < 0) { ptrv_append(hash_files, child); result = true; } } else if (child->reg.has_tth == 0) { if (ptrv_find(hash_files, child, (comparison_fn_t)compare_pointers) < 0) { ptrv_append(hash_files, child); } } } } else { result = true; if (S_ISDIR(st.st_mode)) { child = new_file_node(ep->d_name, DC_TYPE_DIR, node); child->dir.real_path = fullname; fullname = NULL; } else if (S_ISREG(st.st_mode)) { child = new_file_node(ep->d_name, DC_TYPE_REG, node); child->size = st.st_size; child->reg.has_tth = 0; memset(child->reg.tth, 0, sizeof(child->reg.tth)); child->reg.mtime = st.st_mtime; if (ptrv_find(hash_files, child, (comparison_fn_t)compare_pointers) < 0) { ptrv_append(hash_files, child); /* TRACE(stderr, "adding %s for hashing\n", fullname); */ } else { assert(false); } } } if (fullname != NULL) free(fullname); } closedir(dp); } } node->size = 0; hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *child = it.next(&it); if (child->type == DC_TYPE_DIR) { // nanosleep here /* pause.tv_sec = 0; pause.tv_nsec = 1000000; nanosleep(&pause, &remain); */ bool r = lookup_filelist_changes(child, hash_files); result = result || r; } node->size += child->size; } } /* TRACE((stderr, "%s returns %s\n", __FUNCTION__, result ? "true" : "false")); */ return result; } bool report_status(MsgQ* status_mq, const char* fmt, ...) { char* msg = NULL; va_list args; if (fmt != NULL) { va_start(args, fmt); msg = xvasprintf(fmt, args); va_end(args); } msgq_put(status_mq, MSGQ_INT, FILELIST_UPDATE_STATUS, MSGQ_END); msgq_put(status_mq, MSGQ_STR, msg, MSGQ_END); free(msg); if (msgq_write_all(status_mq) < 0) { /* fprintf(stderr, "status queue msgq_write_all error\n"); fflush(stderr); */ return false; } return true; } bool report_error(MsgQ* status_mq, const char* fmt, ...) { char* msg = NULL; va_list args; va_start(args, fmt); msg = xvasprintf(fmt, args); va_end(args); msgq_put(status_mq, MSGQ_INT, FILELIST_UPDATE_ERROR, MSGQ_END); msgq_put(status_mq, MSGQ_STR, msg, MSGQ_END); free(msg); if (msgq_write_all(status_mq) < 0) { /* fprintf(stderr, "status queue msgq_write_all error\n"); fflush(stderr); */ return false; } return true; } bool send_filelist(MsgQ* status_mq, DCFileList* root) { void *data; size_t size; write_filelist_file(root, filelist_prefix); msgq_put(status_mq, MSGQ_INT, FILELIST_UPDATE_COMPLETE, MSGQ_END); filelist_to_data(root, &data, &size); msgq_put(status_mq, MSGQ_BLOB, data, size, MSGQ_END); free(data); if (msgq_write_all(status_mq) < 0) { return false; } return true; } DCFileList* hash_request(PtrV* hash_files, MsgQ* request_mq, MsgQ* status_mq) { DCFileList* hashing = NULL; if (hash_files->cur > 0) { char* filename; hashing = hash_files->buf[0]; filename = catfiles(hashing->parent->dir.real_path, hashing->name); msgq_put(request_mq, MSGQ_STR, filename, MSGQ_END); //TRACE(("%s:%d: request hash for %s (%s)\n", __FUNCTION__, __LINE__, hashing->name, filename)); if (msgq_write_all(request_mq) < 0) { /* fprintf(stderr, "hash queue msgq_write_all error\n"); fflush(stderr); */ hashing = NULL; } report_status(status_mq, "Calculating TTH for %s", filename); free(filename); } return hashing; } static void __attribute__((noreturn)) local_filelist_update_main(int request_fd[2], int result_fd[2]) { PtrV *hash_files = NULL; DCFileList *hashing = NULL; time_t hash_start = 0; bool update_hash = false; bool initial = true; MsgQ *request_mq; MsgQ *result_mq; struct sigaction sigact; fd_set readable, writable; int max_fd = -1; struct timeval tv; DCFileList *root = NULL; /*HMapIterator it;*/ char* flist_filename = NULL, *new_flist_filename = NULL; int update_type = -1; close(request_fd[1]); close(result_fd[0]); request_mq = msgq_new(request_fd[0]); result_mq = msgq_new(result_fd[1]); hash_files = ptrv_new(); if (!hash_init()) { goto cleanup; } /* Inability to register these signals is not a fatal error. */ sigact.sa_flags = SA_RESTART; sigact.sa_handler = SIG_IGN; #ifdef HAVE_STRUCT_SIGACTION_SA_RESTORER sigact.sa_restorer = NULL; #endif sigaction(SIGINT, &sigact, NULL); sigaction(SIGTERM, &sigact, NULL); sigaction(SIGUSR1, &sigact, NULL); sigaction(SIGCHLD, &sigact, NULL); sigaction(SIGPIPE, &sigact, NULL); FD_ZERO(&readable); FD_ZERO(&writable); if (!get_package_file(filelist_name, &flist_filename) || !get_package_file(new_filelist_name, &new_flist_filename)) { goto cleanup; } if (NULL == (root = read_local_file_list(flist_filename))) { if (errno == ENOTFILELIST) { report_error(result_mq, "Cannot load FileList - %s: Invalid file format\n", flist_filename); } else if (errno == EWRONGVERSION) { report_error(result_mq, "Cannot load FileList - %s: Version isn't supported\n", flist_filename); } else { report_error(result_mq, "Cannot load FileList - %s: %s\n", flist_filename, errstr); } goto cleanup; } if (!send_filelist(result_mq, root)) { goto cleanup; } // now we start monitoring the shared directories update_type = -1; FD_SET(request_mq->fd, &readable); max_fd = request_mq->fd; FD_SET(hash_result_mq->fd, &readable); max_fd = MAX(hash_result_mq->fd, max_fd); while (true) { tv.tv_sec = filelist_refresh_timeout; tv.tv_usec = 0; fd_set r_ready = readable, w_ready = writable; int selected = 0; if (!initial) { selected = select(max_fd+1, &r_ready, &w_ready, NULL, &tv); } else { initial = false; } if (selected > 0) { if (FD_ISSET(hash_result_mq->fd, &r_ready)) { int res = msgq_read(hash_result_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { /* fprintf(stderr, "LOCAL_FLIST: hash msgq_read failed: %d, %s\n", errno, errstr); fflush(stderr); */ break; } while (msgq_has_complete_msg(hash_result_mq)) { char* hash; msgq_get(hash_result_mq, MSGQ_STR, &hash, MSGQ_END); //TRACE(("%s:%d: hashing == 0x%08X, hash == 0x%08X\n", __FUNCTION__, __LINE__, hashing, hash)); if (hashing != NULL) { DCFileList* h = ptrv_remove_first(hash_files); assert(hashing == h); if (hash != NULL) { int len = MIN(sizeof(h->reg.tth), strlen(hash)); memcpy(h->reg.tth, hash, len); h->reg.has_tth = 1; update_hash = true; } hashing = NULL; } if (hash != NULL) free(hash); if (hash_files->cur > 0) { /* fprintf(stderr, "before hash_request\n"); fflush(stderr); */ hashing = hash_request(hash_files, hash_request_mq, result_mq); /* fprintf(stderr, "after hash_request\n"); fflush(stderr); fprintf(stderr, "request TTH for %08X (%s)\n", hashing, hashing != NULL ? hashing->name : "NULL"); fflush(stderr); */ } time_t now = time(NULL); if (update_hash && ((hashing == NULL && hash_files->cur == 0) || (now - hash_start) > filelist_hash_refresh_timeout)) { hash_start = now; if (write_local_file_list(new_flist_filename, root)) { rename(new_flist_filename, flist_filename); } else { unlink(new_filelist_name); } if (!send_filelist(result_mq, root)) { break; } update_hash = false; } if (hashing == NULL && !initial) { report_status(result_mq, NULL); } } } if (FD_ISSET(request_mq->fd, &r_ready)) { int res = msgq_read(request_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { break; } while (msgq_has_complete_msg(request_mq)) { if (update_type < 0) { /* read update type */ msgq_get(request_mq, MSGQ_INT, &update_type, MSGQ_END); } else { if (update_type == FILELIST_UPDATE_REFRESH_INTERVAL) { time_t interval = 0; msgq_get(request_mq, MSGQ_INT, &interval, MSGQ_END); if (interval != 0) { filelist_refresh_timeout = interval; } } else { char *name; int len = 0; msgq_get(request_mq, MSGQ_STR, &name, MSGQ_END); len = strlen(name); if (name[len-1] == '/') name[len-1] = 0; switch (update_type) { case FILELIST_UPDATE_ADD_DIR_NAME: if (is_already_shared(root, name)) { // report error here report_error(result_mq, "%s directory is already shared as subfolder of existing shared tree\n", name); } else { char* bname = xstrdup(base_name(name)); if (hmap_contains_key(root->dir.children, bname)) { /* we already have the shared directory with the same name */ report_error(result_mq, "%s directory cannot be shared as %s because there is already shared directory with the same name\n", name, bname); } else { DCFileList* node = new_file_node(bname, DC_TYPE_DIR, root); node->dir.real_path = xstrdup(name); selected = 0; } free(bname); } break; case FILELIST_UPDATE_DEL_DIR_NAME: //selected = 0; { char* bname = xstrdup(base_name(name)); DCFileList* node = hmap_get(root->dir.children, bname); if (node != NULL && node->type == DC_TYPE_DIR) { if (strcmp(node->dir.real_path, name) == 0) { node = hmap_remove(root->dir.children, bname); filelist_free(node); if (write_local_file_list(new_flist_filename, root)) { rename(new_flist_filename, flist_filename); } else { unlink(new_filelist_name); } if (!send_filelist(result_mq, root)) { goto cleanup; } } else { report_error(result_mq, "%s directory is not shared\n"); } } free(bname); } break; case FILELIST_UPDATE_LISTING_DIR: if (listing_dir != NULL) { free(listing_dir); } listing_dir = xstrdup(name); if (!send_filelist(result_mq, root)) { goto cleanup; } break; case FILELIST_UPDATE_HUB_CHARSET: set_hub_charset(name); if (!send_filelist(result_mq, root)) { goto cleanup; } break; case FILELIST_UPDATE_FS_CHARSET: set_fs_charset(name); if (!send_filelist(result_mq, root)) { goto cleanup; } break; default: /* fprintf(stderr, "unknown message type %d\n", update_type); fflush(stderr); */ goto cleanup; break; } free(name); } update_type = -1; } } } } if (selected == 0) { // just look through shared directories for new or deleted files if (hashing == NULL && !initial) report_status(result_mq, "Refreshing FileList"); if (lookup_filelist_changes(root, hash_files)) { if (write_local_file_list(new_flist_filename, root)) { rename(new_flist_filename, flist_filename); } else { unlink(new_filelist_name); } if (!send_filelist(result_mq, root)) { break; } } if (hashing == NULL && !initial) report_status(result_mq, NULL); if (hashing == NULL && hash_files->cur > 0) { hashing = hash_request(hash_files, hash_request_mq, result_mq); if (hashing != NULL) { hash_start = time(NULL); } } } else if (selected < 0) { /* fprintf(stderr, "select error: %d, %s\n", errno, errstr); fflush(stderr); */ if (errno != EINTR) { // error occurs break; } } } /* msgq_read_complete_msg may have failed if it returned < 0. * But we can't print any errors from this process (it would * interfere with the readline-managed display, so just exit * gracefully. */ cleanup: hash_finish(); filelist_free(root); ptrv_free(hash_files); free(flist_filename); free(new_flist_filename); msgq_free(request_mq); msgq_free(result_mq); close(request_fd[0]); close(result_fd[1]); exit(EXIT_SUCCESS); } bool local_file_list_update_init(void) { int request_fd[2]; int result_fd[2]; if (pipe(request_fd) != 0 || pipe(result_fd) != 0) { warn(_("Cannot create pipe pair - %s\n"), errstr); return false; } if (!fd_set_nonblock_flag(request_fd[1], true) || !fd_set_nonblock_flag(result_fd[0], true)) { warn(_("Cannot set non-blocking flag - %s\n"), errstr); return false; } update_child = fork(); if (update_child < 0) { warn(_("Cannot create process - %s\n"), errstr); return false; } if (update_child == 0) { setpriority(PRIO_PROCESS, 0, 16); local_filelist_update_main(request_fd, result_fd); // we never reach this place } close(request_fd[0]); close(result_fd[1]); update_request_mq = msgq_new(request_fd[1]); update_result_mq = msgq_new(result_fd[0]); FD_SET(update_result_mq->fd, &read_fds); return true; } bool process_new_file_list(MsgQ* result_mq) { void *data; size_t size; DCFileList *node; msgq_get(result_mq, MSGQ_BLOB, &data, &size, MSGQ_END); data_to_filelist(data, &node); free(data); fs_to_main_filelist(node); our_filelist_last_update = time(NULL); if (our_filelist != NULL) { filelist_free(our_filelist); } our_filelist = node; my_share_size = our_filelist->size; char sizebuf[LONGEST_HUMAN_READABLE+1]; screen_putf(_("Sharing %" PRIu64 " %s (%s) totally\n"), my_share_size, ngettext("byte", "bytes", my_share_size), human_readable(my_share_size, sizebuf, human_suppress_point_zero|human_autoscale|human_base_1024|human_SI|human_B, 1, 1)); #if 0 struct timeval start, end; gettimeofday(&start, NULL); #endif /*bool result = write_filelist_file(our_filelist);*/ char *dc_flist_from = xasprintf("%s%s%sMyList.DcLst", listing_dir, listing_dir[0] == '\0' || listing_dir[strlen(listing_dir)-1] == '/' ? "" : "/", filelist_prefix), #if defined(HAVE_LIBXML2) *xml_flist_from = xasprintf("%s%s%sfiles.xml", listing_dir, listing_dir[0] == '\0' || listing_dir[strlen(listing_dir)-1] == '/' ? "" : "/", filelist_prefix), *bzxml_flist_from = xasprintf("%s%s%sfiles.xml.bz2",listing_dir, listing_dir[0] == '\0' || listing_dir[strlen(listing_dir)-1] == '/' ? "" : "/", filelist_prefix), *xml_flist_to = xasprintf("%s%sfiles.xml", listing_dir, listing_dir[0] == '\0' || listing_dir[strlen(listing_dir)-1] == '/' ? "" : "/"), *bzxml_flist_to = xasprintf("%s%sfiles.xml.bz2", listing_dir, listing_dir[0] == '\0' || listing_dir[strlen(listing_dir)-1] == '/' ? "" : "/"), #endif *dc_flist_to = xasprintf("%s%sMyList.DcLst", listing_dir, listing_dir[0] == '\0' || listing_dir[strlen(listing_dir)-1] == '/' ? "" : "/"); rename( dc_flist_from, dc_flist_to); if (ptrv_find(delete_files, dc_flist_to, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_files, xstrdup(dc_flist_to)); if (ptrv_find(delete_files, dc_flist_from, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_files, xstrdup(dc_flist_from)); free(dc_flist_from); free(dc_flist_to); #if defined(HAVE_LIBXML2) rename( xml_flist_from, xml_flist_to); rename(bzxml_flist_from, bzxml_flist_to); if (ptrv_find(delete_files, xml_flist_to, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_files, xstrdup(xml_flist_to)); if (ptrv_find(delete_files, xml_flist_from, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_files, xstrdup(xml_flist_from)); if (ptrv_find(delete_files, bzxml_flist_to, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_files, xstrdup(bzxml_flist_to)); if (ptrv_find(delete_files, bzxml_flist_from, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_files, xstrdup(bzxml_flist_from)); free(xml_flist_from); free(xml_flist_to); free(bzxml_flist_from); free(bzxml_flist_to); #endif #if 0 gettimeofday(&end, NULL); long sec = end.tv_usec < start.tv_usec ? end.tv_sec - start.tv_sec - 1 : end.tv_sec - start.tv_sec; long usec = end.tv_usec < start.tv_usec ? 1000000 + end.tv_sec - start.tv_sec : end.tv_sec - start.tv_sec; fprintf(stderr, "write_filelist_file() completes in %ld.%06ld\n", sec, usec); #endif if (hub_state >= DC_HUB_LOGGED_IN && !send_my_info()) return false; return true; } bool local_file_list_init(void) { // read initial file list int res = 0; fd_set readable; FD_ZERO(&readable); FD_SET(update_result_mq->fd, &readable); screen_putf(_("Loading local FileList...")); int update_type = -1; bool exit = false; while (!exit) { fd_set ready = readable; res = select(update_result_mq->fd+1, &ready, NULL, NULL, NULL); if (res > 0) { res = msgq_read(update_result_mq); if (res <= 0) { if (errno != EAGAIN && errno != EINTR) { exit = true; } } else { while (msgq_has_complete_msg(update_result_mq)) { if (update_type < 0) { msgq_get(update_result_mq, MSGQ_INT, &update_type, MSGQ_END); } else { exit = true; break; } } } } else { exit = true; } } if (res <= 0) { warn_socket_error(res, false, "update result pipe"); return false; } if (update_type != FILELIST_UPDATE_COMPLETE) { screen_putf(_("error\n")); if (update_type == FILELIST_UPDATE_ERROR) { char* msg; msgq_get(update_result_mq, MSGQ_STR, &msg, MSGQ_END); screen_putf(_("%s\n"), msg); free(msg); } else { warn(_("unknown messge\n")); } return false; } screen_putf(_("done\n")); return process_new_file_list(update_result_mq); } bool update_request_add_shared_dir(const char* dir) { msgq_put(update_request_mq, MSGQ_INT, FILELIST_UPDATE_ADD_DIR_NAME, MSGQ_END); msgq_put(update_request_mq, MSGQ_STR, dir, MSGQ_END); if (msgq_write_all(update_request_mq) < 0) return false; return true; } bool update_request_del_shared_dir(const char* dir) { msgq_put(update_request_mq, MSGQ_INT, FILELIST_UPDATE_DEL_DIR_NAME, MSGQ_END); msgq_put(update_request_mq, MSGQ_STR, dir, MSGQ_END); if (msgq_write_all(update_request_mq) < 0) return false; return true; } bool update_request_set_listing_dir(const char* dir) { msgq_put(update_request_mq, MSGQ_INT, FILELIST_UPDATE_LISTING_DIR, MSGQ_END); msgq_put(update_request_mq, MSGQ_STR, dir, MSGQ_END); if (msgq_write_all(update_request_mq) < 0) return false; return true; } bool update_request_set_hub_charset(const char* charset) { msgq_put(update_request_mq, MSGQ_INT, FILELIST_UPDATE_HUB_CHARSET, MSGQ_END); msgq_put(update_request_mq, MSGQ_STR, charset, MSGQ_END); if (msgq_write_all(update_request_mq) < 0) return false; return true; } bool update_request_set_fs_charset(const char* charset) { msgq_put(update_request_mq, MSGQ_INT, FILELIST_UPDATE_FS_CHARSET, MSGQ_END); msgq_put(update_request_mq, MSGQ_STR, charset, MSGQ_END); if (msgq_write_all(update_request_mq) < 0) return false; return true; } bool update_request_set_filelist_refresh_timeout(time_t seconds) { msgq_put(update_request_mq, MSGQ_INT, FILELIST_UPDATE_REFRESH_INTERVAL, MSGQ_END); msgq_put(update_request_mq, MSGQ_INT, seconds, MSGQ_END); if (msgq_write_all(update_request_mq) < 0) return false; return true; } void update_request_fd_writable(void) { int res; res = msgq_write(update_request_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, true, "update request pipe"); running = false; return; } if (!msgq_has_partial_msg(update_request_mq)) FD_CLR(update_request_mq->fd, &write_fds); } void update_result_fd_readable(void) { int res; res = msgq_read(update_result_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, false, "update result pipe"); running = false; return; } while (msgq_has_complete_msg(update_result_mq)) { if (incoming_update_type < 0) { /* read update type */ msgq_get(update_result_mq, MSGQ_INT, &incoming_update_type, MSGQ_END); } else { switch (incoming_update_type) { case FILELIST_UPDATE_COMPLETE: process_new_file_list(update_result_mq); break; case FILELIST_UPDATE_STATUS: if (update_status != NULL) { free(update_status); } msgq_get(update_result_mq, MSGQ_STR, &update_status, MSGQ_END); break; case FILELIST_UPDATE_ERROR: { char* err; msgq_get(update_result_mq, MSGQ_STR, &err, MSGQ_END); warn(_("filelist_update: %s\n"), err); free(err); } break; default: assert(false); break; } incoming_update_type = -1; } } } void local_file_list_update_finish(void) { if (update_request_mq != NULL) { close(update_request_mq->fd); msgq_free(update_request_mq); } if (update_result_mq != NULL) { close(update_result_mq->fd); msgq_free(update_result_mq); } if (update_status != NULL) { free(update_status); update_status = NULL; } } microdc2-0.15.6/src/lookup.c0100644000076500007500000002432310527017306015623 0ustar chugunovmicrodc/* lookup.c - Performing name lookup with getaddrinfo * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include /* POSIX.1 */ #include #include #include /* Gnulib */ #include #include #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "xalloc.h" /* Gnulib */ #include "common/msgq.h" #include "common/byteq.h" #include "common/ptrv.h" #include "microdc.h" struct _DCLookup { DCLookupCallback callback; void *data; bool cancelled; }; static PtrV *pending_lookups = NULL; MsgQ *lookup_request_mq = NULL; MsgQ *lookup_result_mq = NULL; pid_t lookup_child; static struct addrinfo * data_to_addrinfo(void *databuf, size_t size) { struct addrinfo *first_ai = NULL; struct addrinfo *prev_ai = NULL; char *data = databuf; char *dataend = data + size; while (data < dataend) { struct addrinfo *ai; bool has_sockaddr; bool has_canon; ai = xmalloc(sizeof(*ai)); if (first_ai == NULL) first_ai = ai; else prev_ai->ai_next = ai; memcpy(&ai->ai_flags, data, sizeof(ai->ai_flags)); data += sizeof(ai->ai_flags); memcpy(&ai->ai_family, data, sizeof(ai->ai_family)); data += sizeof(ai->ai_family); memcpy(&ai->ai_socktype, data, sizeof(ai->ai_socktype)); data += sizeof(ai->ai_socktype); memcpy(&ai->ai_protocol, data, sizeof(ai->ai_protocol)); data += sizeof(ai->ai_protocol); memcpy(&ai->ai_addrlen, data, sizeof(ai->ai_addrlen)); data += sizeof(ai->ai_addrlen); memcpy(&has_sockaddr, data, sizeof(has_sockaddr)); data += sizeof(has_sockaddr); if (has_sockaddr) { ai->ai_addr = xmemdup(data, ai->ai_addrlen); data += ai->ai_addrlen; } else { ai->ai_addr = NULL; } memcpy(&has_canon, data, sizeof(has_sockaddr)); data += sizeof(has_canon); if (has_canon) { ai->ai_canonname = xstrdup(data); data += strlen(ai->ai_canonname)+1; } else { ai->ai_canonname = NULL; } ai->ai_next = NULL; prev_ai = ai; } return first_ai; } static void addrinfo_to_data(const struct addrinfo *first_ai, void **dataptr, size_t *sizeptr) { const struct addrinfo *ai; size_t size = 0; char *data; for (ai = first_ai; ai != NULL; ai = ai->ai_next) { size += sizeof(ai->ai_flags) + sizeof(ai->ai_family) + sizeof(ai->ai_socktype) + sizeof(ai->ai_protocol) + sizeof(ai->ai_addrlen) + sizeof(bool) + sizeof(bool); if (ai->ai_addr != NULL) size += ai->ai_addrlen; if (ai->ai_canonname != NULL) size += strlen(ai->ai_canonname)+1; } data = size == 0 ? NULL : xmalloc(size); *dataptr = (void *) data; *sizeptr = size; for (ai = first_ai; ai != NULL; ai = ai->ai_next) { bool has_sockaddr = ai->ai_addr != NULL; bool has_canon = ai->ai_canonname != NULL; memcpy(data, &ai->ai_flags, sizeof(ai->ai_flags)); data += sizeof(ai->ai_flags); memcpy(data, &ai->ai_family, sizeof(ai->ai_family)); data += sizeof(ai->ai_family); memcpy(data, &ai->ai_socktype, sizeof(ai->ai_socktype)); data += sizeof(ai->ai_socktype); memcpy(data, &ai->ai_protocol, sizeof(ai->ai_protocol)); data += sizeof(ai->ai_protocol); memcpy(data, &ai->ai_addrlen, sizeof(ai->ai_addrlen)); data += sizeof(ai->ai_addrlen); memcpy(data, &has_sockaddr, sizeof(has_sockaddr)); data += sizeof(has_sockaddr); if (has_sockaddr) { memcpy(data, ai->ai_addr, ai->ai_addrlen); data += ai->ai_addrlen; } memcpy(data, &has_canon, sizeof(has_canon)); data += sizeof(has_canon); if (has_canon) { memcpy(data, ai->ai_canonname, strlen(ai->ai_canonname)+1); data += strlen(ai->ai_canonname)+1; } } } static void free_read_addrinfo(struct addrinfo *ai) { while (ai != NULL) { struct addrinfo *next_ai; free(ai->ai_addr); free(ai->ai_canonname); next_ai = ai->ai_next; free(ai); ai = next_ai; } } static void __attribute__((noreturn)) lookup_main(int request_fd[2], int result_fd[2]) { MsgQ *request_mq; MsgQ *result_mq; struct sigaction sigact; close(request_fd[1]); close(result_fd[0]); request_mq = msgq_new(request_fd[0]); result_mq = msgq_new(result_fd[1]); /* Inability to register these signals is not a fatal error. */ sigact.sa_flags = SA_RESTART; sigact.sa_handler = SIG_IGN; #ifdef HAVE_STRUCT_SIGACTION_SA_RESTORER sigact.sa_restorer = NULL; #endif sigaction(SIGINT, &sigact, NULL); sigaction(SIGTERM, &sigact, NULL); sigaction(SIGUSR1, &sigact, NULL); sigaction(SIGCHLD, &sigact, NULL); sigaction(SIGPIPE, &sigact, NULL); while (msgq_read_complete_msg(request_mq) > 0) { char *node; char *service; void *data; size_t size; struct addrinfo *hints_ai; struct addrinfo *result_ai = NULL; int rc; /* XXX: msgq_get_sync, check its result, and use for (;;) */ msgq_get(request_mq, MSGQ_STR, &node, MSGQ_STR, &service, MSGQ_BLOB, &data, &size, MSGQ_END); hints_ai = data_to_addrinfo(data, size); rc = getaddrinfo(node, service, hints_ai, &result_ai); free(node); free(service); free_read_addrinfo(hints_ai); free(data); addrinfo_to_data(result_ai, &data, &size); /* XXX: msgq_put_sync, check its result, and get rid of msgq_write_all */ msgq_put(result_mq, MSGQ_INT, rc, MSGQ_BLOB, data, size, MSGQ_END); free(data); if (msgq_write_all(result_mq) < 0) break; } /* msgq_read_complete_msg may have failed if it returned < 0. * But we can't print any errors from this process (it would * interfere with the readline-managed display, so just exit * gracefully. */ msgq_free(request_mq); msgq_free(result_mq); close(request_fd[0]); close(result_fd[1]); exit(EXIT_SUCCESS); } void lookup_request_fd_writable(void) { int res; res = msgq_write(lookup_request_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, true, "lookup request pipe"); running = false; return; } if (!msgq_has_partial_msg(lookup_request_mq)) FD_CLR(lookup_request_mq->fd, &write_fds); } void lookup_result_fd_readable(void) { int res; res = msgq_read(lookup_result_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, false, "lookup result pipe"); running = false; return; } while (msgq_has_complete_msg(lookup_result_mq)) { int rc; void *data; size_t size; struct addrinfo *ai; DCLookup *lookup; msgq_get(lookup_result_mq, MSGQ_INT, &rc, MSGQ_BLOB, &data, &size, MSGQ_END); ai = data_to_addrinfo(data, size); free(data); lookup = ptrv_remove_first(pending_lookups); if (!lookup->cancelled) lookup->callback(rc, ai, lookup->data); free(lookup); free_read_addrinfo(ai); } } void cancel_lookup_request(DCLookup *lookup) { int c; for (c = 0; c < pending_lookups->cur; c++) { if (lookup == pending_lookups->buf[c]) { if (c == 0) { lookup->cancelled = true; } else { ptrv_remove_range(pending_lookups, c, c+1); } break; } } } DCLookup * add_lookup_request(const char *node, const char *service, const struct addrinfo *hints, DCLookupCallback callback, void *userdata) { void *data; size_t size; DCLookup *lookup; addrinfo_to_data(hints, &data, &size); msgq_put(lookup_request_mq, MSGQ_STR, node, MSGQ_STR, service, MSGQ_BLOB, data, size, MSGQ_END); free(data); FD_SET(lookup_request_mq->fd, &write_fds); lookup = xmalloc(sizeof(DCLookup)); lookup->callback = callback; lookup->data = userdata; lookup->cancelled = false; ptrv_append(pending_lookups, lookup); return lookup; } bool lookup_init(void) { int request_fd[2]; int result_fd[2]; if (pipe(request_fd) != 0 || pipe(result_fd) != 0) { warn(_("Cannot create pipe pair - %s\n"), errstr); return false; } if (!fd_set_nonblock_flag(request_fd[1], true) || !fd_set_nonblock_flag(result_fd[0], true)) { warn(_("Cannot set non-blocking flag - %s\n"), errstr); return false; } lookup_child = fork(); if (lookup_child < 0) { warn(_("Cannot create process - %s\n"), errstr); return false; } if (lookup_child == 0) lookup_main(request_fd, result_fd); pending_lookups = ptrv_new(); close(request_fd[0]); close(result_fd[1]); lookup_request_mq = msgq_new(request_fd[1]); lookup_result_mq = msgq_new(result_fd[0]); FD_SET(lookup_result_mq->fd, &read_fds); return true; } void lookup_finish(void) { if (pending_lookups != NULL) { ptrv_foreach(pending_lookups, free); ptrv_free(pending_lookups); } if (lookup_request_mq != NULL) { close(lookup_request_mq->fd); msgq_free(lookup_request_mq); } if (lookup_result_mq != NULL) { close(lookup_result_mq->fd); msgq_free(lookup_result_mq); } } microdc2-0.15.6/src/main.c0100664000076500007500000013270610543542667015260 0ustar chugunovmicrodc/* main.c - Main routine and some common functions * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include /* POSIX */ #include /* C89 */ #include /* C89 */ #include /* POSIX */ #include /* ? */ #include /* ? */ #include /* POSIX: waitpid */ #include /* POSIX */ #include /* ? */ #include /* ? */ #include /* Gnulib/POSIX */ #include /* ? */ #include "full-write.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "version-etc.h" /* Gnulib */ #include "xalloc.h" /* Gnulib */ #include "quotearg.h" /* Gnulib */ #include "quote.h" /* Gnulib */ #include "sig2str.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "dirname.h" /* Gnulib */ #include "minmax.h" /* Gnulib */ #include "human.h" /* Gnulib */ #include "getline.h" /* Gnulib/GNU Libc */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/error.h" #include "common/strleftcmp.h" #include "common/tempdir.h" #include "common/tempfailure.h" #include "common/msgq.h" #include "microdc.h" enum { VERSION_OPT = 256, HELP_OPT }; #define LISTEN_QUEUE_CONNS 16 /* interactive state (move to transfer.c/browse.c) */ DCFileList *browse_list = NULL; DCUserInfo *browse_user = NULL; char *browse_path = NULL; char *browse_path_previous = NULL; bool browsing_myself = false; /* misc */ uint64_t bytes_received = 0; uint64_t bytes_sent = 0; uint64_t max_speed = 0, prev_max_speed = 0; uint16_t listen_port = 0; bool running = true; fd_set read_fds; fd_set write_fds; PtrV *delete_files = NULL; PtrV *delete_dirs = NULL; static PtrV *search_udpmsg_out; /* pending outgoing search results */ pid_t shell_child = -1; struct sockaddr_in local_addr; HMap *user_conns = NULL; HMap *pending_userinfo = NULL; /* users we want to communicate with, either * us connecting to them or they connecting * to us. (UserInfo->nick => UserInfo) */ /* XXX: change to ("Copyright %s %d Oskar Liljeblad", gettext("(C)"), 2005) */ const char version_etc_copyright[] = "Copyright (C) 2006 Vladimir Chugunov, based on Oskar Liljeblad's microdc 0.11.0\nmicrodc is copyright (C) 2004, 2005 Oskar Liljeblad."; static uint32_t user_conn_unknown_last = 0; static PtrV *user_conn_unknown_free = NULL; static ByteQ *search_recvq; static pid_t main_process_id; static int signal_pipe[2] = { -1, -1 }; static int listen_socket = -1; static int search_socket = -1; static const char *short_opts = "c:n"; static struct option long_opts[] = { { "config", required_argument, NULL, 'c' }, { "no-config", no_argument, NULL, 'n' }, { "version", no_argument, NULL, VERSION_OPT }, { "help", no_argument, NULL, HELP_OPT }, { 0, } }; void warn_file_error(int res, bool write, const char *filename) { if (write) { warn(_("%s: Cannot write to file - %s\n"), quotearg(filename), errstr); } else { if (res < 0) { warn(_("%s: Cannot read from file - %s\n"), quotearg(filename), errstr); } else { warn(_("%s: Premature end of file\n"), quotearg(filename)); } } } void warn_socket_error(int res, bool write, const char *format, ...) { char *subject; va_list args; va_start(args, format); subject = xvasprintf(format, args); va_end(args); if (write) { warn("Cannot send to %s - %s\n", subject, errstr); } else { if (res < 0) { warn("Cannot receive from %s - %s\n", subject, errstr); } else { warn("Disconnected from %s.\n", subject); } } free(subject); } bool get_package_file(const char *name, char **outname) { *outname = xasprintf("%s/.%s/%s", getenv_default("HOME", ""), PACKAGE, name); return true; } bool has_user_conn(DCUserInfo *ui, DCTransferDirection dir) { int c; for (c = 0; c < ui->conn_count; c++) { if (ui->conn[c]->dir == dir) return true; } return false; } static void update_user_connection_name(DCUserConn *uc, const char *format, ...) { char *newname; va_list args; va_start(args, format); newname = xvasprintf(format, args); va_end(args); hmap_remove(user_conns, uc->name); flag_putf(DC_DF_CONNECTIONS, _("User connection %s renamed to %s.\n"), quote_n(0, uc->name), quote_n(1, newname)); if (strchr(uc->name, '|') == NULL) ptrv_append(user_conn_unknown_free, uc->name); else free(uc->name); uc->name = newname; hmap_put(user_conns, uc->name, uc); } static bool validate_nick(DCUserConn *uc, const char *nick) { DCUserInfo *ui; ui = hmap_remove(pending_userinfo, nick); if (ui != NULL) { if (ui->conn_count < DC_USER_MAX_CONN) { uc->info = ui; uc->info->refcount++; uc->info->conn[uc->info->conn_count++] = uc; hmap_remove(pending_userinfo, ui->nick); user_info_free(ui); update_user_connection_name(uc, "%s|", uc->info->nick); return true; } warn(_("No more connections to user %s allowed.\n"), quotearg(nick)); user_info_free(ui); return false; } ui = hmap_get(hub_users, nick); if (ui != NULL) { if (ui->conn_count < DC_USER_MAX_CONN) { uc->info = ui; uc->info->refcount++; uc->info->conn[uc->info->conn_count++] = uc; update_user_connection_name(uc, "%s|", uc->info->nick); return true; } warn(_("No more connections to user %s allowed.\n"), quotearg(nick)); return false; } return false; } static bool validate_direction(DCUserConn *uc, DCTransferDirection dir) { if (uc->dir != DC_DIR_UNKNOWN) return false; /* Shouldn't happen, but better be sure */ if (has_user_conn(uc->info, dir)) return false; uc->dir = dir; update_user_connection_name(uc, "%s|%s", uc->info->nick, dir == DC_DIR_SEND ? _("UL") : _("DL")); /* Don't check for a free slot here. We will do that later. */ /* Make new connection if we want to download but couldn't. */ if (dir == DC_DIR_SEND && uc->info->conn_count < DC_USER_MAX_CONN && !has_user_conn(uc->info, DC_DIR_RECEIVE) && uc->info->download_queue->cur > 0) hub_connect_user(uc->info); return true; } static void display_transfer_ended_msg(bool upload, DCUserConn *uc, bool success, const char *extras_fmt, ...) { char timebuf[LONGEST_ELAPSED_TIME+1]; char ratebuf[LONGEST_HUMAN_READABLE+1]; char sizebuf[LONGEST_HUMAN_READABLE+1]; char *str1; char *str2; time_t now; uint64_t len; va_list args; len = uc->transfer_pos - uc->transfer_start; if (uc->transfer_time == (time_t) -1) { str2 = xstrdup(""); } else { time(&now); if (now == (time_t) -1) { warn(_("Cannot get current time - %s\n"), errstr); str2 = xstrdup(""); } else { str2 = xasprintf(_(" in %s (%s/s)"), elapsed_time_to_string(now - uc->transfer_time, timebuf), human_readable( len/MAX(now - uc->transfer_time, 1), ratebuf, human_suppress_point_zero|human_autoscale|human_base_1024|human_SI|human_B, 1, 1)); } } va_start(args, extras_fmt); str1 = xvasprintf(extras_fmt, args); va_end(args); flag_putf(upload ? DC_DF_UPLOAD : DC_DF_DOWNLOAD, _("%s: %s of %s %s%s. %s %s%s.\n"), quotearg_n(0, uc->info->nick), upload ? _("Upload") : _("Download"), quote_n(1, base_name(uc->transfer_file)), success ? _("succeeded") : _("failed"), str1, human_readable(len, sizebuf, human_suppress_point_zero|human_autoscale|human_base_1024|human_SI|human_B, 1, 1), ngettext("transferred", "transferred", len), str2); free(str1); free(str2); } static void handle_ended_upload(DCUserConn *uc, bool success, const char *reason) { time_t now = (time_t)-1; uint64_t len = uc->transfer_pos - uc->transfer_start; uint64_t speed = len/MAX(now - uc->transfer_time, 1); time(&now); if (speed > max_speed) { prev_max_speed = max_speed; max_speed = speed; } bytes_sent += len; if (uc->occupied_slot || uc->occupied_minislot) { /* Only display "Upload failed" if "Starting upload" was * displayed previously. */ display_transfer_ended_msg(true, uc, success, " (%s)", reason); if (uc->occupied_slot) { used_ul_slots--; uc->occupied_slot = false; } if (uc->occupied_minislot) { used_mini_slots--; uc->occupied_minislot = false; } } free(uc->transfer_file); uc->transfer_file = NULL; uc->transfer_start = 0; uc->transfer_pos = 0; uc->transferring = false; } static void handle_ended_download(DCUserConn *uc, bool success, const char *reason) { bytes_received += uc->transfer_pos - uc->transfer_start; if (uc->occupied_slot) { used_dl_slots--; uc->occupied_slot = false; } /* If we removed from the queued item during download, * queue_pos will point outside the queue. */ if (uc->queued_valid) { DCQueuedFile *queued; /* queued = uc->info->download_queue->buf[uc->queue_pos]; uc->queue_pos++; */ queued = ptrv_remove(uc->info->download_queue, uc->queue_pos); uc->queued_valid = false; if (success) { queued->status = DC_QS_DONE; if (queued->flag == DC_TF_LIST) { if (uc->local_file != NULL) { ptrv_append(delete_files, xstrdup(uc->local_file)); } if (browse_user != NULL && strcmp(browse_user->nick, uc->info->nick) == 0 && browse_list == NULL) { add_parse_request(browse_list_parsed, uc->local_file, xstrdup(browse_user->nick)); } } else { char *final_file = xstrndup(uc->local_file, strlen(uc->local_file)-5); if (safe_rename(uc->local_file, final_file) != 0) { warn(_("%s: Cannot rename file to %s - %s\n"), quotearg_n(0, uc->local_file), quote_n(1, final_file), errstr); reason = _("cannot rename file"); /* XXX: would like a more elaborate error message here perhaps? */ queued->status = DC_QS_ERROR; success = false; } free(final_file); } } else { queued->status = DC_QS_ERROR; } display_transfer_ended_msg(false, uc, success, " (%s)", reason); } else { display_transfer_ended_msg(false, uc, success, " but unqueued (%s)", reason); } free(uc->transfer_file); free(uc->local_file); uc->transfer_file = NULL; uc->local_file = NULL; uc->transfer_start = 0; uc->transfer_pos = 0; uc->transferring = false; } DCUserConn * user_connection_new(struct sockaddr_in *addr, int user_socket) { DCUserConn *uc; int get_fd[2] = { -1, -1 }; int put_fd[2] = { -1, -1 }; pid_t pid; if (pipe(get_fd) != 0 || pipe(put_fd) != 0) { warn(_("Cannot create pipe pair - %s\n"), errstr); goto cleanup; } pid = fork(); if (pid < 0) { warn(_("Cannot create process - %s\n"), errstr); goto cleanup; } if (pid == 0) user_main(put_fd, get_fd, addr, user_socket); if (close(get_fd[1]) != 0 || close(put_fd[0]) != 0) warn(_("Cannot close pipe - %s\n"), errstr); /* Non-blocking mode is not required, but there may be some latency otherwise. */ if (!fd_set_nonblock_flag(get_fd[0], true) || !fd_set_nonblock_flag(put_fd[1], true)) warn(_("Cannot set non-blocking flag - %s\n"), errstr); /* The user socket is only used by the newly created user process. */ if (user_socket >= 0 && close(user_socket) < 0) warn(_("Cannot close socket - %s\n"), errstr); uc = xmalloc(sizeof(DCUserConn)); uc->pid = pid; uc->info = NULL; uc->occupied_slot = 0; uc->occupied_minislot = 0; uc->dir = DC_DIR_UNKNOWN; uc->transfer_file = NULL; uc->local_file = NULL; uc->transfer_start = 0; uc->transfer_pos = 0; uc->transfer_total = 0; uc->transfer_time = (time_t) -1; uc->transferring = false; uc->queue_pos = 0; uc->queued_valid = false; /* uc->we_connected = (user_socket < 0); */ uc->get_mq = msgq_new(get_fd[0]); uc->put_mq = msgq_new(put_fd[1]); FD_SET(uc->get_mq->fd, &read_fds); if (user_conn_unknown_free->cur > 0) { uc->name = ptrv_remove_first(user_conn_unknown_free); } else { /* TRANSLATORS: This represents the connection name used when * the user name is not yet known. It must not contains '|', * because that's used to distinguish between 'unknown' and * (perhaps partially) identified connections. */ uc->name = xasprintf(_("unknown%" PRIu32), user_conn_unknown_last+1); user_conn_unknown_last++; } hmap_put(user_conns, uc->name, uc); return uc; cleanup: if (get_fd[0] != -1) close(get_fd[0]); if (get_fd[1] != -1) close(get_fd[1]); if (put_fd[0] != -1) close(put_fd[0]); if (put_fd[1] != -1) close(put_fd[1]); return NULL; } void user_disconnect(DCUserConn *uc) { flag_putf(DC_DF_CONNECTIONS, _("Shutting down user connection process for %s.\n"), quote(uc->name)); /* XXX: move where? */ hmap_remove(user_conns, uc->name); if (uc->occupied_slot) { /* could also check that uc->transfer_file != NULL */ if (uc->dir == DC_DIR_SEND) { handle_ended_upload(uc, false, "connection terminated prematurely"); } else { /* uc->dir == DC_DIR_RECV */ handle_ended_download(uc, false, "connection terminated prematurely"); } } if (uc->info != NULL) { int c; for (c = 0; c < uc->info->conn_count; c++) { if (uc->info->conn[c] == uc) break; } assert(c < uc->info->conn_count); uc->info->conn[c] = NULL; uc->info->conn_count--; for (; c < uc->info->conn_count; c++) uc->info->conn[c] = uc->info->conn[c+1]; user_info_free(uc->info); } FD_CLR(uc->get_mq->fd, &read_fds); FD_CLR(uc->put_mq->fd, &write_fds); if (close(uc->get_mq->fd) != 0 || close(uc->put_mq->fd) != 0) warn(_("Cannot close pipe - %s\n"), errstr); msgq_free(uc->get_mq); uc->get_mq = NULL; msgq_free(uc->put_mq); uc->put_mq = NULL; if (strchr(uc->name, '|') == NULL) ptrv_append(user_conn_unknown_free, uc->name); else free(uc->name); free(uc); } char * user_conn_status_to_string(DCUserConn *uc, time_t now) { char *status; if (uc->transferring) { int percent = (uc->transfer_pos * 100) / MAX(uc->transfer_total, 1); int rate = 0; if (now != (time_t) -1 && uc->transfer_time != (time_t) -1) rate = (uc->transfer_pos-uc->transfer_start)/1024/MAX(now-uc->transfer_time, 1); status = xasprintf( uc->dir == DC_DIR_RECEIVE ? _("Downloading %3d%% (at %5d kb/s) %s") : _("Uploading %3d%% (at %5d kb/s) %s"), percent, rate, base_name(uc->transfer_file)); } else { status = xasprintf(_("Idle")); } return status; } /* This function should be called when the user process it to be notified * about the termination (when it isn't terminating by itself). */ void user_conn_cancel(DCUserConn *uc) { user_disconnect(uc); /* MSG: "connection terminated by request" */ } static void user_request_fd_writable(DCUserConn *uc) { int res; res = msgq_write(uc->put_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, true, _("user process %s"), quote(uc->name)); user_disconnect(uc); /* MSG: socket error above */ return; } if (!msgq_has_partial_msg(uc->put_mq)) FD_CLR(uc->put_mq->fd, &write_fds); } static void user_result_fd_readable(DCUserConn *uc) { int res; res = msgq_read(uc->get_mq); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, false, _("user process %s"), quote(uc->name)); user_disconnect(uc); /* MSG: socket error above */ return; } while (msgq_has_complete_msg(uc->get_mq)) { int id; msgq_peek(uc->get_mq, MSGQ_INT, &id, MSGQ_END); switch (id) { case DC_MSG_SCREEN_PUT: { char *msg; uint32_t flag; msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_INT32, &flag, MSGQ_STR, &msg, MSGQ_END); flag_putf(flag, _("User %s: %s"), quotearg(uc->name), msg); /* msg already quoted */ free(msg); break; } case DC_MSG_WANT_DOWNLOAD: { bool reply; msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_END); reply = !has_user_conn(uc->info, DC_DIR_RECEIVE) && (uc->queue_pos < uc->info->download_queue->cur); msgq_put(uc->put_mq, MSGQ_BOOL, reply, MSGQ_END); FD_SET(uc->put_mq->fd, &write_fds); break; } case DC_MSG_VALIDATE_DIR: { DCTransferDirection dir; bool reply; msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_INT, &dir, MSGQ_END); reply = validate_direction(uc, dir); msgq_put(uc->put_mq, MSGQ_BOOL, reply, MSGQ_END); FD_SET(uc->put_mq->fd, &write_fds); break; } case DC_MSG_VALIDATE_NICK: { char *nick; bool reply; msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_STR, &nick, MSGQ_END); reply = validate_nick(uc, nick); free(nick); if (uc->info != NULL) { /* The user can only be DC_ACTIVE_SENT_PASSIVE if we are passive. * So if we managed to connect to them even though we were passive, * they must be active. */ if (uc->info->active_state == DC_ACTIVE_SENT_PASSIVE) uc->info->active_state = DC_ACTIVE_KNOWN_ACTIVE; /* The user can only be DC_ACTIVE_SENT_ACTIVE if we are active. * We must set to DC_ACTIVE_UNKNOWN because otherwise * hub.c:hub_connect_user might say "ConnectToMe already sent to * user" next time we're trying to connect to them. */ if (uc->info->active_state == DC_ACTIVE_SENT_ACTIVE) uc->info->active_state = DC_ACTIVE_UNKNOWN; } msgq_put(uc->put_mq, MSGQ_BOOL, reply, MSGQ_END); FD_SET(uc->put_mq->fd, &write_fds); break; } case DC_MSG_GET_MY_NICK: msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_END); msgq_put(uc->put_mq, MSGQ_STR, my_nick, MSGQ_END); FD_SET(uc->put_mq->fd, &write_fds); break; case DC_MSG_TRANSFER_STATUS: msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_INT64, &uc->transfer_pos, MSGQ_END); break; case DC_MSG_TRANSFER_START: { char *share_filename, *local_filename; msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_STR, &local_filename, MSGQ_STR, &share_filename, MSGQ_INT64, &uc->transfer_start, MSGQ_INT64, &uc->transfer_total, MSGQ_END); if (uc->transfer_start != 0) { flag_putf(DC_DF_CONNECTIONS, _("%s: Starting %s of %s (%" PRIu64 " of %" PRIu64 " %s).\n"), quotearg_n(0, uc->info->nick), uc->dir == DC_DIR_SEND ? _("upload") : _("download"), quote_n(1, base_name(share_filename)), uc->transfer_total - uc->transfer_start, uc->transfer_total, ngettext("byte", "bytes", uc->transfer_total)); } else { flag_putf(DC_DF_CONNECTIONS, _("%s: Starting %s of %s (%" PRIu64 " %s).\n"), quotearg_n(0, uc->info->nick), uc->dir == DC_DIR_SEND ? _("upload") : _("download"), quote_n(1, base_name(share_filename)), uc->transfer_total, ngettext("byte", "bytes", uc->transfer_total)); } free(uc->transfer_file); uc->transfer_file = share_filename; free(uc->local_file); uc->local_file = local_filename; uc->transferring = true; uc->transfer_pos = uc->transfer_start; uc->transfer_time = time(NULL); if (uc->transfer_time == (time_t) -1) warn(_("Cannot get current time - %s\n"), errstr); break; } case DC_MSG_CHECK_DOWNLOAD: msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_END); for (; uc->queue_pos < uc->info->download_queue->cur; uc->queue_pos++) { DCQueuedFile *queued; char *local_file; queued = uc->info->download_queue->buf[uc->queue_pos]; if (queued->status != DC_QS_DONE) { local_file = resolve_download_file(uc->info, queued); uc->queued_valid = true; uc->transfer_file = xstrdup(queued->filename); uc->local_file = xstrdup(local_file); uc->occupied_slot = true; queued->status = DC_QS_PROCESSING; used_dl_slots++; msgq_put(uc->put_mq, MSGQ_STR, local_file, MSGQ_STR, uc->transfer_file, MSGQ_INT64, queued->length, MSGQ_INT, queued->flag, MSGQ_END); FD_SET(uc->put_mq->fd, &write_fds); free(local_file); return; } } msgq_put(uc->put_mq, MSGQ_STR, NULL, MSGQ_STR, NULL, MSGQ_INT64, (uint64_t) 0, MSGQ_INT, DC_TF_NORMAL, MSGQ_END); FD_SET(uc->put_mq->fd, &write_fds); break; case DC_MSG_DOWNLOAD_ENDED: { bool success; char *reason; msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_BOOL, &success, MSGQ_STR, &reason, MSGQ_END); handle_ended_download(uc, success, reason); free(reason); break; } case DC_MSG_CHECK_UPLOAD: { char *remote_file; char *local_file; int type; uint64_t size = 0; DCTransferFlag flag = DC_TF_NORMAL; bool permit_transfer = false; msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_INT, &type, MSGQ_STR, &remote_file, MSGQ_END); local_file = resolve_upload_file(uc->info, type, remote_file, &flag, &size); free(remote_file); uc->transfer_file = NULL; if (local_file != NULL) { if (flag == DC_TF_LIST || (flag == DC_TF_NORMAL && size <= minislot_size)) { if (used_mini_slots < minislot_count) { used_mini_slots ++; uc->occupied_minislot = true; permit_transfer = true; } else if (used_ul_slots < my_ul_slots || uc->info->slot_granted) { used_ul_slots ++; uc->occupied_slot = true; permit_transfer = true; } } else if (flag == DC_TF_NORMAL && size > minislot_size) { if (used_ul_slots < my_ul_slots || uc->info->slot_granted) { used_ul_slots ++; uc->occupied_slot = true; permit_transfer = true; } } if (permit_transfer) { uc->transfer_file = local_file; } else { free(local_file); local_file = NULL; } } else { permit_transfer = true; } msgq_put(uc->put_mq, MSGQ_BOOL, permit_transfer, MSGQ_STR, local_file, MSGQ_END); FD_SET(uc->put_mq->fd, &write_fds); break; } case DC_MSG_UPLOAD_ENDED: { bool success; char *reason; msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_BOOL, &success, MSGQ_STR, &reason, MSGQ_END); handle_ended_upload(uc, success, reason); free(reason); break; } case DC_MSG_TERMINATING: /* The TERMINATING message will be sent from users when they're about to * shut down properly. * XXX: This message may contain the reason it was terminated in the future. */ msgq_get(uc->get_mq, MSGQ_INT, &id, MSGQ_END); user_disconnect(uc); /* MSG: reason from DC_MSG_TERMINATING */ return; /* not break! this is the last message. */ default: warn(_("Received unknown message %d from user process, shutting down process.\n"), id); user_disconnect(uc); /* MSG: local communication error? */ return; /* not break! this is the last message. */ } } } void transfer_completion_generator(DCCompletionInfo *ci) { HMapIterator it; /* XXX: perhaps use a tmap for transfers as well? to speed up this */ hmap_iterator(user_conns, &it); while (it.has_next(&it)) { DCUserConn *uc = it.next(&it); if (strleftcmp(ci->word, uc->name) == 0) ptrv_append(ci->results, new_completion_entry(uc->name, NULL)); } ptrv_sort(ci->results, completion_entry_display_compare); } /* This is the actual signal handler, registered in main_init with * sigaction. */ static void signal_received(int signal) { uint8_t signal_char; /* This check is to stop a small risk: The signal may be received in a * newly created child process that hasn't had its signal handler * changed yet. */ if (getpid() != main_process_id) return; signal_char = signal; if (write(signal_pipe[1], &signal, sizeof(uint8_t)) < sizeof(uint8_t)) { /* Die only if the signal is fatal. * If SIGCHLD is not delivered, we would be stuck in a * state where the user cannot enter any commands. */ if (signal == SIGTERM || signal == SIGINT || signal == SIGCHLD) die(_("Cannot write to signal pipe - %s\n"), errstr); /* die OK */ warn(_("Cannot write to signal pipe - %s\n"), errstr); } } static void read_signal_input(void) { uint8_t signal; /* This read is atomic since sizeof(int) < PIPE_BUF! * It also doesn't block since all data is already * available (otherwise select wouldn't tell us there * was data). */ if (read(signal_pipe[0], &signal, sizeof(uint8_t)) < 0) { warn(_("Cannot read from signal pipe - %s\n"), errstr); running = false; return; } if (signal == SIGTERM) { warn(_("Received TERM signal, shutting down.\n")); running = false; } else if (signal == SIGINT) { screen_erase_and_new_line(); } else if (signal == SIGCHLD) { pid_t child; int status; while ((child = waitpid(-1, &status, WNOHANG)) > 0) { char *name; if (child == shell_child) { screen_wakeup(WIFSIGNALED(status) && WTERMSIG(status) == SIGINT); shell_child = -1; name = _("Shell process"); } else if (child == lookup_child) { name = _("Lookup process"); running = false; } else if (child == parse_child) { name = _("Parse process"); running = false; } else if (child == update_child) { name = _("FileList Update process"); running = false; } else { /* Assume it was a child process */ name = _("User process"); } if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { warn(_("%s exited with return code %d.\n"), name, WEXITSTATUS(status)); } else if (WIFSIGNALED(status)) { char signame[SIG2STR_MAX]; if (sig2str(WTERMSIG(status), signame) < 0) sprintf(signame, "%d", WTERMSIG(status)); warn(_("%s terminated by signal %s.\n"), name, signame); } } if (child < 0 && errno != ECHILD) warn(_("Cannot wait for processes - %s\n"), errstr); } else if (signal == SIGUSR1) { /* Not implemented yet, do nothing for now. */ } } /* Load and run a script. */ void run_script(const char *filename, bool allow_missing) { FILE *file; char *line = NULL; size_t line_len = 0; file = fopen(filename, "r"); if (file == NULL) { if (!allow_missing || errno != ENOENT) warn(_("%s: Cannot open file - %s\n"), quotearg(filename), errstr); return; } while (getline(&line, &line_len, file) > 0) { int c; for (c = strlen(line)-1; c > 0 && (line[c] == '\n' || line[c] == '\r'); c--) line[c] = '\0'; command_execute(line); } free(line); if (ferror(file)) { warn(_("%s: Cannot read from file - %s\n"), quotearg(filename), errstr); if (fclose(file) < 0) warn(_("%s: Cannot close file - %s\n"), quotearg(filename), errstr); return; } if (fclose(file) < 0) warn(_("%s: Cannot close file - %s\n"), quotearg(filename), errstr); } bool add_share_dir(const char *dir) { return true; } void add_search_result(struct sockaddr_in *addr, char *results, uint32_t resultlen) { DCUDPMessage *msg; /* int res = 0; */ /* if (search_udpmsg_out->cur == 0) { res = sendto(search_socket, results, resultlen, 0, (struct sockaddr *) addr, sizeof(struct sockaddr_in)); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, true, _("user (search result)")); return; } if (res == resultlen) return; } */ msg = xmalloc(sizeof(DCUDPMessage)+resultlen); msg->addr = *addr; msg->len = resultlen; memcpy(msg->data, results, resultlen); ptrv_append(search_udpmsg_out, msg); FD_SET(search_socket, &write_fds); } static void search_input_available(void) { struct sockaddr_in addr; socklen_t addrlen; int res; /* UDP socket reads are atomic! We are also non-blocking because select told us * there was data available. * * We don't really keep the received address, so we don't need recvfrom here. */ addrlen = sizeof(addr); res = byteq_recvfrom(search_recvq, search_socket, 0, (struct sockaddr *) &addr, &addrlen); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, false, _("user (search result)")); return; } dump_command(_("<=="), search_recvq->buf, search_recvq->cur); search_recvq->buf[search_recvq->cur-1] = '\0'; /* not strictly necessary */ handle_search_result(search_recvq->buf, search_recvq->cur); byteq_clear(search_recvq); } static void search_now_writable(void) { while (search_udpmsg_out->cur > 0) { DCUDPMessage *msg = search_udpmsg_out->buf[0]; int res; /* I don't think you can send off half a UDP packet, no. * Therefore we don't attempt to use non-blocking I/O on search_socket. */ dump_command(_("==>"), msg->data, msg->len); res = sendto(search_socket, msg->data, msg->len, 0, (struct sockaddr *) &msg->addr, sizeof(struct sockaddr_in)); if (res == 0 || (res < 0 && errno != EAGAIN)) warn_socket_error(res, true, _("user (search result)")); if (res < 0 && errno == EAGAIN) break; ptrv_remove_first(search_udpmsg_out); free(msg); } FD_CLR(search_socket, &write_fds); } static void disable_active(void) { if (listen_socket >= 0) { if (close(listen_socket) < 0) warn(_("Cannot close socket - %s\n"), errstr); /* XXX: (user connections server/listen socket) */ FD_CLR(listen_socket, &read_fds); listen_socket = -1; } } static bool enable_search(void) { struct sockaddr_in addr; socklen_t addr_len; int val; search_socket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); if (search_socket < 0) { warn(_("Cannot create socket - %s\n"), errstr); return false; } if (!fd_set_nonblock_flag(search_socket, true)) { warn(_("Cannot set non-blocking flag - %s\n"), errstr); return false; } val = 1; if (setsockopt(search_socket, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) warn(_("Cannot enable address reusing - %s\n"), errstr); if (listen_port != 0) { addr_len = sizeof(addr); addr.sin_family = AF_INET; addr.sin_port = htons(listen_port); addr.sin_addr.s_addr = htonl(INADDR_ANY); if (bind(search_socket, (struct sockaddr *) &addr, addr_len) < 0) { warn(_("Cannot bind to address - %s\n"), errstr); return false; } } FD_SET(search_socket, &read_fds); return true; } static bool enable_active(uint16_t port) { struct sockaddr_in addr; socklen_t addr_len; int val; /* Create sockets. */ listen_socket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); if (listen_socket < 0) { warn(_("Cannot create socket - %s\n"), errstr); disable_active(); return false; } /* Set non-blocking */ if (!fd_set_nonblock_flag(listen_socket, true)) { warn(_("Cannot set non-blocking flag - %s\n"), errstr); disable_active(); return false; } /* Enable listen address reusing */ val = 1; if (setsockopt(listen_socket, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) warn(_("Cannot enable address reusing - %s\n"), errstr); /* Bind to address. If not binding, port is selected randomly. */ addr_len = sizeof(addr); if (port != 0) { addr.sin_family = AF_INET; addr.sin_port = htons(port); if (force_listen_addr.s_addr != INADDR_NONE) { addr.sin_addr.s_addr = force_listen_addr.s_addr; } else { addr.sin_addr.s_addr = htonl(INADDR_ANY); } if (bind(listen_socket, (struct sockaddr *) &addr, addr_len) < 0) { warn(_("Cannot bind to address - %s\n"), errstr); disable_active(); return false; } } /* Start listening for connections. */ if (listen(listen_socket, LISTEN_QUEUE_CONNS) < 0) { warn(_("Cannot listen - %s\n"), errstr); disable_active(); return false; } /* Find port we are listening on. */ if (getsockname(listen_socket, (struct sockaddr *) &addr, &addr_len) < 0) { warn(_("Cannot get socket address - %s\n"), errstr); disable_active(); return false; } screen_putf(_("Listening on %s.\n"), sockaddr_in_str(&addr)); listen_port = ntohs(addr.sin_port); FD_SET(listen_socket, &read_fds); return true; } bool set_active(bool newactive, uint16_t port) { if (newactive) { disable_active(); if (!enable_active(port)) return false; } else { disable_active(); listen_port = port; } /* Start of disable_search. */ if (search_socket >= 0) { if (close(search_socket) < 0) warn(_("Cannot close socket - %s\n"), errstr); search_socket = -1; } /* End of disable_search. */ enable_search(); is_active = newactive; return true; } static void handle_listen_connection(void) { struct sockaddr_in addr; socklen_t addr_len; int socket; addr_len = sizeof(addr); socket = accept(listen_socket, (struct sockaddr *) &addr, &addr_len); if (socket < 0) { warn(_("Cannot accept user connection - %s\n"), errstr); return; } flag_putf(DC_DF_CONNECTIONS, _("User from %s connected.\n"), sockaddr_in_str(&addr)); user_connection_new(&addr, socket); } int main (int argc, char **argv) { uint32_t c; char *config_file; bool custom_config; char *tmpdir; struct sigaction sigact; set_quoting_style(NULL, escape_quoting_style); if (setlocale(LC_ALL, "") == NULL) warn(_("%s: Cannot set locale: %s\n"), argv[0], errstr); #ifdef ENABLE_NLS if (bindtextdomain(PACKAGE, LOCALEDIR) == NULL) warn(_("%s: Cannot bind message domain: %s\n"), argv[0], errstr); if (textdomain(PACKAGE) == NULL) warn(_("%s: Cannot set message domain: %s\n"), argv[0], errstr); #endif custom_config = false; get_package_file("config", &config_file); while (true) { c = getopt_long(argc, argv, short_opts, long_opts, NULL); if (c == -1) break; switch (c) { case 'c': /* --config */ custom_config = true; free(config_file); config_file = xstrdup(optarg); break; case 'n': /* --no-config */ free(config_file); config_file = NULL; break; case HELP_OPT: /* --help */ printf(_("Usage: %s [OPTION]...\n"), quotearg(argv[0])); puts(_("Start microdc, a command-line based Direct Connect client.\n")); printf(_(" -n, --no-config do not read config file on startup\n")); printf(_(" --help display this help and exit\n")); printf(_(" --version output version information and exit\n")); printf(_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); exit(EXIT_SUCCESS); case VERSION_OPT: /* --version */ version_etc(stdout, NULL, PACKAGE, VERSION, /*"Oskar Liljeblad",*/ "Vladimir Chugunov", NULL); exit(EXIT_SUCCESS); default: exit(EXIT_FAILURE); } } if (pipe(signal_pipe) < 0) { warn(_("Cannot create pipe pair - %s\n"), errstr); goto cleanup; } main_process_id = getpid(); sigact.sa_handler = signal_received; if (sigemptyset(&sigact.sa_mask) < 0) { warn(_("Cannot empty signal set - %s\n"), errstr); goto cleanup; } sigact.sa_flags = SA_RESTART; #ifdef HAVE_STRUCT_SIGACTION_SA_RESTORER sigact.sa_restorer = NULL; #endif /* Note: every signal registered with a non-ignore action here must * also be registered in user.c, either with an action or as ignored. */ if (sigaction(SIGINT, &sigact, NULL) < 0 || sigaction(SIGTERM, &sigact, NULL) < 0 || sigaction(SIGUSR1, &sigact, NULL) < 0 || sigaction(SIGCHLD, &sigact, NULL) < 0) { warn(_("Cannot register signal handler - %s\n"), errstr); goto cleanup; } sigact.sa_handler = SIG_IGN; if (sigaction(SIGPIPE, &sigact, NULL) < 0) { warn(_("Cannot register signal handler - %s\n"), errstr); goto cleanup; } FD_ZERO(&read_fds); FD_ZERO(&write_fds); FD_SET(signal_pipe[0], &read_fds); /*FD_SET(STDIN_FILENO, &read_fds);*/ hub_recvq = byteq_new(128); hub_sendq = byteq_new(128); user_conns = hmap_new(); hub_users = hmap_new(); pending_userinfo = hmap_new(); set_main_charset(""); set_hub_charset(""); set_fs_charset(""); user_conn_unknown_free = ptrv_new(); delete_files = ptrv_new(); delete_dirs = ptrv_new(); search_udpmsg_out = ptrv_new(); our_searches = ptrv_new(); search_recvq = byteq_new(8192); // same size as DC++ my_nick = xstrdup(PACKAGE); my_description = xstrdup(""); my_email = xstrdup(""); my_speed = xstrdup("56Kbps"); my_tag = xasprintf("%s V:%s", PACKAGE, VERSION); download_dir = xstrdup("."); tmpdir = tempdir(); if (tmpdir == NULL) { warn(_("Cannot find directory for temporary files - %s\n"), errstr); goto cleanup; } { char *filename = xasprintf("%s.%d", PACKAGE, getpid()); listing_dir = catfiles(tmpdir, filename); free(filename); } ptrv_append(delete_dirs, xstrdup(listing_dir)); is_active = false; listen_port = 0; if (!local_file_list_update_init()) goto cleanup; if (!set_active(false, listen_port)) goto cleanup; if (!enable_search()) goto cleanup; my_ul_slots = 3; if (!lookup_init()) goto cleanup; if (!file_list_parse_init()) goto cleanup; command_init(); if (!local_file_list_init()) { goto cleanup; } if (config_file != NULL) { run_script(config_file, !custom_config); free(config_file); config_file = NULL; } screen_prepare(); while (running) { fd_set res_read_fds; fd_set res_write_fds; int res; struct timeval tv; tv.tv_sec = 1; tv.tv_usec = 0; screen_redisplay_prompt(); res_read_fds = read_fds; res_write_fds = write_fds; res = TEMP_FAILURE_RETRY(select(FD_SETSIZE, &res_read_fds, &res_write_fds, NULL, &tv)); if (res < 0) { warn(_("Cannot select - %s\n"), errstr); break; } if (running && FD_ISSET(signal_pipe[0], &res_read_fds)) read_signal_input(); if (running && FD_ISSET(STDIN_FILENO, &res_read_fds)) screen_read_input(); if (running && listen_socket >= 0 && FD_ISSET(listen_socket, &res_read_fds)) handle_listen_connection(); if (running && hub_socket >= 0 && FD_ISSET(hub_socket, &res_read_fds)) hub_input_available(); if (running && hub_socket >= 0 && FD_ISSET(hub_socket, &res_write_fds)) hub_now_writable(); if (running) check_hub_activity(); if (running && search_socket >= 0 && FD_ISSET(search_socket, &res_read_fds)) search_input_available(); if (running && search_socket >= 0 && FD_ISSET(search_socket, &res_write_fds)) search_now_writable(); if (running && FD_ISSET(lookup_request_mq->fd, &res_write_fds)) lookup_request_fd_writable(); if (running && FD_ISSET(lookup_result_mq->fd, &res_read_fds)) lookup_result_fd_readable(); if (running && FD_ISSET(parse_request_mq->fd, &res_write_fds)) parse_request_fd_writable(); if (running && FD_ISSET(parse_result_mq->fd, &res_read_fds)) parse_result_fd_readable(); if (running && FD_ISSET(update_request_mq->fd, &res_write_fds)) update_request_fd_writable(); if (running && FD_ISSET(update_result_mq->fd, &res_read_fds)) update_result_fd_readable(); if (running) { HMapIterator it; hmap_iterator(user_conns, &it); while (running && it.has_next(&it)) { DCUserConn *uc = it.next(&it); if (uc->put_mq != NULL && FD_ISSET(uc->put_mq->fd, &res_write_fds)) user_request_fd_writable(uc); if (uc->get_mq != NULL && FD_ISSET(uc->get_mq->fd, &res_read_fds)) user_result_fd_readable(uc); } } } cleanup: hub_disconnect(); screen_finish(); command_finish(); local_file_list_update_finish(); file_list_parse_finish(); lookup_finish(); byteq_free(hub_recvq); byteq_free(hub_sendq); hmap_free(hub_users); /* Emptied by hub_disconnect */ hmap_free(pending_userinfo); /* Emptied by hub_disconnect */ byteq_free(search_recvq); ptrv_foreach(user_conn_unknown_free, free); ptrv_free(user_conn_unknown_free); ptrv_foreach(search_udpmsg_out, free); ptrv_free(search_udpmsg_out); ptrv_foreach(our_searches, (PtrVForeachCallback) free_search_request); ptrv_free(our_searches); hmap_foreach_value(user_conns, user_conn_cancel); /* XXX: follow up and wait for user connections to die? */ hmap_free(user_conns); if (our_filelist != NULL) filelist_free(our_filelist); set_main_charset(NULL); set_hub_charset(NULL); set_fs_charset(NULL); free(hub_name); free(my_nick); free(my_description); free(my_email); free(my_speed); free(my_tag); free(download_dir); free(listing_dir); if (delete_files != NULL) { for (c = 0; c < delete_files->cur; c++) { char *filename = delete_files->buf[c]; struct stat st; if (stat(filename, &st) < 0) { if (errno != ENOENT) warn(_("%s: Cannot get file status - %s\n"), quotearg(filename), errstr); free(filename); continue; } if (unlink(filename) < 0) warn(_("%s: Cannot remove file - %s\n"), quotearg(filename), errstr); free(filename); } ptrv_free(delete_files); } if (delete_dirs != NULL) { for (c = 0; c < delete_dirs->cur; c++) { char *filename = delete_dirs->buf[c]; struct stat st; if (stat(filename, &st) < 0) { if (errno != ENOENT) warn(_("%s: Cannot get file status - %s\n"), quotearg(filename), errstr); free(filename); continue; } if (rmdir(filename) < 0) warn(_("%s: Cannot remove file - %s\n"), quotearg(filename), errstr); free(filename); } ptrv_free(delete_dirs); } if (search_socket >= 0 && close(search_socket) < 0) warn(_("Cannot close search results socket - %s\n"), errstr); if (listen_socket >= 0 && close(listen_socket) < 0) warn(_("Cannot close user connections socket - %s\n"), errstr); if (signal_pipe[0] >= 0 && close(signal_pipe[0]) < 0) warn(_("Cannot close signal pipe - %s\n"), errstr); if (signal_pipe[1] >= 0 && close(signal_pipe[1]) < 0) warn(_("Cannot close signal pipe - %s\n"), errstr); free(config_file); exit(EXIT_SUCCESS); } microdc2-0.15.6/src/microdc.10100644000076500007500000000503110516626546015655 0ustar chugunovmicrodc.\" -*- nroff -*- .\" microdc.1 - Manual page for microdc. .\" .\" Copyright (C) 2004, 2005 Oskar Liljeblad .\" .\" 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. .\" .TH MICRODC "1" "September 17, 2005" "microdc" .SH NAME microdc - A command-line based Direct Connect client .SH SYNOPSIS .B microdc .RI [ OPTION ]... .SH DESCRIPTION microdc is a command-line based Direct Connect client that uses the GNU Readline library for user interaction. It was developed from ground up and does not depend on any other program. Despite the command-line user interface, microdc was designed to be user friendly and simple to use. .SH OPTIONS This program follows the usual GNU command line syntax, with long options starting with two dashes (`--'). .TP \fB\-c, \-\-config\fR=\fIFILE\fR Read configuration script from FILE rather than ~/.microdc/config. .TP \fB\-n, \-\-no\-config\fR Do not read config file on startup. .TP \fB\-\-help\fR Show summary of options. .TP \fB\-\-version\fR Output version information and exit. .SH FILES The following files are used by microdc (~ represents the current user's home directory): .TP \fB~/.microdc/config\fR This file is loaded on startup. It contains commands, one per line, that will be executed on startup. You can override loading of this file with --config and --no-config. .TP \fB~/.microdc/history\fR This is the command history file. It contains a list of commands that were typed and executed from the microdc prompt. It can safely be removed. .SH REPORTING BUGS Report bugs to <\fIoskar@osk.mine.nu\fP>. .SH AUTHOR The author of \fBmicrodc\fP and this manual page is Oskar Liljeblad <\fIoskar@osk.mine.nu\fP>. .SH COPYRIGHT Copyright \(co 2004, 2005 Oskar Liljeblad This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. microdc2-0.15.6/src/microdc.h0100664000076500007500000005667010543543203015751 0ustar chugunovmicrodc/* microdc.h - Header file for the project * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MICRODC_H #define MICRODC_H #include #include #include #include #include #include /* struct addrinfo */ #include /* POSIX: O_NONBLOCK */ #include /* POSIX: DIR, struct dirent */ #include /* Gnulib, GNU libc: iconv_t */ #include "common/byteq.h" #include "common/ptrv.h" #include "common/error.h" #include "common/hmap.h" #include "common/msgq.h" #define DC_CLIENT_BASE_KEY 5 #define DC_HUB_TCP_PORT 411 #define DC_CLIENT_UDP_PORT 412 #define DC_USER_MAX_CONN 2 #define SEARCH_TIME_THRESHOLD 60 /* Add no more results to searches after this many seconds elapsed */ typedef enum { DC_CPL_DIR = 1 << 0, /* complete directories or symlinks to directories */ DC_CPL_REG = 1 << 1, /* complete regular files or symlinks to regular files */ DC_CPL_EXE = 1 << 2, /* complete regular files or symlinks to regular files that are executable according to access */ DC_CPL_DOT = 1 << 3, /* always complete files and dirs starting with `.', even if file part of `word' does not start with `.' */ } DCFSCompletionFlags; typedef enum { DC_DF_DEBUG = 1 << 0, /* Various debug messages */ DC_DF_JOIN_PART = 1 << 1, /* Joins and Quits messages */ DC_DF_PUBLIC_CHAT = 1 << 2, /* Public chat */ DC_DF_SEARCH_RESULTS = 1 << 3, /* Incoming search results */ DC_DF_UPLOAD = 1 << 4, /* "Upload complete" message (not errors) */ DC_DF_DOWNLOAD = 1 << 5, /* "Download complete" message (not errors) */ DC_DF_CONNECTIONS = 1 << 6, /* User connections and normal disconnections */ DC_DF_COMMON = 1 << 7, /* Common messages always displayed (XXX: get rid of this?) */ } DCDisplayFlag; typedef enum { DC_TF_NORMAL, /* Normal file transfer */ DC_TF_LIST, /* Transfer of MyList.DcLst */ } DCTransferFlag; typedef enum { DC_DIR_UNKNOWN, DC_DIR_SEND, DC_DIR_RECEIVE, } DCTransferDirection; typedef enum { DC_ACTIVE_UNKNOWN, /* unknown, the default */ DC_ACTIVE_KNOWN_ACTIVE, /* we got a ConnectToMe from user */ DC_ACTIVE_RECEIVED_PASSIVE, /* we got a RevConnectToMe from user */ DC_ACTIVE_SENT_PASSIVE, /* we sent a RevConnectToMe to user, but haven't received anything yet */ DC_ACTIVE_SENT_ACTIVE, /* we sent a ConnectToMe to user, but haven't received a connection yet */ } DCActiveState; typedef enum { DC_USER_DISCONNECTED, DC_USER_CONNECT, /* Waiting for connect() to complete or socket to be writable */ DC_USER_MYNICK = 35, /* Waiting for $MyNick */ DC_USER_LOCK, /* Waiting for $Lock */ DC_USER_DIRECTION, /* Waiting for $Direction */ DC_USER_SUPPORTS, /* Waiting for $Supports */ DC_USER_KEY, /* Waiting for $Key */ DC_USER_GET, /* Waiting for $Get (only when sending) */ DC_USER_SEND_GET, /* Waiting for $Send or $Get (only when sending) */ DC_USER_FILE_LENGTH, /* Waiting for $FileLength (only when receiving) */ DC_USER_DATA_RECV, /* Waiting for file data (only when receiving) */ DC_USER_DATA_SEND, } DCUserState; typedef enum { DC_HUB_DISCONNECTED, DC_HUB_LOOKUP, /* Waiting for getaddrinfo lookup to complete */ DC_HUB_CONNECT, /* Waiting for connect() to complete or socket to be writable */ DC_HUB_LOCK, /* Waiting for $Lock */ DC_HUB_HELLO, /* Waiting for $Hello */ DC_HUB_LOGGED_IN, /* Correctly logged in */ } DCHubState; /* The order of fields in DCFileType is important for sorting * completion entries as well. */ typedef enum { DC_TYPE_DIR, DC_TYPE_REG, } DCFileType; typedef enum { DC_LS_LONG_MODE = 1, DC_LS_TTH_MODE = 2, } DCLsMode; typedef enum { DC_MSG_SCREEN_PUT, DC_MSG_WANT_DOWNLOAD, DC_MSG_VALIDATE_DIR, DC_MSG_VALIDATE_NICK, DC_MSG_GET_MY_NICK, DC_MSG_CHECK_DOWNLOAD, /* get information on next download, allocate slot. */ DC_MSG_CHECK_UPLOAD, /* check that upload is allowed, allocate slot. */ DC_MSG_UPLOAD_ENDED, /* free slot and print info about upload. */ DC_MSG_DOWNLOAD_ENDED, /* free slot and mark download as done or failed. */ DC_MSG_TRANSFER_START, DC_MSG_TRANSFER_STATUS, DC_MSG_TERMINATING, /* the user process decided to terminate. */ } DCUserMsgId; typedef enum { DC_SEARCH_ANY, DC_SEARCH_AUDIO, DC_SEARCH_COMPRESSED, DC_SEARCH_DOCUMENTS, DC_SEARCH_EXECUTABLES, DC_SEARCH_PICTURES, DC_SEARCH_VIDEO, DC_SEARCH_FOLDERS, DC_SEARCH_CHECKSUM, /* DC++: TTH at the moment */ } DCSearchDataType; typedef enum { DC_QS_QUEUED, /* also meaning, "not touched" */ DC_QS_PROCESSING, /* currently being downloaded or about to be downloaded */ DC_QS_DONE, /* succesfully downloaded (XXX or already complete) */ DC_QS_ERROR, /* error occured during download */ } DCQueuedStatus; typedef enum { DC_ADCGET_FILE, /* Upload by filename */ DC_ADCGET_TTH, /* Upload by file root */ DC_ADCGET_TTHL /* Upload tth leaves */ } DCAdcgetType; typedef struct _DCUserConn DCUserConn; typedef struct _DCUserInfo DCUserInfo; typedef struct _DCFileList DCFileList; typedef struct _DCCompletionEntry DCCompletionEntry; typedef struct _DCCompletionInfo DCCompletionInfo; typedef struct _DCSearchSelection DCSearchSelection; typedef struct _DCSearchString DCSearchString; typedef struct _DCSearchRequest DCSearchRequest; typedef struct _DCUDPMessage DCUDPMessage; typedef struct _DCSearchResponse DCSearchResponse; typedef struct _DCQueuedFile DCQueuedFile; typedef struct _DCVariable DCVariable; typedef struct _DCLookup DCLookup; /* defined in lookup.c */ typedef struct _DCFileListParse DCFileListParse; /* defined in filelist-in.c */ typedef void (*DCCompletorFunction)(DCCompletionInfo *ci); typedef void (*DCBuiltinCommandHandler)(int argc, char **argv); typedef void (*ScreenWriter)(DCDisplayFlag flag, const char *format, va_list args); typedef void (*DCLookupCallback)(int rc, struct addrinfo *result_ai, void *data); /* This callback is responsible for freeing node when no longer needed. */ typedef void (*DCFileListParseCallback)(DCFileList *node, void *data); struct _DCSearchResponse { uint32_t refcount; DCUserInfo *userinfo; char *filename; // local namespace DCFileType filetype; uint64_t filesize; uint32_t slots_free; uint32_t slots_total; char *hub_name; struct sockaddr_in hub_addr; }; struct _DCUDPMessage { struct sockaddr_in addr; uint32_t len; char data[0]; }; struct _DCSearchString { char *str; uint32_t len; uint16_t delta[256]; }; struct _DCSearchSelection { uint64_t size_min; uint64_t size_max; DCSearchDataType datatype; uint32_t patterncount; DCSearchString *patterns; }; struct _DCSearchRequest { DCSearchSelection selection; time_t issue_time; PtrV *responses; }; struct _DCCompletionInfo { const char *line; int ws; /* may be modified */ int we; /* may not be modified. */ char *word; /* dequoted word */ char *word_full; /* word not touched */ int word_index; PtrV *results; }; struct _DCCompletionEntry { /* What to display for this completion result. * This should not be escaped or quoted, regardless * of the value of quoted. */ char *display; /* display_fmt is a printf-like format which will * be passed display for first and only argument when * creating the final string to display. This field * is usually just "%s". */ const char *display_fmt; /* What to place in the command line for this result. */ char *input; /* input_fmt is a printf-like format which will be * passed input for the first and only argument when * creating the final input string. */ const char *input_fmt; /* If input_single_fmt is non-NULL, it will be * used as the printf-like format if input_fmt is the * only match. */ const char *input_single_fmt; /* If finalize is true, then the completion will end if this * this entry is the single match. It basicly means that * a space will be appended so that the caret will be moved * to a new word. If the word is quoted, a closing quote * will be added as well. */ bool finalize; /* quoted should be true if input is already quoted. * if quoted is true and input starts with a double quote, * input must also end in a double quote regardless of * finalize. */ bool quoted; /* These fields are used for sorting purposes. * This is currently only used by remote and local fs * completion generators. */ union { DCFileType file_type; } sorting; }; struct _DCFileList { DCFileList *parent; char *name; DCFileType type; uint64_t size; /* total size of all contained files for DC_TYPE_DIR */ union { struct { char has_tth; char tth[39]; time_t mtime; } reg; struct { char *real_path; HMap *children; } dir; }; }; struct _DCQueuedFile { char *filename; /* XXX: should make this relative, not absolute */ char *base_path; /* XXX: so that catfiles(base_path, filename) works. */ DCTransferFlag flag; DCQueuedStatus status; uint64_t length; }; struct _DCUserInfo { char *nick; char *description; char *speed; uint8_t level; char *email; uint64_t share_size; DCActiveState active_state; PtrV *download_queue; uint16_t slot_granted; uint32_t refcount; bool info_quered; bool is_operator; DCUserConn *conn[DC_USER_MAX_CONN]; /* valid elements: conn[0..conn_count-1] */ int conn_count; /* valid range: 0 <= conn_count <= DC_USER_MAX_CONN */ }; struct _DCUserConn { char *name; /* key of connection */ bool disconnecting; DCUserInfo *info; /* if info!=NULL then info->conn must contain this DCUserConn. */ DCTransferDirection dir; pid_t pid; //int main_socket; //IPC *ipc; MsgQ *get_mq; MsgQ *put_mq; /* Note: The main process may only put message on put_mq as a result of * a message just received on get_mq. */ bool occupied_slot; /* true if used_*_slots were increased for this user connection */ bool occupied_minislot; /* true if used_mini_slots were increased for this user connection */ uint32_t queue_pos; bool queued_valid; /* true unless the QueuedFile by queue_pos has been removed */ char *transfer_file; char *local_file; bool transferring; uint64_t transfer_start; /* the byte where the transfer started */ uint64_t transfer_pos; /* current byte position */ uint64_t transfer_total; /* total number of bytes to transfer */ time_t transfer_time; /*bool we_connected;*/ }; struct _DCVariable { char *name; char *(*getter)(DCVariable *var); void (*setter)(DCVariable *var, int argc, char **argv); /* argc >= 1 */ void *value; DCCompletorFunction completor; void *type_details; char *help_string; }; extern ScreenWriter screen_writer; extern char *log_filename; extern DCHubState hub_state; extern ByteQ *hub_recvq; extern ByteQ *hub_sendq; extern HMap *hub_users; extern HMap *user_conns; extern struct sockaddr_in local_addr; extern struct in_addr force_listen_addr; extern int hub_socket; extern bool running; extern HMap *pending_userinfo; extern uint32_t display_flags; extern uint32_t log_flags; extern uint16_t listen_port; extern char *my_tag; extern char *my_nick; extern char *my_description; extern char *my_speed; extern char *my_email; extern uint64_t my_share_size; extern char *download_dir; extern char *listing_dir; extern bool is_active; extern bool auto_reconnect; extern uint32_t my_ul_slots; extern fd_set read_fds; extern fd_set write_fds; extern char *my_password; extern PtrV *delete_files; /* XXX: use LList? */ extern PtrV *delete_dirs; /* XXX: use LList? */ extern uint32_t minislot_count; extern uint32_t minislot_size; extern int used_mini_slots; extern int used_ul_slots; extern int used_dl_slots; extern DCFileList *browse_list; /* list of user we browse */ extern DCUserInfo *browse_user; /* user we browse OR WISH to browse, NULL if possibly browsing ourself */ extern bool browsing_myself; extern char *browse_path; extern char *browse_path_previous; /* recorded for `cd -' purposes */ extern pid_t shell_child; /* hub.c */ void hub_input_available(void); bool hub_putf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); bool hub_connect_user(DCUserInfo *ui); DCUserInfo *user_info_new(const char *nick); DCUserInfo *find_hub_user(const char *nick); void user_info_free(DCUserInfo *ui); void hub_new(const char *hostname, uint16_t port); void hub_connect(struct sockaddr_in *addr); void hub_disconnect(void); void hub_reconnect(void); void hub_now_writable(void); void check_hub_activity(); bool send_my_info(void); extern struct sockaddr_in hub_addr; extern char *hub_name; void say_user_completion_generator(DCCompletionInfo *ci); void user_completion_generator(DCCompletionInfo *ci); void user_or_myself_completion_generator(DCCompletionInfo *ci); void user_with_queue_completion_generator(DCCompletionInfo *ci); void hub_reload_users(); void hub_set_connected(bool state); /* command.c */ void command_execute(const char *line); void default_completion_selector(DCCompletionInfo *ci); void update_prompt(void); void command_init(void); void command_finish(void); void browse_list_parsed(DCFileList *node, void *data); /* screen.c */ #define screen_putf(f,...) flag_putf(DC_DF_COMMON, (f), ## __VA_ARGS__) void flag_putf(DCDisplayFlag flag, const char *format, ...) __attribute__ ((format (printf, 2, 3))); void screen_erase_and_new_line(void); void screen_finish(void); void screen_suspend(void); void screen_wakeup(bool print_newline_first); void screen_prepare(void); void screen_redisplay_prompt(); void screen_read_input(void); void screen_get_size(int *rows, int *cols); void set_screen_prompt(const char *prompt, ...) __attribute__ ((format (printf, 1, 2))); bool set_log_file(const char *new_filename, bool verbose); void sorted_list_completion_generator(const char *base, PtrV *results, void *items, size_t item_count, size_t item_size, size_t key_offset); /* completion */ DCCompletionEntry *new_completion_entry(const char *input, const char *display); /* completion */ DCCompletionEntry *new_completion_entry_full(char *input, char *display, const char *input_fmt, const char *display_fmt, bool finalize, bool quoted); void free_completion_entry(DCCompletionEntry *entry); /* completion */ void get_file_dir_part(const char *word,char **dir_part,const char **file_part); /* completion */ void fill_completion_info(DCCompletionInfo *ci); char *quote_string(const char *str, bool dquotes, bool finalize); char *filename_quote_string(const char *str, bool dquotes, bool finalize); int completion_entry_display_compare(const void *e1, const void *e2); int completion_entry_int_userdata_compare(const void *e1, const void *e2); /* huffman.c */ char *huffman_decode(const uint8_t *data, uint32_t data_size, uint32_t *out_size); char *huffman_encode(const uint8_t *data, uint32_t data_size, uint32_t *out_size); /* user.c */ void user_main(int get_fd[2], int put_fd[2], struct sockaddr_in *addr, int sock); /* main.c */ /*bool get_user_conn_status(DCUserConn *uc);*/ bool set_active(bool newactive, uint16_t newport); bool add_share_dir(const char *dir); bool del_share_dir(const char *dir); bool has_user_conn(DCUserInfo *info, DCTransferDirection dir); uint32_t get_user_conn_count(DCUserInfo *info); bool get_package_file(const char *name, char **outname); void transfer_completion_generator(DCCompletionInfo *ci); void user_conn_cancel(DCUserConn *uc); void warn_file_error(int res, bool write, const char *filename); void warn_socket_error(int res, bool write, const char *subject, ...); void add_search_result(struct sockaddr_in *addr, char *results, uint32_t resultlen); void free_queued_file(DCQueuedFile *qf); /* XXX: move transfer.c? */ DCUserConn *user_connection_new(struct sockaddr_in *addr, int socket); /*void user_disconnect(DCUserConn *uc);*/ char *user_conn_status_to_string(DCUserConn *uc, time_t now); extern uint64_t bytes_received; extern uint64_t bytes_sent; /* fs.c */ DCFileList *new_file_node(const char *name, DCFileType type, DCFileList *parent); void rename_node(DCFileList *node, const char* new_name); void set_child_node(DCFileList *parent, DCFileList *child); void filelist_free(DCFileList *fl); void filelist_list(DCFileList *fl, int mode); DCFileList *filelist_lookup(DCFileList *node, const char *filename); char *filelist_get_path(DCFileList *node); char *filelist_get_path_with_trailing_slash(DCFileList *node); char *resolve_upload_file(DCUserInfo *ui, DCAdcgetType ul_type, const char *name, DCTransferFlag* flag, uint64_t* size); char *resolve_download_file(DCUserInfo *ui, DCQueuedFile *queued); bool filelist_create(const char *dir); char *translate_local_to_remote(const char *localname); char *translate_remote_to_local(const char *remotename); void local_fs_completion_generator(DCCompletionInfo *ci, DCFSCompletionFlags flags); void local_path_completion_generator(DCCompletionInfo *ci); void local_dir_completion_generator(DCCompletionInfo *ci); void remote_path_completion_generator(DCCompletionInfo *ci); void remote_dir_completion_generator(DCCompletionInfo *ci); char *apply_cwd(const char *path); /* XXX: move transfer.c? */ extern DCFileList *our_filelist; extern time_t our_filelist_last_update; void filelist_list_recursively(DCFileList *node, char *basepath); void remote_wildcard_expand(char *matchpath, bool *quotedptr, const char *basedir, DCFileList *basenode, PtrV *results); bool has_leading_slash(const char *str); void dir_to_filelist(DCFileList *parent, const char *path); bool write_filelist_file(DCFileList* root, const char* prefix); /* xml_flist.c */ int write_xml_filelist(int fd, DCFileList* root); int write_bzxml_filelist(int fd, DCFileList* root); DCFileList* filelist_xml_open(const char* filename); DCFileList* filelist_bzxml_open(const char* filename); /* connection.c */ char *decode_lock(const char *lock, size_t locklen, uint32_t basekey); char *escape_message(const char *str); char *unescape_message(const char *str); void dump_command(const char *header, const char *buf, size_t len); /* util.c */ int safe_rename(const char *oldpath, const char *newpath); int ilog10(uint64_t c); int mkdirs_for_file(char *filename); char *catfiles(const char *p1, const char *p2); char *catfiles_with_trailing_slash(const char *p1, const char *p2); bool fd_set_status_flags(int fd, bool set, int modflags); #define fd_set_nonblock_flag(f,s) fd_set_status_flags(f,s,O_NONBLOCK) char *getenv_default(const char *name, char *defvalue); #include "tth_file.h" #define COMPARE_RETURN(a,b) { if ((a) < (b)) return -1; if ((a) > (b)) return 1; } #define COMPARE_RETURN_FUNC(f) { int _c = (f); if (_c != 0) return _c; } char *sockaddr_in_str(struct sockaddr_in *addr); char *in_addr_str(struct in_addr addr); bool parse_ip_and_port(char *source, struct sockaddr_in *addr, uint16_t defport); #define xquotestr(s) (quotearg_alloc((s), SIZE_MAX, NULL)) #define quotearg_mem(m,l) (quotearg_n_style_mem(0, escape_quoting_style, (m), (l))) char *join_strings(char **strs, int count, char mid); PtrV *wordwrap(const char *str, size_t len, size_t first_width, size_t other_width); struct dirent *xreaddir(DIR *dh); #define LONGEST_ELAPSED_TIME 22 /* 123456789012dNNhNNmNNs */ char *elapsed_time_to_string(time_t elapsed, char *buf); /* search.c */ int parse_search_selection(char *str, DCSearchSelection *data); bool perform_inbound_search(DCSearchSelection *data, DCUserInfo *ui, struct sockaddr_in *addr); extern PtrV *our_searches; bool add_search_request(char *args); void handle_search_result(char *buf, uint32_t len); void free_search_request(DCSearchRequest *sr); char *search_selection_to_string(DCSearchSelection *sr); void search_string_new(DCSearchString *sp, const char *p, int len); void search_hash_new(DCSearchString *sp, const char *p, int len); void search_string_free(DCSearchString *sp); /* variables.c */ void cmd_set(int argc, char **argv); void set_command_completion_selector(DCCompletionInfo *ci); /* lookup.c */ extern MsgQ *lookup_request_mq; extern MsgQ *lookup_result_mq; extern pid_t lookup_child; bool lookup_init(void); void lookup_request_fd_writable(void); void lookup_result_fd_readable(void); DCLookup *add_lookup_request(const char *node, const char *service, const struct addrinfo *hints, DCLookupCallback callback, void *userdata); void cancel_lookup_request(DCLookup *lookup); void lookup_finish(void); /* filelist-in.c */ extern MsgQ *parse_request_mq; extern MsgQ *parse_result_mq; extern pid_t parse_child; bool file_list_parse_init(void); void file_list_parse_finish(void); DCFileListParse *add_parse_request(DCFileListParseCallback callback, const char *filename, void *userdata); void cancel_parse_request(DCFileListParse *parse); void parse_result_fd_readable(void); void parse_request_fd_writable(void); void* data_to_filelist(void *dataptr, DCFileList **outnode); void filelist_to_data(DCFileList *node, void **dataptr, size_t *sizeptr); /* local_flist.c */ extern MsgQ *update_request_mq; extern MsgQ *update_result_mq; extern pid_t update_child; extern char* update_status; extern time_t filelist_refresh_timeout; bool local_file_list_update_init(void); bool local_file_list_init(void); void local_file_list_update_finish(void); bool update_request_add_shared_dir(const char* dir); bool update_request_del_shared_dir(const char* dir); bool update_request_set_listing_dir(const char* dir); bool update_request_set_hub_charset(const char* charset); bool update_request_set_fs_charset(const char* charset); bool update_request_set_filelist_refresh_timeout(time_t seconds); /* DCFileListParse *add_parse_request(DCFileListParseCallback callback, const char *filename, void *userdata); void cancel_parse_request(DCFileListParse *parse); */ void update_result_fd_readable(void); void update_request_fd_writable(void); /* charsets.c */ #include "charsets.h" EXPORT_CHARSET(main); EXPORT_CHARSET(hub); EXPORT_CHARSET(fs); EXPORT_CHARSET(log); EXPORT_CONST_CHARSET(utf8); void set_main_charset(const char* charset); void set_hub_charset(const char* charset); void set_fs_charset(const char* charset); void set_log_charset(const char* charset); EXPORT_ICONV_CONVERSION(main, hub); EXPORT_ICONV_CONVERSION(hub, main); EXPORT_ICONV_CONVERSION(main, fs); EXPORT_ICONV_CONVERSION(fs, main); EXPORT_ICONV_CONVERSION(hub, fs); EXPORT_ICONV_CONVERSION(fs, hub); EXPORT_ICONV_CONVERSION(main, log); EXPORT_ICONV_CONVERSION(log, main); #if defined(HAVE_LIBXML2) EXPORT_ICONV_CONVERSION(utf8, fs); EXPORT_ICONV_CONVERSION(fs, utf8); EXPORT_ICONV_CONVERSION(utf8, main); EXPORT_ICONV_CONVERSION(main, utf8); EXPORT_ICONV_CONVERSION(utf8, hub); EXPORT_ICONV_CONVERSION(hub, utf8); #endif #endif microdc2-0.15.6/src/microdc.pl.10100644000076500007500000000416210516626546016273 0ustar chugunovmicrodc.\" -*- nroff -*- .\" microdc.1 - Manual page for microdc. .\" .\" Copyright (C) 2005, 2005 Oskar Liljeblad .\" .\" 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. .\" .TH MICRODC "1" "May 6, 2005" "microdc" .SH NAZWA microdc - klient Direct Connect z interfejsem tekstowym .SH SK£ADNIA .B microdc .RI [ OPCJE ]... .SH OPIS microdc jest tekstowym klientem Direct Connect, u¿ywaj±cym biblioteki GNU Readline do komunikacji z u¿ytkownikiem. Zosta³ napisany od podstaw i nie korzysta z ¿adnego innego programu. Pomimo wy³±cznie tekstowego interfejsu u¿ytkownika, microdc zosta³ zaprojektowany tak, aby byæ przyjaznym dla u¿ytkownika i prostym w obs³udze. .SH OPCJE Program ten wykorzystuje zwyczajn± sk³adnie poleceñ GNU, z d³ugimi opcjami zaczynaj±cymi siê od dwóch my¶lników (--). .TP .B \-\-help Pokazuje krótki opis dostêpnych opcji. .TP .B \-\-version Wy¶wietla informacjê o wersji i koñczy program. .SH ZG£ASZANIE B£ÊDÓW B³êdy proszê zg³aszaæ na adres <\fIoskar@osk.mine.nu\fP>. .SH AUTOR Autorem \fBmicrodc\fP jest Oskar Liljeblad <\fIoskar@osk.mine.nu\fP>. Autorem polskiego t³umaczenia programu i strony podrêcznika systemowego jest Jakub Jankowski <\fIshasta@atn.pl\fP> .SH PRAWA AUTORSKIE Copyright \(co 2004, 2005 Oskar Liljeblad To jest wolne oprogramowanie; zajrzyj do ¼róde³ po warunki rozpowszechniania. Nie ma ¯ADNEJ gwarancji, nawet domy¶lnej gwarancji PRZYDATNO¦CI HANDLOWEJ albo PRZYDATNO¦CI DO OKRE¦LONYCH ZASTOSOWAÑ. microdc2-0.15.6/src/microdc_tth.c0100664000076500007500000002512410533252373016615 0ustar chugunovmicrodc#include #include /* for errstr */ #include /* ? */ #include /* ? */ #include /* POSIX */ #include /* ? */ #include /* C89 */ #include /* ? */ #include #include #include #include #include #include #include "version-etc.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "dirname.h" /* Gnulib */ #include "tth/tth.h" #include "tth_file.h" #define errstr (strerror(errno)) struct dirent *xreaddir(DIR *dh); char *catfiles(const char *p1, const char *p2); int process_directory(const char* directory); enum { VERSION_OPT = 256, HELP_OPT }; static const char *short_opts = "rf"; static struct option long_opts[] = { { "report", no_argument, NULL, 'r' }, { "print-files", no_argument, NULL, 'f' }, { "version", no_argument, NULL, VERSION_OPT }, { "help", no_argument, NULL, HELP_OPT }, { 0, } }; const char version_etc_copyright[] = "Copyright (C) 2006 Vladimir Chugunov"; double avg_speed = 0; off_t directory_count = 0; off_t directory_failed = 0; off_t total_files = 0; off_t existing_files = 0; off_t new_files = 0; off_t removed_files = 0; off_t failed_files = 0; int report = 0; int print_files = 0; int main(int argc, char* argv[]) { char *directory = NULL; int i, count_failed = 0; struct timeval start_time, end_time; int print_help = 0; int opt = -1, long_idx = -1; while (!print_help && (-1 != (opt = getopt_long(argc, argv, short_opts, long_opts, &long_idx)))) { switch (opt) { case 'r': report = 1; break; case 'f': print_files = 1; break; case VERSION_OPT: version_etc(stdout, NULL, base_name(argv[0]), VERSION, "Vladimir Chugunov", NULL); exit(EXIT_SUCCESS); case HELP_OPT: print_help = 1; break; default: fprintf(stderr, "unknown option value %d\n", opt); break; } } if (argc < 2 || print_help) { fprintf(stderr, "Usage: %s [-r|--report] [-f|--print-files] directory [directory...]\n\n", base_name(argv[0])); fprintf(stderr, "Maintain TTH for microdc shared files.\n\n" "Available options:\n" " -r, --report - reports some statistic at the end of processing\n" " -f, --print-files - print file names during processing\n" " --version - print version information\n" " --help - print this help\n\n"); return 255; } gettimeofday(&start_time, NULL); for (i = optind; i < argc; i++) { directory = argv[i]; if (process_directory(directory) != 0) { count_failed++; } } gettimeofday(&end_time, NULL); if (report) { unsigned long elapsed_sec = end_time.tv_sec - start_time.tv_sec; unsigned long elapsed_usec = 0; if (end_time.tv_usec > start_time.tv_usec) { elapsed_usec = end_time.tv_usec - start_time.tv_usec; } else { elapsed_sec -= 1; elapsed_usec = 1000000 + end_time.tv_usec - start_time.tv_usec; } printf("%lld directories processed in %ld hours %02ld minutes %02ld.%03ld seconds:\n", directory_count, (elapsed_sec / 3600), ((elapsed_sec / 60) % 60), (elapsed_sec % 60), (elapsed_usec / 1000)); printf("FILES: total:%8lld, existing:%8lld, new:%8lld\n" " removed:%8lld, failed:%8lld\n", total_files, existing_files, new_files, removed_files, failed_files); printf("AVERAGE SPEED: %10.6f KB/sec\n", avg_speed); } if (count_failed == (argc-1)) { return 3; } else if (count_failed > 0) { return 4; } return 0; } int process_directory(const char* path) { struct dirent *ep; DIR *dp = NULL, *tth_dp = NULL; char* tth_path = NULL; dp = opendir(path); if (dp == NULL) { if (print_files) { fprintf(stderr, "%s: Cannot open directory - %s\n", path, errstr); } directory_failed ++; return errno; } directory_count ++; tth_path = catfiles(path, tth_directory_name); tth_dp = opendir(tth_path); if (tth_dp == NULL) { if (0 == mkdir(tth_path, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) { tth_dp = opendir(tth_path); if (tth_dp == NULL) { if (print_files) { fprintf(stderr, "%s: Cannot open directory - %s\n", tth_path, errstr); } } } else { if (print_files) { fprintf(stderr, "%s: Cannot create directory - %s\n", tth_path, errstr); } } if (tth_dp == NULL) { free(tth_path); closedir(dp); return errno; } } while ((ep = xreaddir(dp)) != NULL) { struct stat st; char *fullname; if (IS_SPECIAL_DIR(ep->d_name)) continue; /* If we ran into looped symlinked dirs, stat will stop (errno=ELOOP). */ fullname = catfiles(path, ep->d_name); if (stat(fullname, &st) < 0) { if (print_files) { fprintf(stderr, "%s: Cannot get file status - %s\n", fullname, errstr); } free(fullname); continue; } if (S_ISDIR(st.st_mode)) { process_directory(fullname); } else if (S_ISREG(st.st_mode)) { struct stat tth_st; int create = 0, stat_result, tth_fd = -1; char *tth_fname = xasprintf("%s%s%s%s", tth_path, tth_path[0] == '\0' || tth_path[strlen(tth_path)-1] == '/' ? "" : "/", ep->d_name, ".tth"); total_files ++; stat_result = stat(tth_fname, &tth_st); if (stat_result < 0 && errno == ENOENT) { // file not found create = 1; } else if (stat_result == 0) { tth_fd = open(tth_fname, O_RDONLY); if (tth_fd >= 0) { uint64_t fsize; time_t mtime, ctime; char tth[39]; if (read(tth_fd, &fsize, sizeof(fsize)) != sizeof(fsize) || st.st_size != fsize || read(tth_fd, &mtime, sizeof(mtime)) != sizeof(mtime) || st.st_mtime != mtime || read(tth_fd, &ctime, sizeof(ctime)) != sizeof(ctime) || st.st_ctime != ctime || read(tth_fd, tth, sizeof(tth)) != sizeof(tth)) { printf("%s: existing TTH is old or currupted\n", fullname); create = 1; } close(tth_fd); tth_fd = -1; } } else { // error occured - just continue } if (create != 0) { struct timeval file_start_time; struct timeval file_end_time; if (print_files) { printf("%s...", fullname); fflush(stdout); } gettimeofday(&file_start_time, NULL); unsigned char* p_tth = tth(fullname, 0, st.st_size); int failed = 0; tth_fd = open(tth_fname, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); if (tth_fd >= 0) { uint64_t fsize = st.st_size; time_t mtime = st.st_mtime, ctime = st.st_ctime; if (write(tth_fd, &fsize, sizeof(fsize)) != sizeof(fsize) || write(tth_fd, &mtime, sizeof(mtime)) != sizeof(mtime) || write(tth_fd, &ctime, sizeof(ctime)) != sizeof(ctime) || write(tth_fd, p_tth, strlen(p_tth)) != strlen(p_tth)) { failed = 1; } close(tth_fd); } if (failed != 0) { unlink(tth_fname); failed_files ++; } else { new_files ++; } free(p_tth); gettimeofday(&file_end_time, NULL); double speed = ((st.st_size/1024)*1000000)/(double)((file_end_time.tv_sec*1000000+file_end_time.tv_usec)-(file_start_time.tv_sec*1000000+file_start_time.tv_usec)); if (avg_speed == 0.) { avg_speed = speed; } else { avg_speed = (avg_speed + speed) / 2; } if (print_files) { printf("done (spd=%10.4fKB/sec, avg=%10.4fKB/sec)\n", speed, avg_speed); fflush(stdout); } } else { existing_files ++; } free(tth_fname); } else { if (print_files) { fprintf(stderr, "%s: Not a regular file or directory, ignoring\n", fullname); } } free(fullname); } while ((ep = xreaddir(tth_dp)) != NULL) { struct stat st; char *fullname, *tth_name; int len = strlen(ep->d_name); if (len <= 4 || strcmp(ep->d_name+len-4, ".tth") != 0) { continue; } /* If we ran into looped symlinked dirs, stat will stop (errno=ELOOP). */ tth_name = catfiles(tth_path, ep->d_name); if (stat(tth_name, &st) < 0) { if (print_files) { fprintf(stderr, "%s: Cannot get file status - %s\n", tth_name, errstr); } free(tth_name); continue; } fullname = catfiles(path, ep->d_name); //ptintf("%s: TTH %s\n", fullname, tth_name) len = strlen(fullname); if (S_ISREG(st.st_mode) ) { fullname[len-4] = '\0'; if (stat(fullname, &st) < 0 && errno == ENOENT) { if (print_files) { printf("%s: removed file. Removing TTH file %s\n", fullname, tth_name); fflush(stdout); } unlink(tth_name); removed_files ++; } } free(tth_name); free(fullname); } free(tth_path); closedir(dp); closedir(tth_dp); return 0; } char * catfiles(const char *p1, const char *p2) { return xasprintf("%s%s%s", p1, p1[0] == '\0' || p1[strlen(p1)-1] == '/' ? "" : "/", p2); } struct dirent * xreaddir(DIR *dh) { errno = 0; return readdir(dh); } microdc2-0.15.6/src/screen.c0100644000076500007500000004720310532571230015570 0ustar chugunovmicrodc/* screen.c - User interface management (Readline) * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* POSIX: STDIN_FILENO */ #include #include #include #if defined(HAVE_READLINE_READLINE_H) # include #elif defined(HAVE_READLINE_H) # include #endif #if defined(HAVE_READLINE_HISTORY_H) # include #elif defined(HAVE_HISTORY_H) # include #endif #include "xalloc.h" /* Gnulib */ #include "minmax.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "quotearg.h" /* Gnulib */ #include "minmax.h" /* Gnulib */ #include "iconvme.h" #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "microdc.h" #include "common/strbuf.h" #include "common/error.h" #include "common/strleftcmp.h" #include "common/bksearch.h" #include "common/quoting.h" /* Flow of messages in microdc: * * main process: * warn(error.c) -> warn_writer(error.c) -> screen_warn_writer(screen.c) -> screen_writer(screen.c) -> flag_vputf(screen.c) -> log/screen * die(error.c) -> warn_writer(error.c) -> screen_warn_writer(screen.c) -> screen_writer(screen.c) -> flag_vputf(screen.c) -> log/screen * screen_putf(screen.c) -> flag_putf(screen.c) -> screen_writer(screen.c) -> flag_vputf(screen.c) -> log/screen * user process: * warn(error.c) -> warn_writer(error.c) -> screen_warn_writer(screen.c) -> screen_writer(screen.c) -> user_screen_writer(user.c) -> ipc * die(error.c) -> warn_writer(error.c) -> screen_warn_writer(screen.c) -> screen_writer(screen.c) -> user_screen_writer(user.c) -> ipc * screen_putf(screen.c) -> flag_putf(screen.c) -> screen_writer(screen.c) -> user_screen_writer(user.c) -> ipc * */ typedef enum { SCREEN_UNINITIALIZED, /* History not initialized */ SCREEN_NO_HANDLER, /* rl_callback_handler_install not called. */ SCREEN_RL_CLEARED, /* Readline has been cleared. Need to redisplay after. */ SCREEN_RL_DISPLAYED, /* Readline will be displayed. Need to clear first. */ SCREEN_SUSPENDED, /* A command using the screen is running. */ } ScreenState; static void clear_rl(); static void user_input(char *line); static int screen_warn_writer(const char *format, va_list args); static void flag_vputf(DCDisplayFlag flag, const char *format, va_list args); char *log_filename = NULL; ScreenWriter screen_writer = flag_vputf; static char *screen_prompt = NULL; static FILE *log_fh = NULL; static PtrV *suspend_msgs = NULL; static ScreenState screen_state = SCREEN_UNINITIALIZED; /* This piece of code was snatched from lftp, and modified somewhat by me. * I suggest a function called rl_clear() be added to readline. The * function clears the prompt and everything the user has written so far on * the line. The cursor is positioned at the beginning of the line that * contained the prompt. Note: This function doesn't modify the screen_state * variable. */ static void clear_rl() { extern char *rl_display_prompt; #if HAVE__RL_MARK_MODIFIED_LINES extern int _rl_mark_modified_lines; int old_mark = _rl_mark_modified_lines; #endif int old_end = rl_end; char *old_prompt = rl_display_prompt; rl_end = 0; rl_display_prompt = ""; rl_expand_prompt(""); #if HAVE__RL_MARK_MODIFIED_LINES _rl_mark_modified_lines = 0; #endif rl_redisplay(); rl_end = old_end; rl_display_prompt = old_prompt; #if HAVE__RL_MARK_MODIFIED_LINES _rl_mark_modified_lines = old_mark; #endif if (rl_display_prompt == rl_prompt) rl_expand_prompt(rl_prompt); } bool set_log_file(const char *new_filename, bool verbose) { if (log_fh != NULL) { if (fclose(log_fh) != 0) warn(_("%s: Cannot close file - %s\n"), quotearg(log_filename), errstr); log_fh = NULL; free(log_filename); log_filename = NULL; } if (new_filename == NULL) { if (verbose) screen_putf(_("No longer logging to file.\n")); return true; } log_fh = fopen(new_filename, "a"); if (log_fh == NULL) { screen_putf(_("%s: Cannot open file for appending - %s\n"), quotearg(new_filename), errstr); return false; } log_filename = xstrdup(new_filename); if (verbose) screen_putf(_("Logging to `%s'.\n"), quotearg(new_filename)); return true; } /* Readline < 5.0 disables SA_RESTART on SIGWINCH for some reason. * This turns it back on. * This was partially copied from guile. */ static int fix_winch(void) { struct sigaction action; if (sigaction(SIGWINCH, NULL, &action) >= 0) { action.sa_flags |= SA_RESTART; sigaction(SIGWINCH, &action, NULL); /* Ignore errors */ } return 0; } /* XXX: move this to strutil.c or something? */ void get_file_dir_part(const char *word, char **dir_part, const char **file_part) { const char *fp; fp = strrchr(word, '/'); if (fp == NULL) { *dir_part = xstrdup(""); *file_part = word; } else { for (; fp > word && fp[-1] == '/'; fp--); *dir_part = xstrndup(word, fp - word + 1); for (fp++; *fp == '/'; fp++); *file_part = fp; } } DCCompletionEntry * new_completion_entry_full(char *input, char *display, const char *input_fmt, const char *display_fmt, bool finalize, bool quoted) { DCCompletionEntry *entry = xmalloc(sizeof(DCCompletionEntry)); entry->input = input; entry->display = display; entry->input_fmt = input_fmt; entry->input_single_fmt = NULL; entry->display_fmt = display_fmt; entry->finalize = finalize; entry->quoted = quoted; return entry; } DCCompletionEntry * new_completion_entry(const char *input, const char *display) { DCCompletionEntry *entry = xmalloc(sizeof(DCCompletionEntry)); entry->input = input == NULL ? NULL : xstrdup(input); entry->display = display == NULL ? entry->input : xstrdup(display); entry->display_fmt = "%s"; entry->input_fmt = "%s"; entry->input_single_fmt = NULL; entry->finalize = true; entry->quoted = false; return entry; } void free_completion_entry(DCCompletionEntry *entry) { if (entry->display != entry->input) free(entry->display); free(entry->input); free(entry); } /* This function is called via the warn_writer variable by warn() and * die() in error.c to print messages on screen properly. */ static int screen_warn_writer(const char *format, va_list args) { screen_writer(DC_DF_COMMON, format, args); return 0; } static void flag_vputf(DCDisplayFlag flag, const char *format, va_list args) { //va_list args2; //va_copy(args2, args); if (display_flags & flag) { if (screen_state == SCREEN_SUSPENDED) { ptrv_append(suspend_msgs, xvasprintf(format, args)); } else { if (screen_state == SCREEN_RL_DISPLAYED) { clear_rl(); screen_state = SCREEN_RL_CLEARED; } vprintf(format, args); fflush(stdout); } } if (log_fh != NULL && log_flags & flag) { char c_time[1024]; time_t now = time(NULL); struct tm _tm = {0}; if (NULL != localtime_r(&now, &_tm) && 0 != strftime(c_time, 1023, "%d.%m.%Y %H:%M:%S", &_tm)) { fprintf(log_fh, "%s ", c_time); } char* msg = xvasprintf(format, args); //va_end(args2); char* log_msg = main_to_log_string(msg); free(msg); fprintf(log_fh, log_msg); free(log_msg); fflush(log_fh); } } void flag_putf(DCDisplayFlag flag, const char *format, ...) { va_list args; va_start(args, format); screen_writer(flag, format, args); va_end(args); } /* This function is called by readline whenever the user has * entered a full line (usually by pressing enter). */ static void user_input(char *line) { /* Readline has already made way for us. */ screen_state = SCREEN_RL_CLEARED; if (log_fh != NULL) { char c_time[1024]; time_t now = time(NULL); struct tm _tm = {0}; if (NULL != localtime_r(&now, &_tm) && 0 != strftime(c_time, 1023, "%d.%m.%Y %H:%M:%S", &_tm)) { fprintf(log_fh, "%s ", c_time); } fprintf(log_fh, "> %s\n", line == NULL ? "(null)" : line); fflush(log_fh); } if (line == NULL) { /* Ctrl+D was pressed on an empty line. */ screen_putf("exit\n"); running = false; } else if (line[0] != '\0') { add_history(line); /* XXX: handle input differently * !shell_cmd * /cmd * depending on context: msg, say, cmd */ command_execute(line); } /* As soon as we exit this function, a new prompt will be displayed. */ if (running) { if (screen_state != SCREEN_SUSPENDED) screen_state = SCREEN_RL_DISPLAYED; } else { rl_callback_handler_remove(); FD_CLR(STDIN_FILENO, &read_fds); screen_state = SCREEN_NO_HANDLER; } } /* Move down one line (rl_on_new_line+redisplay), print a new prompt and * empty the input buffer. Unlike rl_clear this doesn't erase anything on * screen. * * This is usually called when a user presses Ctrl+C. * XXX: Should find a better way to do this (see lftp or bash). */ void screen_erase_and_new_line(void) { if (screen_state == SCREEN_RL_DISPLAYED) { rl_callback_handler_remove(); putchar('\n'); rl_callback_handler_install(screen_prompt, user_input); } } /* Suspend screen operations so that nothing in here * uses standard in or standard out. This is necessary when * running a system command in the terminal. */ void screen_suspend(void) { if (screen_state == SCREEN_RL_DISPLAYED || screen_state == SCREEN_RL_CLEARED) { rl_callback_handler_remove(); FD_CLR(STDIN_FILENO, &read_fds); if (screen_state == SCREEN_RL_DISPLAYED) putchar('\n'); suspend_msgs = ptrv_new(); screen_state = SCREEN_SUSPENDED; } } /* Wake up screen after suspension. */ void screen_wakeup(bool print_newline_first) { if (screen_state == SCREEN_SUSPENDED) { int c; if (print_newline_first) putchar('\n'); for (c = 0; c < suspend_msgs->cur; c++) fputs((char *) suspend_msgs->buf[c], stdout); ptrv_foreach(suspend_msgs, free); ptrv_free(suspend_msgs); screen_state = SCREEN_NO_HANDLER; } } /* Finish screen management. Usually called from main_finish. */ void screen_finish(void) { if (screen_state == SCREEN_SUSPENDED) { int c; for (c = 0; c < suspend_msgs->cur; c++) fputs((char *) suspend_msgs->buf[c], stdout); ptrv_foreach(suspend_msgs, free); ptrv_free(suspend_msgs); } else if (screen_state > SCREEN_NO_HANDLER) { rl_callback_handler_remove(); if (screen_state == SCREEN_RL_DISPLAYED) putchar('\n'); FD_CLR(STDIN_FILENO, &read_fds); } if (screen_state >= SCREEN_NO_HANDLER) { char *path; /* Save history */ get_package_file("history", &path); if (mkdirs_for_file(path) >= 0) { if (write_history(path) != 0) warn(_("%s: Cannot write history - %s\n"), quotearg(path), errstr); } free(path); rl_pre_input_hook = NULL; warn_writer = default_warn_writer; screen_state = SCREEN_UNINITIALIZED; free(screen_prompt); set_log_file(NULL, false); } } /* XXX: move somewhere else. */ static char * dequote_string(const char *str) { return dequote_words_full(str, false, false, true, false/*true*/, NULL); } char * filename_quote_string(const char *str, bool dquotes, bool finalize) { return quote_word_full(str, dquotes, finalize, ";*?", "#", false, true, false/*true*/, true); } char * quote_string(const char *str, bool dquotes, bool finalize) { return quote_word_full(str, dquotes, finalize, ";", "#", false, true, false/*true*/, true); } void fill_completion_info(DCCompletionInfo *ci) { ci->word_full = xstrndup(ci->line + ci->ws, ci->we - ci->ws); ci->word = dequote_string(ci->word_full); ci->word_index = get_word_index(ci->line, ci->ws); } /* Return escaped text to display for the specified completion entry. */ static char * get_escaped_display(DCCompletionEntry *ce) { char *d1; char *d2; d1 = xasprintf(ce->display_fmt, ce->display); d2 = quote_word_full(d1, false, false, ";", "#", false, true, false/*true*/, false); free(d1); return d2; } /* Return quoted text to put in the command line buffer for the completion entry CE. * If SINGLE is true, then the input_single_fmt may be used. * If FINALIZE is true, then the text will have a trailing closing quote (if quoted) * and a space after that. The returned value should be freed when no longer needed. */ static char * get_quoted_input(DCCompletionInfo *ci, DCCompletionEntry *ce, bool single, bool finalize) { char *str1; char *str2; /* If quoted already, get rid of trailing quotes (at least temporarily). */ if (ce->quoted && ce->input[0] == '"') ce->input[strlen(ce->input)-1] = '\0'; /* Pick the right input format, and print using it. */ if (single && ce->input_single_fmt != NULL) { str1 = xasprintf(ce->input_single_fmt, ce->input); } else { str1 = xasprintf(ce->input_fmt, ce->input); } /* Add quotes if necessarily. If already quoted, add trailing quote if it should be there. */ if (ce->quoted) { if (ce->input[0] == '"' && ce->finalize && finalize) { str2 = xasprintf("%s\"", str1); free(str1); } else { str2 = str1; } } else { str2 = quote_word_full(str1, ci->line[ci->ws] == '"', finalize && ce->finalize, ";", "#", false, true, true, true); free(str1); } if (finalize && ce->finalize) { str1 = xasprintf("%s ", str2); free(str2); return str1; } return str2; } static size_t leading_same(const char *c1, const char *c2) { int c; for (c = 0; c1[c] != '\0' && c2[c] != '\0'; c++) { if (c1[c] != c2[c]) break; } return c; } static int completion_readline(int key, int count) { char *input; DCCompletionInfo ci; int c; ci.line = rl_line_buffer;/*RL*/ ci.we = rl_point;/*RL*/ ci.ws = find_completion_word_start(ci.line, ci.we); ci.results = ptrv_new(); fill_completion_info(&ci); default_completion_selector(&ci); if (ci.results->cur == 0) { rl_ding();/*RL*/ return -1; } if (ci.results->cur == 1) { input = get_quoted_input(&ci, ci.results->buf[0], true, true); } else { int minlen; int maxlen; char *matches[ci.results->cur + 1]; DCCompletionEntry *ce; ce = ci.results->buf[0]; input = get_quoted_input(&ci, ce, false, false); minlen = strlen(input); matches[1] = get_escaped_display(ce); maxlen = strlen(matches[1]); for (c = 1; c < ci.results->cur; c++) { char *input2; ce = ci.results->buf[c]; input2 = get_quoted_input(&ci, ce, false, false); minlen = MIN(minlen, leading_same(input, input2)); free(input2); matches[c+1] = get_escaped_display(ce); maxlen = MAX(maxlen, strlen(matches[c+1])); } rl_display_match_list(matches, ci.results->cur, maxlen);/*RL*/ for (c = 0; c < ci.results->cur; c++) free(matches[c+1]); rl_on_new_line();/*RL*/ input[minlen] = '\0'; /* XXX: get rid of trailing escape on input somehow! */ } rl_begin_undo_group();/*RL*/ if (ci.ws != ci.we) rl_point/*RL*/ -= rl_delete_text(ci.ws, ci.we);/*RL*/ rl_insert_text(input);/*RL*/ /* automaticly updates rl_point */ rl_end_undo_group();/*RL*/ free(input); free(ci.word_full); free(ci.word); ptrv_foreach(ci.results, (PtrVForeachCallback) free_completion_entry); ptrv_free(ci.results); return 0; } /* Prepare the screen prior to waiting for events with select/poll/epoll. * Redisplay the prompt if it was cleared by a call to screen_(v)put(f). */ void screen_prepare(void) { if (screen_state == SCREEN_SUSPENDED) return; if (screen_state == SCREEN_UNINITIALIZED) { char *path; screen_state = SCREEN_NO_HANDLER; warn_writer = screen_warn_writer; if (screen_prompt == NULL) screen_prompt = xasprintf("%s> ", PACKAGE); rl_readline_name = PACKAGE; rl_add_defun(PACKAGE "-complete", completion_readline, '\t'); rl_pre_input_hook = fix_winch; using_history(); get_package_file("history", &path); if (path != NULL) { if (read_history(path) != 0 && errno != ENOENT) { warn(_("%s: Cannot read history - %s\n"), quotearg(path), errstr); } free(path); } } if (screen_state == SCREEN_NO_HANDLER) { rl_callback_handler_install(screen_prompt, user_input); FD_SET(STDIN_FILENO, &read_fds); } else if (screen_state == SCREEN_RL_CLEARED) { rl_set_prompt(screen_prompt); rl_redisplay(); } screen_state = SCREEN_RL_DISPLAYED; } void screen_redisplay_prompt() { rl_set_prompt(screen_prompt); rl_redisplay(); screen_state = SCREEN_RL_DISPLAYED; } /* This function is called from the main loop when there's input for us to * read on stdin. */ void screen_read_input(void) { rl_callback_read_char(); } /* Return the size of the screen. */ void screen_get_size(int *rows, int *cols) { int dummy; rl_get_screen_size(rows ? rows : &dummy, cols ? cols : &dummy); } void set_screen_prompt(const char *prompt, ...) { va_list args; if (screen_prompt != NULL) free(screen_prompt); va_start(args, prompt); screen_prompt = xvasprintf(prompt, args); va_end(args); if (screen_state != SCREEN_SUSPENDED) rl_set_prompt(screen_prompt); } /* Look up completion alternatives from a sorted list using binary search. */ void sorted_list_completion_generator(const char *base, PtrV *results, void *items, size_t item_count, size_t item_size, size_t key_offset) { const void *item; const void *last_item; if (bksearchrange(base, items, item_count, item_size, key_offset, (comparison_fn_t) strleftcmp, &item, &last_item)) { while (item <= last_item) { char *key = xstrdup(*(const char **) (((const char *) item) + key_offset)); ptrv_append(results, new_completion_entry(key, NULL)); item = (const void *) (((const char *) item) + item_size); } } } int completion_entry_display_compare(const void *e1, const void *e2) { const DCCompletionEntry *ce1 = *(const DCCompletionEntry **) e1; const DCCompletionEntry *ce2 = *(const DCCompletionEntry **) e2; char *s1 = xasprintf(ce1->display_fmt, ce1->display); /* XXX: this is really slow */ char *s2 = xasprintf(ce2->display_fmt, ce2->display); /* XXX: this is really slow */ int cmp = strcmp(s1, s2); free(s1); free(s2); return cmp; } microdc2-0.15.6/src/search.c0100664000076500007500000005237210534102201015551 0ustar chugunovmicrodc/* search.c - Search support * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* C89 */ #include /* ? */ #include /* C89 */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* ? */ #include "xalloc.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "quotearg.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/strbuf.h" #include "common/intutil.h" #include "microdc.h" //#define _TRACE #if defined(_TRACE) #include #define TRACE(x) printf x; fflush(stdout) #else #define TRACE(x) #endif #define MAX_RESULTS_ACTIVE 10 /* Max number of search results to send to active users */ #define MAX_RESULTS_PASSIVE 5 /* Max number of search results to send to passive users */ PtrV *our_searches; static char *extensions[] = { // NULL means match any extension /* ANY */ NULL, /* AUDIO */ "mp3/mp2/wav/au/rm/mid/sm", /* COMPRESSED */ "zip/arj/rar/lzh/gz/z/arc/pak", /* DOCUMENTS */ "doc/txt/wri/pdf/ps/tex", /* EXECUTABLES */ "pm/exe/bat/com", /* PICTURES */ "gif/jpg/jpeg/bmp/pcx/png/wmf/psd", /* VIDEO */ "mpg/mpeg/avi/asf/mov", /* FOLDERS */ NULL, /* CHECKSUM */ NULL, }; static int compare_search_response(DCSearchResponse *sr1, DCSearchResponse *sr2) { /* refcount is not derived from results - not compared. */ COMPARE_RETURN_FUNC(strcmp(sr1->userinfo->nick, sr2->userinfo->nick)); COMPARE_RETURN_FUNC(strcmp(sr1->filename, sr2->filename)); COMPARE_RETURN(sr1->filetype, sr2->filetype); COMPARE_RETURN(sr1->filesize, sr2->filesize); /* slots_free and slots_total may change - not compared. */ /* hub_name and hub_addr may be incomplete - not compared. */ /* XXX: when/if multiple hub connections are supported, we probably need * to compare hub_name and/or hub_addr as well. */ return 0; } void search_string_new(DCSearchString *sp, const char *p, int len) { int c; unsigned char *u_str; u_str = xstrndup(p, len); for (c = 0; c < len; c++) u_str[c] = tolower(u_str[c]); sp->len = len; sp->str = u_str; for (c = 0; c < 256; c++) sp->delta[c] = len+1; for (c = 0; c < len; c++) sp->delta[ u_str[c] ] = len-c; } void search_hash_new(DCSearchString *sp, const char *p, int len) { int c; sp->str = xstrndup(p, len); for (c = 0; c < len; c++) sp->str[c] = toupper(sp->str[c]); sp->len = len; for (c = 0; c < 256; c++) sp->delta[c] = len+1; for (c = 0; c < len; c++) sp->delta[(uint8_t) sp->str[c]] = len-c; } void search_string_free(DCSearchString *sp) { free(sp->str); } static bool parse_hash(char *str, DCSearchSelection *ss) { int len = strlen(str); flag_putf(DC_DF_DEBUG, _("incoming hash: %s\n"), str); if (len > 4 && str[3] == ':' && (str[0] == 't' || str[0] == 'T') && (str[1] == 't' || str[1] == 'T') && (str[2] == 'h' || str[2] == 'H')) { /* TTH hash lookup */ ss->patterncount = 1; ss->patterns = xmalloc(sizeof(DCSearchString)); search_hash_new(ss->patterns, str+4, len-4); return true; } return false; } static bool parse_search_strings(char *str, DCSearchSelection *ss) { uint32_t c; char *t1; char *t2; ss->patterncount = 0; for (t1 = str; (t2 = strchr(t1, '$')) != NULL; t1 = t2+1) { if (t2 != str && t2[-1] != '$') ss->patterncount++; } if (*t1) ss->patterncount++; if (ss->patterncount == 0) return false; ss->patterns = xmalloc(sizeof(DCSearchString) * ss->patterncount); c = 0; for (t1 = str; (t2 = strchr(t1, '$')) != NULL; t1 = t2+1) { if (t2 != str && t2[-1] != '$') { search_string_new(ss->patterns+c, t1, t2-t1); c++; } } if (*t1) search_string_new(ss->patterns+c, t1, strlen(t1)); return true; } static bool match_file_extension(const char *filename, DCSearchDataType type) { char *ext; char *t1; char *t2; t1 = extensions[type]; if (t1 == NULL) return true; ext = strrchr(filename, '.'); if (ext == NULL) return false; ext++; for (; (t2 = strchr(t1, '/')) != NULL; t1 = t2+1) { if (strncasecmp(ext, t1, t2-t1) == 0) return true; } if (strcasecmp(ext, t1) == 0) return true; return false; } int parse_search_selection(char *str, DCSearchSelection *data) { char sizeres; char sizemin; char *sizestr; uint64_t size; char *datatype; char *tmpstr; bool ret; if (str[0] != 'T' && str[0] != 'F') return 0; if (str[1] != '?') return 0; if (str[2] != 'T' && str[2] != 'F') return 0; if (str[3] != '?') return 0; sizeres = str[0]; sizemin = str[2]; str += 4; sizestr = strsep(&str, "?"); if (sizestr == NULL) return 0; if (!parse_uint64(sizestr, &size)) return 0; datatype = strsep(&str, "?"); if (datatype == NULL || datatype[0] < '1' || datatype[0] > '9' || datatype[1] != '\0') return 0; if (*str == '\0') return 2; if (strlen(str) >= 1 << 16) /* Needed for delta match */ return 0; if (sizeres) { if (sizemin) { data->size_min = size; data->size_max = UINT64_MAX; } else { data->size_min = 0; data->size_max = size; } } else { data->size_min = 0; data->size_max = UINT64_MAX; } data->datatype = datatype[0]-'1'; if (data->datatype == DC_SEARCH_CHECKSUM) { return parse_hash(str, data); } /* convert search string from hub charset to local charset */ tmpstr = hub_to_main_string(str); ret = parse_search_strings(tmpstr, data); free (tmpstr); return ret; } static bool match_search_pattern(const char *t, DCSearchString *pattern) { const char *end; const unsigned char *ut; uint32_t tlen; tlen = strlen(t); if (tlen < pattern->len) return false; end = t + tlen - pattern->len + 1; while (t < end) { uint32_t i = 0; ut = (const unsigned char *)t; for (; pattern->str[i] && pattern->str[i] == (char)tolower(ut[i]); i++) ; if (pattern->str[i] == '\0') return true; t += pattern->delta[(uint8_t) tolower(ut[pattern->len])]; } return false; } static bool match_search_patterns(const char *text, DCSearchSelection *data) { uint32_t c; for (c = 0; c < data->patterncount; c++) { if (!match_search_pattern(text, data->patterns+c)) return 0; } return 1; } static void append_result(DCFileList *node, DCUserInfo *ui, struct sockaddr_in *addr) { StrBuf *sb; char *lpath; char *rpath; char *conv_rpath; char *hub_my_nick; char *hub_hub_name; char *hub_ui_nick; int free_slots; sb = strbuf_new(); lpath = filelist_get_path(node); rpath = translate_local_to_remote(lpath); free(lpath); free_slots = used_ul_slots > my_ul_slots ? 0 : my_ul_slots-used_ul_slots; conv_rpath = main_to_hub_string(rpath); hub_my_nick = main_to_hub_string(my_nick); hub_hub_name = main_to_hub_string(hub_name); if ( ui != NULL) hub_ui_nick = main_to_hub_string(ui->nick); else hub_ui_nick = NULL; strbuf_appendf(sb, "$SR %s %s", hub_my_nick, conv_rpath); if (node->type == DC_TYPE_REG) strbuf_appendf(sb, "\x05%" PRIu64, node->size); strbuf_appendf(sb, " %d/%d\x05", free_slots, my_ul_slots); if (node->type == DC_TYPE_REG && node->reg.has_tth) { unsigned char tth[40]; memcpy(tth, node->reg.tth, sizeof(node->reg.tth)); tth[39] = '\0'; strbuf_appendf(sb, "TTH:%s", tth); } else { strbuf_appendf(sb, "%s", hub_hub_name); } strbuf_appendf(sb, " (%s)", sockaddr_in_str(&hub_addr)); if (ui != NULL) strbuf_appendf(sb, "\x05%s", hub_ui_nick); strbuf_append(sb, "|"); if (ui != NULL) { hub_putf("%s", sb->buf); /* want hub_put here */ } else { add_search_result(addr, sb->buf, strbuf_length(sb)); } free(hub_ui_nick); free(hub_hub_name); free(hub_my_nick); free(conv_rpath); strbuf_free(sb); } static int filelist_search(DCFileList *node, DCSearchSelection *data, int maxresults, DCUserInfo *ui, struct sockaddr_in *addr) { assert(maxresults > 0); if (node->type == DC_TYPE_REG) { if (data->datatype == DC_SEARCH_CHECKSUM) { if (!node->reg.has_tth) return 0; if (strncmp(node->reg.tth, data->patterns->str, sizeof(node->reg.tth)) != 0) { /* only TTH is supported up to now */ return 0; } } else { if (data->datatype == DC_SEARCH_FOLDERS) return 0; if (node->size < data->size_min) return 0; if (node->size > data->size_max) return 0; if (!match_search_patterns(node->name, data)) return 0; if (!match_file_extension(node->name, data->datatype)) return 0; } append_result(node, ui, addr); return 1; } if (node->type == DC_TYPE_DIR) { HMapIterator it; int curresults = 0; if (data->datatype == DC_SEARCH_ANY || data->datatype == DC_SEARCH_FOLDERS) { if (match_search_patterns(node->name, data)) { append_result(node, ui, addr); curresults++; if (curresults >= maxresults) return curresults; } } hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *subnode = it.next(&it); curresults += filelist_search(subnode, data, maxresults-curresults, ui, addr); if ((data->datatype == DC_SEARCH_CHECKSUM && curresults > 0) || (curresults >= maxresults)) break; } return curresults; } return 0; } //XXX: assumes our_filelist != NULL bool perform_inbound_search(DCSearchSelection *data, DCUserInfo *ui, struct sockaddr_in *addr) { int maxresults; int curresults; TRACE(("%s:%d: \n", __FUNCTION__, __LINE__)); maxresults = (ui == NULL ? MAX_RESULTS_ACTIVE : MAX_RESULTS_PASSIVE); curresults = filelist_search(our_filelist, data, maxresults, ui, addr); if (curresults > 0) { if (ui != NULL) { flag_putf(DC_DF_DEBUG, _("Sent %d/%d search results to %s.\n"), curresults, maxresults, quotearg(ui->nick)); } else { flag_putf(DC_DF_DEBUG, _("Sent %d/%d search results to %s.\n"), curresults, maxresults, sockaddr_in_str(addr)); } } else { flag_putf(DC_DF_DEBUG, _("No search results.\n")); } return false; } /* Parse a $SR message into a DCSearchResponse */ static DCSearchResponse * parse_search_response(char *buf, uint32_t len) { DCSearchResponse *sr; DCUserInfo *ui; char *token; char *filename; uint64_t filesize; DCFileType filetype; uint32_t slots_free; uint32_t slots_total; char *hub_name; char *local_nick; struct sockaddr_in hub_addr; if (strncmp(buf, "$SR ", 4) != 0) return NULL; /* Invalid $SR message: Not starting with $SR. */ buf += 4; token = strsep(&buf, " "); if (token == NULL) return NULL; /* Invalid $SR message: Missing user. */ local_nick = hub_to_main_string(token); ui = hmap_get(hub_users, local_nick); free(local_nick); if (ui == NULL) return NULL; /* Invalid $SR message: Unknown user. */ /* Why look for `/' here? * A search result looks like this: * Directories: $SR <0x20><0x20>/<0x05><0x20>() * Files: $SR <0x20><0x05><0x20>/<0x05><0x20>() * In the directories case, the only way to determine where the file * name ends is to look for `/' because it delimits the free slots and * total slots value. It is assumed that file names cannot contain the * slash (which is true for both *nix and windows). */ filename = strsep(&buf, "/"); if (filename == NULL) return NULL; /* Invalid $SR message: Missing filename. */ buf[-1] = '/'; for (; filename < buf && *buf != ' '; buf--); if (filename == buf) return NULL; /* Invalid $SR message: Missing free slots. */ *buf = '\0'; filename = hub_to_main_string(filename); if (filename == NULL) return NULL; /* Invalid $SR message: not convertable to local charset */ buf++; token = strchr(filename, '\x05'); if (token == NULL) { filetype = DC_TYPE_DIR; filesize = 0; } else { filetype = DC_TYPE_REG; *token = '\0'; if (!parse_uint64(token+1, &filesize)) { free(filename); return NULL; /* Invalid $SR message: Invalid file size */ } } token = strsep(&buf, "/"); assert(token != NULL); if (!parse_uint32(token, &slots_free)) { free(filename); return NULL; /* Invalid $SR message: Invalid free slots. */ } token = strsep(&buf, "\x05"); if (token == NULL) { free(filename); return NULL; /* Invalid $SR message: Missing total slots. */ } if (!parse_uint32(token, &slots_total)) { free(filename); return NULL; /* Invalid $SR message: Invalid total slots. */ } hub_name = buf; token = strrchr(buf, '('); if (token == NULL) { free(filename); return NULL; /* Invalid $SR message: Missing hub address. */ } *token = '\0'; buf = token+1; token = strchr(buf, ')'); /* NeoModus DirectConnect 2.20 doesn't appear to add `)|' to $SR * messages. Or some other client which puts 'DC V:2.20' in the * client tag. */ if (token != NULL) *token = '\0'; token = strchr(buf, ':'); if (token != NULL) { *token = '\0'; if (!parse_uint16(token+1, &hub_addr.sin_port)) { free(filename); return NULL; /* Invalid $SR message: Invalid hub port. */ } hub_addr.sin_port = htons(hub_addr.sin_port); } else { hub_addr.sin_port = htons(DC_HUB_TCP_PORT); } if (!inet_aton(buf, &hub_addr.sin_addr)) { free(filename); return NULL; /* Invalid $SR message: Invalid hub address. */ } sr = xmalloc(sizeof(DCSearchResponse)); sr->userinfo = ui; ui->refcount++; sr->filename = filename; sr->filetype = filetype; sr->filesize = filesize; sr->slots_free = slots_free; sr->slots_total = slots_total; sr->hub_name = xstrdup(hub_name); sr->hub_addr = hub_addr; sr->refcount = 1; return sr; } static void free_search_response(DCSearchResponse *sr) { sr->refcount--; if (sr->refcount == 0) { user_info_free(sr->userinfo); free(sr->filename); free(sr->hub_name); free(sr); } } static bool match_selection_against_response(DCSearchSelection *ss, DCSearchResponse *sr) { if (sr->filetype == DC_TYPE_DIR) { if (ss->datatype != DC_SEARCH_ANY && ss->datatype != DC_SEARCH_FOLDERS) return false; if (ss->datatype == DC_SEARCH_CHECKSUM) return false; if (!match_search_patterns(sr->filename, ss)) return false; return true; } else { if (ss->datatype == DC_SEARCH_FOLDERS) return false; // if (ss->datatype == DC_SEARCH_CHECKSUM) /* TTH not supported yet */ // return false; if (sr->filesize < ss->size_min || sr->filesize > ss->size_max) return false; if (!match_search_patterns(sr->filename, ss)) return false; if (!match_file_extension(sr->filename, ss->datatype)) return false; return true; } } static int compare_search_selection(DCSearchSelection *s1, DCSearchSelection *s2) { uint32_t c; COMPARE_RETURN(s1->size_min, s2->size_min); COMPARE_RETURN(s1->size_max, s2->size_max); COMPARE_RETURN(s1->datatype, s2->datatype); COMPARE_RETURN(s1->patterncount, s2->patterncount); for (c = 0; c < s1->patterncount; c++) { COMPARE_RETURN(s1->patterns[c].len, s2->patterns[c].len); COMPARE_RETURN_FUNC(memcmp(s1->patterns[c].str, s2->patterns[c].str, s1->patterns[c].len)); } return 0; } bool add_search_request(char *args) { DCSearchSelection sel; DCSearchRequest *sr = NULL; uint32_t c; time_t now; char *hub_args; for (c = 0; args[c] != '\0'; c++) { if (args[c] == '|' || args[c] == ' ') args[c] = '$'; } sel.size_min = 0; sel.size_max = UINT64_MAX; sel.datatype = DC_SEARCH_ANY; if (!parse_search_strings(args, &sel)) { int i = 0; if (sel.patterns != NULL) { for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } warn(_("No pattern to match.\n")); return false; } for (c = 0; c < our_searches->cur; c++) { sr = our_searches->buf[c]; if (compare_search_selection(&sel, &sr->selection) == 0) break; } if (time(&now) == (time_t) -1) { warn(_("Cannot get current time - %s\n"), errstr); if (sel.patterns != NULL) { int i = 0; for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } return false; } if (c < our_searches->cur) { screen_putf(_("Reissuing search %d.\n"), c+1); if (sel.patterns != NULL) { int i = 0; for (i = 0; i < sel.patterncount; i++) { search_string_free(sel.patterns+i); } free(sel.patterns); } sr->issue_time = now; } else { screen_putf(_("Issuing new search with index %d.\n"), c+1); sr = xmalloc(sizeof(DCSearchRequest)); sr->selection = sel; sr->responses = ptrv_new(); sr->issue_time = now; ptrv_append(our_searches, sr); } /* convert search string from local to hub charset */ hub_args = main_to_hub_string(args); if (is_active) { hub_putf("$Search %s:%u F?F?0?1?%s|", inet_ntoa(local_addr.sin_addr), listen_port, hub_args); } else { char *hub_my_nick; hub_my_nick = main_to_hub_string(my_nick); hub_putf("$Search Hub:%s F?F?0?1?%s|", hub_my_nick, hub_args); free(hub_my_nick); } free(hub_args); return true; } void free_search_request(DCSearchRequest *sr) { int i = 0; for (i = 0; sr->selection.patterns != NULL && i < sr->selection.patterncount; i++) { search_string_free(sr->selection.patterns+i); } free(sr->selection.patterns); ptrv_foreach(sr->responses, (PtrVForeachCallback) free_search_response); ptrv_free(sr->responses); } void handle_search_result(char *buf, uint32_t len) { DCSearchResponse *sr; uint32_t c; time_t now; if (time(&now) == (time_t) -1) { warn(_("Cannot get current time - %s\n"), errstr); return; } sr = parse_search_response(buf, len); if (sr == NULL) { warn(_("Unterminated or invalid $SR, discarding: %s\n"), quotearg_mem(buf, len)); return; } for (c = 0; c < our_searches->cur; c++) { DCSearchRequest *sd = our_searches->buf[c]; if (sd->issue_time + SEARCH_TIME_THRESHOLD <= now) continue; if (match_selection_against_response(&sd->selection, sr)) { char *fmt; uint32_t d; /* This is slow, but better than dupes... */ for (d = 0; d < sd->responses->cur; d++) { if (compare_search_response(sd->responses->buf[d], sr) == 0) { screen_putf(_("Result has been added earlier to search %d.\n"), c+1); break; } } if (d >= sd->responses->cur) { ptrv_append(sd->responses, sr); fmt = ngettext("Added result to search %d (now %d result).\n", "Added result to search %d (now %d results).\n", sd->responses->cur); flag_putf(DC_DF_SEARCH_RESULTS, fmt, c+1, sd->responses->cur); sr->refcount++; } } } free_search_response(sr); } char * search_selection_to_string(DCSearchSelection *sr) { StrBuf *out; uint32_t c; out = strbuf_new_from_char('"'); for (c = 0; c < sr->patterncount; c++) { if (c != 0) strbuf_append_char(out, ' '); strbuf_append_substring(out, sr->patterns[c].str, 0, sr->patterns[c].len); } strbuf_append_char(out, '"'); return strbuf_free_to_string(out); } microdc2-0.15.6/src/tth_file.c0100644000076500007500000000011110517316754016105 0ustar chugunovmicrodc#include "tth_file.h" const char tth_directory_name[] = ".microdc_tth"; microdc2-0.15.6/src/tth_file.h0100644000076500007500000000060110517316754016116 0ustar chugunovmicrodc#ifndef __TTH_FILE_H #define __TTH_FILE_H #define IS_CURRENT_DIR(x) ((x)[0] == '.' && (x)[1] == '\0') #define IS_PARENT_DIR(x) ((x)[0] == '.' && (x)[1] == '.' && (x)[2] == '\0') #define IS_SPECIAL_DIR(x) (IS_CURRENT_DIR(x) || IS_PARENT_DIR(x) || strncmp(x, tth_directory_name, strlen(tth_directory_name)) == 0) extern const char tth_directory_name[]; #endif // ifndef __TTH_FILE_H microdc2-0.15.6/src/user.c0100644000076500007500000014332310533525710015272 0ustar chugunovmicrodc/* user.c - User communication (in separate process) * * Copyright (C) 2004, 2005 Oskar Liljeblad * Copyright (C) 2006 Alexey Illarionov * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* ? */ #include /* POSIX */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* ? */ #include /* ? */ #include "dirname.h" /* Gnulib */ #include "full-write.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "xalloc.h" /* Gnulib */ #include "minmax.h" /* Gnulib */ #include "quotearg.h" /* Gnulib */ #include "memmem.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #include "dirname.h" /* Gnulib */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/error.h" #include "common/intutil.h" #include "common/tempfailure.h" #include "iconvme.h" #include "tth/tigertree.h" #include "microdc.h" #define LOCK_STRING "EXTENDEDPROTOCOLABCABCABCABCABCABCA" #define LOCK_STRING_LEN (sizeof(LOCK_STRING)-1) #define LOCK_PK_STRING "MICRODCABCABCABCABCAB" #define DEFAULT_RECVQ_SIZE (64*1024) #define DEFAULT_SENDQ_SIZE (64*1024) #define USER_CONN_IDLE_TIMEOUT (3*60) typedef struct _DCUserConnLocal DCUserConnLocal; struct _DCUserConnLocal { MsgQ *get_mq;/*=NULL*/ MsgQ *put_mq;/*=NULL*/ int signal_pipe[2]/* = { -1, -1 }*/; char *user_nick/* = NULL*/; uint32_t user_recvq_last/* = 0*/; ByteQ *user_recvq; ByteQ *user_sendq; int user_socket/* = -1*/; uint64_t data_size/* = 0*/; /* only useful when receiving files */ uint16_t dir_rand; bool we_connected; DCTransferDirection our_dir; DCUserState user_state/* = DC_USER_CONNECT*/; bool user_running/* = true*/; fd_set user_read_fds; fd_set user_write_fds; PtrV* supports; //union { //struct { char *share_file; /* complete filename in shared file namespace. */ char *local_file; /* complete filename in local physical file namespace. */ int transfer_fd; /* file descriptor for opened local_file */ uint64_t file_pos; /* how much of local_file that has been written */ uint64_t final_pos; /* how much of local_file shuld be written */ uint64_t file_size; /* the final size of local_file */ uint64_t transfer_pos; /* how much that has been read (but not necessarily written yet) */ bool local_exists; /* does local_file exist already? */ //} dl; //struct { //char *share_file; /* complete filename in shared file namespace. */ //char *local_file; /* complete filename in local physical file namespace. */ //int fd; /* file descriptor for opened local_file */ //uint64_t file_pos; /* how much of local_file that has been read */ //uint64_t file_size; /* the size of local_file */ //uint64_t transfer_pos; /* how much of what's been read that has been sent to remote */ //} ul; //}; }; static DCUserConnLocal *cur_ucl; static void upload_file(DCUserConnLocal *ucl); /* NOTE: All the code below assumes that main never disconnects a user * (close on main_socket) on purpose. The user must do this first if * things happen gracefully. */ /* This function should be called when the communication to the * main process becomes unusable. It will terminate the user * process. If it appears that the communication was closed by * the remote end, no error is printed. */ static void fatal_error(DCUserConnLocal *ucl, int res, bool writing) /* XXX: rename communication_error or something */ { warn_writer = default_warn_writer; /* These tests are for the case when the main process closed * the connection first. The first test is when reading (and * the result is EOF because of closed pipe), and the second * set of tests are used when writing. The latter case is * probably rare - the child process would have to be * 'cancelled' in main when the child was just about to call * msgq_put. */ if (res != 0 && !(writing && res < 0 && errno == EPIPE)) warn_socket_error(res, writing, _("main process")); ucl->user_running = false; } /* This function should be called when the user process decided to * terminate itself (but the communication to the main process * is still usable). */ static void terminate_process(DCUserConnLocal *ucl) { int res; ucl->user_running = false; res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_TERMINATING, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, true); return; } } static bool check_state(DCUserConnLocal *ucl, char *buf, DCUserState state) { if (ucl->user_state != state) { warn(_("Received %s message in wrong state.\n"), strtok(buf, " ")); terminate_process(ucl); /* protocol error */ return false; } return true; } static bool send_user_status(DCUserConnLocal *ucl, uint64_t pos) { int res; res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_TRANSFER_STATUS, MSGQ_INT64, pos, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, true); return false; } return true; } static void user_screen_writer(DCDisplayFlag flag, const char *format, va_list args) { DCUserConnLocal *ucl = cur_ucl; /* XXX */ char *msg; int res; msg = xvasprintf(format, args); res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_SCREEN_PUT, MSGQ_INT32, (int32_t) flag, MSGQ_STR, msg, MSGQ_END); free(msg); if (res <= 0) /* XXX: should we maybe print this message manually? */ fatal_error(ucl, res, true); /* delay handling until later. */ } /* Put some data onto the connection, printf style. */ bool user_putf(DCUserConnLocal *ucl, const char *format, ...) { va_list args; uint32_t oldcur; int res; oldcur = ucl->user_sendq->cur; va_start(args, format); res = byteq_vappendf(ucl->user_sendq, format, args); va_end(args); /* byteq_vappendf cannot fail. */ /*if (res < 0) { warn(_("Cannot append to user send queue - %s\n"), errstr); terminate_process(ucl); return false; }*/ if (ucl->data_size/*DL*/ == 0) dump_command(_("-->"), ucl->user_sendq->buf+oldcur, ucl->user_sendq->cur-oldcur); res = byteq_write(ucl->user_sendq, ucl->user_socket); if (res == 0 || (res < 0 && errno != EAGAIN)) { warn_socket_error(res, true, _("user")); terminate_process(ucl); /* MSG: socket error above */ return false; } if (oldcur == 0 && ucl->user_sendq->cur > 0) FD_SET(ucl->user_socket, &ucl->user_write_fds); return true; } static bool wants_to_download(DCUserConnLocal *ucl, bool *reply) { int res; res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_WANT_DOWNLOAD, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, true); return false; } res = msgq_get_sync(ucl->get_mq, MSGQ_BOOL, reply, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, false); return false; } return true; } static bool direction_validate(DCUserConnLocal *ucl, DCTransferDirection dir) { bool reply; int res; res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_VALIDATE_DIR, MSGQ_INT, dir, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, true); return false; } res = msgq_get_sync(ucl->get_mq, MSGQ_BOOL, &reply, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, false); return false; } if (!reply) { warn(_("Too many connections to user, or no free slots.\n")); terminate_process(ucl); /* MSG: msg above */ return false; } return true; } static bool get_our_nick(DCUserConnLocal *ucl, char **str) { int res; res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_GET_MY_NICK, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, true); return false; } res = msgq_get_sync(ucl->get_mq, MSGQ_STR, str, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, false); return false; } return true; } static bool nick_validate(DCUserConnLocal *ucl, const char *str) { bool reply; int res; res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_VALIDATE_NICK, MSGQ_STR, str, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, true); return false; } res = msgq_get_sync(ucl->get_mq, MSGQ_BOOL, &reply, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, false); return false; } if (!reply) { warn(_("User %s not on hub, or too many connections to user.\n"), quotearg(str));/*XXX: move main.c */ terminate_process(ucl); /* MSG: msg above */ return false; } return true; } static void end_download(DCUserConnLocal *ucl, bool success, const char *reason_fmt, ...) { va_list args; char *reason = NULL; int res; if (ucl->transfer_fd/*DL*/ >= 0) { /* Inability to close the downloaded file is a serious error. */ if (close(ucl->transfer_fd/*DL*/) < 0) { warn(_("%s: Cannot close file - %s\n"), quotearg(ucl->local_file/*DL*/), errstr); if (success) { /* don't let this error obscure a previous error */ reason = xstrdup("local error"); success = false; } } ucl->transfer_fd/*DL*/ = -1; } va_start(args, reason_fmt); if (reason == NULL) reason = xvasprintf(reason_fmt, args); res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_DOWNLOAD_ENDED, MSGQ_BOOL, success, MSGQ_STR, reason, MSGQ_END); if (res <= 0) fatal_error(ucl, res, true); free(reason); va_end(args); free(ucl->share_file/*DL*/); ucl->share_file/*DL*/ = NULL; /* if "user terminated" calls this function, then this is not necessary */ free(ucl->local_file/*DL*/); ucl->local_file/*DL*/ = NULL; /* if "user terminated" calls this function, then this is not necessary */ } /* This is called when the next file should be downloaded. * It will send $Get to the user. */ static void download_next_file(DCUserConnLocal *ucl) { int flag = 0; char *share_file; char *local_file, *conv_local_file; char *remote_file, *hub_remote_file; uint64_t resume_pos; uint64_t file_size; struct stat sb; int res; if (!ucl->user_running) return; res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_CHECK_DOWNLOAD, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, true); return; } /* local_file is in filesystem charset */ res = msgq_get_sync(ucl->get_mq, MSGQ_STR, &local_file, MSGQ_STR, &share_file, MSGQ_INT64, &file_size, MSGQ_INT, &flag, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, false); return; } if (local_file == NULL) { flag_putf(DC_DF_CONNECTIONS, _("No more files to download.\n"));/*XXX:move main.c?*/ terminate_process(ucl); /* MSG: no more to download */ return; } /* int i = 0; for (i = 0; ucl->supports != NULL && i < ucl->supports->cur; i++) { if (ucl->supports->buf[i] != NULL) { flag_putf(DC_DF_DEBUG, _("%s\n"), (char*)ucl->supports->buf[i]); } } */ if (flag == DC_TF_LIST) { free(share_file); #if defined(HAVE_LIBXML2) if (ucl->supports != NULL && ptrv_find(ucl->supports, "XmlBZList", (comparison_fn_t)strcasecmp) >= 0) { share_file = strdup("/files.xml.bz2"); } else { share_file = strdup("/MyList.DcLst"); } #else share_file = strdup("/MyList.DcLst"); #endif char* tmp = xasprintf("%s.%s", local_file, base_name(share_file)); free(local_file); local_file = tmp; } conv_local_file = fs_to_main_string(local_file); ucl->share_file/*DL*/ = share_file; ucl->local_file = conv_local_file; /* XXX: what if file without ".part" exists and is complete? */ /* Check if file already exists, and if it need to be resumed. */ if (flag == DC_TF_LIST) { unlink(local_file); ucl->local_exists = false; resume_pos = 0; } else { if (lstat(local_file, &sb) != 0) { if (errno != ENOENT) { warn(_("%s: Cannot get file status: %s\n"), quotearg(local_file), errstr); end_download(ucl, false, _("local error")); download_next_file(ucl); return; } ucl->local_exists = false; resume_pos = 0; } else { if (!S_ISREG(sb.st_mode)) { warn(_("%s: File exists and is not a regular file\n"), quotearg(local_file)); end_download(ucl, false, _("local error")); download_next_file(ucl); return; } ucl->local_exists = true; resume_pos = sb.st_size; } } free(local_file); remote_file = translate_local_to_remote(share_file); if (remote_file == NULL) { end_download(ucl, false, _("communication error")); return; } hub_remote_file = main_to_hub_string(remote_file); if (!user_putf(ucl, "$Get %s$%" PRIu64 "|", hub_remote_file , resume_pos+1)) { /* " */ end_download(ucl, false, _("communication error")); free(remote_file); free(hub_remote_file); return; } free(remote_file); free(hub_remote_file); ucl->user_state = DC_USER_FILE_LENGTH; ucl->file_size = file_size; ucl->file_pos = resume_pos; ucl->transfer_pos = resume_pos; } static void open_download_file(DCUserConnLocal *ucl, uint64_t file_size) { int res; char *conv_local_file, *conv_share_file; if (ucl->file_size == UINT64_MAX) { /* A file size of UINT64_MAX means that we did not know the size * of the file in advance which is only true for file list files. */ ucl->file_size = file_size; } else if (file_size < ucl->file_size) { end_download(ucl, false, _("remote file is smaller than local (expected %" PRIu64 ", got %" PRIu64 " %s)"), ucl->file_size, file_size, ngettext("byte", "bytes", file_size)); /* We're probably left in a weird state here. It is possible that * some clients (at least DC++ 0.700) won't let us download more * files from here. */ download_next_file(ucl); return; } conv_local_file = main_to_fs_string(ucl->local_file); if (ucl->local_exists) { /* Resuming */ ucl->transfer_fd/*DL*/ = open/*64*/(conv_local_file/*DL*/, O_CREAT|O_WRONLY, 0644); } else { ucl->transfer_fd/*DL*/ = open/*64*/(conv_local_file/*DL*/, O_CREAT|O_EXCL|O_WRONLY, 0644); } free(conv_local_file); if (ucl->transfer_fd/*DL*/ < 0) { warn(_("%s: Cannot open file for writing - %s\n"), quotearg(ucl->local_file/*DL*/), errstr); end_download(ucl, false, _("local error")); download_next_file(ucl); return; } if (ucl->file_pos != 0 && lseek(ucl->transfer_fd/*DL*/, ucl->file_pos, SEEK_SET) < 0) { warn(_("%s: Cannot seek to resume position - %s\n"), quotearg(ucl->local_file/*DL*/), errstr); end_download(ucl, false, _("local error")); download_next_file(ucl); return; } if (!user_putf(ucl, "$Send|")) { end_download(ucl, false, _("communication error")); return; } conv_share_file = hub_to_main_string(ucl->share_file); res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_TRANSFER_START, MSGQ_STR, ucl->local_file, MSGQ_STR, conv_share_file, MSGQ_INT64, ucl->file_pos, MSGQ_INT64, ucl->file_size, MSGQ_END); free(conv_share_file); if (res <= 0) { fatal_error(ucl, res, true); /*end_download(ucl, false, "internal communication error");*/ /* Just won't go through! */ return; } ucl->data_size/*DL*/ = ucl->file_size - ucl->file_pos; if (ucl->data_size/*DL*/ == 0) { end_download(ucl, true, _("no data to transfer")); download_next_file(ucl); return; } ucl->user_state = DC_USER_DATA_RECV; /* Places to go from here * user_running becomes false * User process termination. user_disconnect deals with used_*_slots. * data received until file complete (possible no data) * Will issue DC_MSG_DOWNLOAD_ENDED prior to calling * download_next_file. */ } static void end_upload(DCUserConnLocal *ucl, bool success, const char *reason) { int res; if (ucl->transfer_fd/*DL*/ >= 0) { close(ucl->transfer_fd/*DL*/); /* Ignore errors */ ucl->transfer_fd/*DL*/ = -1; } free(ucl->share_file/*UL*/); ucl->share_file/*UL*/ = NULL; free(ucl->local_file/*UL*/); ucl->local_file/*UL*/ = NULL; res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_UPLOAD_ENDED, MSGQ_BOOL, success, MSGQ_STR, reason, MSGQ_END); if (res <= 0) fatal_error(ucl, res, true); } static int open_upload_file_main(DCUserConnLocal *ucl, const char *str, uint64_t offset, DCAdcgetType type) { struct stat st; bool may_upload; char *share_file; char *local_file, *conv_local_file; int res; if (strlen(str) > 0) { #if 0 if ( type == DC_ADCGET_TTHL) { if (offset == 0) offset = /*fsize*/ sizeof(uint64_t) + /*mtime*/sizeof(time_t) + /*ctime*/ sizeof(time_t) + /*tth base32*/39; else { flag_putf(DC_DF_CONNECTIONS, _("%s: Incorrect offset in tthl request\n"), quotearg(ucl->local_file/*UL*/)); user_putf(ucl, "$Error Incorrect offset in tthl request|"); end_upload(ucl, false, _("Incorrect offset in tthl request")); return -9; } } #endif if (type == DC_ADCGET_FILE) share_file = translate_remote_to_local(str); else share_file = xstrdup(str); res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_CHECK_UPLOAD, MSGQ_INT, type, MSGQ_STR, share_file, MSGQ_END); if (res <= 0) { free(share_file); return -1; } res = msgq_get_sync(ucl->get_mq, MSGQ_BOOL, &may_upload, MSGQ_STR, &local_file, MSGQ_END); if (res <= 0) { free(share_file); return -2; } if (!may_upload) { user_putf(ucl, "$MaxedOut|"); free(share_file); return -3; } if (type == DC_ADCGET_FILE) { ucl->share_file/*UL*/ = share_file; } else { free(share_file); ucl->share_file = xstrdup(base_name(local_file)); } ucl->local_file/*UL*/ = local_file; } else { ucl->local_file/*UL*/ = NULL; } if (ucl->local_file/*UL*/ == NULL) { flag_putf(DC_DF_CONNECTIONS, _("%s: File Not Available\n"), quotearg(ucl->local_file/*UL*/)); user_putf(ucl, "$Error File Not Available|"); end_upload(ucl, false, _("no such shared file")); return -4; } conv_local_file = main_to_fs_string(ucl->local_file); if (stat(conv_local_file/*UL*/, &st) < 0) { free (conv_local_file); flag_putf(DC_DF_CONNECTIONS, _("%s: Cannot get file status - %s\n"), quotearg(ucl->local_file/*UL*/), errstr); user_putf(ucl, "$Error File Not Available|"); end_upload(ucl, false, _("local error")); return -5; } #if 0 if ( type == DC_ADCGET_TTHL) { if ( (offset + 2*TIGERSIZE > st.st_size) || ( (st.st_size - offset) % TIGERSIZE)) { free (conv_local_file); flag_putf(DC_DF_CONNECTIONS, _("%s: Resume offset %" PRIu64 " outside tthl file\n"), quotearg(ucl->local_file/*UL*/), offset); user_putf(ucl, "$Error File Not Available|"); end_upload(ucl, false, _("resume offset out of tthl range")); return -10; } } #endif if (offset > st.st_size) { free (conv_local_file); flag_putf(DC_DF_CONNECTIONS, _("%s: Resume offset %" PRIu64 " outside file\n"), quotearg(ucl->local_file/*UL*/), offset); user_putf(ucl, "$Error Offset out of range|"); end_upload(ucl, false, _("resume offset out of range")); return -6; } ucl->transfer_fd/*UL*/ = open/*64*/(conv_local_file/*UL*/, O_RDONLY); if (ucl->transfer_fd/*UL*/ < 0) { free (conv_local_file); flag_putf(DC_DF_CONNECTIONS, _("%s: Cannot open file for reading - %s\n"), quotearg(ucl->local_file/*UL*/), errstr); user_putf(ucl, "$Error File Not Available|"); end_upload(ucl, false, _("local error")); return -7; } free (conv_local_file); if (offset != 0 && lseek/*64*/(ucl->transfer_fd/*UL*/, offset, SEEK_SET) < 0) { flag_putf(DC_DF_CONNECTIONS, _("%s: Cannot seek in file - %s\n"), quotearg(ucl->local_file/*UL*/), errstr); user_putf(ucl, "$Error File Not Available|"); end_upload(ucl, false, _("local error")); return -8; } ucl->file_pos = offset; ucl->transfer_pos = offset; ucl->user_state = DC_USER_SEND_GET; ucl->file_size = st.st_size; return 0; /* Places to go from here: * user_running becomes false * User process termination. user_disconnect deals with used_*_slots. * $Get received * Will issue DC_MSG_UPLOAD_ENDED prior to calling this * function again. * $Send received with file_size == 0 * $Send received with file_size != 0, download finished * Will issue DC_MSG_UPLOAD_ENDED prior to setting state * to DC_USER_GET. */ } static void open_upload_file(DCUserConnLocal *ucl, const char *str, uint64_t offset) { if ( open_upload_file_main(ucl, str, offset, DC_ADCGET_FILE) < 0 ) return; ucl->final_pos = ucl->file_size; if (!user_putf(ucl, "$FileLength %" PRIu64 "|", ucl->file_size)) { end_upload(ucl, false, _("communication error")); return; } } #if defined(HAVE_LIBXML2) static void open_upload_file_block(DCUserConnLocal *ucl, const char *str, uint64_t offset, uint64_t numbytes) { if ( open_upload_file_main(ucl, str, offset, DC_ADCGET_FILE) < 0) return; if ((numbytes == (uint64_t)-1) || (offset + numbytes >= ucl->file_size)) ucl->final_pos = ucl->file_size; else ucl->final_pos = offset + numbytes; if (!user_putf(ucl, "$Sending %" PRIu64 "|", ucl->final_pos - ucl->file_pos)){ end_upload(ucl, false, _("communication error")); return; } upload_file(ucl); } static void open_upload_file_adcget(DCUserConnLocal *ucl, const char *type, const char *str, uint64_t offset, uint64_t numbytes) { char *filename; DCAdcgetType t = DC_ADCGET_FILE; if ( strcmp(type, "file") == 0) t = DC_ADCGET_FILE; else if ( strcmp(type, "tthl") == 0) t = DC_ADCGET_TTHL; else { if ( !user_putf(ucl, "$Error Unknown ADCGET type: %s|", type) ){ end_upload(ucl, false, _("communication error")); return; } } if ((strlen(str) == 4 + 39) && (str[0] == 'T') && (str[1] == 'T') && (str[2] == 'H') && (str[3] == '/')) { filename = xstrdup(str+4); if (t != DC_ADCGET_TTHL) t = DC_ADCGET_TTH; } else { char *s1, *s2; // name must be converted from UTF-8 to local charset filename = utf8_to_main_string(str); if (filename == NULL) return; /* unescape filename */ s1 = s2 = filename; while ( *s1 != '\0' ) { if ( *s2 == '\\') s2++; *s1++ = *s2++; } } if (numbytes == (uint64_t)-1) { flag_putf(DC_DF_DEBUG, _("User requests entire file <%s> starting from %" PRIu64 "\n"), filename, offset); } else { flag_putf(DC_DF_DEBUG, _("User requests %" PRIu64 " bytes of <%s> starting from %" PRIu64 "\n"), numbytes, filename, offset); } if (open_upload_file_main(ucl, filename, offset, t) < 0) { free(filename); return; } free(filename); if ((numbytes == (uint64_t)-1) || (offset + numbytes >= ucl->file_size)) ucl->final_pos = ucl->file_size; else ucl->final_pos = offset + numbytes; if (!user_putf(ucl, "$ADCSND %s %s %" PRIu64 " %" PRIu64 "|", type, str, ucl->transfer_pos, ucl->final_pos - ucl->transfer_pos)) { end_upload(ucl, false, _("communication error")); return; } upload_file(ucl); } #endif static void upload_file(DCUserConnLocal *ucl) { int res; if (ucl->final_pos == ucl->file_pos) { /* There's nothing to send - size is 0 or resuming at end. */ end_upload(ucl, true, _("no data to transfer")); ucl->user_state = DC_USER_GET; return; } res = msgq_put_sync(ucl->put_mq, MSGQ_INT, DC_MSG_TRANSFER_START, MSGQ_STR, ucl->local_file, MSGQ_STR, ucl->share_file, MSGQ_INT64, ucl->file_pos, MSGQ_INT64, ucl->final_pos, MSGQ_END); if (res <= 0) { fatal_error(ucl, res, true); /*end_upload(ucl, true);*/ /* Just won't go through */ return; } FD_SET(ucl->user_socket, &ucl->user_write_fds); assert(ucl->user_sendq->cur == 0); ucl->user_state = DC_USER_DATA_SEND; } /* Handle commands and data sent by the hub. */ static void user_handle_command(DCUserConnLocal *ucl, char *buf, uint32_t len) { if (ucl->user_state == DC_USER_DATA_RECV) { ssize_t res; res = full_write(ucl->transfer_fd/*DL*/, buf, len); if (res < len) { /* We cannot expect to synchronize with remote at this point, so shut down. */ warn_file_error(res, true, ucl->share_file/*DL*/); end_download(ucl, false, _("local error")); terminate_process(ucl); /* MSG: local error */ return; } ucl->file_pos += len; ucl->transfer_pos += len; ucl->data_size/*DL*/ -= len; send_user_status(ucl, ucl->file_pos); if (ucl->file_pos == ucl->file_size) { end_download(ucl, true, _("transfer complete")); download_next_file(ucl); return; } } else if (len >= 8 && strncmp(buf, "$MyNick ", 8) == 0) { char *local_nick; if (!check_state(ucl, buf, DC_USER_MYNICK)) return; local_nick = hub_to_main_string(buf+8); if (!nick_validate(ucl, local_nick)){ free(local_nick); return; } ucl->user_nick = local_nick; if (!ucl->we_connected) { char *our_nick; char *hub_my_nick; if (!get_our_nick(ucl, &our_nick)) return; hub_my_nick = main_to_hub_string(our_nick); if (!user_putf(ucl, "$MyNick %s|", hub_my_nick)) { free(our_nick); free(hub_my_nick); return; } free(our_nick); free(hub_my_nick); if (!user_putf(ucl, "$Lock %s Pk=%s|", LOCK_STRING, LOCK_PK_STRING)) return; } ucl->user_state = DC_USER_LOCK; } else if (len >= 6 && strncmp(buf, "$Lock ", 6) == 0) { char *key; bool download; if (!check_state(ucl, buf, DC_USER_LOCK)) return; key = memmem(buf+6, len-6, " Pk=", 4); if (key == NULL) { warn(_("Invalid $Lock message: Missing Pk value\n")); key = buf+len; } key = decode_lock(buf+6, key-buf-6, DC_CLIENT_BASE_KEY); if (!wants_to_download(ucl, &download)) { free(key); return; } #if defined(HAVE_LIBXML2) /*if (!user_putf(ucl, "$Supports XmlBZList|")) {*/ /*if (!user_putf(ucl, "$Supports XmlBZList ADCGet TTHF TTHL|")) {*/ if (!user_putf(ucl, "$Supports MiniSlots XmlBZList ADCGet TTHF|")) { free(key); return; } #endif if (!user_putf(ucl, "$Direction %s %d|", download ? "Download" : "Upload", ucl->dir_rand)) { free(key); return; } if (!user_putf(ucl, "$Key %s|", key)) { free(key); return; } free(key); ucl->user_state = DC_USER_SUPPORTS; } else if (len >= 10 && strncmp(buf, "$Supports ", 10) == 0) { char* p = buf+10; if (!check_state(ucl, buf, DC_USER_SUPPORTS)) return; if (ucl->supports != NULL) { ptrv_foreach(ucl->supports, free); } do { char* token = strsep(&p, " "); if (token != NULL) ptrv_append(ucl->supports, strdup(token)); } while (p != NULL); ucl->user_state = DC_USER_DIRECTION; } else if (len >= 11 && strncmp(buf, "$Direction ", 11) == 0) { char *token; uint16_t remote_rand; bool they_download; bool we_download; if (!check_state(ucl, buf, DC_USER_DIRECTION)) return; token = strtok(buf+11, " "); if (token == NULL) { warn(_("Invalid $Direction message: Missing direction parameter\n")); terminate_process(ucl); /* MSG: protocol error */ return; } if (strcmp(token, "Upload") == 0) { they_download = false; } else if (strcmp(token, "Download") == 0) { they_download = true; } else { warn(_("Invalid $Direction message: Invalid direction parameter\n")); terminate_process(ucl); /* MSG: protocol error */ return; } token = strtok(NULL, " "); if (token == NULL) { warn(_("Invalid $Direction message: Missing challenge parameter\n")); terminate_process(ucl); /* MSG: protocol error */ return; } if (!parse_uint16(token, &remote_rand)) { warn(_("Invalid $Direction message: Invalid challenge parameter\n")); terminate_process(ucl); /* MSG: protocol error */ return; } if (!wants_to_download(ucl, &we_download)) return; if (they_download) { /* Remote wants to download. Do we want to download too? */ if (we_download) { if (remote_rand >= ucl->dir_rand) { /* We lost. Let them download. */ ucl->our_dir = DC_DIR_SEND; } else { /* We won. */ ucl->our_dir = DC_DIR_RECEIVE; } /* XXX: what should happen if remote_rand == dir_rand!? */ } else { /* We don't want to download anything. Let remote download. */ ucl->our_dir = DC_DIR_SEND; } } else { /* Remote wants to upload. Do we want to upload too? */ if (!we_download) { warn(_("User does not want to download, nor do we.\n")); terminate_process(ucl); /* MSG: no one wants to exchange files */ return; } ucl->our_dir = DC_DIR_RECEIVE; } if (!direction_validate(ucl, ucl->our_dir)) return; ucl->user_state = DC_USER_KEY; } else if (len >= 5 && strncmp(buf, "$Key ", 5) == 0) { char *key; if (!check_state(ucl, buf, DC_USER_KEY)) return; key = decode_lock(LOCK_STRING, LOCK_STRING_LEN, DC_CLIENT_BASE_KEY); if (strcmp(buf+5, key) != 0) warn(_("Invalid $Key message: Incorrect key, ignoring\n")); free(key); if (ucl->our_dir == DC_DIR_SEND) { ucl->user_state = DC_USER_GET; } else { download_next_file(ucl); } } else if (len >= 5 && strncmp(buf, "$Get ", 5) == 0) { char *token; uint64_t offset = 0; int filename_len = 0; if (ucl->user_state != DC_USER_SEND_GET && ucl->user_state != DC_USER_GET) { warn(_("Received %s message in wrong state.\n"), strtok(buf, " ")); terminate_process(ucl); /* MSG: protocol error */ return; } token = strtok(buf+5, "$"); if (*(buf+5) != '$') { filename_len = strlen(buf+5); } if (token == NULL) { warn(_("Invalid $Get message: Missing offset, assuming start\n")); offset = 0; } else if (filename_len > 0) { token = strtok(NULL, ""); /* Cannot fail! */ if (token == NULL || !parse_uint64(token, &offset)) { warn(_("Invalid $Get message: Offset not integer\n")); terminate_process(ucl); /* MSG: protocol error */ return; } if (offset > 0) offset--; } /* Maybe the remote user did not want the file after all? */ if (ucl->user_state == DC_USER_SEND_GET) end_upload(ucl, false, _("remote did not want file")); if (filename_len > 0) { /* Convert filename from hub to local charset * Try utf-8 if it fails */ char *s = /* hub_to_main_string(buf+5); */ utf8_to_main_string(buf+5); /* if (s == NULL) s = iconv_alloc(from_utf8, buf+5); */ open_upload_file(ucl, s, offset); /* Changes state */ free(s); } } else if (len == 9 && strcmp(buf, "$MaxedOut") == 0) { if (!check_state(ucl, buf, DC_USER_FILE_LENGTH)) return; end_download(ucl, false, _("remote is maxed out")); terminate_process(ucl); /* MSG: msg above */ } else if (len >= 12 && strncmp(buf, "$FileLength ", 12) == 0) { uint64_t file_size; if (!check_state(ucl, buf, DC_USER_FILE_LENGTH)) return; if (!parse_uint64(buf+12, &file_size)) { end_download(ucl, false, _("protocol error: invalid $FileLength message")); download_next_file(ucl); return; } open_download_file(ucl, file_size); /* Will change state */ } else if (len >= 7 && strncmp(buf, "$Error ", 7) == 0) { if (ucl->user_state == DC_USER_FILE_LENGTH) { if (strcmp(buf+7, "File Not Available") == 0) { end_download(ucl, false, _("file not available on remote")); } else { end_download(ucl, false, _("remote error: %s"), quotearg(buf+7)); } download_next_file(ucl); return; } warn(_("Received error from user: %s\n"), quotearg(buf+7)); terminate_process(ucl); /* MSG: remote replied with error (including msg above) */ } else if (len >= 5 && strncmp(buf, "$Send ", 5) == 0) { if (!check_state(ucl, buf, DC_USER_SEND_GET)) return; upload_file(ucl); } #if defined(HAVE_LIBXML2) else if (len >= 11 && strncmp(buf, "$UGetBlock ", 11) == 0) { char filename[10240]; char* p_filename = NULL; uint64_t offset = 0, block_size = 0; if (!check_state(ucl, buf, DC_USER_GET)) { warn(_("Received %s message in wrong state.\n"), strtok(buf, " ")); terminate_process(ucl); /* MSG: protocol error */ return; } if (3 != sscanf(buf+11, "%" PRIu64 "%" PRIu64 "%*c%[^\n]", &offset, &block_size, filename)) { warn(_("Invalid $UGetBlock message\n")); terminate_process(ucl); /* MSG: protocol error */ return; } p_filename = utf8_to_main_string(filename); flag_putf(DC_DF_DEBUG, _("User requests %" PRIu64 " bytes of <%s> starting from %" PRIu64 "\n"), block_size, p_filename, offset); open_upload_file_block(ucl, p_filename, offset, block_size); free(p_filename); } else if (len >= 8 && strncmp(buf, "$ADCGET ", 8) == 0) { char *type, *filename, *startpos, *numbytes, *flags; uint64_t n_startpos, n_numbytes; if (!check_state(ucl, buf, DC_USER_GET)) { warn(_("Received %s message in wrong state.\n"), strtok(buf, " ")); terminate_process(ucl); /* MSG: protocol error */ return; } filename = buf + 8; type = strsep(&filename, " "); if ( (type[0] == '\0') || (filename == NULL) || (filename == '\0') || (filename[0] == ' ' )) { warn(_("Received %s message in wrong state.\n"), strtok(buf, " ")); terminate_process(ucl); /* MSG: protocol error */ return; } /* search for first non-escaped space */ for ( startpos = filename + 1; *startpos; startpos++) { if ( ( startpos[0] == ' ') && ( startpos[-1] != '\\' ) ) break; } if (*startpos == '\0') { warn(_("Received %s message in wrong state.\n"), strtok(buf, " ")); terminate_process(ucl); /* MSG: protocol error */ return; } startpos[0] = '\0'; numbytes = startpos + 1; startpos = strsep(&numbytes, " "); if ( (numbytes == NULL) || (!parse_uint64(startpos, &n_startpos))) { warn(_("Received %s message in wrong state.\n"), strtok(buf, " ")); terminate_process(ucl); /* MSG: protocol error */ return; } flags = numbytes; numbytes = strsep(&flags, " \r\n"); if ( (!parse_int64(numbytes, &n_numbytes))) { warn(_("Received %s message in wrong state.\n"), strtok(buf, " ")); terminate_process(ucl); /* MSG: protocol error */ return; } if ( flags != NULL ) { warn(_("Ignoring $ADCGET flags: %s\n"), flags); } open_upload_file_adcget(ucl, type, filename , n_startpos, n_numbytes); } #endif } static void user_input_available(DCUserConnLocal *ucl) { int start = 0; int c; int res; alarm(0); /* cannot fail */ res = byteq_read(ucl->user_recvq, ucl->user_socket); if (res == 0 || (res < 0 && errno != EAGAIN && errno != EINTR)) { warn_socket_error(res, false, _("user")); terminate_process(ucl); /* MSG: socket error above */ return; } for (c = ucl->user_recvq_last; c < ucl->user_recvq->cur; c++) { if (ucl->data_size/*DL*/ > 0) { uint32_t size; /* Handle what've got, but never more than data_size */ size = MIN(ucl->data_size/*DL*/, ucl->user_recvq->cur - start); user_handle_command(ucl, ucl->user_recvq->buf + start, size); start += size; if (!ucl->user_running) break; c += size - 1; } else if (ucl->user_recvq->buf[c] == '|') { /* Got a complete command. */ if (c - start > 0) dump_command(_("<--"), ucl->user_recvq->buf + start, c - start + 1); ucl->user_recvq->buf[c] = '\0'; /* Just to be on the safe side... */ user_handle_command(ucl, ucl->user_recvq->buf + start, c - start); start = c+1; if (!ucl->user_running) break; } } if (start != 0) byteq_remove(ucl->user_recvq, start); ucl->user_recvq_last = ucl->user_recvq->cur; alarm(USER_CONN_IDLE_TIMEOUT); /* cannot fail */ } static void user_now_writable(DCUserConnLocal *ucl) { alarm(0); /* cannot fail */ if (ucl->user_state == DC_USER_CONNECT) { int error; socklen_t size = sizeof(error); if (getsockopt(ucl->user_socket, SOL_SOCKET, SO_ERROR, &error, &size) < 0) { warn(_("Cannot get error status - %s\n"), errstr); terminate_process(ucl); /* MSG: local error */ return; } if (error != 0) { /* The connect call on the socket failed. */ warn(_("Cannot connect - %s\n"), strerror(error) /* not errno! */); terminate_process(ucl); /* MSG: local error */ return; } FD_CLR(ucl->user_socket, &ucl->user_write_fds); FD_SET(ucl->user_socket, &ucl->user_read_fds); ucl->user_state = DC_USER_MYNICK; if (ucl->we_connected) { char *our_nick; char *hub_my_nick; if (!get_our_nick(ucl, &our_nick)) return; hub_my_nick = main_to_hub_string(our_nick); flag_putf(DC_DF_CONNECTIONS, _("Connected to user.\n"));/*XXX: move where!?*/ if (!user_putf(ucl, "$MyNick %s|", hub_my_nick)) { free(our_nick); free(hub_my_nick); return; } free(our_nick); free(hub_my_nick); if (!user_putf(ucl, "$Lock %s Pk=%s|", LOCK_STRING, LOCK_PK_STRING)) return; } } else if (ucl->user_state == DC_USER_DATA_SEND) { size_t block; ssize_t res; assert(ucl->file_size != 0); block = MIN(DEFAULT_SENDQ_SIZE, ucl->final_pos - ucl->file_pos); if (block > 0 && ucl->user_sendq->cur == 0) { //if (ucl->user_sendq->cur < ucl->user_sendq->max) { res = byteq_full_read_upto(ucl->user_sendq, ucl->transfer_fd/*UL*/, block); if (res < block) { warn_file_error(res, false, ucl->local_file/*UL*/); end_upload(ucl, false, _("local error")); terminate_process(ucl); /* MSG: local error */ return; } ucl->file_pos += res; } assert(ucl->user_sendq->cur != 0); res = byteq_write(ucl->user_sendq, ucl->user_socket); if (res == 0 || (res < 0 && errno != EAGAIN && errno != EINTR)) { warn_socket_error(res, true, _("user")); end_upload(ucl, false, _("communication error")); terminate_process(ucl); /* MSG: communication error */ return; } ucl->transfer_pos += res; send_user_status(ucl, ucl->file_pos - ucl->user_sendq->cur); if (ucl->file_pos == ucl->final_pos && ucl->user_sendq->cur == 0) { FD_CLR(ucl->user_socket, &ucl->user_write_fds); end_upload(ucl, true, _("transfer complete")); ucl->user_state = DC_USER_GET; } } else { int res; if (ucl->user_sendq->cur > 0) { res = byteq_write(ucl->user_sendq, ucl->user_socket); if (res == 0 || (res < 0 && errno != EAGAIN && errno != EINTR)) { warn_socket_error(res, true, _("user")); terminate_process(ucl); /* MSG: socket error above */ return; } } if (ucl->user_sendq->cur == 0) FD_CLR(ucl->user_socket, &ucl->user_write_fds); } alarm(USER_CONN_IDLE_TIMEOUT); /* cannot fail */ } static void signal_received(int signal) { DCUserConnLocal *ucl = cur_ucl; /* XXX */ uint8_t signal_char; signal_char = signal; /* We don't care if this blocks - since we can't postpone this. */ if (write(ucl->signal_pipe[1], &signal_char, sizeof(uint8_t)) < sizeof(uint8_t)) { /* Die only if the signal is fatal. * SIGALRM is sent when the connection has been idle too long. * It will result in the connection shutting down, so if we * can't deliver it we might just shut down here. */ if (signal == SIGTERM || signal == SIGALRM) die(_("Cannot write to signal pipe - %s\n"), errstr); /* die OK */ warn(_("Cannot write to signal pipe - %s\n"), errstr); } } static void read_signal_input(DCUserConnLocal *ucl) { uint8_t signal; /* This read is atomic since sizeof(int) < PIPE_BUF! * It also doesn't block since all data is already * available (otherwise select wouldn't tell us there * was data). */ if (read(ucl->signal_pipe[0], &signal, sizeof(uint8_t)) < 0) { warn(_("Cannot read from signal pipe - %s\n"), errstr); terminate_process(ucl); /* MSG: local error */ return; } if (signal == SIGTERM) { warn(_("Received TERM signal, shutting down.\n")); terminate_process(ucl); /* MSG: terminating by signal */ } else if (signal == SIGALRM) { warn(_("Idle timeout (%d seconds)\n"), USER_CONN_IDLE_TIMEOUT); terminate_process(ucl); /* MSG: idle timeout msg above */ } else if (signal == SIGUSR1) { /* Not implemented yet, do nothing for now. */ } } static void main_request_fd_writable(DCUserConnLocal *ucl) { int res; res = msgq_write(ucl->put_mq); if (res <= 0) { fatal_error(ucl, res, true); return; } if (!msgq_has_partial_msg(ucl->put_mq)) FD_CLR(ucl->put_mq->fd, &ucl->user_write_fds); } static void main_result_fd_readable(DCUserConnLocal *ucl) { int res; res = msgq_read(ucl->get_mq); if (res <= 0) { fatal_error(ucl, res, false); return; } warn(_("Received unknown message from main process, shutting down process.\n")); ucl->user_running = false; } void __attribute__((noreturn)) user_main(int get_fd[2], int put_fd[2], struct sockaddr_in *addr, int sock) { struct sigaction sigact; DCUserConnLocal *ucl; filelist_free(our_filelist); ucl = xmalloc(sizeof(DCUserConnLocal)); cur_ucl = ucl; /* one per process anyway */ ucl->user_nick = NULL; ucl->share_file = NULL; ucl->local_file = NULL; ucl->user_recvq_last = 0; ucl->user_socket = -1; ucl->transfer_fd = -1; ucl->data_size = 0; /* only useful when receiving files */ ucl->file_pos = 0; ucl->final_pos = 0; ucl->transfer_pos = 0; ucl->file_size = 0; ucl->user_state = DC_USER_CONNECT; ucl->user_running = true; ucl->get_mq = msgq_new(get_fd[0]); ucl->put_mq = msgq_new(put_fd[1]); ucl->supports = ptrv_new(); screen_writer = user_screen_writer; if (close(get_fd[1]) != 0 || close(put_fd[0]) != 0) warn(_("Cannot close pipe - %s\n"), errstr); if (pipe(ucl->signal_pipe) < 0) { warn(_("Cannot create pipe pair - %s\n"), errstr); goto cleanup; } sigact.sa_handler = signal_received; if (sigemptyset(&sigact.sa_mask) < 0) { warn(_("Cannot empty signal set - %s\n"), errstr); goto cleanup; } sigact.sa_flags = SA_RESTART; #ifdef HAVE_STRUCT_SIGACTION_SA_RESTORER sigact.sa_restorer = NULL; #endif /* Note: every signal registered with a non-ignore action in main.c * must also be registered here, either with an action or as ignored. */ if (sigaction(SIGTERM, &sigact, NULL) < 0 || sigaction(SIGUSR1, &sigact, NULL) < 0 || sigaction(SIGALRM, &sigact, NULL) < 0) { warn(_("Cannot register signal handler - %s\n"), errstr); goto cleanup; } sigact.sa_handler = SIG_IGN; if (sigaction(SIGINT, &sigact, NULL) < 0 || sigaction(SIGCHLD, &sigact, NULL) < 0 || sigaction(SIGPIPE, &sigact, NULL) < 0) { warn(_("Cannot register signal handler - %s\n"), errstr); goto cleanup; } ucl->user_recvq = byteq_new(DEFAULT_RECVQ_SIZE); ucl->user_sendq = byteq_new(DEFAULT_SENDQ_SIZE); ucl->dir_rand = rand() % 0x8000; if (sock < 0) { ucl->user_socket = socket(PF_INET, SOCK_STREAM, 0); if (ucl->user_socket < 0) { warn(_("Cannot create socket - %s\n"), errstr); goto cleanup; } ucl->we_connected = true; } else { ucl->user_socket = sock; ucl->we_connected = false; } /* Set non-blocking I/O on socket. */ if (!fd_set_nonblock_flag(ucl->user_socket, true)) { warn(_("Cannot set non-blocking flag - %s\n"), errstr); goto cleanup; } if (sock < 0) { /* Connect to host, non-blocking manner. Even if connect would return * success, we would catch the successful connection after select - * when socket_fd is writable. */ if (connect(ucl->user_socket, (struct sockaddr *) addr, sizeof(struct sockaddr_in)) < 0 && errno != EINPROGRESS) { warn(_("Cannot connect - %s\n"), errstr); goto cleanup; } } FD_ZERO(&ucl->user_read_fds); FD_ZERO(&ucl->user_write_fds); FD_SET(ucl->signal_pipe[0], &ucl->user_read_fds); FD_SET(ucl->user_socket, &ucl->user_write_fds); /* will set read after connect() finishes */ FD_SET(ucl->get_mq->fd, &ucl->user_read_fds); while (ucl->user_running) { fd_set res_read_fds; fd_set res_write_fds; res_read_fds = ucl->user_read_fds; res_write_fds = ucl->user_write_fds; if (TEMP_FAILURE_RETRY(select(FD_SETSIZE, &res_read_fds, &res_write_fds, NULL, NULL)) < 0) { warn(_("Cannot select - %s\n"), errstr); break; } /* We must check for user writable prior to readable, to detect * connect() completion before any data is received and handled. */ if (ucl->user_running && FD_ISSET(ucl->signal_pipe[0], &res_read_fds)) read_signal_input(ucl); if (ucl->user_running && FD_ISSET(ucl->put_mq->fd, &res_write_fds)) main_request_fd_writable(ucl); if (ucl->user_running && FD_ISSET(ucl->get_mq->fd, &res_read_fds)) main_result_fd_readable(ucl); if (ucl->user_running && FD_ISSET(ucl->user_socket, &res_write_fds)) user_now_writable(ucl); if (ucl->user_running && FD_ISSET(ucl->user_socket, &res_read_fds)) user_input_available(ucl); } cleanup: free(ucl->local_file); free(ucl->share_file); free(ucl->user_nick); byteq_free(ucl->user_recvq); byteq_free(ucl->user_sendq); if (ucl->transfer_fd >= 0 && close(ucl->transfer_fd) < 0) warn(_("Cannot close transfer file - %s\n"), errstr); /* XXX: should print WHAT file - then remove " transfer" */ if (ucl->signal_pipe[0] >= 0 && close(ucl->signal_pipe[0]) < 0) warn(_("Cannot close signal pipe - %s\n"), errstr); if (ucl->signal_pipe[1] >= 0 && close(ucl->signal_pipe[1]) < 0) warn(_("Cannot close signal pipe - %s\n"), errstr); if (ucl->get_mq != NULL && close(ucl->get_mq->fd) != 0) warn(_("Cannot close pipe - %s\n"), errstr); if (ucl->put_mq != NULL && close(ucl->put_mq->fd) != 0) warn(_("Cannot close pipe - %s\n"), errstr); if (ucl->user_socket >= 0 && close(ucl->user_socket) < 0) warn(_("Cannot close user connection - %s\n"), errstr); msgq_free(ucl->get_mq); msgq_free(ucl->put_mq); ptrv_foreach(ucl->supports, free); ptrv_free(ucl->supports); exit(EXIT_SUCCESS); } microdc2-0.15.6/src/util.c0100644000076500007500000002013110524431462015260 0ustar chugunovmicrodc/* util.c - Utility functions that didn't make it elsewhere * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* Gnulib/POSIX/C99 */ #include /* ? */ #include /* ? */ #include /* POSIX: confstr, ... */ #include /* ? */ #include /* C89 */ #include /* ? */ #include "xalloc.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "quotearg.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/comparison.h" #include "common/intutil.h" #include "microdc.h" #define SECONDS_PER_DAY (SECONDS_PER_HOUR*HOURS_PER_DAY) #define SECONDS_PER_HOUR (SECONDS_PER_MINUTE*MINUTES_PER_HOUR) #define SECONDS_PER_MINUTE 60 #define MINUTES_PER_HOUR 60 #define HOURS_PER_DAY 24 /* safe_rename: A rename that won't overwrite the destination. * Or at least try not to. :) */ int safe_rename(const char *oldpath, const char *newpath) { int fd; fd = open(newpath, O_CREAT|O_EXCL, 0600); if (fd < 0) return -1; if (close(fd) != 0) return -1; return rename(oldpath, newpath); } bool parse_ip_and_port(char *source, struct sockaddr_in *addr, uint16_t defport) { char *port; port = strrchr(source, ':'); if (port == NULL) { if (defport == 0) return false; addr->sin_port = htons(defport); } else { *port = '\0'; port++; if (!parse_uint16(port, &addr->sin_port)) return false; addr->sin_port = htons(addr->sin_port); } if (!inet_aton(source, &addr->sin_addr)) return false; addr->sin_family = AF_INET; return true; } /* Move to lib !? */ int ilog10(uint64_t c) { int r; for (r = 0; c > 0; r++) c /= 10; return r; } /* XXX: try to get rid of screen_putf from this function. */ int mkdirs_for_file(char *filename) { char *t; for (t = filename; *t == '/'; t++); while ((t = strchr(t, '/')) != NULL) { struct stat st; *t = '\0'; if (stat(filename, &st) < 0) { if (errno != ENOENT) { screen_putf(_("%s: Cannot get file status - %s\n"), quotearg(filename), errstr); return -1; } else { if (mkdir(filename, 0777) < 0) { screen_putf(_("%s: Cannot create directory - %s\n"), quotearg(filename), errstr); return -1; } /* else if (deletedirs) { if (ptrv_find(delete_dirs, filename, (comparison_fn_t) strcmp) < 0) ptrv_append(delete_dirs, xstrdup(filename)); } */ } } *t = '/'; for (; *t == '/'; t++); } return 0; } /* Concatenate two file names, adding slash character in between * if necessary. An empty string for file name will be treated as * the current directory, only invisible instead of `./'. If both * P1 and P2 are empty strings, then the empty string will be * returned. P1 and P2 must not be NULL. The returned value will * be allocated on the heap and must be freed with free(). NULL * will never be returned. * * P1 P2 with slash as is * "" "" "" "" * "foo" "" "foo/" "foo" * "foo/" "" "foo/" "foo/" * "" "foo" "foo/" "foo" * "" "foo/" "foo/ "foo/" * "foo" "foo" "foo/foo/" "foo/foo" * "foo" "foo/" "foo/foo/" "foo/foo" * "foo/" "foo" "foo/foo/" "foo/foo/" * "foo/" "foo/" "foo/foo" "foo/foo/" */ char * catfiles_with_trailing_slash(const char *p1, const char *p2) { return xasprintf("%s%s%s%s", p1, p1[0] == '\0' || p1[strlen(p1)-1] == '/' ? "" : "/", p2, p2[0] == '\0' || p2[strlen(p2)-1] == '/' ? "" : "/"); } char * catfiles(const char *p1, const char *p2) { return xasprintf("%s%s%s", p1, p1[0] == '\0' || p1[strlen(p1)-1] == '/' ? "" : "/", p2); } /* Get environment variable with default value if it is not set. * Can be moved info lib directory: Finalize name. */ char * getenv_default(const char *name, char *defvalue) { char *value; value = getenv(name); return (value == NULL ? defvalue : value); } /* Set or remove status flags on the specified file descriptor * using the F_SETFL fcntl command. This function will not set * call fcntl if the flags are already set (this is determined * by issuing the F_GETFL fcntl command). SET determines if the * flags MODFLAGS are to be added (true) or removed (false). */ bool fd_set_status_flags(int fd, bool set, int modflags) { int curflags; int newflags; curflags = fcntl(fd, F_GETFL, 0); if (curflags < 0) return false; if (set) newflags = curflags | modflags; else newflags = curflags & ~modflags; if (newflags == curflags) return true; return fcntl(fd, F_SETFL, newflags) != -1; } char * in_addr_str(struct in_addr addr) { static char buffer[16]; unsigned char *bytes; bytes = (unsigned char *) &addr; snprintf(buffer, sizeof(buffer), "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]); return buffer; } char * sockaddr_in_str(struct sockaddr_in *addr) { static char buffer[22]; unsigned char *bytes; bytes = (unsigned char *) &addr->sin_addr; snprintf(buffer, sizeof(buffer), "%d.%d.%d.%d:%u", bytes[0], bytes[1], bytes[2], bytes[3], ntohs(addr->sin_port)); return buffer; } PtrV * wordwrap(const char *str, size_t len, size_t first_width, size_t other_width) { size_t width; PtrV *out; out = ptrv_new(); width = first_width; while (len > width) { size_t c, d; if (str[width] == ' ') { ptrv_append(out, xstrndup(str, width)); for (c = width+1; c < len && str[c] == ' '; c++); str += c; len -= c; } else { for (c = width; c > 0 && str[c-1] != ' '; c--); for (d = width+1; d < len && str[d] != ' '; d++); if (d-c <= width) { ptrv_append(out, xstrndup(str, c-1)); str += c; len -= c; } else { ptrv_append(out, xstrndup(str, width)); str += width; len -= width; } } width = other_width; } if (len > 0) ptrv_append(out, xstrndup(str, len)); return out; } char * join_strings(char **strs, int count, char mid) { int c; size_t len = count; char *out; char *p; for (c = 0; c < count; c++) len += strlen(strs[c]); p = out = xmalloc(len); for (c = 0; c < count ;c++) { p = stpcpy(p, strs[c]); *p = mid; p++; } p--; *p = '\0'; return out; } struct dirent * xreaddir(DIR *dh) { errno = 0; return readdir(dh); } char * elapsed_time_to_string(time_t elapsed, char *buf) { char *s = buf; if (elapsed >= SECONDS_PER_DAY) { s += sprintf(s, "%lud", (long) (elapsed / SECONDS_PER_DAY)); elapsed %= SECONDS_PER_DAY; } if (elapsed >= SECONDS_PER_HOUR) { s += sprintf(s, "%luh", (long) (elapsed / SECONDS_PER_HOUR)); elapsed %= SECONDS_PER_HOUR; } if (elapsed >= SECONDS_PER_MINUTE) { s += sprintf(s, "%lum", (long) (elapsed / SECONDS_PER_MINUTE)); elapsed %= SECONDS_PER_MINUTE; } if (elapsed > 0 || s == buf) s += sprintf(s, "%lus", (long) elapsed); return buf; } microdc2-0.15.6/src/variables.c0100664000076500007500000006141710543544777016310 0ustar chugunovmicrodc/* variables.c - Setting variables * * Copyright (C) 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include /* POSIX (XSI) */ #include "xalloc.h" /* Gnulib */ #include "quotearg.h" /* Gnulib */ #include "minmax.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "strnlen.h" /* Gnulib */ #include "iconvme.h" #include "xstrndup.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "common/strleftcmp.h" #include "common/intutil.h" #include "common/strbuf.h" #include "common/quoting.h" #include "common/comparison.h" #include "common/bksearch.h" #include "microdc.h" /* TRANSLATORS: This comma-separated list specifies * all strings which are considered negative boolean * values for variables such as `active'. * Retain the default English strings and add the * localized ones. */ #define NEGATIVE_BOOL_STRINGS _("0,off,no,false") /* TRANSLATORS: This comma-separated list specifies * all strings which are considered positive boolean * values for variables such as `active'. * Retain the default English strings and add the * localized ones. */ #define POSITIVE_BOOL_STRINGS _("1,on,yes,true") static void var_set_hub_charset(DCVariable *var, int argc, char **argv); static void var_set_fs_charset(DCVariable *var, int argc, char **argv); static void var_set_log_charset(DCVariable *var, int argc, char **argv); static void var_set_nick(DCVariable *var, int argc, char **argv); static void var_set_password(DCVariable *var, int argc, char **argv); static void var_set_description(DCVariable *var, int argc, char **argv); static void var_set_tag(DCVariable *var, int argc, char **argv); static void var_set_speed(DCVariable *var, int argc, char **argv); static void var_set_email(DCVariable *var, int argc, char **argv); static void var_set_download_dir(DCVariable *var, int argc, char **argv); static void var_set_listing_dir(DCVariable *var, int argc, char **argv); static void var_set_slots(DCVariable *var, int argc, char **argv); static char *var_get_slots(DCVariable *var); static char *var_get_string(DCVariable *var); static char *var_get_bool(DCVariable *var); static void var_set_active(DCVariable *var, int argc, char **argv); static void var_set_auto_reconnect(DCVariable *var, int argc, char **argv); static char *var_get_listen_addr(DCVariable *var); static void var_set_listen_addr(DCVariable *var, int argc, char **argv); static char *var_get_listen_port(DCVariable *var); static void var_set_listen_port(DCVariable *var, int argc, char **argv); static char *var_get_display_flags(DCVariable *var); static void var_set_display_flags(DCVariable *var, int argc, char **argv); static void var_set_log_file(DCVariable *var, int argc, char **argv); static char *var_get_time(DCVariable *var); static void var_set_filelist_refresh_interval(DCVariable *var, int argc, char **argv); static void speed_completion_generator(DCCompletionInfo *ci); static void bool_completion_generator(DCCompletionInfo *ci); static void variable_completion_generator(DCCompletionInfo *ci); static void display_completion_generator(DCCompletionInfo *ci); static void charset_completion_generator(DCCompletionInfo *ci); typedef struct { DCDisplayFlag flag; const char *name; } DCDisplayFlagDetails; /* settings/variables */ uint32_t minislot_count = 3; uint32_t minislot_size = (1 << 16); int used_mini_slots = 0; int used_ul_slots = 0; int used_dl_slots = 0; uint32_t my_ul_slots; char *my_nick; char *my_tag; char *my_description; char *my_speed; char *my_email; char *share_dir = NULL; char *download_dir; char *listing_dir; char *my_password; bool is_active; bool auto_reconnect = 0; uint64_t my_share_size = 0; uint32_t display_flags = ~(DC_DF_DEBUG); /* All flags except debug set */ uint32_t log_flags = ~(DC_DF_DEBUG); struct in_addr force_listen_addr = { INADDR_NONE }; /* This list must be sorted according to strcmp. */ DCDisplayFlagDetails display_flag_details[] = { { DC_DF_CONNECTIONS, "connections" }, { DC_DF_DEBUG, "debug" }, { DC_DF_DOWNLOAD, "download" }, { DC_DF_JOIN_PART, "joinpart" }, { DC_DF_PUBLIC_CHAT, "publicchat" }, { DC_DF_SEARCH_RESULTS, "searchresults" }, { DC_DF_UPLOAD, "upload" }, }; static const int display_flag_count = sizeof(display_flag_details)/sizeof(*display_flag_details); static char *speeds[] = { "28.8Kbps", "33.6Kbps", "56Kbps", "Cable", "DSL", "ISDN", "LAN(T1)", "LAN(T3)", "Modem", "Satellite", }; static const int speeds_count = sizeof(speeds)/sizeof(*speeds); /* This structure must be sorted by variable name, according to strcmp. */ static DCVariable variables[] = { { "active", var_get_bool, var_set_active, &is_active, bool_completion_generator, NULL, "Enable if listening for remote connections" }, { "auto_reconnect", var_get_bool, var_set_auto_reconnect, &auto_reconnect, bool_completion_generator, NULL, "Enable automatic reconnect to the last connected hub" }, { "description", var_get_string, var_set_description, &my_description, NULL, NULL, "This is the description which is visible to other users of the hub." }, { "display", var_get_display_flags, var_set_display_flags, &display_flags, display_completion_generator, NULL, "Types of messages to display on screen" }, { "downloaddir", var_get_string, var_set_download_dir, &download_dir, local_dir_completion_generator, NULL, "Directory which files are downloaded to" }, { "email", var_get_string, var_set_email, &my_email, NULL, NULL, "The e-mail visible to other users of the hub" }, { "filelist_refresh_interval", var_get_time, var_set_filelist_refresh_interval, &filelist_refresh_timeout, NULL, NULL, "Local filelist refresh interval (in seconds)" }, { "filesystem_charset", var_get_string, var_set_fs_charset, &fs_charset, charset_completion_generator, NULL, "Local filesystem charset (if it differs from local charset)" }, { "hub_charset", var_get_string, var_set_hub_charset, &hub_charset, charset_completion_generator, NULL, "Character set used for chat on the hub" }, { "listenaddr", var_get_listen_addr, var_set_listen_addr, &force_listen_addr, NULL, NULL, "Address to send to clients" }, { "listenport", var_get_listen_port, var_set_listen_port, &listen_port, NULL, NULL, "Port to listen on for connections" }, { "listingdir", var_get_string, var_set_listing_dir, &listing_dir, local_dir_completion_generator, NULL, "Directory where file listings are kept" }, { "log", var_get_display_flags, var_set_display_flags, &log_flags, display_completion_generator, NULL, "Types of messages to log (if logfile set)" }, { "log_charset", var_get_string, var_set_log_charset, &log_charset, charset_completion_generator, NULL, "Log charset (if it differs from local charset)" }, { "logfile", var_get_string, var_set_log_file, &log_filename, local_path_completion_generator, NULL, "File to log screen messages to (will be appeneded)" }, { "nick", var_get_string, var_set_nick, &my_nick, NULL, NULL, "This is the desired (but not necessarily the current) nick name." }, { "password", var_get_string, var_set_password, &my_password, NULL, NULL, "The optional password to pass to the hub." }, /* { "sharedir", var_get_string, var_set_share_dir, &share_dir, local_path_completion_generator, NULL, "Directory containing files to share (or a single file to share)" }, */ { "slots", var_get_slots, var_set_slots, &my_ul_slots, NULL, NULL, "Number of open upload slots" }, { "speed", var_get_string, var_set_speed, &my_speed, speed_completion_generator, NULL, "The speed visible to other users of the hub" }, { "tag", var_get_string, var_set_tag, &my_tag, NULL, NULL, "The user agent tag the hub uses to detect features" }, }; static const int variables_count = sizeof(variables)/sizeof(*variables); static DCVariable * find_variable(const char *name) { return (DCVariable *) bksearch(name, variables, variables_count, sizeof(DCVariable), offsetof(DCVariable, name), (comparison_fn_t) strcmp); } static void charset_completion_generator(DCCompletionInfo *ci) { /* FIXME: NYI */ /*run the command 'iconv --list' to get a list of completion alternatives fork(); exec('iconv', 'iconv', '--list');*/ } static void var_set_hub_charset(DCVariable *var, int argc, char **argv) { if (argc > 2) { warn(_("too many arguments\n")); return; } set_hub_charset(argv[1]); /* rebuild filelist (filenames should be in hub charset ) */ update_request_set_hub_charset(argv[1]); if (hub_state == DC_HUB_LOGGED_IN) hub_reconnect(); } static void var_set_fs_charset(DCVariable *var, int argc, char **argv) { if (argc > 2) { warn(_("too many arguments\n")); return; } set_fs_charset(argv[1]); /* rebuild filelist (read filenames in new charset */ update_request_set_fs_charset(argv[1]); } static void var_set_log_charset(DCVariable *var, int argc, char **argv) { if (argc > 2) { warn(_("too many arguments\n")); return; } set_log_charset(argv[1]); } static void var_set_nick(DCVariable *var, int argc, char **argv) { if (argc > 2) { warn(_("too many arguments\n")); } else if (argv[1][0] == '\0') { warn(_("Nick cannot be empty.\n")); } else if (strnlen(argv[1], 36) >= 36) { warn(_("Nick is too long - max length is 35 characters.\n")); } else if (strpbrk(argv[1], "$| ") != NULL) { warn(_("Nick may not contain `$', `|' or space characters.\n")); } else { free(my_nick); my_nick = xstrdup(argv[1]); } } static void var_set_description(DCVariable *var, int argc, char **argv) { char *new_value = join_strings(argv+1, argc-1, ' '); if (strpbrk(new_value, "$|") != NULL) { warn(_("Description may not contain `$' or `|' characters.\n")); free(new_value); } else if (strnlen(new_value, 36) >= 36) { warn(_("Description is too long - max length is 35 characters.\n")); free(new_value); } else { free(my_description); my_description = new_value; } } static void var_set_email(DCVariable *var, int argc, char **argv) { if (argc > 2) { warn(_("too many arguments\n")); } else if (strpbrk(argv[1], "$|") != NULL) { warn(_("E-mail may not contain `$' or `|' characters.\n")); } else if (strnlen(argv[1], 36) >= 36) { warn(_("E-mail is too long - max length is 35 characters.\n")); } else { free(my_email); my_email = xstrdup(argv[1]); } } static void var_set_tag(DCVariable *var, int argc, char **argv) { char *new_value = join_strings(argv+1, argc-1, ' '); if (strpbrk(new_value, "$|") != NULL) { warn(_("Tag may not contain `$' or `|' characters.\n")); free(new_value); } else { free(my_tag); my_tag = new_value; } } static void var_set_speed(DCVariable *var, int argc, char **argv) { if (argc > 2) { warn(_("too many arguments\n")); } else if (strpbrk(argv[1], "$|") != NULL) { warn(_("Speed may not contain `$' or `|' characters.\n")); } else { free(my_speed); my_speed = xstrdup(argv[1]); } } static void var_set_download_dir(DCVariable *var, int argc, char **argv) { struct stat st; if (argc > 2) { warn(_("too many arguments\n")); return; } if (stat(argv[1], &st) < 0) { screen_putf(_("%s: Cannot get file status - %s\n"), quotearg(argv[1]), errstr); return; } if (!S_ISDIR(st.st_mode)) { screen_putf(_("%s: Not a directory\n"), quotearg(argv[1])); return; } free(download_dir); download_dir = xstrdup(argv[1]); } static void var_set_listing_dir(DCVariable *var, int argc, char **argv) { struct stat st; if (argc > 2) { warn(_("too many arguments\n")); return; } if (stat(argv[1], &st) < 0) { screen_putf(_("%s: Cannot get file status - %s\n"), quotearg(argv[1]), errstr); return; } if (!S_ISDIR(st.st_mode)) { screen_putf(_("%s: Not a directory\n"), quotearg(argv[1])); return; } free(listing_dir); listing_dir = xstrdup(argv[1]); update_request_set_listing_dir(listing_dir); } static void var_set_slots(DCVariable *var, int argc, char **argv) { if (argc > 2) { warn(_("too many arguments\n")); return; } if (!parse_uint32(argv[1], &my_ul_slots)) screen_putf(_("Invalid slot number `%s'\n"), quotearg(argv[1])); if (hub_state >= DC_HUB_LOGGED_IN) send_my_info(); } static char * var_get_slots(DCVariable *var) { return xstrdup(uint32_str(my_ul_slots)); } /* Improve: return string position or word index in csv where value was found * XXX: move to strutil.c or something. Also on gmediaserver! */ bool string_in_csv(const char *csv, char sep, const char *value) { const char *p0; const char *p1; size_t len; len = strlen(value); for (p0 = csv; (p1 = strchr(p0, sep)) != NULL; p0 = p1+1) { if (p1-p0 == len && strncmp(p0, value, len) == 0) return true; } if (strcmp(p0, value) == 0) return true; return false; } static void bool_completion_generator(DCCompletionInfo *ci) { const char *p0; const char *p1; size_t wlen; wlen = strlen(ci->word); p0 = POSITIVE_BOOL_STRINGS; for (; (p1 = strchr(p0, ',')) != NULL; p0 = p1+1) { if (p1-p0 >= wlen && memcmp(ci->word, p0, wlen) == 0) ptrv_append(ci->results, new_completion_entry(xstrndup(p0, p1-p0), NULL)); } if (strleftcmp(ci->word, p0) == 0) ptrv_append(ci->results, new_completion_entry(xstrdup(p0), NULL)); p0 = NEGATIVE_BOOL_STRINGS; for (; (p1 = strchr(p0, ',')) != NULL; p0 = p1+1) { if (p1-p0 >= wlen && memcmp(ci->word, p0, wlen) == 0) ptrv_append(ci->results, new_completion_entry(xstrndup(p0, p1-p0), NULL)); } if (strleftcmp(ci->word, p0) == 0) ptrv_append(ci->results, new_completion_entry(xstrdup(p0), NULL)); ptrv_sort(ci->results, completion_entry_display_compare); } static bool parse_bool(const char *s, bool *value) { if (string_in_csv(POSITIVE_BOOL_STRINGS, ',', s)) { *value = true; return true; } if (string_in_csv(NEGATIVE_BOOL_STRINGS, ',', s)) { *value = false; return true; } return false; } static void var_set_active(DCVariable *var, int argc, char **argv) { bool state; if (argc > 2) { warn(_("too many arguments\n")); return; } if (!parse_bool(argv[1], &state)) { screen_putf(_("Specify active as `0', `no', `off', `1', `yes', or `on'.\n")); return;/*false*/ } if (!set_active(state, listen_port)) screen_putf(_("Active setting not changed.\n"));/*return false;*/ } static void var_set_auto_reconnect(DCVariable *var, int argc, char **argv) { bool state; if (argc > 2) { warn(_("too many arguments\n")); return; } if (!parse_bool(argv[1], &state)) { screen_putf(_("Specify value as `0', `no', `off', `1', `yes', or `on'.\n")); return;/*false*/ } auto_reconnect = state; } static char * var_get_listen_addr(DCVariable *var) { if (force_listen_addr.s_addr == INADDR_NONE) return NULL; return xstrdup(in_addr_str(force_listen_addr)); } static void var_set_listen_addr(DCVariable *var, int argc, char **argv) { struct sockaddr_in addr; if (argc > 2) { warn(_("too many arguments\n")); return; } if (argv[1][0] == '\0') { force_listen_addr.s_addr = INADDR_NONE; screen_putf(_("Removing listening address.\n")); return; } if (!inet_aton(argv[1], &addr.sin_addr)) { screen_putf(_("%s: Specify listen address as an IP address\n"), quotearg(argv[1])); /* XXX: fix this in the future... */ /*struct hostent *he; screen_putf(_("Looking up IP address for %s\n"), quotearg(argv[1])); he = gethostbyname(argv[1]); if (he == NULL) { screen_putf(_("%s: Cannot look up address - %s\n"), quotearg(argv[1]), hstrerror(h_errno)); return; } addr.sin_addr = *(struct in_addr *) he->h_addr;*/ } force_listen_addr = addr.sin_addr; screen_putf(_("Listening address set to %s.\n"), inet_ntoa(force_listen_addr)); } static char * var_get_display_flags(DCVariable *var) { StrBuf *out; uint32_t c; uint32_t flags; flags = *(uint32_t *) var->value; out = strbuf_new(); for (c = 0; c < display_flag_count; c++) { if (flags & display_flag_details[c].flag) { if (!strbuf_is_empty(out)) strbuf_append_char(out, ' '); strbuf_append(out, display_flag_details[c].name); } } return strbuf_free_to_string(out); } static uint32_t find_display_flag_value(const char *name) { DCDisplayFlagDetails *details; details = (DCDisplayFlagDetails *) bksearch(name, display_flag_details, display_flag_count, sizeof(DCDisplayFlagDetails), offsetof(DCDisplayFlagDetails, name), (comparison_fn_t) strcmp); return (details == NULL ? 0 : details->flag); } static void var_set_display_flags(DCVariable *var, int argc, char **argv) { uint32_t add_values = 0; uint32_t set_values = 0; uint32_t del_values = 0; uint32_t c; for (c = 1; c < argc; c++) { char *arg = argv[c]; uint32_t *values; uint32_t value; if (arg[0] == '+') { values = &add_values; arg++; } else if (arg[0] == '-') { values = &del_values; arg++; } else { values = &set_values; } if (strcmp(arg, "all") == 0) { value = ~0; } else if (strcmp(arg, "default") == 0) { value = ~0; } else { value = find_display_flag_value(arg); } if (value == 0) { screen_putf(_("No flag by the name %s, display flags not changed.\n"), quotearg(arg)); return; } *values |= value; } if (set_values != 0 && (add_values != 0 || del_values != 0)) screen_putf(_("Cannot set and add or delete flags at the same time.\n")); if (set_values != 0) *((uint32_t *) var->value) = set_values; *((uint32_t *) var->value) |= add_values; *((uint32_t *) var->value) &= ~del_values; *((uint32_t *) var->value) |= DC_DF_COMMON; /* XXX: must always be available, but for logging? */ } static char * var_get_listen_port(DCVariable *var) { if (listen_port == 0) return NULL; /* random */ return xstrdup(uint16_str(listen_port)); } static void var_set_listen_port(DCVariable *var, int argc, char **argv) { uint16_t port; if (argc > 2) { warn(_("too many arguments\n")); return; } if (argv[1][0] == '\0') { port = 0; } else { if (!parse_uint16(argv[1], &port)) { screen_putf(_("Invalid value `%s' for port number.\n"), quotearg(argv[1])); return; } } if (!set_active(is_active, port)) screen_putf(_("Active setting not changed.\n")); } static void var_set_log_file(DCVariable *var, int argc, char **argv) { if (argc > 2) { warn(_("too many arguments\n")); return; } set_log_file(argv[1], true); } static char * var_get_string(DCVariable *var) { char *value = *((char **) var->value); return value == NULL ? NULL : xstrdup(value); } static char * var_get_bool(DCVariable *var) { bool value = *((bool *) var->value); return xstrdup(value ? _("on") : _("off")); } static void var_set_password(DCVariable *var, int argc, char **argv) { if (argc > 2) { warn(_("too many arguments\n")); return; } if (argv[1][0] == '\0') { screen_putf(_("Removing current password.\n")); free(my_password); my_password = NULL; } else if (strchr(argv[1], '|') != NULL) { warn(_("Password may not contain `|' characters.\n")); } else { free(my_password); my_password = xstrdup(argv[1]); } } static char* var_get_time(DCVariable *var) { time_t value = *((time_t *) var->value); return xasprintf("%ld", value); } static void var_set_filelist_refresh_interval(DCVariable *var, int argc, char **argv) { unsigned int interval; if (argc > 2) { warn(_("too many arguments\n")); return; } if (argv[1][0] == '\0') { interval = 0; } else { if (!parse_uint32(argv[1], &interval)) { screen_putf(_("Invalid value `%s' for interval.\n"), quotearg(argv[1])); return; } } filelist_refresh_timeout = interval; update_request_set_filelist_refresh_timeout(filelist_refresh_timeout); } /* The following completers could be improved by doing a modified * binsearch for the first match, then stopping immediately when a * non-match is found. */ void variable_completion_generator(DCCompletionInfo *ci) { sorted_list_completion_generator(ci->word,ci->results,variables,variables_count,sizeof(DCVariable),offsetof(DCVariable, name)); } static void speed_completion_generator(DCCompletionInfo *ci) { int c; /* There's not enough speed types to justify a binary search... */ for (c = 0; c < speeds_count; c++) { if (strleftcmp(ci->word, speeds[c]) == 0) ptrv_append(ci->results, new_completion_entry(speeds[c], NULL)); } } static void display_completion_generator(DCCompletionInfo *ci) { char *word; char base_char; uint32_t c; uint32_t flags; char *cmd; cmd = get_word_dequoted(ci->line, 1); if (strcmp(cmd, "log") == 0) { /* this is safe even when using aliases */ flags = log_flags; } else { flags = display_flags; } free(cmd); word = ci->word; base_char = (word[0] == '+' || word[0] == '-' ? *word++ : '\0'); /* XXX: complete `all', `default' */ for (c = 0; c < display_flag_count; c++) { if (strleftcmp(word, display_flag_details[c].name) == 0) { DCCompletionEntry *entry; if (base_char == '+' && (flags & display_flag_details[c].flag) != 0) continue; if (base_char == '-' && (flags & display_flag_details[c].flag) == 0) continue; entry = new_completion_entry(NULL, NULL); entry->input = xasprintf("%c%s", base_char, display_flag_details[c].name); entry->display = xstrdup(display_flag_details[c].name); ptrv_append(ci->results, entry); } } } void cmd_set(int argc, char **argv) { uint32_t c; DCVariable *var; if (argc == 1) { int max_len = 0; int cols; char *fmt; for (c = 0; c < variables_count; c++) max_len = MAX(max_len, strlen(variables[c].name)); fmt = xasprintf("%%-%ds %%s\n", max_len); screen_get_size(NULL, &cols); for (c = 0; c < variables_count; c++) { DCVariable *var = &variables[c]; char *value = var->getter(var); screen_putf(fmt, var->name, value == NULL ? "(unset)" : quotearg(value)); free(value); } free(fmt); return; } var = find_variable(argv[1]); if (var == NULL) { warn("No variable by the name `%s'.\n", quotearg(argv[1])); return; } if (argc <= 2) { char *value; value = var->getter(var); if (value == NULL) { screen_putf(_("No value is set for `%s'.\n"), var->name); } else { screen_putf(_("Current value for `%s':\n%s\n"), var->name, quotearg(value)); } return; } var->setter(var, argc-1, argv+1); } void set_command_completion_selector(DCCompletionInfo *ci) { char *name; DCVariable *var; /* ci->word_index > 0 is assured by get_completor. */ if (ci->word_index <= 1) { variable_completion_generator(ci); } else { name = get_word_dequoted(ci->line, 1); var = find_variable(name); if (var != NULL && var->completor != NULL) var->completor(ci); free(name); } } microdc2-0.15.6/src/xml_flist.c0100664000076500007500000003511610543530314016314 0ustar chugunovmicrodc#include //#define _DEBUG #if defined(HAVE_LIBXML2) #include #include #include #include #include "bzip2/bzlib.h" #include /* ? */ #include "iconvme.h" #include "common/comparison.h" #include "common/intutil.h" #include "common/strbuf.h" #include "microdc.h" xmlNodePtr insert_node(xmlNodePtr xml_node, DCFileList* node); xmlDocPtr generate_xml_filelist(DCFileList* root); //#define _TRACE #if defined(_TRACE) #include #define TRACE(x) printf x; fflush(stdout); #else #define TRACE(x) #endif #if defined(_DEBUG) FILE* fdebug = 0; #endif #define XML_CALL(var, call) \ var = call; \ if (var == 0) goto cleanup; typedef struct __plain_xml_context { int fd; } PLAIN_XML_CTXT; typedef struct __bzip2_xml_context { BZFILE* file; } BZIP2_XML_CTXT; char* xml_quote_string(const unsigned char* str) { int i = 0; int len = strlen(str); StrBuf *r = strbuf_new(); for (i = 0; i < len; i++) { switch (str[i]) { case '&': strbuf_append(r, "&"); break; case '<': strbuf_append(r, "<"); break; case '>': strbuf_append(r, ">"); break; case '\"': strbuf_append(r, """); break; case '\'': strbuf_append(r, "'"); break; default: strbuf_append_char(r, str[i]); break; } } return strbuf_free_to_string(r); } int xmlTextWriterStartDocumentNew(xmlTextWriterPtr writer, const char *version, const char *encoding, const char *standalone) { int count; int sum; sum = 0; if (version != 0) count = xmlTextWriterWriteFormatRaw(writer, "\n"); sum += count; return sum; } int xmlTextWriterWriteAttributeFilename(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * content) { int count; int sum; sum = 0; count = xmlTextWriterStartAttribute(writer, name); if (count < 0) return -1; sum += count; count = xmlTextWriterWriteRaw(writer, content); if (count < 0) return -1; sum += count; count = xmlTextWriterEndAttribute(writer); if (count < 0) return -1; sum += count; return sum; } int write_plain_xml(void* ctxt, const char* buffer, int len) { PLAIN_XML_CTXT* pctxt = (PLAIN_XML_CTXT*)ctxt; return write(pctxt->fd, buffer, len); } int write_bzip2_xml(void* ctxt, const char* buffer, int len) { BZIP2_XML_CTXT* pctxt = (BZIP2_XML_CTXT*)ctxt; return BZ2_bzwrite(pctxt->file, (char*)buffer, len); } int read_plain_xml(void* ctxt, char* buffer, int len) { PLAIN_XML_CTXT* pctxt = (PLAIN_XML_CTXT*)ctxt; return read(pctxt->fd, buffer, len); } int read_bzip2_xml(void* ctxt, char* buffer, int len) { BZIP2_XML_CTXT* pctxt = (BZIP2_XML_CTXT*)ctxt; return BZ2_bzread(pctxt->file, (char*)buffer, len); } int write_node(xmlTextWriterPtr writer, DCFileList* node) { size_t written = 0; if (node != NULL) { switch (node->type) { case DC_TYPE_REG: written += xmlTextWriterStartElement(writer, "File"); break; case DC_TYPE_DIR: written += xmlTextWriterStartElement(writer, "Directory"); break; default: return 0; } char* q_name = xml_quote_string(node->name); char* utf8_name = fs_to_utf8_string(q_name); free(q_name); written += xmlTextWriterWriteAttributeFilename(writer, "Name", utf8_name); free(utf8_name); switch (node->type) { case DC_TYPE_REG: { char value[64]; sprintf(value, "%" PRIu64, node->size); written += xmlTextWriterWriteAttribute(writer, "Size", value); if (node->reg.has_tth) { memset(value, 0, 64); memcpy(value, node->reg.tth, sizeof(node->reg.tth)); written += xmlTextWriterWriteAttribute(writer, "TTH", value); } } break; case DC_TYPE_DIR: { HMapIterator it; hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *subnode = it.next(&it); write_node(writer, subnode); } } break; default: return 0; } written += xmlTextWriterFullEndElement(writer); } return written; } int write_xml_filelist_document(xmlOutputBufferPtr output, DCFileList* root) { size_t written = 0; xmlTextWriterPtr writer = xmlNewTextWriter(output); xmlTextWriterSetIndent(writer, 0); written += xmlTextWriterStartDocumentNew(writer, "1.0", "utf-8", NULL); written += xmlTextWriterStartElement(writer, "FileListing"); written += xmlTextWriterWriteAttribute(writer, "Version", "1"); written += xmlTextWriterWriteAttribute(writer, "CID", "ABBACDDCEFFE23324554GHHG7667XYYX2RR2XYZ"); written += xmlTextWriterWriteAttribute(writer, "Generator", my_tag); written += xmlTextWriterWriteAttribute(writer, "Base", "/"); if (root != NULL) { HMapIterator it; hmap_iterator(root->dir.children, &it); while (it.has_next(&it)) { DCFileList *node = it.next(&it); written += write_node(writer, node); } } written += xmlTextWriterEndElement(writer); written += xmlTextWriterEndDocument(writer); xmlFreeTextWriter(writer); return written; } int write_xml_filelist(int fd, DCFileList* root) { int result = -1; PLAIN_XML_CTXT plain_ctxt; plain_ctxt.fd = fd; xmlOutputBufferPtr plain_xml = xmlOutputBufferCreateIO(write_plain_xml, NULL, &plain_ctxt, NULL); result = write_xml_filelist_document(plain_xml, root); // we don't need to free plain_xml because it is deallocated by xmlFreeTextWriter return result; } int write_bzxml_filelist(int fd, DCFileList* root) { int result = -1; BZIP2_XML_CTXT bzip2_ctxt; xmlOutputBufferPtr bzip2_xml = NULL; bzip2_ctxt.file = BZ2_bzdopen(fd, "w"); if (bzip2_ctxt.file != 0) { bzip2_xml = xmlOutputBufferCreateIO(write_bzip2_xml, NULL, &bzip2_ctxt, NULL); result = write_xml_filelist_document(bzip2_xml, root); BZ2_bzclose(bzip2_ctxt.file); // we don't need to free bzip2_xml because it is deallocated by xmlFreeTextWriter } return result; } xmlDocPtr generate_xml_filelist(DCFileList* root) { xmlDocPtr xml_flist = 0; xmlNodePtr xml_root = 0; xmlAttrPtr attr = 0; XML_CALL(xml_flist, xmlNewDoc(BAD_CAST("1.0"))); XML_CALL(xml_root, xmlNewNode(NULL, BAD_CAST("FileListing"))); xmlDocSetRootElement(xml_flist, xml_root); XML_CALL(attr, xmlNewProp(xml_root, BAD_CAST("Version"), BAD_CAST("1"))); XML_CALL(attr, xmlNewProp(xml_root, BAD_CAST("CID"), BAD_CAST("ABBACDDCEFFE23324554GHHG7667XYYX2RR2XYZ"))); XML_CALL(attr, xmlNewProp(xml_root, BAD_CAST("Generator"), my_tag)); XML_CALL(attr, xmlNewProp(xml_root, BAD_CAST("Base"), BAD_CAST("/"))); HMapIterator it; hmap_iterator(root->dir.children, &it); while (it.has_next(&it)) { DCFileList *subnode = it.next(&it); insert_node(xml_root, subnode); } cleanup: return xml_flist; } xmlNodePtr insert_node(xmlNodePtr xml_parent, DCFileList* node) { xmlNodePtr xml_node = 0; xmlAttrPtr attr = 0; HMapIterator it; switch (node->type) { case DC_TYPE_REG: XML_CALL(xml_node, xmlNewChild(xml_parent, NULL, BAD_CAST("File"), BAD_CAST(""))); break; case DC_TYPE_DIR: XML_CALL(xml_node, xmlNewChild(xml_parent, NULL, BAD_CAST("Directory"), BAD_CAST(""))); hmap_iterator(node->dir.children, &it); while (it.has_next(&it)) { DCFileList *subnode = it.next(&it); insert_node(xml_node, subnode); } break; default: break; } if (node != NULL) { char* utf8_name = fs_to_utf8_string(node->name); XML_CALL(attr, xmlNewProp(xml_node, BAD_CAST("Name"), utf8_name)); free(utf8_name); if (node->type == DC_TYPE_REG) { char value[64]; sprintf(value, "%" PRIu64, node->size); XML_CALL(attr, xmlNewProp(xml_node, BAD_CAST("Size"), value)); if (node->reg.has_tth) { memset(value, 0, 64); memcpy(value, node->reg.tth, sizeof(node->reg.tth)); XML_CALL(attr, xmlNewProp(xml_node, BAD_CAST("TTH"), value)); } } } return xml_node; cleanup: return NULL; } typedef struct _parser_state_ctxt { DCFileList* root; DCFileList* current; int unknown_level; } parser_state_ctxt; void start_document_callback(void* ctxt) { //TRACE(("%s:%d: start document\n", __FUNCTION__, __LINE__)); } void end_document_callback(void* ctxt) { //TRACE(("%s:%d: end document\n", __FUNCTION__, __LINE__)); } void start_element_callback(void* ctxt, const xmlChar* name, const xmlChar** attrs) { parser_state_ctxt* pctxt = (parser_state_ctxt*)ctxt; if (pctxt != NULL) { char* filename = NULL; //TRACE(("%s:%d: start element <%s>\n", __FUNCTION__, __LINE__, name)); if (pctxt->unknown_level == 0) { char** a = NULL; for (a = (const char**)attrs; *a != NULL; a++) { char* aname = *a++; char* avalue = *a; if (aname != NULL && avalue != NULL) { if (strcasecmp(aname, "Name") == 0) { filename = utf8_to_main_string(avalue); } } } } if (pctxt->unknown_level == 0 && strcasecmp(name, "FileListing") == 0) { if (pctxt->root != NULL) filelist_free(pctxt->root); pctxt->root = pctxt->current = new_file_node("", DC_TYPE_DIR, NULL); } else if (pctxt->unknown_level == 0 && strcasecmp(name, "Directory") == 0) { if (filename == NULL) { TRACE(("%s:%d: malformed XML document - unknown directory name\n", __FUNCTION__, __LINE__)); } else { DCFileList* node = new_file_node(filename, DC_TYPE_DIR, pctxt->current); pctxt->current = node; } } else if (pctxt->unknown_level == 0 && strcasecmp(name, "File") == 0) { if (filename == NULL) { TRACE(("%s:%d: malformed XML document - unknown file name\n", __FUNCTION__, __LINE__)); } else { DCFileList* node = new_file_node(filename, DC_TYPE_REG, pctxt->current); pctxt->current = node; } } else { pctxt->unknown_level += 1; } if (filename != NULL) { free(filename); filename = NULL; } if (pctxt->unknown_level == 0 && pctxt->current->type == DC_TYPE_REG) { char** a = NULL; for (a = (const char**)attrs; *a != NULL; a++) { char* aname = *a++; char* avalue = *a; if (aname != NULL && avalue != NULL) { if (strcasecmp(aname, "Size") == 0) { uint64_t size; if (!parse_uint64(avalue, &size)) { pctxt->current->size = 0; } else { pctxt->current->size = size; pctxt->current->parent->size += size; } } else if (strcasecmp(aname, "TTH") == 0) { pctxt->current->reg.has_tth = 1; memcpy(pctxt->current->reg.tth, avalue, sizeof(pctxt->current->reg.tth)); } } } } } } void end_element_callback(void* ctxt, const xmlChar* name) { parser_state_ctxt* pctxt = (parser_state_ctxt*)ctxt; if (pctxt != NULL) { if (pctxt->unknown_level > 0) { pctxt->unknown_level -= 1; } else { if (pctxt->current != NULL) { pctxt->current = pctxt->current->parent; } else { TRACE(("%s:%d: malformed XML document - too many <%s> tags\n", __FUNCTION__, __LINE__, name)); } } //TRACE(("%s:%d: end element <%s>\n", __FUNCTION__, __LINE__, name)); } } DCFileList* filelist_xml_open(const char* filename) { DCFileList* root = NULL; PLAIN_XML_CTXT io_ctxt; io_ctxt.fd = open(filename, O_RDONLY); if (io_ctxt.fd >= 0) { xmlSAXHandler sax; parser_state_ctxt state_ctxt; memset(&sax, 0, sizeof(sax)); memset(&state_ctxt, 0, sizeof(state_ctxt)); sax.startDocument = start_document_callback; sax.endDocument = end_document_callback; sax.startElement = start_element_callback; sax.endElement = end_element_callback; xmlParserCtxtPtr ctxt = xmlCreateIOParserCtxt(&sax, &state_ctxt, read_plain_xml, NULL, &io_ctxt, XML_CHAR_ENCODING_UTF8); xmlParseDocument(ctxt); xmlFreeParserCtxt(ctxt); root = state_ctxt.root; close(io_ctxt.fd); } return root; } DCFileList* filelist_bzxml_open(const char* filename) { DCFileList* root = NULL; BZIP2_XML_CTXT io_ctxt; io_ctxt.file = BZ2_bzopen(filename, "r"); if (io_ctxt.file != NULL) { xmlSAXHandler sax; parser_state_ctxt state_ctxt; memset(&sax, 0, sizeof(sax)); memset(&state_ctxt, 0, sizeof(state_ctxt)); sax.startDocument = start_document_callback; sax.endDocument = end_document_callback; sax.startElement = start_element_callback; sax.endElement = end_element_callback; xmlParserCtxtPtr ctxt = xmlCreateIOParserCtxt(&sax, &state_ctxt, read_bzip2_xml, NULL, &io_ctxt, XML_CHAR_ENCODING_UTF8); xmlParseDocument(ctxt); xmlFreeParserCtxt(ctxt); root = state_ctxt.root; BZ2_bzclose(io_ctxt.file); } return root; } #endif // defined(HAVE_LIBXML2) microdc2-0.15.6/src/bzip2/0040755000076500007500000000000010543546024015175 5ustar chugunovmicrodcmicrodc2-0.15.6/src/bzip2/CVS/0040755000076500007500000000000010543546032015627 5ustar chugunovmicrodcmicrodc2-0.15.6/src/bzip2/CVS/Root0100644000076500007500000000003610527341105016465 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/src/bzip2/CVS/Repository0100644000076500007500000000002210527341105017714 0ustar chugunovmicrodcmicrodc/src/bzip2 microdc2-0.15.6/src/bzip2/CVS/Entries0100644000076500007500000000153210543546032017161 0ustar chugunovmicrodc/LICENSE/1.1/Sun Oct 22 09:23:33 2006//Tmicrodc2_0_13_1_locale /Makefile.am/1.1/Sun Oct 22 09:23:33 2006//Tmicrodc2_0_13_1_locale /blocksort.c/1.1/Sun Oct 22 09:23:33 2006//Tmicrodc2_0_13_1_locale /bzip2.c/1.1/Sun Oct 22 09:23:33 2006//Tmicrodc2_0_13_1_locale /bzlib.c/1.1/Sun Oct 22 09:23:34 2006//Tmicrodc2_0_13_1_locale /bzlib.h/1.1/Sun Oct 22 09:23:34 2006//Tmicrodc2_0_13_1_locale /bzlib_private.h/1.1/Sun Oct 22 09:23:34 2006//Tmicrodc2_0_13_1_locale /compress.c/1.1/Sun Oct 22 09:23:34 2006//Tmicrodc2_0_13_1_locale /crctable.c/1.1/Sun Oct 22 09:23:34 2006//Tmicrodc2_0_13_1_locale /decompress.c/1.1/Sun Oct 22 09:23:34 2006//Tmicrodc2_0_13_1_locale /huffman.c/1.1/Sun Oct 22 09:23:34 2006//Tmicrodc2_0_13_1_locale /randtable.c/1.1/Sun Oct 22 09:23:34 2006//Tmicrodc2_0_13_1_locale /Makefile.in/1.3/Sun Dec 24 18:44:49 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/src/bzip2/CVS/Tag0100644000076500007500000000003010527341105016247 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/src/bzip2/LICENSE0100644000076500007500000000341410516634225016202 0ustar chugunovmicrodc This program, "bzip2", the associated library "libbzip2", and all documentation, are copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@acm.org bzip2/libbzip2 version 1.0.3 of 15 February 2005 microdc2-0.15.6/src/bzip2/Makefile.am0100644000076500007500000000044710516634225017234 0ustar chugunovmicrodcAM_CFLAGS = -Wall AM_CPPFLAGS = \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib noinst_LIBRARIES = libbzip2.a libbzip2_a_SOURCES = \ blocksort.c \ bzip2.c \ bzlib.c \ bzlib.h \ bzlib_private.h \ compress.c \ crctable.c \ decompress.c \ huffman.c \ randtable.c microdc2-0.15.6/src/bzip2/Makefile.in0100644000076500007500000003656710543545241017260 0ustar chugunovmicrodc# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/bzip2 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/ac_lib_readline.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/alloca.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/free.m4 \ $(top_srcdir)/m4/getaddrinfo.m4 $(top_srcdir)/m4/getdelim.m4 \ $(top_srcdir)/m4/gethostname.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/human.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconvme.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes.m4 \ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memmem.m4 $(top_srcdir)/m4/minmax.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/sig2str.m4 \ $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stdbool.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strtoimax.m4 \ $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoll.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strtoull.m4 \ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtol.m4 $(top_srcdir)/m4/xstrtoumax.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libbzip2_a_AR = $(AR) $(ARFLAGS) libbzip2_a_LIBADD = am_libbzip2_a_OBJECTS = blocksort.$(OBJEXT) bzip2.$(OBJEXT) \ bzlib.$(OBJEXT) compress.$(OBJEXT) crctable.$(OBJEXT) \ decompress.$(OBJEXT) huffman.$(OBJEXT) randtable.$(OBJEXT) libbzip2_a_OBJECTS = $(am_libbzip2_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libbzip2_a_SOURCES) DIST_SOURCES = $(libbzip2_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FNMATCH_H = @FNMATCH_H@ GETOPT_H = @GETOPT_H@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ HAVE_LONG_64BIT = @HAVE_LONG_64BIT@ HAVE_LONG_LONG_64BIT = @HAVE_LONG_LONG_64BIT@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LOCALEDIR = @LOCALEDIR@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TR = @TR@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XML_CONFIG = @XML_CONFIG@ ac_ct_CC = @ac_ct_CC@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AM_CFLAGS = -Wall AM_CPPFLAGS = \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib noinst_LIBRARIES = libbzip2.a libbzip2_a_SOURCES = \ blocksort.c \ bzip2.c \ bzlib.c \ bzlib.h \ bzlib_private.h \ compress.c \ crctable.c \ decompress.c \ huffman.c \ randtable.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bzip2/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/bzip2/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libbzip2.a: $(libbzip2_a_OBJECTS) $(libbzip2_a_DEPENDENCIES) -rm -f libbzip2.a $(libbzip2_a_AR) libbzip2.a $(libbzip2_a_OBJECTS) $(libbzip2_a_LIBADD) $(RANLIB) libbzip2.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blocksort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzlib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crctable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decompress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/huffman.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randtable.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: microdc2-0.15.6/src/bzip2/blocksort.c0100644000076500007500000010170710516634225017347 0ustar chugunovmicrodc /*-------------------------------------------------------------*/ /*--- Block sorting machinery ---*/ /*--- blocksort.c ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. To get some idea how the block sorting algorithms in this file work, read my paper On the Performance of BWT Sorting Algorithms in Proceedings of the IEEE Data Compression Conference 2000, Snowbird, Utah, USA, 27-30 March 2000. The main sort in this file implements the algorithm called cache in the paper. --*/ #include "bzlib_private.h" /*---------------------------------------------*/ /*--- Fallback O(N log(N)^2) sorting ---*/ /*--- algorithm, for repetitive blocks ---*/ /*---------------------------------------------*/ /*---------------------------------------------*/ static __inline__ void fallbackSimpleSort ( UInt32* fmap, UInt32* eclass, Int32 lo, Int32 hi ) { Int32 i, j, tmp; UInt32 ec_tmp; if (lo == hi) return; if (hi - lo > 3) { for ( i = hi-4; i >= lo; i-- ) { tmp = fmap[i]; ec_tmp = eclass[tmp]; for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 ) fmap[j-4] = fmap[j]; fmap[j-4] = tmp; } } for ( i = hi-1; i >= lo; i-- ) { tmp = fmap[i]; ec_tmp = eclass[tmp]; for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ ) fmap[j-1] = fmap[j]; fmap[j-1] = tmp; } } /*---------------------------------------------*/ #define fswap(zz1, zz2) \ { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } #define fvswap(zzp1, zzp2, zzn) \ { \ Int32 yyp1 = (zzp1); \ Int32 yyp2 = (zzp2); \ Int32 yyn = (zzn); \ while (yyn > 0) { \ fswap(fmap[yyp1], fmap[yyp2]); \ yyp1++; yyp2++; yyn--; \ } \ } #define fmin(a,b) ((a) < (b)) ? (a) : (b) #define fpush(lz,hz) { stackLo[sp] = lz; \ stackHi[sp] = hz; \ sp++; } #define fpop(lz,hz) { sp--; \ lz = stackLo[sp]; \ hz = stackHi[sp]; } #define FALLBACK_QSORT_SMALL_THRESH 10 #define FALLBACK_QSORT_STACK_SIZE 100 static void fallbackQSort3 ( UInt32* fmap, UInt32* eclass, Int32 loSt, Int32 hiSt ) { Int32 unLo, unHi, ltLo, gtHi, n, m; Int32 sp, lo, hi; UInt32 med, r, r3; Int32 stackLo[FALLBACK_QSORT_STACK_SIZE]; Int32 stackHi[FALLBACK_QSORT_STACK_SIZE]; r = 0; sp = 0; fpush ( loSt, hiSt ); while (sp > 0) { AssertH ( sp < FALLBACK_QSORT_STACK_SIZE, 1004 ); fpop ( lo, hi ); if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) { fallbackSimpleSort ( fmap, eclass, lo, hi ); continue; } /* Random partitioning. Median of 3 sometimes fails to avoid bad cases. Median of 9 seems to help but looks rather expensive. This too seems to work but is cheaper. Guidance for the magic constants 7621 and 32768 is taken from Sedgewick's algorithms book, chapter 35. */ r = ((r * 7621) + 1) % 32768; r3 = r % 3; if (r3 == 0) med = eclass[fmap[lo]]; else if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else med = eclass[fmap[hi]]; unLo = ltLo = lo; unHi = gtHi = hi; while (1) { while (1) { if (unLo > unHi) break; n = (Int32)eclass[fmap[unLo]] - (Int32)med; if (n == 0) { fswap(fmap[unLo], fmap[ltLo]); ltLo++; unLo++; continue; }; if (n > 0) break; unLo++; } while (1) { if (unLo > unHi) break; n = (Int32)eclass[fmap[unHi]] - (Int32)med; if (n == 0) { fswap(fmap[unHi], fmap[gtHi]); gtHi--; unHi--; continue; }; if (n < 0) break; unHi--; } if (unLo > unHi) break; fswap(fmap[unLo], fmap[unHi]); unLo++; unHi--; } AssertD ( unHi == unLo-1, "fallbackQSort3(2)" ); if (gtHi < ltLo) continue; n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n); m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m); n = lo + unLo - ltLo - 1; m = hi - (gtHi - unHi) + 1; if (n - lo > hi - m) { fpush ( lo, n ); fpush ( m, hi ); } else { fpush ( m, hi ); fpush ( lo, n ); } } } #undef fmin #undef fpush #undef fpop #undef fswap #undef fvswap #undef FALLBACK_QSORT_SMALL_THRESH #undef FALLBACK_QSORT_STACK_SIZE /*---------------------------------------------*/ /* Pre: nblock > 0 eclass exists for [0 .. nblock-1] ((UChar*)eclass) [0 .. nblock-1] holds block ptr exists for [0 .. nblock-1] Post: ((UChar*)eclass) [0 .. nblock-1] holds block All other areas of eclass destroyed fmap [0 .. nblock-1] holds sorted order bhtab [ 0 .. 2+(nblock/32) ] destroyed */ #define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) #define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) #define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) #define WORD_BH(zz) bhtab[(zz) >> 5] #define UNALIGNED_BH(zz) ((zz) & 0x01f) static void fallbackSort ( UInt32* fmap, UInt32* eclass, UInt32* bhtab, Int32 nblock, Int32 verb ) { Int32 ftab[257]; Int32 ftabCopy[256]; Int32 H, i, j, k, l, r, cc, cc1; Int32 nNotDone; Int32 nBhtab; UChar* eclass8 = (UChar*)eclass; /*-- Initial 1-char radix sort to generate initial fmap and initial BH bits. --*/ if (verb >= 4) VPrintf0 ( " bucket sorting ...\n" ); for (i = 0; i < 257; i++) ftab[i] = 0; for (i = 0; i < nblock; i++) ftab[eclass8[i]]++; for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i]; for (i = 1; i < 257; i++) ftab[i] += ftab[i-1]; for (i = 0; i < nblock; i++) { j = eclass8[i]; k = ftab[j] - 1; ftab[j] = k; fmap[k] = i; } nBhtab = 2 + (nblock / 32); for (i = 0; i < nBhtab; i++) bhtab[i] = 0; for (i = 0; i < 256; i++) SET_BH(ftab[i]); /*-- Inductively refine the buckets. Kind-of an "exponential radix sort" (!), inspired by the Manber-Myers suffix array construction algorithm. --*/ /*-- set sentinel bits for block-end detection --*/ for (i = 0; i < 32; i++) { SET_BH(nblock + 2*i); CLEAR_BH(nblock + 2*i + 1); } /*-- the log(N) loop --*/ H = 1; while (1) { if (verb >= 4) VPrintf1 ( " depth %6d has ", H ); j = 0; for (i = 0; i < nblock; i++) { if (ISSET_BH(i)) j = i; k = fmap[i] - H; if (k < 0) k += nblock; eclass[k] = j; } nNotDone = 0; r = -1; while (1) { /*-- find the next non-singleton bucket --*/ k = r + 1; while (ISSET_BH(k) && UNALIGNED_BH(k)) k++; if (ISSET_BH(k)) { while (WORD_BH(k) == 0xffffffff) k += 32; while (ISSET_BH(k)) k++; } l = k - 1; if (l >= nblock) break; while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++; if (!ISSET_BH(k)) { while (WORD_BH(k) == 0x00000000) k += 32; while (!ISSET_BH(k)) k++; } r = k - 1; if (r >= nblock) break; /*-- now [l, r] bracket current bucket --*/ if (r > l) { nNotDone += (r - l + 1); fallbackQSort3 ( fmap, eclass, l, r ); /*-- scan bucket and generate header bits-- */ cc = -1; for (i = l; i <= r; i++) { cc1 = eclass[fmap[i]]; if (cc != cc1) { SET_BH(i); cc = cc1; }; } } } if (verb >= 4) VPrintf1 ( "%6d unresolved strings\n", nNotDone ); H *= 2; if (H > nblock || nNotDone == 0) break; } /*-- Reconstruct the original block in eclass8 [0 .. nblock-1], since the previous phase destroyed it. --*/ if (verb >= 4) VPrintf0 ( " reconstructing block ...\n" ); j = 0; for (i = 0; i < nblock; i++) { while (ftabCopy[j] == 0) j++; ftabCopy[j]--; eclass8[fmap[i]] = (UChar)j; } AssertH ( j < 256, 1005 ); } #undef SET_BH #undef CLEAR_BH #undef ISSET_BH #undef WORD_BH #undef UNALIGNED_BH /*---------------------------------------------*/ /*--- The main, O(N^2 log(N)) sorting ---*/ /*--- algorithm. Faster for "normal" ---*/ /*--- non-repetitive blocks. ---*/ /*---------------------------------------------*/ /*---------------------------------------------*/ static __inline__ Bool mainGtU ( UInt32 i1, UInt32 i2, UChar* block, UInt16* quadrant, UInt32 nblock, Int32* budget ) { Int32 k; UChar c1, c2; UInt16 s1, s2; AssertD ( i1 != i2, "mainGtU" ); /* 1 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 2 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 3 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 4 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 5 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 6 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 7 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 8 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 9 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 10 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 11 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; /* 12 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); i1++; i2++; k = nblock + 8; do { /* 1 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); s1 = quadrant[i1]; s2 = quadrant[i2]; if (s1 != s2) return (s1 > s2); i1++; i2++; /* 2 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); s1 = quadrant[i1]; s2 = quadrant[i2]; if (s1 != s2) return (s1 > s2); i1++; i2++; /* 3 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); s1 = quadrant[i1]; s2 = quadrant[i2]; if (s1 != s2) return (s1 > s2); i1++; i2++; /* 4 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); s1 = quadrant[i1]; s2 = quadrant[i2]; if (s1 != s2) return (s1 > s2); i1++; i2++; /* 5 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); s1 = quadrant[i1]; s2 = quadrant[i2]; if (s1 != s2) return (s1 > s2); i1++; i2++; /* 6 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); s1 = quadrant[i1]; s2 = quadrant[i2]; if (s1 != s2) return (s1 > s2); i1++; i2++; /* 7 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); s1 = quadrant[i1]; s2 = quadrant[i2]; if (s1 != s2) return (s1 > s2); i1++; i2++; /* 8 */ c1 = block[i1]; c2 = block[i2]; if (c1 != c2) return (c1 > c2); s1 = quadrant[i1]; s2 = quadrant[i2]; if (s1 != s2) return (s1 > s2); i1++; i2++; if (i1 >= nblock) i1 -= nblock; if (i2 >= nblock) i2 -= nblock; k -= 8; (*budget)--; } while (k >= 0); return False; } /*---------------------------------------------*/ /*-- Knuth's increments seem to work better than Incerpi-Sedgewick here. Possibly because the number of elems to sort is usually small, typically <= 20. --*/ static Int32 incs[14] = { 1, 4, 13, 40, 121, 364, 1093, 3280, 9841, 29524, 88573, 265720, 797161, 2391484 }; static void mainSimpleSort ( UInt32* ptr, UChar* block, UInt16* quadrant, Int32 nblock, Int32 lo, Int32 hi, Int32 d, Int32* budget ) { Int32 i, j, h, bigN, hp; UInt32 v; bigN = hi - lo + 1; if (bigN < 2) return; hp = 0; while (incs[hp] < bigN) hp++; hp--; for (; hp >= 0; hp--) { h = incs[hp]; i = lo + h; while (True) { /*-- copy 1 --*/ if (i > hi) break; v = ptr[i]; j = i; while ( mainGtU ( ptr[j-h]+d, v+d, block, quadrant, nblock, budget ) ) { ptr[j] = ptr[j-h]; j = j - h; if (j <= (lo + h - 1)) break; } ptr[j] = v; i++; /*-- copy 2 --*/ if (i > hi) break; v = ptr[i]; j = i; while ( mainGtU ( ptr[j-h]+d, v+d, block, quadrant, nblock, budget ) ) { ptr[j] = ptr[j-h]; j = j - h; if (j <= (lo + h - 1)) break; } ptr[j] = v; i++; /*-- copy 3 --*/ if (i > hi) break; v = ptr[i]; j = i; while ( mainGtU ( ptr[j-h]+d, v+d, block, quadrant, nblock, budget ) ) { ptr[j] = ptr[j-h]; j = j - h; if (j <= (lo + h - 1)) break; } ptr[j] = v; i++; if (*budget < 0) return; } } } /*---------------------------------------------*/ /*-- The following is an implementation of an elegant 3-way quicksort for strings, described in a paper "Fast Algorithms for Sorting and Searching Strings", by Robert Sedgewick and Jon L. Bentley. --*/ #define mswap(zz1, zz2) \ { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } #define mvswap(zzp1, zzp2, zzn) \ { \ Int32 yyp1 = (zzp1); \ Int32 yyp2 = (zzp2); \ Int32 yyn = (zzn); \ while (yyn > 0) { \ mswap(ptr[yyp1], ptr[yyp2]); \ yyp1++; yyp2++; yyn--; \ } \ } static __inline__ UChar mmed3 ( UChar a, UChar b, UChar c ) { UChar t; if (a > b) { t = a; a = b; b = t; }; if (b > c) { b = c; if (a > b) b = a; } return b; } #define mmin(a,b) ((a) < (b)) ? (a) : (b) #define mpush(lz,hz,dz) { stackLo[sp] = lz; \ stackHi[sp] = hz; \ stackD [sp] = dz; \ sp++; } #define mpop(lz,hz,dz) { sp--; \ lz = stackLo[sp]; \ hz = stackHi[sp]; \ dz = stackD [sp]; } #define mnextsize(az) (nextHi[az]-nextLo[az]) #define mnextswap(az,bz) \ { Int32 tz; \ tz = nextLo[az]; nextLo[az] = nextLo[bz]; nextLo[bz] = tz; \ tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \ tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; } #define MAIN_QSORT_SMALL_THRESH 20 #define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT) #define MAIN_QSORT_STACK_SIZE 100 static void mainQSort3 ( UInt32* ptr, UChar* block, UInt16* quadrant, Int32 nblock, Int32 loSt, Int32 hiSt, Int32 dSt, Int32* budget ) { Int32 unLo, unHi, ltLo, gtHi, n, m, med; Int32 sp, lo, hi, d; Int32 stackLo[MAIN_QSORT_STACK_SIZE]; Int32 stackHi[MAIN_QSORT_STACK_SIZE]; Int32 stackD [MAIN_QSORT_STACK_SIZE]; Int32 nextLo[3]; Int32 nextHi[3]; Int32 nextD [3]; sp = 0; mpush ( loSt, hiSt, dSt ); while (sp > 0) { AssertH ( sp < MAIN_QSORT_STACK_SIZE, 1001 ); mpop ( lo, hi, d ); if (hi - lo < MAIN_QSORT_SMALL_THRESH || d > MAIN_QSORT_DEPTH_THRESH) { mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget ); if (*budget < 0) return; continue; } med = (Int32) mmed3 ( block[ptr[ lo ]+d], block[ptr[ hi ]+d], block[ptr[ (lo+hi)>>1 ]+d] ); unLo = ltLo = lo; unHi = gtHi = hi; while (True) { while (True) { if (unLo > unHi) break; n = ((Int32)block[ptr[unLo]+d]) - med; if (n == 0) { mswap(ptr[unLo], ptr[ltLo]); ltLo++; unLo++; continue; }; if (n > 0) break; unLo++; } while (True) { if (unLo > unHi) break; n = ((Int32)block[ptr[unHi]+d]) - med; if (n == 0) { mswap(ptr[unHi], ptr[gtHi]); gtHi--; unHi--; continue; }; if (n < 0) break; unHi--; } if (unLo > unHi) break; mswap(ptr[unLo], ptr[unHi]); unLo++; unHi--; } AssertD ( unHi == unLo-1, "mainQSort3(2)" ); if (gtHi < ltLo) { mpush(lo, hi, d+1 ); continue; } n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n); m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m); n = lo + unLo - ltLo - 1; m = hi - (gtHi - unHi) + 1; nextLo[0] = lo; nextHi[0] = n; nextD[0] = d; nextLo[1] = m; nextHi[1] = hi; nextD[1] = d; nextLo[2] = n+1; nextHi[2] = m-1; nextD[2] = d+1; if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); if (mnextsize(1) < mnextsize(2)) mnextswap(1,2); if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); AssertD (mnextsize(0) >= mnextsize(1), "mainQSort3(8)" ); AssertD (mnextsize(1) >= mnextsize(2), "mainQSort3(9)" ); mpush (nextLo[0], nextHi[0], nextD[0]); mpush (nextLo[1], nextHi[1], nextD[1]); mpush (nextLo[2], nextHi[2], nextD[2]); } } #undef mswap #undef mvswap #undef mpush #undef mpop #undef mmin #undef mnextsize #undef mnextswap #undef MAIN_QSORT_SMALL_THRESH #undef MAIN_QSORT_DEPTH_THRESH #undef MAIN_QSORT_STACK_SIZE /*---------------------------------------------*/ /* Pre: nblock > N_OVERSHOOT block32 exists for [0 .. nblock-1 +N_OVERSHOOT] ((UChar*)block32) [0 .. nblock-1] holds block ptr exists for [0 .. nblock-1] Post: ((UChar*)block32) [0 .. nblock-1] holds block All other areas of block32 destroyed ftab [0 .. 65536 ] destroyed ptr [0 .. nblock-1] holds sorted order if (*budget < 0), sorting was abandoned */ #define BIGFREQ(b) (ftab[((b)+1) << 8] - ftab[(b) << 8]) #define SETMASK (1 << 21) #define CLEARMASK (~(SETMASK)) static void mainSort ( UInt32* ptr, UChar* block, UInt16* quadrant, UInt32* ftab, Int32 nblock, Int32 verb, Int32* budget ) { Int32 i, j, k, ss, sb; Int32 runningOrder[256]; Bool bigDone[256]; Int32 copyStart[256]; Int32 copyEnd [256]; UChar c1; Int32 numQSorted; UInt16 s; if (verb >= 4) VPrintf0 ( " main sort initialise ...\n" ); /*-- set up the 2-byte frequency table --*/ for (i = 65536; i >= 0; i--) ftab[i] = 0; j = block[0] << 8; i = nblock-1; for (; i >= 3; i -= 4) { quadrant[i] = 0; j = (j >> 8) | ( ((UInt16)block[i]) << 8); ftab[j]++; quadrant[i-1] = 0; j = (j >> 8) | ( ((UInt16)block[i-1]) << 8); ftab[j]++; quadrant[i-2] = 0; j = (j >> 8) | ( ((UInt16)block[i-2]) << 8); ftab[j]++; quadrant[i-3] = 0; j = (j >> 8) | ( ((UInt16)block[i-3]) << 8); ftab[j]++; } for (; i >= 0; i--) { quadrant[i] = 0; j = (j >> 8) | ( ((UInt16)block[i]) << 8); ftab[j]++; } /*-- (emphasises close relationship of block & quadrant) --*/ for (i = 0; i < BZ_N_OVERSHOOT; i++) { block [nblock+i] = block[i]; quadrant[nblock+i] = 0; } if (verb >= 4) VPrintf0 ( " bucket sorting ...\n" ); /*-- Complete the initial radix sort --*/ for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1]; s = block[0] << 8; i = nblock-1; for (; i >= 3; i -= 4) { s = (s >> 8) | (block[i] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i; s = (s >> 8) | (block[i-1] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i-1; s = (s >> 8) | (block[i-2] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i-2; s = (s >> 8) | (block[i-3] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i-3; } for (; i >= 0; i--) { s = (s >> 8) | (block[i] << 8); j = ftab[s] -1; ftab[s] = j; ptr[j] = i; } /*-- Now ftab contains the first loc of every small bucket. Calculate the running order, from smallest to largest big bucket. --*/ for (i = 0; i <= 255; i++) { bigDone [i] = False; runningOrder[i] = i; } { Int32 vv; Int32 h = 1; do h = 3 * h + 1; while (h <= 256); do { h = h / 3; for (i = h; i <= 255; i++) { vv = runningOrder[i]; j = i; while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) { runningOrder[j] = runningOrder[j-h]; j = j - h; if (j <= (h - 1)) goto zero; } zero: runningOrder[j] = vv; } } while (h != 1); } /*-- The main sorting loop. --*/ numQSorted = 0; for (i = 0; i <= 255; i++) { /*-- Process big buckets, starting with the least full. Basically this is a 3-step process in which we call mainQSort3 to sort the small buckets [ss, j], but also make a big effort to avoid the calls if we can. --*/ ss = runningOrder[i]; /*-- Step 1: Complete the big bucket [ss] by quicksorting any unsorted small buckets [ss, j], for j != ss. Hopefully previous pointer-scanning phases have already completed many of the small buckets [ss, j], so we don't have to sort them at all. --*/ for (j = 0; j <= 255; j++) { if (j != ss) { sb = (ss << 8) + j; if ( ! (ftab[sb] & SETMASK) ) { Int32 lo = ftab[sb] & CLEARMASK; Int32 hi = (ftab[sb+1] & CLEARMASK) - 1; if (hi > lo) { if (verb >= 4) VPrintf4 ( " qsort [0x%x, 0x%x] " "done %d this %d\n", ss, j, numQSorted, hi - lo + 1 ); mainQSort3 ( ptr, block, quadrant, nblock, lo, hi, BZ_N_RADIX, budget ); numQSorted += (hi - lo + 1); if (*budget < 0) return; } } ftab[sb] |= SETMASK; } } AssertH ( !bigDone[ss], 1006 ); /*-- Step 2: Now scan this big bucket [ss] so as to synthesise the sorted order for small buckets [t, ss] for all t, including, magically, the bucket [ss,ss] too. This will avoid doing Real Work in subsequent Step 1's. --*/ { for (j = 0; j <= 255; j++) { copyStart[j] = ftab[(j << 8) + ss] & CLEARMASK; copyEnd [j] = (ftab[(j << 8) + ss + 1] & CLEARMASK) - 1; } for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) { k = ptr[j]-1; if (k < 0) k += nblock; c1 = block[k]; if (!bigDone[c1]) ptr[ copyStart[c1]++ ] = k; } for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) { k = ptr[j]-1; if (k < 0) k += nblock; c1 = block[k]; if (!bigDone[c1]) ptr[ copyEnd[c1]-- ] = k; } } AssertH ( (copyStart[ss]-1 == copyEnd[ss]) || /* Extremely rare case missing in bzip2-1.0.0 and 1.0.1. Necessity for this case is demonstrated by compressing a sequence of approximately 48.5 million of character 251; 1.0.0/1.0.1 will then die here. */ (copyStart[ss] == 0 && copyEnd[ss] == nblock-1), 1007 ) for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK; /*-- Step 3: The [ss] big bucket is now done. Record this fact, and update the quadrant descriptors. Remember to update quadrants in the overshoot area too, if necessary. The "if (i < 255)" test merely skips this updating for the last bucket processed, since updating for the last bucket is pointless. The quadrant array provides a way to incrementally cache sort orderings, as they appear, so as to make subsequent comparisons in fullGtU() complete faster. For repetitive blocks this makes a big difference (but not big enough to be able to avoid the fallback sorting mechanism, exponential radix sort). The precise meaning is: at all times: for 0 <= i < nblock and 0 <= j <= nblock if block[i] != block[j], then the relative values of quadrant[i] and quadrant[j] are meaningless. else { if quadrant[i] < quadrant[j] then the string starting at i lexicographically precedes the string starting at j else if quadrant[i] > quadrant[j] then the string starting at j lexicographically precedes the string starting at i else the relative ordering of the strings starting at i and j has not yet been determined. } --*/ bigDone[ss] = True; if (i < 255) { Int32 bbStart = ftab[ss << 8] & CLEARMASK; Int32 bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart; Int32 shifts = 0; while ((bbSize >> shifts) > 65534) shifts++; for (j = bbSize-1; j >= 0; j--) { Int32 a2update = ptr[bbStart + j]; UInt16 qVal = (UInt16)(j >> shifts); quadrant[a2update] = qVal; if (a2update < BZ_N_OVERSHOOT) quadrant[a2update + nblock] = qVal; } AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 ); } } if (verb >= 4) VPrintf3 ( " %d pointers, %d sorted, %d scanned\n", nblock, numQSorted, nblock - numQSorted ); } #undef BIGFREQ #undef SETMASK #undef CLEARMASK /*---------------------------------------------*/ /* Pre: nblock > 0 arr2 exists for [0 .. nblock-1 +N_OVERSHOOT] ((UChar*)arr2) [0 .. nblock-1] holds block arr1 exists for [0 .. nblock-1] Post: ((UChar*)arr2) [0 .. nblock-1] holds block All other areas of block destroyed ftab [ 0 .. 65536 ] destroyed arr1 [0 .. nblock-1] holds sorted order */ void BZ2_blockSort ( EState* s ) { UInt32* ptr = s->ptr; UChar* block = s->block; UInt32* ftab = s->ftab; Int32 nblock = s->nblock; Int32 verb = s->verbosity; Int32 wfact = s->workFactor; UInt16* quadrant; Int32 budget; Int32 budgetInit; Int32 i; if (nblock < 10000) { fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); } else { /* Calculate the location for quadrant, remembering to get the alignment right. Assumes that &(block[0]) is at least 2-byte aligned -- this should be ok since block is really the first section of arr2. */ i = nblock+BZ_N_OVERSHOOT; if (i & 1) i++; quadrant = (UInt16*)(&(block[i])); /* (wfact-1) / 3 puts the default-factor-30 transition point at very roughly the same place as with v0.1 and v0.9.0. Not that it particularly matters any more, since the resulting compressed stream is now the same regardless of whether or not we use the main sort or fallback sort. */ if (wfact < 1 ) wfact = 1; if (wfact > 100) wfact = 100; budgetInit = nblock * ((wfact-1) / 3); budget = budgetInit; mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget ); if (verb >= 3) VPrintf3 ( " %d work, %d block, ratio %5.2f\n", budgetInit - budget, nblock, (float)(budgetInit - budget) / (float)(nblock==0 ? 1 : nblock) ); if (budget < 0) { if (verb >= 2) VPrintf0 ( " too repetitive; using fallback" " sorting algorithm\n" ); fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); } } s->origPtr = -1; for (i = 0; i < s->nblock; i++) if (ptr[i] == 0) { s->origPtr = i; break; }; AssertH( s->origPtr != -1, 1003 ); } /*-------------------------------------------------------------*/ /*--- end blocksort.c ---*/ /*-------------------------------------------------------------*/ microdc2-0.15.6/src/bzip2/bzip2.c0100644000076500007500000017446010516634225016401 0ustar chugunovmicrodc /*-----------------------------------------------------------*/ /*--- A block-sorting, lossless compressor bzip2.c ---*/ /*-----------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ /*----------------------------------------------------*/ /*--- IMPORTANT ---*/ /*----------------------------------------------------*/ /*-- WARNING: This program and library (attempts to) compress data by performing several non-trivial transformations on it. Unless you are 100% familiar with *all* the algorithms contained herein, and with the consequences of modifying them, you should NOT meddle with the compression or decompression machinery. Incorrect changes can and very likely *will* lead to disasterous loss of data. DISCLAIMER: I TAKE NO RESPONSIBILITY FOR ANY LOSS OF DATA ARISING FROM THE USE OF THIS PROGRAM, HOWSOEVER CAUSED. Every compression of a file implies an assumption that the compressed file can be decompressed to reproduce the original. Great efforts in design, coding and testing have been made to ensure that this program works correctly. However, the complexity of the algorithms, and, in particular, the presence of various special cases in the code which occur with very low but non-zero probability make it impossible to rule out the possibility of bugs remaining in the program. DO NOT COMPRESS ANY DATA WITH THIS PROGRAM AND/OR LIBRARY UNLESS YOU ARE PREPARED TO ACCEPT THE POSSIBILITY, HOWEVER SMALL, THAT THE DATA WILL NOT BE RECOVERABLE. That is not to say this program is inherently unreliable. Indeed, I very much hope the opposite is true. bzip2/libbzip2 has been carefully constructed and extensively tested. PATENTS: To the best of my knowledge, bzip2/libbzip2 does not use any patented algorithms. However, I do not have the resources available to carry out a full patent search. Therefore I cannot give any guarantee of the above statement. --*/ /*----------------------------------------------------*/ /*--- and now for something much more pleasant :-) ---*/ /*----------------------------------------------------*/ /*---------------------------------------------*/ /*-- Place a 1 beside your platform, and 0 elsewhere. --*/ /*-- Generic 32-bit Unix. Also works on 64-bit Unix boxes. This is the default. --*/ #define BZ_UNIX 1 /*-- Win32, as seen by Jacob Navia's excellent port of (Chris Fraser & David Hanson)'s excellent lcc compiler. Or with MS Visual C. This is selected automatically if compiled by a compiler which defines _WIN32, not including the Cygwin GCC. --*/ #define BZ_LCCWIN32 0 #if defined(_WIN32) && !defined(__CYGWIN__) #undef BZ_LCCWIN32 #define BZ_LCCWIN32 1 #undef BZ_UNIX #define BZ_UNIX 0 #endif /*---------------------------------------------*/ /*-- Some stuff for all platforms. --*/ #include #include #include #include #include #include #include #include "bzlib.h" #define ERROR_IF_EOF(i) { if ((i) == EOF) ioError(); } #define ERROR_IF_NOT_ZERO(i) { if ((i) != 0) ioError(); } #define ERROR_IF_MINUS_ONE(i) { if ((i) == (-1)) ioError(); } /*---------------------------------------------*/ /*-- Platform-specific stuff. --*/ #if BZ_UNIX # include # include # include # include # include # include # define PATH_SEP '/' # define MY_LSTAT lstat # define MY_STAT stat # define MY_S_ISREG S_ISREG # define MY_S_ISDIR S_ISDIR # define APPEND_FILESPEC(root, name) \ root=snocString((root), (name)) # define APPEND_FLAG(root, name) \ root=snocString((root), (name)) # define SET_BINARY_MODE(fd) /**/ # ifdef __GNUC__ # define NORETURN __attribute__ ((noreturn)) # else # define NORETURN /**/ # endif # ifdef __DJGPP__ # include # include # undef MY_LSTAT # undef MY_STAT # define MY_LSTAT stat # define MY_STAT stat # undef SET_BINARY_MODE # define SET_BINARY_MODE(fd) \ do { \ int retVal = setmode ( fileno ( fd ), \ O_BINARY ); \ ERROR_IF_MINUS_ONE ( retVal ); \ } while ( 0 ) # endif # ifdef __CYGWIN__ # include # include # undef SET_BINARY_MODE # define SET_BINARY_MODE(fd) \ do { \ int retVal = setmode ( fileno ( fd ), \ O_BINARY ); \ ERROR_IF_MINUS_ONE ( retVal ); \ } while ( 0 ) # endif #endif /* BZ_UNIX */ #if BZ_LCCWIN32 # include # include # include # define NORETURN /**/ # define PATH_SEP '\\' # define MY_LSTAT _stat # define MY_STAT _stat # define MY_S_ISREG(x) ((x) & _S_IFREG) # define MY_S_ISDIR(x) ((x) & _S_IFDIR) # define APPEND_FLAG(root, name) \ root=snocString((root), (name)) # define APPEND_FILESPEC(root, name) \ root = snocString ((root), (name)) # define SET_BINARY_MODE(fd) \ do { \ int retVal = setmode ( fileno ( fd ), \ O_BINARY ); \ ERROR_IF_MINUS_ONE ( retVal ); \ } while ( 0 ) #endif /* BZ_LCCWIN32 */ /*---------------------------------------------*/ /*-- Some more stuff for all platforms :-) --*/ typedef char Char; typedef unsigned char Bool; typedef unsigned char UChar; typedef int Int32; typedef unsigned int UInt32; typedef short Int16; typedef unsigned short UInt16; #define True ((Bool)1) #define False ((Bool)0) /*-- IntNative is your platform's `native' int size. Only here to avoid probs with 64-bit platforms. --*/ typedef int IntNative; /*---------------------------------------------------*/ /*--- Misc (file handling) data decls ---*/ /*---------------------------------------------------*/ Int32 verbosity; Bool keepInputFiles, smallMode, deleteOutputOnInterrupt; Bool forceOverwrite, testFailsExist, unzFailsExist, noisy; Int32 numFileNames, numFilesProcessed, blockSize100k; Int32 exitValue; /*-- source modes; F==file, I==stdin, O==stdout --*/ #define SM_I2O 1 #define SM_F2O 2 #define SM_F2F 3 /*-- operation modes --*/ #define OM_Z 1 #define OM_UNZ 2 #define OM_TEST 3 Int32 opMode; Int32 srcMode; #define FILE_NAME_LEN 1034 Int32 longestFileName; Char inName [FILE_NAME_LEN]; Char outName[FILE_NAME_LEN]; Char tmpName[FILE_NAME_LEN]; Char *progName; Char progNameReally[FILE_NAME_LEN]; FILE *outputHandleJustInCase; Int32 workFactor; static void panic ( Char* ) NORETURN; static void ioError ( void ) NORETURN; static void outOfMemory ( void ) NORETURN; static void configError ( void ) NORETURN; static void crcError ( void ) NORETURN; static void cleanUpAndFail ( Int32 ) NORETURN; static void compressedStreamEOF ( void ) NORETURN; static void copyFileName ( Char*, Char* ); static void* myMalloc ( Int32 ); /*---------------------------------------------------*/ /*--- An implementation of 64-bit ints. Sigh. ---*/ /*--- Roll on widespread deployment of ANSI C9X ! ---*/ /*---------------------------------------------------*/ typedef struct { UChar b[8]; } UInt64; static void uInt64_from_UInt32s ( UInt64* n, UInt32 lo32, UInt32 hi32 ) { n->b[7] = (UChar)((hi32 >> 24) & 0xFF); n->b[6] = (UChar)((hi32 >> 16) & 0xFF); n->b[5] = (UChar)((hi32 >> 8) & 0xFF); n->b[4] = (UChar) (hi32 & 0xFF); n->b[3] = (UChar)((lo32 >> 24) & 0xFF); n->b[2] = (UChar)((lo32 >> 16) & 0xFF); n->b[1] = (UChar)((lo32 >> 8) & 0xFF); n->b[0] = (UChar) (lo32 & 0xFF); } static double uInt64_to_double ( UInt64* n ) { Int32 i; double base = 1.0; double sum = 0.0; for (i = 0; i < 8; i++) { sum += base * (double)(n->b[i]); base *= 256.0; } return sum; } static Bool uInt64_isZero ( UInt64* n ) { Int32 i; for (i = 0; i < 8; i++) if (n->b[i] != 0) return 0; return 1; } /* Divide *n by 10, and return the remainder. */ static Int32 uInt64_qrm10 ( UInt64* n ) { UInt32 rem, tmp; Int32 i; rem = 0; for (i = 7; i >= 0; i--) { tmp = rem * 256 + n->b[i]; n->b[i] = tmp / 10; rem = tmp % 10; } return rem; } /* ... and the Whole Entire Point of all this UInt64 stuff is so that we can supply the following function. */ static void uInt64_toAscii ( char* outbuf, UInt64* n ) { Int32 i, q; UChar buf[32]; Int32 nBuf = 0; UInt64 n_copy = *n; do { q = uInt64_qrm10 ( &n_copy ); buf[nBuf] = q + '0'; nBuf++; } while (!uInt64_isZero(&n_copy)); outbuf[nBuf] = 0; for (i = 0; i < nBuf; i++) outbuf[i] = buf[nBuf-i-1]; } /*---------------------------------------------------*/ /*--- Processing of complete files and streams ---*/ /*---------------------------------------------------*/ /*---------------------------------------------*/ static Bool myfeof ( FILE* f ) { Int32 c = fgetc ( f ); if (c == EOF) return True; ungetc ( c, f ); return False; } /*---------------------------------------------*/ static void compressStream ( FILE *stream, FILE *zStream ) { BZFILE* bzf = NULL; UChar ibuf[5000]; Int32 nIbuf; UInt32 nbytes_in_lo32, nbytes_in_hi32; UInt32 nbytes_out_lo32, nbytes_out_hi32; Int32 bzerr, bzerr_dummy, ret; SET_BINARY_MODE(stream); SET_BINARY_MODE(zStream); if (ferror(stream)) goto errhandler_io; if (ferror(zStream)) goto errhandler_io; bzf = BZ2_bzWriteOpen ( &bzerr, zStream, blockSize100k, verbosity, workFactor ); if (bzerr != BZ_OK) goto errhandler; if (verbosity >= 2) fprintf ( stderr, "\n" ); while (True) { if (myfeof(stream)) break; nIbuf = fread ( ibuf, sizeof(UChar), 5000, stream ); if (ferror(stream)) goto errhandler_io; if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf ); if (bzerr != BZ_OK) goto errhandler; } BZ2_bzWriteClose64 ( &bzerr, bzf, 0, &nbytes_in_lo32, &nbytes_in_hi32, &nbytes_out_lo32, &nbytes_out_hi32 ); if (bzerr != BZ_OK) goto errhandler; if (ferror(zStream)) goto errhandler_io; ret = fflush ( zStream ); if (ret == EOF) goto errhandler_io; if (zStream != stdout) { ret = fclose ( zStream ); outputHandleJustInCase = NULL; if (ret == EOF) goto errhandler_io; } outputHandleJustInCase = NULL; if (ferror(stream)) goto errhandler_io; ret = fclose ( stream ); if (ret == EOF) goto errhandler_io; if (verbosity >= 1) { if (nbytes_in_lo32 == 0 && nbytes_in_hi32 == 0) { fprintf ( stderr, " no data compressed.\n"); } else { Char buf_nin[32], buf_nout[32]; UInt64 nbytes_in, nbytes_out; double nbytes_in_d, nbytes_out_d; uInt64_from_UInt32s ( &nbytes_in, nbytes_in_lo32, nbytes_in_hi32 ); uInt64_from_UInt32s ( &nbytes_out, nbytes_out_lo32, nbytes_out_hi32 ); nbytes_in_d = uInt64_to_double ( &nbytes_in ); nbytes_out_d = uInt64_to_double ( &nbytes_out ); uInt64_toAscii ( buf_nin, &nbytes_in ); uInt64_toAscii ( buf_nout, &nbytes_out ); fprintf ( stderr, "%6.3f:1, %6.3f bits/byte, " "%5.2f%% saved, %s in, %s out.\n", nbytes_in_d / nbytes_out_d, (8.0 * nbytes_out_d) / nbytes_in_d, 100.0 * (1.0 - nbytes_out_d / nbytes_in_d), buf_nin, buf_nout ); } } return; errhandler: BZ2_bzWriteClose64 ( &bzerr_dummy, bzf, 1, &nbytes_in_lo32, &nbytes_in_hi32, &nbytes_out_lo32, &nbytes_out_hi32 ); switch (bzerr) { case BZ_CONFIG_ERROR: configError(); break; case BZ_MEM_ERROR: outOfMemory (); break; case BZ_IO_ERROR: errhandler_io: ioError(); break; default: panic ( "compress:unexpected error" ); } panic ( "compress:end" ); /*notreached*/ } /*---------------------------------------------*/ static Bool uncompressStream ( FILE *zStream, FILE *stream ) { BZFILE* bzf = NULL; Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; UChar obuf[5000]; UChar unused[BZ_MAX_UNUSED]; Int32 nUnused; void* unusedTmpV; UChar* unusedTmp; nUnused = 0; streamNo = 0; SET_BINARY_MODE(stream); SET_BINARY_MODE(zStream); if (ferror(stream)) goto errhandler_io; if (ferror(zStream)) goto errhandler_io; while (True) { bzf = BZ2_bzReadOpen ( &bzerr, zStream, verbosity, (int)smallMode, unused, nUnused ); if (bzf == NULL || bzerr != BZ_OK) goto errhandler; streamNo++; while (bzerr == BZ_OK) { nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); if (bzerr == BZ_DATA_ERROR_MAGIC) goto trycat; if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0) fwrite ( obuf, sizeof(UChar), nread, stream ); if (ferror(stream)) goto errhandler_io; } if (bzerr != BZ_STREAM_END) goto errhandler; BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused ); if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" ); unusedTmp = (UChar*)unusedTmpV; for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i]; BZ2_bzReadClose ( &bzerr, bzf ); if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" ); if (nUnused == 0 && myfeof(zStream)) break; } closeok: if (ferror(zStream)) goto errhandler_io; ret = fclose ( zStream ); if (ret == EOF) goto errhandler_io; if (ferror(stream)) goto errhandler_io; ret = fflush ( stream ); if (ret != 0) goto errhandler_io; if (stream != stdout) { ret = fclose ( stream ); outputHandleJustInCase = NULL; if (ret == EOF) goto errhandler_io; } outputHandleJustInCase = NULL; if (verbosity >= 2) fprintf ( stderr, "\n " ); return True; trycat: if (forceOverwrite) { rewind(zStream); while (True) { if (myfeof(zStream)) break; nread = fread ( obuf, sizeof(UChar), 5000, zStream ); if (ferror(zStream)) goto errhandler_io; if (nread > 0) fwrite ( obuf, sizeof(UChar), nread, stream ); if (ferror(stream)) goto errhandler_io; } goto closeok; } errhandler: BZ2_bzReadClose ( &bzerr_dummy, bzf ); switch (bzerr) { case BZ_CONFIG_ERROR: configError(); break; case BZ_IO_ERROR: errhandler_io: ioError(); break; case BZ_DATA_ERROR: crcError(); case BZ_MEM_ERROR: outOfMemory(); case BZ_UNEXPECTED_EOF: compressedStreamEOF(); case BZ_DATA_ERROR_MAGIC: if (zStream != stdin) fclose(zStream); if (stream != stdout) fclose(stream); if (streamNo == 1) { return False; } else { if (noisy) fprintf ( stderr, "\n%s: %s: trailing garbage after EOF ignored\n", progName, inName ); return True; } default: panic ( "decompress:unexpected error" ); } panic ( "decompress:end" ); return True; /*notreached*/ } /*---------------------------------------------*/ static Bool testStream ( FILE *zStream ) { BZFILE* bzf = NULL; Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; UChar obuf[5000]; UChar unused[BZ_MAX_UNUSED]; Int32 nUnused; void* unusedTmpV; UChar* unusedTmp; nUnused = 0; streamNo = 0; SET_BINARY_MODE(zStream); if (ferror(zStream)) goto errhandler_io; while (True) { bzf = BZ2_bzReadOpen ( &bzerr, zStream, verbosity, (int)smallMode, unused, nUnused ); if (bzf == NULL || bzerr != BZ_OK) goto errhandler; streamNo++; while (bzerr == BZ_OK) { nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler; } if (bzerr != BZ_STREAM_END) goto errhandler; BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused ); if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" ); unusedTmp = (UChar*)unusedTmpV; for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i]; BZ2_bzReadClose ( &bzerr, bzf ); if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" ); if (nUnused == 0 && myfeof(zStream)) break; } if (ferror(zStream)) goto errhandler_io; ret = fclose ( zStream ); if (ret == EOF) goto errhandler_io; if (verbosity >= 2) fprintf ( stderr, "\n " ); return True; errhandler: BZ2_bzReadClose ( &bzerr_dummy, bzf ); if (verbosity == 0) fprintf ( stderr, "%s: %s: ", progName, inName ); switch (bzerr) { case BZ_CONFIG_ERROR: configError(); break; case BZ_IO_ERROR: errhandler_io: ioError(); break; case BZ_DATA_ERROR: fprintf ( stderr, "data integrity (CRC) error in data\n" ); return False; case BZ_MEM_ERROR: outOfMemory(); case BZ_UNEXPECTED_EOF: fprintf ( stderr, "file ends unexpectedly\n" ); return False; case BZ_DATA_ERROR_MAGIC: if (zStream != stdin) fclose(zStream); if (streamNo == 1) { fprintf ( stderr, "bad magic number (file not created by bzip2)\n" ); return False; } else { if (noisy) fprintf ( stderr, "trailing garbage after EOF ignored\n" ); return True; } default: panic ( "test:unexpected error" ); } panic ( "test:end" ); return True; /*notreached*/ } /*---------------------------------------------------*/ /*--- Error [non-] handling grunge ---*/ /*---------------------------------------------------*/ /*---------------------------------------------*/ static void setExit ( Int32 v ) { if (v > exitValue) exitValue = v; } /*---------------------------------------------*/ static void cadvise ( void ) { if (noisy) fprintf ( stderr, "\nIt is possible that the compressed file(s) have become corrupted.\n" "You can use the -tvv option to test integrity of such files.\n\n" "You can use the `bzip2recover' program to attempt to recover\n" "data from undamaged sections of corrupted files.\n\n" ); } /*---------------------------------------------*/ static void showFileNames ( void ) { if (noisy) fprintf ( stderr, "\tInput file = %s, output file = %s\n", inName, outName ); } /*---------------------------------------------*/ static void cleanUpAndFail ( Int32 ec ) { IntNative retVal; struct MY_STAT statBuf; if ( srcMode == SM_F2F && opMode != OM_TEST && deleteOutputOnInterrupt ) { /* Check whether input file still exists. Delete output file only if input exists to avoid loss of data. Joerg Prante, 5 January 2002. (JRS 06-Jan-2002: other changes in 1.0.2 mean this is less likely to happen. But to be ultra-paranoid, we do the check anyway.) */ retVal = MY_STAT ( inName, &statBuf ); if (retVal == 0) { if (noisy) fprintf ( stderr, "%s: Deleting output file %s, if it exists.\n", progName, outName ); if (outputHandleJustInCase != NULL) fclose ( outputHandleJustInCase ); retVal = remove ( outName ); if (retVal != 0) fprintf ( stderr, "%s: WARNING: deletion of output file " "(apparently) failed.\n", progName ); } else { fprintf ( stderr, "%s: WARNING: deletion of output file suppressed\n", progName ); fprintf ( stderr, "%s: since input file no longer exists. Output file\n", progName ); fprintf ( stderr, "%s: `%s' may be incomplete.\n", progName, outName ); fprintf ( stderr, "%s: I suggest doing an integrity test (bzip2 -tv)" " of it.\n", progName ); } } if (noisy && numFileNames > 0 && numFilesProcessed < numFileNames) { fprintf ( stderr, "%s: WARNING: some files have not been processed:\n" "%s: %d specified on command line, %d not processed yet.\n\n", progName, progName, numFileNames, numFileNames - numFilesProcessed ); } setExit(ec); exit(exitValue); } /*---------------------------------------------*/ static void panic ( Char* s ) { fprintf ( stderr, "\n%s: PANIC -- internal consistency error:\n" "\t%s\n" "\tThis is a BUG. Please report it to me at:\n" "\tjseward@bzip.org\n", progName, s ); showFileNames(); cleanUpAndFail( 3 ); } /*---------------------------------------------*/ static void crcError ( void ) { fprintf ( stderr, "\n%s: Data integrity error when decompressing.\n", progName ); showFileNames(); cadvise(); cleanUpAndFail( 2 ); } /*---------------------------------------------*/ static void compressedStreamEOF ( void ) { if (noisy) { fprintf ( stderr, "\n%s: Compressed file ends unexpectedly;\n\t" "perhaps it is corrupted? *Possible* reason follows.\n", progName ); perror ( progName ); showFileNames(); cadvise(); } cleanUpAndFail( 2 ); } /*---------------------------------------------*/ static void ioError ( void ) { fprintf ( stderr, "\n%s: I/O or other error, bailing out. " "Possible reason follows.\n", progName ); perror ( progName ); showFileNames(); cleanUpAndFail( 1 ); } /*---------------------------------------------*/ static void mySignalCatcher ( IntNative n ) { fprintf ( stderr, "\n%s: Control-C or similar caught, quitting.\n", progName ); cleanUpAndFail(1); } /*---------------------------------------------*/ static void mySIGSEGVorSIGBUScatcher ( IntNative n ) { if (opMode == OM_Z) fprintf ( stderr, "\n%s: Caught a SIGSEGV or SIGBUS whilst compressing.\n" "\n" " Possible causes are (most likely first):\n" " (1) This computer has unreliable memory or cache hardware\n" " (a surprisingly common problem; try a different machine.)\n" " (2) A bug in the compiler used to create this executable\n" " (unlikely, if you didn't compile bzip2 yourself.)\n" " (3) A real bug in bzip2 -- I hope this should never be the case.\n" " The user's manual, Section 4.3, has more info on (1) and (2).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (1)\n" " or (2), feel free to report it to me at: jseward@bzip.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" " have the manual or can't be bothered to read it, mail me anyway.\n" "\n", progName ); else fprintf ( stderr, "\n%s: Caught a SIGSEGV or SIGBUS whilst decompressing.\n" "\n" " Possible causes are (most likely first):\n" " (1) The compressed data is corrupted, and bzip2's usual checks\n" " failed to detect this. Try bzip2 -tvv my_file.bz2.\n" " (2) This computer has unreliable memory or cache hardware\n" " (a surprisingly common problem; try a different machine.)\n" " (3) A bug in the compiler used to create this executable\n" " (unlikely, if you didn't compile bzip2 yourself.)\n" " (4) A real bug in bzip2 -- I hope this should never be the case.\n" " The user's manual, Section 4.3, has more info on (2) and (3).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (2)\n" " or (3), feel free to report it to me at: jseward@bzip.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" " have the manual or can't be bothered to read it, mail me anyway.\n" "\n", progName ); showFileNames(); if (opMode == OM_Z) cleanUpAndFail( 3 ); else { cadvise(); cleanUpAndFail( 2 ); } } /*---------------------------------------------*/ static void outOfMemory ( void ) { fprintf ( stderr, "\n%s: couldn't allocate enough memory\n", progName ); showFileNames(); cleanUpAndFail(1); } /*---------------------------------------------*/ static void configError ( void ) { fprintf ( stderr, "bzip2: I'm not configured correctly for this platform!\n" "\tI require Int32, Int16 and Char to have sizes\n" "\tof 4, 2 and 1 bytes to run properly, and they don't.\n" "\tProbably you can fix this by defining them correctly,\n" "\tand recompiling. Bye!\n" ); setExit(3); exit(exitValue); } /*---------------------------------------------------*/ /*--- The main driver machinery ---*/ /*---------------------------------------------------*/ /* All rather crufty. The main problem is that input files are stat()d multiple times before use. This should be cleaned up. */ /*---------------------------------------------*/ static void pad ( Char *s ) { Int32 i; if ( (Int32)strlen(s) >= longestFileName ) return; for (i = 1; i <= longestFileName - (Int32)strlen(s); i++) fprintf ( stderr, " " ); } /*---------------------------------------------*/ static void copyFileName ( Char* to, Char* from ) { if ( strlen(from) > FILE_NAME_LEN-10 ) { fprintf ( stderr, "bzip2: file name\n`%s'\n" "is suspiciously (more than %d chars) long.\n" "Try using a reasonable file name instead. Sorry! :-)\n", from, FILE_NAME_LEN-10 ); setExit(1); exit(exitValue); } strncpy(to,from,FILE_NAME_LEN-10); to[FILE_NAME_LEN-10]='\0'; } /*---------------------------------------------*/ static Bool fileExists ( Char* name ) { FILE *tmp = fopen ( name, "rb" ); Bool exists = (tmp != NULL); if (tmp != NULL) fclose ( tmp ); return exists; } /*---------------------------------------------*/ /* Open an output file safely with O_EXCL and good permissions. This avoids a race condition in versions < 1.0.2, in which the file was first opened and then had its interim permissions set safely. We instead use open() to create the file with the interim permissions required. (--- --- rw-). For non-Unix platforms, if we are not worrying about security issues, simple this simply behaves like fopen. */ FILE* fopen_output_safely ( Char* name, const char* mode ) { # if BZ_UNIX FILE* fp; IntNative fh; fh = open(name, O_WRONLY|O_CREAT|O_EXCL, S_IWUSR|S_IRUSR); if (fh == -1) return NULL; fp = fdopen(fh, mode); if (fp == NULL) close(fh); return fp; # else return fopen(name, mode); # endif } /*---------------------------------------------*/ /*-- if in doubt, return True --*/ static Bool notAStandardFile ( Char* name ) { IntNative i; struct MY_STAT statBuf; i = MY_LSTAT ( name, &statBuf ); if (i != 0) return True; if (MY_S_ISREG(statBuf.st_mode)) return False; return True; } /*---------------------------------------------*/ /*-- rac 11/21/98 see if file has hard links to it --*/ static Int32 countHardLinks ( Char* name ) { IntNative i; struct MY_STAT statBuf; i = MY_LSTAT ( name, &statBuf ); if (i != 0) return 0; return (statBuf.st_nlink - 1); } /*---------------------------------------------*/ /* Copy modification date, access date, permissions and owner from the source to destination file. We have to copy this meta-info off into fileMetaInfo before starting to compress / decompress it, because doing it afterwards means we get the wrong access time. To complicate matters, in compress() and decompress() below, the sequence of tests preceding the call to saveInputFileMetaInfo() involves calling fileExists(), which in turn establishes its result by attempting to fopen() the file, and if successful, immediately fclose()ing it again. So we have to assume that the fopen() call does not cause the access time field to be updated. Reading of the man page for stat() (man 2 stat) on RedHat 7.2 seems to imply that merely doing open() will not affect the access time. Therefore we merely need to hope that the C library only does open() as a result of fopen(), and not any kind of read()-ahead cleverness. It sounds pretty fragile to me. Whether this carries across robustly to arbitrary Unix-like platforms (or even works robustly on this one, RedHat 7.2) is unknown to me. Nevertheless ... */ #if BZ_UNIX static struct MY_STAT fileMetaInfo; #endif static void saveInputFileMetaInfo ( Char *srcName ) { # if BZ_UNIX IntNative retVal; /* Note use of stat here, not lstat. */ retVal = MY_STAT( srcName, &fileMetaInfo ); ERROR_IF_NOT_ZERO ( retVal ); # endif } static void applySavedMetaInfoToOutputFile ( Char *dstName ) { # if BZ_UNIX IntNative retVal; struct utimbuf uTimBuf; uTimBuf.actime = fileMetaInfo.st_atime; uTimBuf.modtime = fileMetaInfo.st_mtime; retVal = chmod ( dstName, fileMetaInfo.st_mode ); ERROR_IF_NOT_ZERO ( retVal ); retVal = utime ( dstName, &uTimBuf ); ERROR_IF_NOT_ZERO ( retVal ); retVal = chown ( dstName, fileMetaInfo.st_uid, fileMetaInfo.st_gid ); /* chown() will in many cases return with EPERM, which can be safely ignored. */ # endif } /*---------------------------------------------*/ static Bool containsDubiousChars ( Char* name ) { # if BZ_UNIX /* On unix, files can contain any characters and the file expansion * is performed by the shell. */ return False; # else /* ! BZ_UNIX */ /* On non-unix (Win* platforms), wildcard characters are not allowed in * filenames. */ for (; *name != '\0'; name++) if (*name == '?' || *name == '*') return True; return False; # endif /* BZ_UNIX */ } /*---------------------------------------------*/ #define BZ_N_SUFFIX_PAIRS 4 Char* zSuffix[BZ_N_SUFFIX_PAIRS] = { ".bz2", ".bz", ".tbz2", ".tbz" }; Char* unzSuffix[BZ_N_SUFFIX_PAIRS] = { "", "", ".tar", ".tar" }; static Bool hasSuffix ( Char* s, Char* suffix ) { Int32 ns = strlen(s); Int32 nx = strlen(suffix); if (ns < nx) return False; if (strcmp(s + ns - nx, suffix) == 0) return True; return False; } static Bool mapSuffix ( Char* name, Char* oldSuffix, Char* newSuffix ) { if (!hasSuffix(name,oldSuffix)) return False; name[strlen(name)-strlen(oldSuffix)] = 0; strcat ( name, newSuffix ); return True; } /*---------------------------------------------*/ static void compress ( Char *name ) { FILE *inStr; FILE *outStr; Int32 n, i; struct MY_STAT statBuf; deleteOutputOnInterrupt = False; if (name == NULL && srcMode != SM_I2O) panic ( "compress: bad modes\n" ); switch (srcMode) { case SM_I2O: copyFileName ( inName, "(stdin)" ); copyFileName ( outName, "(stdout)" ); break; case SM_F2F: copyFileName ( inName, name ); copyFileName ( outName, name ); strcat ( outName, ".bz2" ); break; case SM_F2O: copyFileName ( inName, name ); copyFileName ( outName, "(stdout)" ); break; } if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) { if (noisy) fprintf ( stderr, "%s: There are no files matching `%s'.\n", progName, inName ); setExit(1); return; } if ( srcMode != SM_I2O && !fileExists ( inName ) ) { fprintf ( stderr, "%s: Can't open input file %s: %s.\n", progName, inName, strerror(errno) ); setExit(1); return; } for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) { if (hasSuffix(inName, zSuffix[i])) { if (noisy) fprintf ( stderr, "%s: Input file %s already has %s suffix.\n", progName, inName, zSuffix[i] ); setExit(1); return; } } if ( srcMode == SM_F2F || srcMode == SM_F2O ) { MY_STAT(inName, &statBuf); if ( MY_S_ISDIR(statBuf.st_mode) ) { fprintf( stderr, "%s: Input file %s is a directory.\n", progName,inName); setExit(1); return; } } if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) { if (noisy) fprintf ( stderr, "%s: Input file %s is not a normal file.\n", progName, inName ); setExit(1); return; } if ( srcMode == SM_F2F && fileExists ( outName ) ) { if (forceOverwrite) { remove(outName); } else { fprintf ( stderr, "%s: Output file %s already exists.\n", progName, outName ); setExit(1); return; } } if ( srcMode == SM_F2F && !forceOverwrite && (n=countHardLinks ( inName )) > 0) { fprintf ( stderr, "%s: Input file %s has %d other link%s.\n", progName, inName, n, n > 1 ? "s" : "" ); setExit(1); return; } if ( srcMode == SM_F2F ) { /* Save the file's meta-info before we open it. Doing it later means we mess up the access times. */ saveInputFileMetaInfo ( inName ); } switch ( srcMode ) { case SM_I2O: inStr = stdin; outStr = stdout; if ( isatty ( fileno ( stdout ) ) ) { fprintf ( stderr, "%s: I won't write compressed data to a terminal.\n", progName ); fprintf ( stderr, "%s: For help, type: `%s --help'.\n", progName, progName ); setExit(1); return; }; break; case SM_F2O: inStr = fopen ( inName, "rb" ); outStr = stdout; if ( isatty ( fileno ( stdout ) ) ) { fprintf ( stderr, "%s: I won't write compressed data to a terminal.\n", progName ); fprintf ( stderr, "%s: For help, type: `%s --help'.\n", progName, progName ); if ( inStr != NULL ) fclose ( inStr ); setExit(1); return; }; if ( inStr == NULL ) { fprintf ( stderr, "%s: Can't open input file %s: %s.\n", progName, inName, strerror(errno) ); setExit(1); return; }; break; case SM_F2F: inStr = fopen ( inName, "rb" ); outStr = fopen_output_safely ( outName, "wb" ); if ( outStr == NULL) { fprintf ( stderr, "%s: Can't create output file %s: %s.\n", progName, outName, strerror(errno) ); if ( inStr != NULL ) fclose ( inStr ); setExit(1); return; } if ( inStr == NULL ) { fprintf ( stderr, "%s: Can't open input file %s: %s.\n", progName, inName, strerror(errno) ); if ( outStr != NULL ) fclose ( outStr ); setExit(1); return; }; break; default: panic ( "compress: bad srcMode" ); break; } if (verbosity >= 1) { fprintf ( stderr, " %s: ", inName ); pad ( inName ); fflush ( stderr ); } /*--- Now the input and output handles are sane. Do the Biz. ---*/ outputHandleJustInCase = outStr; deleteOutputOnInterrupt = True; compressStream ( inStr, outStr ); outputHandleJustInCase = NULL; /*--- If there was an I/O error, we won't get here. ---*/ if ( srcMode == SM_F2F ) { applySavedMetaInfoToOutputFile ( outName ); deleteOutputOnInterrupt = False; if ( !keepInputFiles ) { IntNative retVal = remove ( inName ); ERROR_IF_NOT_ZERO ( retVal ); } } deleteOutputOnInterrupt = False; } /*---------------------------------------------*/ static void uncompress ( Char *name ) { FILE *inStr; FILE *outStr; Int32 n, i; Bool magicNumberOK; Bool cantGuess; struct MY_STAT statBuf; deleteOutputOnInterrupt = False; if (name == NULL && srcMode != SM_I2O) panic ( "uncompress: bad modes\n" ); cantGuess = False; switch (srcMode) { case SM_I2O: copyFileName ( inName, "(stdin)" ); copyFileName ( outName, "(stdout)" ); break; case SM_F2F: copyFileName ( inName, name ); copyFileName ( outName, name ); for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) if (mapSuffix(outName,zSuffix[i],unzSuffix[i])) goto zzz; cantGuess = True; strcat ( outName, ".out" ); break; case SM_F2O: copyFileName ( inName, name ); copyFileName ( outName, "(stdout)" ); break; } zzz: if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) { if (noisy) fprintf ( stderr, "%s: There are no files matching `%s'.\n", progName, inName ); setExit(1); return; } if ( srcMode != SM_I2O && !fileExists ( inName ) ) { fprintf ( stderr, "%s: Can't open input file %s: %s.\n", progName, inName, strerror(errno) ); setExit(1); return; } if ( srcMode == SM_F2F || srcMode == SM_F2O ) { MY_STAT(inName, &statBuf); if ( MY_S_ISDIR(statBuf.st_mode) ) { fprintf( stderr, "%s: Input file %s is a directory.\n", progName,inName); setExit(1); return; } } if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) { if (noisy) fprintf ( stderr, "%s: Input file %s is not a normal file.\n", progName, inName ); setExit(1); return; } if ( /* srcMode == SM_F2F implied && */ cantGuess ) { if (noisy) fprintf ( stderr, "%s: Can't guess original name for %s -- using %s\n", progName, inName, outName ); /* just a warning, no return */ } if ( srcMode == SM_F2F && fileExists ( outName ) ) { if (forceOverwrite) { remove(outName); } else { fprintf ( stderr, "%s: Output file %s already exists.\n", progName, outName ); setExit(1); return; } } if ( srcMode == SM_F2F && !forceOverwrite && (n=countHardLinks ( inName ) ) > 0) { fprintf ( stderr, "%s: Input file %s has %d other link%s.\n", progName, inName, n, n > 1 ? "s" : "" ); setExit(1); return; } if ( srcMode == SM_F2F ) { /* Save the file's meta-info before we open it. Doing it later means we mess up the access times. */ saveInputFileMetaInfo ( inName ); } switch ( srcMode ) { case SM_I2O: inStr = stdin; outStr = stdout; if ( isatty ( fileno ( stdin ) ) ) { fprintf ( stderr, "%s: I won't read compressed data from a terminal.\n", progName ); fprintf ( stderr, "%s: For help, type: `%s --help'.\n", progName, progName ); setExit(1); return; }; break; case SM_F2O: inStr = fopen ( inName, "rb" ); outStr = stdout; if ( inStr == NULL ) { fprintf ( stderr, "%s: Can't open input file %s:%s.\n", progName, inName, strerror(errno) ); if ( inStr != NULL ) fclose ( inStr ); setExit(1); return; }; break; case SM_F2F: inStr = fopen ( inName, "rb" ); outStr = fopen_output_safely ( outName, "wb" ); if ( outStr == NULL) { fprintf ( stderr, "%s: Can't create output file %s: %s.\n", progName, outName, strerror(errno) ); if ( inStr != NULL ) fclose ( inStr ); setExit(1); return; } if ( inStr == NULL ) { fprintf ( stderr, "%s: Can't open input file %s: %s.\n", progName, inName, strerror(errno) ); if ( outStr != NULL ) fclose ( outStr ); setExit(1); return; }; break; default: panic ( "uncompress: bad srcMode" ); break; } if (verbosity >= 1) { fprintf ( stderr, " %s: ", inName ); pad ( inName ); fflush ( stderr ); } /*--- Now the input and output handles are sane. Do the Biz. ---*/ outputHandleJustInCase = outStr; deleteOutputOnInterrupt = True; magicNumberOK = uncompressStream ( inStr, outStr ); outputHandleJustInCase = NULL; /*--- If there was an I/O error, we won't get here. ---*/ if ( magicNumberOK ) { if ( srcMode == SM_F2F ) { applySavedMetaInfoToOutputFile ( outName ); deleteOutputOnInterrupt = False; if ( !keepInputFiles ) { IntNative retVal = remove ( inName ); ERROR_IF_NOT_ZERO ( retVal ); } } } else { unzFailsExist = True; deleteOutputOnInterrupt = False; if ( srcMode == SM_F2F ) { IntNative retVal = remove ( outName ); ERROR_IF_NOT_ZERO ( retVal ); } } deleteOutputOnInterrupt = False; if ( magicNumberOK ) { if (verbosity >= 1) fprintf ( stderr, "done\n" ); } else { setExit(2); if (verbosity >= 1) fprintf ( stderr, "not a bzip2 file.\n" ); else fprintf ( stderr, "%s: %s is not a bzip2 file.\n", progName, inName ); } } /*---------------------------------------------*/ static void testf ( Char *name ) { FILE *inStr; Bool allOK; struct MY_STAT statBuf; deleteOutputOnInterrupt = False; if (name == NULL && srcMode != SM_I2O) panic ( "testf: bad modes\n" ); copyFileName ( outName, "(none)" ); switch (srcMode) { case SM_I2O: copyFileName ( inName, "(stdin)" ); break; case SM_F2F: copyFileName ( inName, name ); break; case SM_F2O: copyFileName ( inName, name ); break; } if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) { if (noisy) fprintf ( stderr, "%s: There are no files matching `%s'.\n", progName, inName ); setExit(1); return; } if ( srcMode != SM_I2O && !fileExists ( inName ) ) { fprintf ( stderr, "%s: Can't open input %s: %s.\n", progName, inName, strerror(errno) ); setExit(1); return; } if ( srcMode != SM_I2O ) { MY_STAT(inName, &statBuf); if ( MY_S_ISDIR(statBuf.st_mode) ) { fprintf( stderr, "%s: Input file %s is a directory.\n", progName,inName); setExit(1); return; } } switch ( srcMode ) { case SM_I2O: if ( isatty ( fileno ( stdin ) ) ) { fprintf ( stderr, "%s: I won't read compressed data from a terminal.\n", progName ); fprintf ( stderr, "%s: For help, type: `%s --help'.\n", progName, progName ); setExit(1); return; }; inStr = stdin; break; case SM_F2O: case SM_F2F: inStr = fopen ( inName, "rb" ); if ( inStr == NULL ) { fprintf ( stderr, "%s: Can't open input file %s:%s.\n", progName, inName, strerror(errno) ); setExit(1); return; }; break; default: panic ( "testf: bad srcMode" ); break; } if (verbosity >= 1) { fprintf ( stderr, " %s: ", inName ); pad ( inName ); fflush ( stderr ); } /*--- Now the input handle is sane. Do the Biz. ---*/ outputHandleJustInCase = NULL; allOK = testStream ( inStr ); if (allOK && verbosity >= 1) fprintf ( stderr, "ok\n" ); if (!allOK) testFailsExist = True; } /*---------------------------------------------*/ static void license ( void ) { fprintf ( stderr, "bzip2, a block-sorting file compressor. " "Version %s.\n" " \n" " Copyright (C) 1996-2005 by Julian Seward.\n" " \n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms set out in the LICENSE file, which is included\n" " in the bzip2-1.0 source distribution.\n" " \n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" " LICENSE file for more details.\n" " \n", BZ2_bzlibVersion() ); } /*---------------------------------------------*/ static void usage ( Char *fullProgName ) { fprintf ( stderr, "bzip2, a block-sorting file compressor. " "Version %s.\n" "\n usage: %s [flags and input files in any order]\n" "\n" " -h --help print this message\n" " -d --decompress force decompression\n" " -z --compress force compression\n" " -k --keep keep (don't delete) input files\n" " -f --force overwrite existing output files\n" " -t --test test compressed file integrity\n" " -c --stdout output to standard out\n" " -q --quiet suppress noncritical error messages\n" " -v --verbose be verbose (a 2nd -v gives more)\n" " -L --license display software version & license\n" " -V --version display software version & license\n" " -s --small use less memory (at most 2500k)\n" " -1 .. -9 set block size to 100k .. 900k\n" " --fast alias for -1\n" " --best alias for -9\n" "\n" " If invoked as `bzip2', default action is to compress.\n" " as `bunzip2', default action is to decompress.\n" " as `bzcat', default action is to decompress to stdout.\n" "\n" " If no file names are given, bzip2 compresses or decompresses\n" " from standard input to standard output. You can combine\n" " short flags, so `-v -4' means the same as -v4 or -4v, &c.\n" # if BZ_UNIX "\n" # endif , BZ2_bzlibVersion(), fullProgName ); } /*---------------------------------------------*/ static void redundant ( Char* flag ) { fprintf ( stderr, "%s: %s is redundant in versions 0.9.5 and above\n", progName, flag ); } /*---------------------------------------------*/ /*-- All the garbage from here to main() is purely to implement a linked list of command-line arguments, into which main() copies argv[1 .. argc-1]. The purpose of this exercise is to facilitate the expansion of wildcard characters * and ? in filenames for OSs which don't know how to do it themselves, like MSDOS, Windows 95 and NT. The actual Dirty Work is done by the platform- specific macro APPEND_FILESPEC. --*/ typedef struct zzzz { Char *name; struct zzzz *link; } Cell; /*---------------------------------------------*/ static void *myMalloc ( Int32 n ) { void* p; p = malloc ( (size_t)n ); if (p == NULL) outOfMemory (); return p; } /*---------------------------------------------*/ static Cell *mkCell ( void ) { Cell *c; c = (Cell*) myMalloc ( sizeof ( Cell ) ); c->name = NULL; c->link = NULL; return c; } /*---------------------------------------------*/ static Cell *snocString ( Cell *root, Char *name ) { if (root == NULL) { Cell *tmp = mkCell(); tmp->name = (Char*) myMalloc ( 5 + strlen(name) ); strcpy ( tmp->name, name ); return tmp; } else { Cell *tmp = root; while (tmp->link != NULL) tmp = tmp->link; tmp->link = snocString ( tmp->link, name ); return root; } } /*---------------------------------------------*/ static void addFlagsFromEnvVar ( Cell** argList, Char* varName ) { Int32 i, j, k; Char *envbase, *p; envbase = getenv(varName); if (envbase != NULL) { p = envbase; i = 0; while (True) { if (p[i] == 0) break; p += i; i = 0; while (isspace((Int32)(p[0]))) p++; while (p[i] != 0 && !isspace((Int32)(p[i]))) i++; if (i > 0) { k = i; if (k > FILE_NAME_LEN-10) k = FILE_NAME_LEN-10; for (j = 0; j < k; j++) tmpName[j] = p[j]; tmpName[k] = 0; APPEND_FLAG(*argList, tmpName); } } } } /*---------------------------------------------*/ #define ISFLAG(s) (strcmp(aa->name, (s))==0) IntNative main ( IntNative argc, Char *argv[] ) { Int32 i, j; Char *tmp; Cell *argList; Cell *aa; Bool decode; /*-- Be really really really paranoid :-) --*/ if (sizeof(Int32) != 4 || sizeof(UInt32) != 4 || sizeof(Int16) != 2 || sizeof(UInt16) != 2 || sizeof(Char) != 1 || sizeof(UChar) != 1) configError(); /*-- Initialise --*/ outputHandleJustInCase = NULL; smallMode = False; keepInputFiles = False; forceOverwrite = False; noisy = True; verbosity = 0; blockSize100k = 9; testFailsExist = False; unzFailsExist = False; numFileNames = 0; numFilesProcessed = 0; workFactor = 30; deleteOutputOnInterrupt = False; exitValue = 0; i = j = 0; /* avoid bogus warning from egcs-1.1.X */ /*-- Set up signal handlers for mem access errors --*/ signal (SIGSEGV, mySIGSEGVorSIGBUScatcher); # if BZ_UNIX # ifndef __DJGPP__ signal (SIGBUS, mySIGSEGVorSIGBUScatcher); # endif # endif copyFileName ( inName, "(none)" ); copyFileName ( outName, "(none)" ); copyFileName ( progNameReally, argv[0] ); progName = &progNameReally[0]; for (tmp = &progNameReally[0]; *tmp != '\0'; tmp++) if (*tmp == PATH_SEP) progName = tmp + 1; /*-- Copy flags from env var BZIP2, and expand filename wildcards in arg list. --*/ argList = NULL; addFlagsFromEnvVar ( &argList, "BZIP2" ); addFlagsFromEnvVar ( &argList, "BZIP" ); for (i = 1; i <= argc-1; i++) APPEND_FILESPEC(argList, argv[i]); /*-- Find the length of the longest filename --*/ longestFileName = 7; numFileNames = 0; decode = True; for (aa = argList; aa != NULL; aa = aa->link) { if (ISFLAG("--")) { decode = False; continue; } if (aa->name[0] == '-' && decode) continue; numFileNames++; if (longestFileName < (Int32)strlen(aa->name) ) longestFileName = (Int32)strlen(aa->name); } /*-- Determine source modes; flag handling may change this too. --*/ if (numFileNames == 0) srcMode = SM_I2O; else srcMode = SM_F2F; /*-- Determine what to do (compress/uncompress/test/cat). --*/ /*-- Note that subsequent flag handling may change this. --*/ opMode = OM_Z; if ( (strstr ( progName, "unzip" ) != 0) || (strstr ( progName, "UNZIP" ) != 0) ) opMode = OM_UNZ; if ( (strstr ( progName, "z2cat" ) != 0) || (strstr ( progName, "Z2CAT" ) != 0) || (strstr ( progName, "zcat" ) != 0) || (strstr ( progName, "ZCAT" ) != 0) ) { opMode = OM_UNZ; srcMode = (numFileNames == 0) ? SM_I2O : SM_F2O; } /*-- Look at the flags. --*/ for (aa = argList; aa != NULL; aa = aa->link) { if (ISFLAG("--")) break; if (aa->name[0] == '-' && aa->name[1] != '-') { for (j = 1; aa->name[j] != '\0'; j++) { switch (aa->name[j]) { case 'c': srcMode = SM_F2O; break; case 'd': opMode = OM_UNZ; break; case 'z': opMode = OM_Z; break; case 'f': forceOverwrite = True; break; case 't': opMode = OM_TEST; break; case 'k': keepInputFiles = True; break; case 's': smallMode = True; break; case 'q': noisy = False; break; case '1': blockSize100k = 1; break; case '2': blockSize100k = 2; break; case '3': blockSize100k = 3; break; case '4': blockSize100k = 4; break; case '5': blockSize100k = 5; break; case '6': blockSize100k = 6; break; case '7': blockSize100k = 7; break; case '8': blockSize100k = 8; break; case '9': blockSize100k = 9; break; case 'V': case 'L': license(); break; case 'v': verbosity++; break; case 'h': usage ( progName ); exit ( 0 ); break; default: fprintf ( stderr, "%s: Bad flag `%s'\n", progName, aa->name ); usage ( progName ); exit ( 1 ); break; } } } } /*-- And again ... --*/ for (aa = argList; aa != NULL; aa = aa->link) { if (ISFLAG("--")) break; if (ISFLAG("--stdout")) srcMode = SM_F2O; else if (ISFLAG("--decompress")) opMode = OM_UNZ; else if (ISFLAG("--compress")) opMode = OM_Z; else if (ISFLAG("--force")) forceOverwrite = True; else if (ISFLAG("--test")) opMode = OM_TEST; else if (ISFLAG("--keep")) keepInputFiles = True; else if (ISFLAG("--small")) smallMode = True; else if (ISFLAG("--quiet")) noisy = False; else if (ISFLAG("--version")) license(); else if (ISFLAG("--license")) license(); else if (ISFLAG("--exponential")) workFactor = 1; else if (ISFLAG("--repetitive-best")) redundant(aa->name); else if (ISFLAG("--repetitive-fast")) redundant(aa->name); else if (ISFLAG("--fast")) blockSize100k = 1; else if (ISFLAG("--best")) blockSize100k = 9; else if (ISFLAG("--verbose")) verbosity++; else if (ISFLAG("--help")) { usage ( progName ); exit ( 0 ); } else if (strncmp ( aa->name, "--", 2) == 0) { fprintf ( stderr, "%s: Bad flag `%s'\n", progName, aa->name ); usage ( progName ); exit ( 1 ); } } if (verbosity > 4) verbosity = 4; if (opMode == OM_Z && smallMode && blockSize100k > 2) blockSize100k = 2; if (opMode == OM_TEST && srcMode == SM_F2O) { fprintf ( stderr, "%s: -c and -t cannot be used together.\n", progName ); exit ( 1 ); } if (srcMode == SM_F2O && numFileNames == 0) srcMode = SM_I2O; if (opMode != OM_Z) blockSize100k = 0; if (srcMode == SM_F2F) { signal (SIGINT, mySignalCatcher); signal (SIGTERM, mySignalCatcher); # if BZ_UNIX signal (SIGHUP, mySignalCatcher); # endif } if (opMode == OM_Z) { if (srcMode == SM_I2O) { compress ( NULL ); } else { decode = True; for (aa = argList; aa != NULL; aa = aa->link) { if (ISFLAG("--")) { decode = False; continue; } if (aa->name[0] == '-' && decode) continue; numFilesProcessed++; compress ( aa->name ); } } } else if (opMode == OM_UNZ) { unzFailsExist = False; if (srcMode == SM_I2O) { uncompress ( NULL ); } else { decode = True; for (aa = argList; aa != NULL; aa = aa->link) { if (ISFLAG("--")) { decode = False; continue; } if (aa->name[0] == '-' && decode) continue; numFilesProcessed++; uncompress ( aa->name ); } } if (unzFailsExist) { setExit(2); exit(exitValue); } } else { testFailsExist = False; if (srcMode == SM_I2O) { testf ( NULL ); } else { decode = True; for (aa = argList; aa != NULL; aa = aa->link) { if (ISFLAG("--")) { decode = False; continue; } if (aa->name[0] == '-' && decode) continue; numFilesProcessed++; testf ( aa->name ); } } if (testFailsExist && noisy) { fprintf ( stderr, "\n" "You can use the `bzip2recover' program to attempt to recover\n" "data from undamaged sections of corrupted files.\n\n" ); setExit(2); exit(exitValue); } } /* Free the argument list memory to mollify leak detectors (eg) Purify, Checker. Serves no other useful purpose. */ aa = argList; while (aa != NULL) { Cell* aa2 = aa->link; if (aa->name != NULL) free(aa->name); free(aa); aa = aa2; } return exitValue; } /*-----------------------------------------------------------*/ /*--- end bzip2.c ---*/ /*-----------------------------------------------------------*/ microdc2-0.15.6/src/bzip2/bzlib.c0100644000076500007500000014002410516634226016443 0ustar chugunovmicrodc /*-------------------------------------------------------------*/ /*--- Library top-level functions. ---*/ /*--- bzlib.c ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ /*-- CHANGES ~~~~~~~ 0.9.0 -- original version. 0.9.0a/b -- no changes in this file. 0.9.0c * made zero-length BZ_FLUSH work correctly in bzCompress(). * fixed bzWrite/bzRead to ignore zero-length requests. * fixed bzread to correctly handle read requests after EOF. * wrong parameter order in call to bzDecompressInit in bzBuffToBuffDecompress. Fixed. --*/ #include "bzlib_private.h" /*---------------------------------------------------*/ /*--- Compression stuff ---*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ #ifndef BZ_NO_STDIO void BZ2_bz__AssertH__fail ( int errcode ) { fprintf(stderr, "\n\nbzip2/libbzip2: internal error number %d.\n" "This is a bug in bzip2/libbzip2, %s.\n" "Please report it to me at: jseward@bzip.org. If this happened\n" "when you were using some program which uses libbzip2 as a\n" "component, you should also report this bug to the author(s)\n" "of that program. Please make an effort to report this bug;\n" "timely and accurate bug reports eventually lead to higher\n" "quality software. Thanks. Julian Seward, 15 February 2005.\n\n", errcode, BZ2_bzlibVersion() ); if (errcode == 1007) { fprintf(stderr, "\n*** A special note about internal error number 1007 ***\n" "\n" "Experience suggests that a common cause of i.e. 1007\n" "is unreliable memory or other hardware. The 1007 assertion\n" "just happens to cross-check the results of huge numbers of\n" "memory reads/writes, and so acts (unintendedly) as a stress\n" "test of your memory system.\n" "\n" "I suggest the following: try compressing the file again,\n" "possibly monitoring progress in detail with the -vv flag.\n" "\n" "* If the error cannot be reproduced, and/or happens at different\n" " points in compression, you may have a flaky memory system.\n" " Try a memory-test program. I have used Memtest86\n" " (www.memtest86.com). At the time of writing it is free (GPLd).\n" " Memtest86 tests memory much more thorougly than your BIOSs\n" " power-on test, and may find failures that the BIOS doesn't.\n" "\n" "* If the error can be repeatably reproduced, this is a bug in\n" " bzip2, and I would very much like to hear about it. Please\n" " let me know, and, ideally, save a copy of the file causing the\n" " problem -- without which I will be unable to investigate it.\n" "\n" ); } exit(3); } #endif /*---------------------------------------------------*/ static int bz_config_ok ( void ) { if (sizeof(int) != 4) return 0; if (sizeof(short) != 2) return 0; if (sizeof(char) != 1) return 0; return 1; } /*---------------------------------------------------*/ static void* default_bzalloc ( void* opaque, Int32 items, Int32 size ) { void* v = malloc ( items * size ); return v; } static void default_bzfree ( void* opaque, void* addr ) { if (addr != NULL) free ( addr ); } /*---------------------------------------------------*/ static void prepare_new_block ( EState* s ) { Int32 i; s->nblock = 0; s->numZ = 0; s->state_out_pos = 0; BZ_INITIALISE_CRC ( s->blockCRC ); for (i = 0; i < 256; i++) s->inUse[i] = False; s->blockNo++; } /*---------------------------------------------------*/ static void init_RL ( EState* s ) { s->state_in_ch = 256; s->state_in_len = 0; } static Bool isempty_RL ( EState* s ) { if (s->state_in_ch < 256 && s->state_in_len > 0) return False; else return True; } /*---------------------------------------------------*/ int BZ_API(BZ2_bzCompressInit) ( bz_stream* strm, int blockSize100k, int verbosity, int workFactor ) { Int32 n; EState* s; if (!bz_config_ok()) return BZ_CONFIG_ERROR; if (strm == NULL || blockSize100k < 1 || blockSize100k > 9 || workFactor < 0 || workFactor > 250) return BZ_PARAM_ERROR; if (workFactor == 0) workFactor = 30; if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; if (strm->bzfree == NULL) strm->bzfree = default_bzfree; s = BZALLOC( sizeof(EState) ); if (s == NULL) return BZ_MEM_ERROR; s->strm = strm; s->arr1 = NULL; s->arr2 = NULL; s->ftab = NULL; n = 100000 * blockSize100k; s->arr1 = BZALLOC( n * sizeof(UInt32) ); s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) ); s->ftab = BZALLOC( 65537 * sizeof(UInt32) ); if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) { if (s->arr1 != NULL) BZFREE(s->arr1); if (s->arr2 != NULL) BZFREE(s->arr2); if (s->ftab != NULL) BZFREE(s->ftab); if (s != NULL) BZFREE(s); return BZ_MEM_ERROR; } s->blockNo = 0; s->state = BZ_S_INPUT; s->mode = BZ_M_RUNNING; s->combinedCRC = 0; s->blockSize100k = blockSize100k; s->nblockMAX = 100000 * blockSize100k - 19; s->verbosity = verbosity; s->workFactor = workFactor; s->block = (UChar*)s->arr2; s->mtfv = (UInt16*)s->arr1; s->zbits = NULL; s->ptr = (UInt32*)s->arr1; strm->state = s; strm->total_in_lo32 = 0; strm->total_in_hi32 = 0; strm->total_out_lo32 = 0; strm->total_out_hi32 = 0; init_RL ( s ); prepare_new_block ( s ); return BZ_OK; } /*---------------------------------------------------*/ static void add_pair_to_block ( EState* s ) { Int32 i; UChar ch = (UChar)(s->state_in_ch); for (i = 0; i < s->state_in_len; i++) { BZ_UPDATE_CRC( s->blockCRC, ch ); } s->inUse[s->state_in_ch] = True; switch (s->state_in_len) { case 1: s->block[s->nblock] = (UChar)ch; s->nblock++; break; case 2: s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; break; case 3: s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; break; default: s->inUse[s->state_in_len-4] = True; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = (UChar)ch; s->nblock++; s->block[s->nblock] = ((UChar)(s->state_in_len-4)); s->nblock++; break; } } /*---------------------------------------------------*/ static void flush_RL ( EState* s ) { if (s->state_in_ch < 256) add_pair_to_block ( s ); init_RL ( s ); } /*---------------------------------------------------*/ #define ADD_CHAR_TO_BLOCK(zs,zchh0) \ { \ UInt32 zchh = (UInt32)(zchh0); \ /*-- fast track the common case --*/ \ if (zchh != zs->state_in_ch && \ zs->state_in_len == 1) { \ UChar ch = (UChar)(zs->state_in_ch); \ BZ_UPDATE_CRC( zs->blockCRC, ch ); \ zs->inUse[zs->state_in_ch] = True; \ zs->block[zs->nblock] = (UChar)ch; \ zs->nblock++; \ zs->state_in_ch = zchh; \ } \ else \ /*-- general, uncommon cases --*/ \ if (zchh != zs->state_in_ch || \ zs->state_in_len == 255) { \ if (zs->state_in_ch < 256) \ add_pair_to_block ( zs ); \ zs->state_in_ch = zchh; \ zs->state_in_len = 1; \ } else { \ zs->state_in_len++; \ } \ } /*---------------------------------------------------*/ static Bool copy_input_until_stop ( EState* s ) { Bool progress_in = False; if (s->mode == BZ_M_RUNNING) { /*-- fast track the common case --*/ while (True) { /*-- block full? --*/ if (s->nblock >= s->nblockMAX) break; /*-- no input? --*/ if (s->strm->avail_in == 0) break; progress_in = True; ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); s->strm->next_in++; s->strm->avail_in--; s->strm->total_in_lo32++; if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; } } else { /*-- general, uncommon case --*/ while (True) { /*-- block full? --*/ if (s->nblock >= s->nblockMAX) break; /*-- no input? --*/ if (s->strm->avail_in == 0) break; /*-- flush/finish end? --*/ if (s->avail_in_expect == 0) break; progress_in = True; ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); s->strm->next_in++; s->strm->avail_in--; s->strm->total_in_lo32++; if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++; s->avail_in_expect--; } } return progress_in; } /*---------------------------------------------------*/ static Bool copy_output_until_stop ( EState* s ) { Bool progress_out = False; while (True) { /*-- no output space? --*/ if (s->strm->avail_out == 0) break; /*-- block done? --*/ if (s->state_out_pos >= s->numZ) break; progress_out = True; *(s->strm->next_out) = s->zbits[s->state_out_pos]; s->state_out_pos++; s->strm->avail_out--; s->strm->next_out++; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } return progress_out; } /*---------------------------------------------------*/ static Bool handle_compress ( bz_stream* strm ) { Bool progress_in = False; Bool progress_out = False; EState* s = strm->state; while (True) { if (s->state == BZ_S_OUTPUT) { progress_out |= copy_output_until_stop ( s ); if (s->state_out_pos < s->numZ) break; if (s->mode == BZ_M_FINISHING && s->avail_in_expect == 0 && isempty_RL(s)) break; prepare_new_block ( s ); s->state = BZ_S_INPUT; if (s->mode == BZ_M_FLUSHING && s->avail_in_expect == 0 && isempty_RL(s)) break; } if (s->state == BZ_S_INPUT) { progress_in |= copy_input_until_stop ( s ); if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) { flush_RL ( s ); BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) ); s->state = BZ_S_OUTPUT; } else if (s->nblock >= s->nblockMAX) { BZ2_compressBlock ( s, False ); s->state = BZ_S_OUTPUT; } else if (s->strm->avail_in == 0) { break; } } } return progress_in || progress_out; } /*---------------------------------------------------*/ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) { Bool progress; EState* s; if (strm == NULL) return BZ_PARAM_ERROR; s = strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; preswitch: switch (s->mode) { case BZ_M_IDLE: return BZ_SEQUENCE_ERROR; case BZ_M_RUNNING: if (action == BZ_RUN) { progress = handle_compress ( strm ); return progress ? BZ_RUN_OK : BZ_PARAM_ERROR; } else if (action == BZ_FLUSH) { s->avail_in_expect = strm->avail_in; s->mode = BZ_M_FLUSHING; goto preswitch; } else if (action == BZ_FINISH) { s->avail_in_expect = strm->avail_in; s->mode = BZ_M_FINISHING; goto preswitch; } else return BZ_PARAM_ERROR; case BZ_M_FLUSHING: if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR; if (s->avail_in_expect != s->strm->avail_in) return BZ_SEQUENCE_ERROR; progress = handle_compress ( strm ); if (s->avail_in_expect > 0 || !isempty_RL(s) || s->state_out_pos < s->numZ) return BZ_FLUSH_OK; s->mode = BZ_M_RUNNING; return BZ_RUN_OK; case BZ_M_FINISHING: if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR; if (s->avail_in_expect != s->strm->avail_in) return BZ_SEQUENCE_ERROR; progress = handle_compress ( strm ); if (!progress) return BZ_SEQUENCE_ERROR; if (s->avail_in_expect > 0 || !isempty_RL(s) || s->state_out_pos < s->numZ) return BZ_FINISH_OK; s->mode = BZ_M_IDLE; return BZ_STREAM_END; } return BZ_OK; /*--not reached--*/ } /*---------------------------------------------------*/ int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) { EState* s; if (strm == NULL) return BZ_PARAM_ERROR; s = strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; if (s->arr1 != NULL) BZFREE(s->arr1); if (s->arr2 != NULL) BZFREE(s->arr2); if (s->ftab != NULL) BZFREE(s->ftab); BZFREE(strm->state); strm->state = NULL; return BZ_OK; } /*---------------------------------------------------*/ /*--- Decompression stuff ---*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ int BZ_API(BZ2_bzDecompressInit) ( bz_stream* strm, int verbosity, int small ) { DState* s; if (!bz_config_ok()) return BZ_CONFIG_ERROR; if (strm == NULL) return BZ_PARAM_ERROR; if (small != 0 && small != 1) return BZ_PARAM_ERROR; if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR; if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; if (strm->bzfree == NULL) strm->bzfree = default_bzfree; s = BZALLOC( sizeof(DState) ); if (s == NULL) return BZ_MEM_ERROR; s->strm = strm; strm->state = s; s->state = BZ_X_MAGIC_1; s->bsLive = 0; s->bsBuff = 0; s->calculatedCombinedCRC = 0; strm->total_in_lo32 = 0; strm->total_in_hi32 = 0; strm->total_out_lo32 = 0; strm->total_out_hi32 = 0; s->smallDecompress = (Bool)small; s->ll4 = NULL; s->ll16 = NULL; s->tt = NULL; s->currBlockNo = 0; s->verbosity = verbosity; return BZ_OK; } /*---------------------------------------------------*/ /* Return True iff data corruption is discovered. Returns False if there is no problem. */ static Bool unRLE_obuf_to_output_FAST ( DState* s ) { UChar k1; if (s->blockRandomised) { while (True) { /* try to finish existing run */ while (True) { if (s->strm->avail_out == 0) return False; if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); s->state_out_len--; s->strm->next_out++; s->strm->avail_out--; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } /* can a new run be started? */ if (s->nblock_used == s->save_nblock+1) return False; /* Only caused by corrupt data stream? */ if (s->nblock_used > s->save_nblock+1) return True; s->state_out_len = 1; s->state_out_ch = s->k0; BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 2; BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 3; BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; s->nblock_used++; } } else { /* restore */ UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC; UChar c_state_out_ch = s->state_out_ch; Int32 c_state_out_len = s->state_out_len; Int32 c_nblock_used = s->nblock_used; Int32 c_k0 = s->k0; UInt32* c_tt = s->tt; UInt32 c_tPos = s->tPos; char* cs_next_out = s->strm->next_out; unsigned int cs_avail_out = s->strm->avail_out; /* end restore */ UInt32 avail_out_INIT = cs_avail_out; Int32 s_save_nblockPP = s->save_nblock+1; unsigned int total_out_lo32_old; while (True) { /* try to finish existing run */ if (c_state_out_len > 0) { while (True) { if (cs_avail_out == 0) goto return_notr; if (c_state_out_len == 1) break; *( (UChar*)(cs_next_out) ) = c_state_out_ch; BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); c_state_out_len--; cs_next_out++; cs_avail_out--; } s_state_out_len_eq_one: { if (cs_avail_out == 0) { c_state_out_len = 1; goto return_notr; }; *( (UChar*)(cs_next_out) ) = c_state_out_ch; BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); cs_next_out++; cs_avail_out--; } } /* Only caused by corrupt data stream? */ if (c_nblock_used > s_save_nblockPP) return True; /* can a new run be started? */ if (c_nblock_used == s_save_nblockPP) { c_state_out_len = 0; goto return_notr; }; c_state_out_ch = c_k0; BZ_GET_FAST_C(k1); c_nblock_used++; if (k1 != c_k0) { c_k0 = k1; goto s_state_out_len_eq_one; }; if (c_nblock_used == s_save_nblockPP) goto s_state_out_len_eq_one; c_state_out_len = 2; BZ_GET_FAST_C(k1); c_nblock_used++; if (c_nblock_used == s_save_nblockPP) continue; if (k1 != c_k0) { c_k0 = k1; continue; }; c_state_out_len = 3; BZ_GET_FAST_C(k1); c_nblock_used++; if (c_nblock_used == s_save_nblockPP) continue; if (k1 != c_k0) { c_k0 = k1; continue; }; BZ_GET_FAST_C(k1); c_nblock_used++; c_state_out_len = ((Int32)k1) + 4; BZ_GET_FAST_C(c_k0); c_nblock_used++; } return_notr: total_out_lo32_old = s->strm->total_out_lo32; s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out); if (s->strm->total_out_lo32 < total_out_lo32_old) s->strm->total_out_hi32++; /* save */ s->calculatedBlockCRC = c_calculatedBlockCRC; s->state_out_ch = c_state_out_ch; s->state_out_len = c_state_out_len; s->nblock_used = c_nblock_used; s->k0 = c_k0; s->tt = c_tt; s->tPos = c_tPos; s->strm->next_out = cs_next_out; s->strm->avail_out = cs_avail_out; /* end save */ } return False; } /*---------------------------------------------------*/ __inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab ) { Int32 nb, na, mid; nb = 0; na = 256; do { mid = (nb + na) >> 1; if (indx >= cftab[mid]) nb = mid; else na = mid; } while (na - nb != 1); return nb; } /*---------------------------------------------------*/ /* Return True iff data corruption is discovered. Returns False if there is no problem. */ static Bool unRLE_obuf_to_output_SMALL ( DState* s ) { UChar k1; if (s->blockRandomised) { while (True) { /* try to finish existing run */ while (True) { if (s->strm->avail_out == 0) return False; if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); s->state_out_len--; s->strm->next_out++; s->strm->avail_out--; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } /* can a new run be started? */ if (s->nblock_used == s->save_nblock+1) return False; /* Only caused by corrupt data stream? */ if (s->nblock_used > s->save_nblock+1) return True; s->state_out_len = 1; s->state_out_ch = s->k0; BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 2; BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 3; BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; k1 ^= BZ_RAND_MASK; s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; s->nblock_used++; } } else { while (True) { /* try to finish existing run */ while (True) { if (s->strm->avail_out == 0) return False; if (s->state_out_len == 0) break; *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); s->state_out_len--; s->strm->next_out++; s->strm->avail_out--; s->strm->total_out_lo32++; if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; } /* can a new run be started? */ if (s->nblock_used == s->save_nblock+1) return False; /* Only caused by corrupt data stream? */ if (s->nblock_used > s->save_nblock+1) return True; s->state_out_len = 1; s->state_out_ch = s->k0; BZ_GET_SMALL(k1); s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 2; BZ_GET_SMALL(k1); s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; s->state_out_len = 3; BZ_GET_SMALL(k1); s->nblock_used++; if (s->nblock_used == s->save_nblock+1) continue; if (k1 != s->k0) { s->k0 = k1; continue; }; BZ_GET_SMALL(k1); s->nblock_used++; s->state_out_len = ((Int32)k1) + 4; BZ_GET_SMALL(s->k0); s->nblock_used++; } } } /*---------------------------------------------------*/ int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) { Bool corrupt; DState* s; if (strm == NULL) return BZ_PARAM_ERROR; s = strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; while (True) { if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR; if (s->state == BZ_X_OUTPUT) { if (s->smallDecompress) corrupt = unRLE_obuf_to_output_SMALL ( s ); else corrupt = unRLE_obuf_to_output_FAST ( s ); if (corrupt) return BZ_DATA_ERROR; if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) { BZ_FINALISE_CRC ( s->calculatedBlockCRC ); if (s->verbosity >= 3) VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC, s->calculatedBlockCRC ); if (s->verbosity >= 2) VPrintf0 ( "]" ); if (s->calculatedBlockCRC != s->storedBlockCRC) return BZ_DATA_ERROR; s->calculatedCombinedCRC = (s->calculatedCombinedCRC << 1) | (s->calculatedCombinedCRC >> 31); s->calculatedCombinedCRC ^= s->calculatedBlockCRC; s->state = BZ_X_BLKHDR_1; } else { return BZ_OK; } } if (s->state >= BZ_X_MAGIC_1) { Int32 r = BZ2_decompress ( s ); if (r == BZ_STREAM_END) { if (s->verbosity >= 3) VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x", s->storedCombinedCRC, s->calculatedCombinedCRC ); if (s->calculatedCombinedCRC != s->storedCombinedCRC) return BZ_DATA_ERROR; return r; } if (s->state != BZ_X_OUTPUT) return r; } } AssertH ( 0, 6001 ); return 0; /*NOTREACHED*/ } /*---------------------------------------------------*/ int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) { DState* s; if (strm == NULL) return BZ_PARAM_ERROR; s = strm->state; if (s == NULL) return BZ_PARAM_ERROR; if (s->strm != strm) return BZ_PARAM_ERROR; if (s->tt != NULL) BZFREE(s->tt); if (s->ll16 != NULL) BZFREE(s->ll16); if (s->ll4 != NULL) BZFREE(s->ll4); BZFREE(strm->state); strm->state = NULL; return BZ_OK; } #ifndef BZ_NO_STDIO /*---------------------------------------------------*/ /*--- File I/O stuff ---*/ /*---------------------------------------------------*/ #define BZ_SETERR(eee) \ { \ if (bzerror != NULL) *bzerror = eee; \ if (bzf != NULL) bzf->lastErr = eee; \ } typedef struct { FILE* handle; Char buf[BZ_MAX_UNUSED]; Int32 bufN; Bool writing; bz_stream strm; Int32 lastErr; Bool initialisedOk; } bzFile; /*---------------------------------------------*/ static Bool myfeof ( FILE* f ) { Int32 c = fgetc ( f ); if (c == EOF) return True; ungetc ( c, f ); return False; } /*---------------------------------------------------*/ BZFILE* BZ_API(BZ2_bzWriteOpen) ( int* bzerror, FILE* f, int blockSize100k, int verbosity, int workFactor ) { Int32 ret; bzFile* bzf = NULL; BZ_SETERR(BZ_OK); if (f == NULL || (blockSize100k < 1 || blockSize100k > 9) || (workFactor < 0 || workFactor > 250) || (verbosity < 0 || verbosity > 4)) { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; if (ferror(f)) { BZ_SETERR(BZ_IO_ERROR); return NULL; }; bzf = malloc ( sizeof(bzFile) ); if (bzf == NULL) { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; BZ_SETERR(BZ_OK); bzf->initialisedOk = False; bzf->bufN = 0; bzf->handle = f; bzf->writing = True; bzf->strm.bzalloc = NULL; bzf->strm.bzfree = NULL; bzf->strm.opaque = NULL; if (workFactor == 0) workFactor = 30; ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, verbosity, workFactor ); if (ret != BZ_OK) { BZ_SETERR(ret); free(bzf); return NULL; }; bzf->strm.avail_in = 0; bzf->initialisedOk = True; return bzf; } /*---------------------------------------------------*/ void BZ_API(BZ2_bzWrite) ( int* bzerror, BZFILE* b, void* buf, int len ) { Int32 n, n2, ret; bzFile* bzf = (bzFile*)b; BZ_SETERR(BZ_OK); if (bzf == NULL || buf == NULL || len < 0) { BZ_SETERR(BZ_PARAM_ERROR); return; }; if (!(bzf->writing)) { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; if (len == 0) { BZ_SETERR(BZ_OK); return; }; bzf->strm.avail_in = len; bzf->strm.next_in = buf; while (True) { bzf->strm.avail_out = BZ_MAX_UNUSED; bzf->strm.next_out = bzf->buf; ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); if (ret != BZ_RUN_OK) { BZ_SETERR(ret); return; }; if (bzf->strm.avail_out < BZ_MAX_UNUSED) { n = BZ_MAX_UNUSED - bzf->strm.avail_out; n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), n, bzf->handle ); if (n != n2 || ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; } if (bzf->strm.avail_in == 0) { BZ_SETERR(BZ_OK); return; }; } } /*---------------------------------------------------*/ void BZ_API(BZ2_bzWriteClose) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in, unsigned int* nbytes_out ) { BZ2_bzWriteClose64 ( bzerror, b, abandon, nbytes_in, NULL, nbytes_out, NULL ); } void BZ_API(BZ2_bzWriteClose64) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in_lo32, unsigned int* nbytes_in_hi32, unsigned int* nbytes_out_lo32, unsigned int* nbytes_out_hi32 ) { Int32 n, n2, ret; bzFile* bzf = (bzFile*)b; if (bzf == NULL) { BZ_SETERR(BZ_OK); return; }; if (!(bzf->writing)) { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0; if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0; if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0; if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0; if ((!abandon) && bzf->lastErr == BZ_OK) { while (True) { bzf->strm.avail_out = BZ_MAX_UNUSED; bzf->strm.next_out = bzf->buf; ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END) { BZ_SETERR(ret); return; }; if (bzf->strm.avail_out < BZ_MAX_UNUSED) { n = BZ_MAX_UNUSED - bzf->strm.avail_out; n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), n, bzf->handle ); if (n != n2 || ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; } if (ret == BZ_STREAM_END) break; } } if ( !abandon && !ferror ( bzf->handle ) ) { fflush ( bzf->handle ); if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return; }; } if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = bzf->strm.total_in_lo32; if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = bzf->strm.total_in_hi32; if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = bzf->strm.total_out_lo32; if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = bzf->strm.total_out_hi32; BZ_SETERR(BZ_OK); BZ2_bzCompressEnd ( &(bzf->strm) ); free ( bzf ); } /*---------------------------------------------------*/ BZFILE* BZ_API(BZ2_bzReadOpen) ( int* bzerror, FILE* f, int verbosity, int small, void* unused, int nUnused ) { bzFile* bzf = NULL; int ret; BZ_SETERR(BZ_OK); if (f == NULL || (small != 0 && small != 1) || (verbosity < 0 || verbosity > 4) || (unused == NULL && nUnused != 0) || (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED))) { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; if (ferror(f)) { BZ_SETERR(BZ_IO_ERROR); return NULL; }; bzf = malloc ( sizeof(bzFile) ); if (bzf == NULL) { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; BZ_SETERR(BZ_OK); bzf->initialisedOk = False; bzf->handle = f; bzf->bufN = 0; bzf->writing = False; bzf->strm.bzalloc = NULL; bzf->strm.bzfree = NULL; bzf->strm.opaque = NULL; while (nUnused > 0) { bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; unused = ((void*)( 1 + ((UChar*)(unused)) )); nUnused--; } ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); if (ret != BZ_OK) { BZ_SETERR(ret); free(bzf); return NULL; }; bzf->strm.avail_in = bzf->bufN; bzf->strm.next_in = bzf->buf; bzf->initialisedOk = True; return bzf; } /*---------------------------------------------------*/ void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b ) { bzFile* bzf = (bzFile*)b; BZ_SETERR(BZ_OK); if (bzf == NULL) { BZ_SETERR(BZ_OK); return; }; if (bzf->writing) { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; if (bzf->initialisedOk) (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); free ( bzf ); } /*---------------------------------------------------*/ int BZ_API(BZ2_bzRead) ( int* bzerror, BZFILE* b, void* buf, int len ) { Int32 n, ret; bzFile* bzf = (bzFile*)b; BZ_SETERR(BZ_OK); if (bzf == NULL || buf == NULL || len < 0) { BZ_SETERR(BZ_PARAM_ERROR); return 0; }; if (bzf->writing) { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; }; if (len == 0) { BZ_SETERR(BZ_OK); return 0; }; bzf->strm.avail_out = len; bzf->strm.next_out = buf; while (True) { if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return 0; }; if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { n = fread ( bzf->buf, sizeof(UChar), BZ_MAX_UNUSED, bzf->handle ); if (ferror(bzf->handle)) { BZ_SETERR(BZ_IO_ERROR); return 0; }; bzf->bufN = n; bzf->strm.avail_in = bzf->bufN; bzf->strm.next_in = bzf->buf; } ret = BZ2_bzDecompress ( &(bzf->strm) ); if (ret != BZ_OK && ret != BZ_STREAM_END) { BZ_SETERR(ret); return 0; }; if (ret == BZ_OK && myfeof(bzf->handle) && bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; }; if (ret == BZ_STREAM_END) { BZ_SETERR(BZ_STREAM_END); return len - bzf->strm.avail_out; }; if (bzf->strm.avail_out == 0) { BZ_SETERR(BZ_OK); return len; }; } return 0; /*not reached*/ } /*---------------------------------------------------*/ void BZ_API(BZ2_bzReadGetUnused) ( int* bzerror, BZFILE* b, void** unused, int* nUnused ) { bzFile* bzf = (bzFile*)b; if (bzf == NULL) { BZ_SETERR(BZ_PARAM_ERROR); return; }; if (bzf->lastErr != BZ_STREAM_END) { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; if (unused == NULL || nUnused == NULL) { BZ_SETERR(BZ_PARAM_ERROR); return; }; BZ_SETERR(BZ_OK); *nUnused = bzf->strm.avail_in; *unused = bzf->strm.next_in; } #endif /*---------------------------------------------------*/ /*--- Misc convenience stuff ---*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ int BZ_API(BZ2_bzBuffToBuffCompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int blockSize100k, int verbosity, int workFactor ) { bz_stream strm; int ret; if (dest == NULL || destLen == NULL || source == NULL || blockSize100k < 1 || blockSize100k > 9 || verbosity < 0 || verbosity > 4 || workFactor < 0 || workFactor > 250) return BZ_PARAM_ERROR; if (workFactor == 0) workFactor = 30; strm.bzalloc = NULL; strm.bzfree = NULL; strm.opaque = NULL; ret = BZ2_bzCompressInit ( &strm, blockSize100k, verbosity, workFactor ); if (ret != BZ_OK) return ret; strm.next_in = source; strm.next_out = dest; strm.avail_in = sourceLen; strm.avail_out = *destLen; ret = BZ2_bzCompress ( &strm, BZ_FINISH ); if (ret == BZ_FINISH_OK) goto output_overflow; if (ret != BZ_STREAM_END) goto errhandler; /* normal termination */ *destLen -= strm.avail_out; BZ2_bzCompressEnd ( &strm ); return BZ_OK; output_overflow: BZ2_bzCompressEnd ( &strm ); return BZ_OUTBUFF_FULL; errhandler: BZ2_bzCompressEnd ( &strm ); return ret; } /*---------------------------------------------------*/ int BZ_API(BZ2_bzBuffToBuffDecompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int small, int verbosity ) { bz_stream strm; int ret; if (dest == NULL || destLen == NULL || source == NULL || (small != 0 && small != 1) || verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR; strm.bzalloc = NULL; strm.bzfree = NULL; strm.opaque = NULL; ret = BZ2_bzDecompressInit ( &strm, verbosity, small ); if (ret != BZ_OK) return ret; strm.next_in = source; strm.next_out = dest; strm.avail_in = sourceLen; strm.avail_out = *destLen; ret = BZ2_bzDecompress ( &strm ); if (ret == BZ_OK) goto output_overflow_or_eof; if (ret != BZ_STREAM_END) goto errhandler; /* normal termination */ *destLen -= strm.avail_out; BZ2_bzDecompressEnd ( &strm ); return BZ_OK; output_overflow_or_eof: if (strm.avail_out > 0) { BZ2_bzDecompressEnd ( &strm ); return BZ_UNEXPECTED_EOF; } else { BZ2_bzDecompressEnd ( &strm ); return BZ_OUTBUFF_FULL; }; errhandler: BZ2_bzDecompressEnd ( &strm ); return ret; } /*---------------------------------------------------*/ /*-- Code contributed by Yoshioka Tsuneo (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp), to support better zlib compatibility. This code is not _officially_ part of libbzip2 (yet); I haven't tested it, documented it, or considered the threading-safeness of it. If this code breaks, please contact both Yoshioka and me. --*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ /*-- return version like "0.9.0c". --*/ const char * BZ_API(BZ2_bzlibVersion)(void) { return BZ_VERSION; } #ifndef BZ_NO_STDIO /*---------------------------------------------------*/ #if defined(_WIN32) || defined(OS2) || defined(MSDOS) # include # include # define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY) #else # define SET_BINARY_MODE(file) #endif static BZFILE * bzopen_or_bzdopen ( const char *path, /* no use when bzdopen */ int fd, /* no use when bzdopen */ const char *mode, int open_mode) /* bzopen: 0, bzdopen:1 */ { int bzerr; char unused[BZ_MAX_UNUSED]; int blockSize100k = 9; int writing = 0; char mode2[10] = ""; FILE *fp = NULL; BZFILE *bzfp = NULL; int verbosity = 0; int workFactor = 30; int smallMode = 0; int nUnused = 0; if (mode == NULL) return NULL; while (*mode) { switch (*mode) { case 'r': writing = 0; break; case 'w': writing = 1; break; case 's': smallMode = 1; break; default: if (isdigit((int)(*mode))) { blockSize100k = *mode-BZ_HDR_0; } } mode++; } strcat(mode2, writing ? "w" : "r" ); strcat(mode2,"b"); /* binary mode */ if (open_mode==0) { if (path==NULL || strcmp(path,"")==0) { fp = (writing ? stdout : stdin); SET_BINARY_MODE(fp); } else { fp = fopen(path,mode2); } } else { #ifdef BZ_STRICT_ANSI fp = NULL; #else fp = fdopen(fd,mode2); #endif } if (fp == NULL) return NULL; if (writing) { /* Guard against total chaos and anarchy -- JRS */ if (blockSize100k < 1) blockSize100k = 1; if (blockSize100k > 9) blockSize100k = 9; bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k, verbosity,workFactor); } else { bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode, unused,nUnused); } if (bzfp == NULL) { if (fp != stdin && fp != stdout) fclose(fp); return NULL; } return bzfp; } /*---------------------------------------------------*/ /*-- open file for read or write. ex) bzopen("file","w9") case path="" or NULL => use stdin or stdout. --*/ BZFILE * BZ_API(BZ2_bzopen) ( const char *path, const char *mode ) { return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0); } /*---------------------------------------------------*/ BZFILE * BZ_API(BZ2_bzdopen) ( int fd, const char *mode ) { return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1); } /*---------------------------------------------------*/ int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len ) { int bzerr, nread; if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0; nread = BZ2_bzRead(&bzerr,b,buf,len); if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) { return nread; } else { return -1; } } /*---------------------------------------------------*/ int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len ) { int bzerr; BZ2_bzWrite(&bzerr,b,buf,len); if(bzerr == BZ_OK){ return len; }else{ return -1; } } /*---------------------------------------------------*/ int BZ_API(BZ2_bzflush) (BZFILE *b) { /* do nothing now... */ return 0; } /*---------------------------------------------------*/ void BZ_API(BZ2_bzclose) (BZFILE* b) { int bzerr; FILE *fp = ((bzFile *)b)->handle; if (b==NULL) {return;} if(((bzFile*)b)->writing){ BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL); if(bzerr != BZ_OK){ BZ2_bzWriteClose(NULL,b,1,NULL,NULL); } }else{ BZ2_bzReadClose(&bzerr,b); } if(fp!=stdin && fp!=stdout){ fclose(fp); } } /*---------------------------------------------------*/ /*-- return last error code --*/ static char *bzerrorstrings[] = { "OK" ,"SEQUENCE_ERROR" ,"PARAM_ERROR" ,"MEM_ERROR" ,"DATA_ERROR" ,"DATA_ERROR_MAGIC" ,"IO_ERROR" ,"UNEXPECTED_EOF" ,"OUTBUFF_FULL" ,"CONFIG_ERROR" ,"???" /* for future */ ,"???" /* for future */ ,"???" /* for future */ ,"???" /* for future */ ,"???" /* for future */ ,"???" /* for future */ }; const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum) { int err = ((bzFile *)b)->lastErr; if(err>0) err = 0; *errnum = err; return bzerrorstrings[err*-1]; } #endif /*-------------------------------------------------------------*/ /*--- end bzlib.c ---*/ /*-------------------------------------------------------------*/ microdc2-0.15.6/src/bzip2/bzlib.h0100644000076500007500000001777010516634226016463 0ustar chugunovmicrodc /*-------------------------------------------------------------*/ /*--- Public header file for the library. ---*/ /*--- bzlib.h ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ #ifndef _BZLIB_H #define _BZLIB_H #ifdef __cplusplus extern "C" { #endif #define BZ_RUN 0 #define BZ_FLUSH 1 #define BZ_FINISH 2 #define BZ_OK 0 #define BZ_RUN_OK 1 #define BZ_FLUSH_OK 2 #define BZ_FINISH_OK 3 #define BZ_STREAM_END 4 #define BZ_SEQUENCE_ERROR (-1) #define BZ_PARAM_ERROR (-2) #define BZ_MEM_ERROR (-3) #define BZ_DATA_ERROR (-4) #define BZ_DATA_ERROR_MAGIC (-5) #define BZ_IO_ERROR (-6) #define BZ_UNEXPECTED_EOF (-7) #define BZ_OUTBUFF_FULL (-8) #define BZ_CONFIG_ERROR (-9) typedef struct { char *next_in; unsigned int avail_in; unsigned int total_in_lo32; unsigned int total_in_hi32; char *next_out; unsigned int avail_out; unsigned int total_out_lo32; unsigned int total_out_hi32; void *state; void *(*bzalloc)(void *,int,int); void (*bzfree)(void *,void *); void *opaque; } bz_stream; #ifndef BZ_IMPORT #define BZ_EXPORT #endif #ifndef BZ_NO_STDIO /* Need a definitition for FILE */ #include #endif #ifdef _WIN32 # include # ifdef small /* windows.h define small to char */ # undef small # endif # ifdef BZ_EXPORT # define BZ_API(func) WINAPI func # define BZ_EXTERN extern # else /* import windows dll dynamically */ # define BZ_API(func) (WINAPI * func) # define BZ_EXTERN # endif #else # define BZ_API(func) func # define BZ_EXTERN extern #endif /*-- Core (low-level) library functions --*/ BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( bz_stream* strm, int blockSize100k, int verbosity, int workFactor ); BZ_EXTERN int BZ_API(BZ2_bzCompress) ( bz_stream* strm, int action ); BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( bz_stream* strm ); BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( bz_stream *strm, int verbosity, int small ); BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( bz_stream* strm ); BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ); /*-- High(er) level library functions --*/ #ifndef BZ_NO_STDIO #define BZ_MAX_UNUSED 5000 typedef void BZFILE; BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( int* bzerror, FILE* f, int verbosity, int small, void* unused, int nUnused ); BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( int* bzerror, BZFILE* b ); BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( int* bzerror, BZFILE* b, void** unused, int* nUnused ); BZ_EXTERN int BZ_API(BZ2_bzRead) ( int* bzerror, BZFILE* b, void* buf, int len ); BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( int* bzerror, FILE* f, int blockSize100k, int verbosity, int workFactor ); BZ_EXTERN void BZ_API(BZ2_bzWrite) ( int* bzerror, BZFILE* b, void* buf, int len ); BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in, unsigned int* nbytes_out ); BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( int* bzerror, BZFILE* b, int abandon, unsigned int* nbytes_in_lo32, unsigned int* nbytes_in_hi32, unsigned int* nbytes_out_lo32, unsigned int* nbytes_out_hi32 ); #endif /*-- Utility functions --*/ BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int blockSize100k, int verbosity, int workFactor ); BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int small, int verbosity ); /*-- Code contributed by Yoshioka Tsuneo (QWF00133@niftyserve.or.jp/tsuneo-y@is.aist-nara.ac.jp), to support better zlib compatibility. This code is not _officially_ part of libbzip2 (yet); I haven't tested it, documented it, or considered the threading-safeness of it. If this code breaks, please contact both Yoshioka and me. --*/ BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( void ); #ifndef BZ_NO_STDIO BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( const char *path, const char *mode ); BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( int fd, const char *mode ); BZ_EXTERN int BZ_API(BZ2_bzread) ( BZFILE* b, void* buf, int len ); BZ_EXTERN int BZ_API(BZ2_bzwrite) ( BZFILE* b, void* buf, int len ); BZ_EXTERN int BZ_API(BZ2_bzflush) ( BZFILE* b ); BZ_EXTERN void BZ_API(BZ2_bzclose) ( BZFILE* b ); BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( BZFILE *b, int *errnum ); #endif #ifdef __cplusplus } #endif #endif /*-------------------------------------------------------------*/ /*--- end bzlib.h ---*/ /*-------------------------------------------------------------*/ microdc2-0.15.6/src/bzip2/bzlib_private.h0100644000076500007500000003471210516634226020210 0ustar chugunovmicrodc /*-------------------------------------------------------------*/ /*--- Private header file for the library. ---*/ /*--- bzlib_private.h ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ #ifndef _BZLIB_PRIVATE_H #define _BZLIB_PRIVATE_H #include #ifndef BZ_NO_STDIO #include #include #include #endif #include "bzlib.h" /*-- General stuff. --*/ #define BZ_VERSION "1.0.3, 15-Feb-2005" typedef char Char; typedef unsigned char Bool; typedef unsigned char UChar; typedef int Int32; typedef unsigned int UInt32; typedef short Int16; typedef unsigned short UInt16; #define True ((Bool)1) #define False ((Bool)0) #ifndef __GNUC__ #define __inline__ /* */ #endif #ifndef BZ_NO_STDIO extern void BZ2_bz__AssertH__fail ( int errcode ); #define AssertH(cond,errcode) \ { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); } #if BZ_DEBUG #define AssertD(cond,msg) \ { if (!(cond)) { \ fprintf ( stderr, \ "\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\ exit(1); \ }} #else #define AssertD(cond,msg) /* */ #endif #define VPrintf0(zf) \ fprintf(stderr,zf) #define VPrintf1(zf,za1) \ fprintf(stderr,zf,za1) #define VPrintf2(zf,za1,za2) \ fprintf(stderr,zf,za1,za2) #define VPrintf3(zf,za1,za2,za3) \ fprintf(stderr,zf,za1,za2,za3) #define VPrintf4(zf,za1,za2,za3,za4) \ fprintf(stderr,zf,za1,za2,za3,za4) #define VPrintf5(zf,za1,za2,za3,za4,za5) \ fprintf(stderr,zf,za1,za2,za3,za4,za5) #else extern void bz_internal_error ( int errcode ); #define AssertH(cond,errcode) \ { if (!(cond)) bz_internal_error ( errcode ); } #define AssertD(cond,msg) /* */ #define VPrintf0(zf) /* */ #define VPrintf1(zf,za1) /* */ #define VPrintf2(zf,za1,za2) /* */ #define VPrintf3(zf,za1,za2,za3) /* */ #define VPrintf4(zf,za1,za2,za3,za4) /* */ #define VPrintf5(zf,za1,za2,za3,za4,za5) /* */ #endif #define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1) #define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp)) /*-- Header bytes. --*/ #define BZ_HDR_B 0x42 /* 'B' */ #define BZ_HDR_Z 0x5a /* 'Z' */ #define BZ_HDR_h 0x68 /* 'h' */ #define BZ_HDR_0 0x30 /* '0' */ /*-- Constants for the back end. --*/ #define BZ_MAX_ALPHA_SIZE 258 #define BZ_MAX_CODE_LEN 23 #define BZ_RUNA 0 #define BZ_RUNB 1 #define BZ_N_GROUPS 6 #define BZ_G_SIZE 50 #define BZ_N_ITERS 4 #define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE)) /*-- Stuff for randomising repetitive blocks. --*/ extern Int32 BZ2_rNums[512]; #define BZ_RAND_DECLS \ Int32 rNToGo; \ Int32 rTPos \ #define BZ_RAND_INIT_MASK \ s->rNToGo = 0; \ s->rTPos = 0 \ #define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0) #define BZ_RAND_UPD_MASK \ if (s->rNToGo == 0) { \ s->rNToGo = BZ2_rNums[s->rTPos]; \ s->rTPos++; \ if (s->rTPos == 512) s->rTPos = 0; \ } \ s->rNToGo--; /*-- Stuff for doing CRCs. --*/ extern UInt32 BZ2_crc32Table[256]; #define BZ_INITIALISE_CRC(crcVar) \ { \ crcVar = 0xffffffffL; \ } #define BZ_FINALISE_CRC(crcVar) \ { \ crcVar = ~(crcVar); \ } #define BZ_UPDATE_CRC(crcVar,cha) \ { \ crcVar = (crcVar << 8) ^ \ BZ2_crc32Table[(crcVar >> 24) ^ \ ((UChar)cha)]; \ } /*-- States and modes for compression. --*/ #define BZ_M_IDLE 1 #define BZ_M_RUNNING 2 #define BZ_M_FLUSHING 3 #define BZ_M_FINISHING 4 #define BZ_S_OUTPUT 1 #define BZ_S_INPUT 2 #define BZ_N_RADIX 2 #define BZ_N_QSORT 12 #define BZ_N_SHELL 18 #define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2) /*-- Structure holding all the compression-side stuff. --*/ typedef struct { /* pointer back to the struct bz_stream */ bz_stream* strm; /* mode this stream is in, and whether inputting */ /* or outputting data */ Int32 mode; Int32 state; /* remembers avail_in when flush/finish requested */ UInt32 avail_in_expect; /* for doing the block sorting */ UInt32* arr1; UInt32* arr2; UInt32* ftab; Int32 origPtr; /* aliases for arr1 and arr2 */ UInt32* ptr; UChar* block; UInt16* mtfv; UChar* zbits; /* for deciding when to use the fallback sorting algorithm */ Int32 workFactor; /* run-length-encoding of the input */ UInt32 state_in_ch; Int32 state_in_len; BZ_RAND_DECLS; /* input and output limits and current posns */ Int32 nblock; Int32 nblockMAX; Int32 numZ; Int32 state_out_pos; /* map of bytes used in block */ Int32 nInUse; Bool inUse[256]; UChar unseqToSeq[256]; /* the buffer for bit stream creation */ UInt32 bsBuff; Int32 bsLive; /* block and combined CRCs */ UInt32 blockCRC; UInt32 combinedCRC; /* misc administratium */ Int32 verbosity; Int32 blockNo; Int32 blockSize100k; /* stuff for coding the MTF values */ Int32 nMTF; Int32 mtfFreq [BZ_MAX_ALPHA_SIZE]; UChar selector [BZ_MAX_SELECTORS]; UChar selectorMtf[BZ_MAX_SELECTORS]; UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; /* second dimension: only 3 needed; 4 makes index calculations faster */ UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4]; } EState; /*-- externs for compression. --*/ extern void BZ2_blockSort ( EState* ); extern void BZ2_compressBlock ( EState*, Bool ); extern void BZ2_bsInitWrite ( EState* ); extern void BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 ); extern void BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 ); /*-- states for decompression. --*/ #define BZ_X_IDLE 1 #define BZ_X_OUTPUT 2 #define BZ_X_MAGIC_1 10 #define BZ_X_MAGIC_2 11 #define BZ_X_MAGIC_3 12 #define BZ_X_MAGIC_4 13 #define BZ_X_BLKHDR_1 14 #define BZ_X_BLKHDR_2 15 #define BZ_X_BLKHDR_3 16 #define BZ_X_BLKHDR_4 17 #define BZ_X_BLKHDR_5 18 #define BZ_X_BLKHDR_6 19 #define BZ_X_BCRC_1 20 #define BZ_X_BCRC_2 21 #define BZ_X_BCRC_3 22 #define BZ_X_BCRC_4 23 #define BZ_X_RANDBIT 24 #define BZ_X_ORIGPTR_1 25 #define BZ_X_ORIGPTR_2 26 #define BZ_X_ORIGPTR_3 27 #define BZ_X_MAPPING_1 28 #define BZ_X_MAPPING_2 29 #define BZ_X_SELECTOR_1 30 #define BZ_X_SELECTOR_2 31 #define BZ_X_SELECTOR_3 32 #define BZ_X_CODING_1 33 #define BZ_X_CODING_2 34 #define BZ_X_CODING_3 35 #define BZ_X_MTF_1 36 #define BZ_X_MTF_2 37 #define BZ_X_MTF_3 38 #define BZ_X_MTF_4 39 #define BZ_X_MTF_5 40 #define BZ_X_MTF_6 41 #define BZ_X_ENDHDR_2 42 #define BZ_X_ENDHDR_3 43 #define BZ_X_ENDHDR_4 44 #define BZ_X_ENDHDR_5 45 #define BZ_X_ENDHDR_6 46 #define BZ_X_CCRC_1 47 #define BZ_X_CCRC_2 48 #define BZ_X_CCRC_3 49 #define BZ_X_CCRC_4 50 /*-- Constants for the fast MTF decoder. --*/ #define MTFA_SIZE 4096 #define MTFL_SIZE 16 /*-- Structure holding all the decompression-side stuff. --*/ typedef struct { /* pointer back to the struct bz_stream */ bz_stream* strm; /* state indicator for this stream */ Int32 state; /* for doing the final run-length decoding */ UChar state_out_ch; Int32 state_out_len; Bool blockRandomised; BZ_RAND_DECLS; /* the buffer for bit stream reading */ UInt32 bsBuff; Int32 bsLive; /* misc administratium */ Int32 blockSize100k; Bool smallDecompress; Int32 currBlockNo; Int32 verbosity; /* for undoing the Burrows-Wheeler transform */ Int32 origPtr; UInt32 tPos; Int32 k0; Int32 unzftab[256]; Int32 nblock_used; Int32 cftab[257]; Int32 cftabCopy[257]; /* for undoing the Burrows-Wheeler transform (FAST) */ UInt32 *tt; /* for undoing the Burrows-Wheeler transform (SMALL) */ UInt16 *ll16; UChar *ll4; /* stored and calculated CRCs */ UInt32 storedBlockCRC; UInt32 storedCombinedCRC; UInt32 calculatedBlockCRC; UInt32 calculatedCombinedCRC; /* map of bytes used in block */ Int32 nInUse; Bool inUse[256]; Bool inUse16[16]; UChar seqToUnseq[256]; /* for decoding the MTF values */ UChar mtfa [MTFA_SIZE]; Int32 mtfbase[256 / MTFL_SIZE]; UChar selector [BZ_MAX_SELECTORS]; UChar selectorMtf[BZ_MAX_SELECTORS]; UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 minLens[BZ_N_GROUPS]; /* save area for scalars in the main decompress code */ Int32 save_i; Int32 save_j; Int32 save_t; Int32 save_alphaSize; Int32 save_nGroups; Int32 save_nSelectors; Int32 save_EOB; Int32 save_groupNo; Int32 save_groupPos; Int32 save_nextSym; Int32 save_nblockMAX; Int32 save_nblock; Int32 save_es; Int32 save_N; Int32 save_curr; Int32 save_zt; Int32 save_zn; Int32 save_zvec; Int32 save_zj; Int32 save_gSel; Int32 save_gMinlen; Int32* save_gLimit; Int32* save_gBase; Int32* save_gPerm; } DState; /*-- Macros for decompression. --*/ #define BZ_GET_FAST(cccc) \ s->tPos = s->tt[s->tPos]; \ cccc = (UChar)(s->tPos & 0xff); \ s->tPos >>= 8; #define BZ_GET_FAST_C(cccc) \ c_tPos = c_tt[c_tPos]; \ cccc = (UChar)(c_tPos & 0xff); \ c_tPos >>= 8; #define SET_LL4(i,n) \ { if (((i) & 0x1) == 0) \ s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \ s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \ } #define GET_LL4(i) \ ((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF) #define SET_LL(i,n) \ { s->ll16[i] = (UInt16)(n & 0x0000ffff); \ SET_LL4(i, n >> 16); \ } #define GET_LL(i) \ (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16)) #define BZ_GET_SMALL(cccc) \ cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \ s->tPos = GET_LL(s->tPos); /*-- externs for decompression. --*/ extern Int32 BZ2_indexIntoF ( Int32, Int32* ); extern Int32 BZ2_decompress ( DState* ); extern void BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, Int32, Int32, Int32 ); #endif /*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/ #ifdef BZ_NO_STDIO #ifndef NULL #define NULL 0 #endif #endif /*-------------------------------------------------------------*/ /*--- end bzlib_private.h ---*/ /*-------------------------------------------------------------*/ microdc2-0.15.6/src/bzip2/compress.c0100644000076500007500000005452110516634226017202 0ustar chugunovmicrodc /*-------------------------------------------------------------*/ /*--- Compression machinery (not incl block sorting) ---*/ /*--- compress.c ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ /*-- CHANGES ~~~~~~~ 0.9.0 -- original version. 0.9.0a/b -- no changes in this file. 0.9.0c * changed setting of nGroups in sendMTFValues() so as to do a bit better on small files --*/ #include "bzlib_private.h" /*---------------------------------------------------*/ /*--- Bit stream I/O ---*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ void BZ2_bsInitWrite ( EState* s ) { s->bsLive = 0; s->bsBuff = 0; } /*---------------------------------------------------*/ static void bsFinishWrite ( EState* s ) { while (s->bsLive > 0) { s->zbits[s->numZ] = (UChar)(s->bsBuff >> 24); s->numZ++; s->bsBuff <<= 8; s->bsLive -= 8; } } /*---------------------------------------------------*/ #define bsNEEDW(nz) \ { \ while (s->bsLive >= 8) { \ s->zbits[s->numZ] \ = (UChar)(s->bsBuff >> 24); \ s->numZ++; \ s->bsBuff <<= 8; \ s->bsLive -= 8; \ } \ } /*---------------------------------------------------*/ static __inline__ void bsW ( EState* s, Int32 n, UInt32 v ) { bsNEEDW ( n ); s->bsBuff |= (v << (32 - s->bsLive - n)); s->bsLive += n; } /*---------------------------------------------------*/ static void bsPutUInt32 ( EState* s, UInt32 u ) { bsW ( s, 8, (u >> 24) & 0xffL ); bsW ( s, 8, (u >> 16) & 0xffL ); bsW ( s, 8, (u >> 8) & 0xffL ); bsW ( s, 8, u & 0xffL ); } /*---------------------------------------------------*/ static void bsPutUChar ( EState* s, UChar c ) { bsW( s, 8, (UInt32)c ); } /*---------------------------------------------------*/ /*--- The back end proper ---*/ /*---------------------------------------------------*/ /*---------------------------------------------------*/ static void makeMaps_e ( EState* s ) { Int32 i; s->nInUse = 0; for (i = 0; i < 256; i++) if (s->inUse[i]) { s->unseqToSeq[i] = s->nInUse; s->nInUse++; } } /*---------------------------------------------------*/ static void generateMTFValues ( EState* s ) { UChar yy[256]; Int32 i, j; Int32 zPend; Int32 wr; Int32 EOB; /* After sorting (eg, here), s->arr1 [ 0 .. s->nblock-1 ] holds sorted order, and ((UChar*)s->arr2) [ 0 .. s->nblock-1 ] holds the original block data. The first thing to do is generate the MTF values, and put them in ((UInt16*)s->arr1) [ 0 .. s->nblock-1 ]. Because there are strictly fewer or equal MTF values than block values, ptr values in this area are overwritten with MTF values only when they are no longer needed. The final compressed bitstream is generated into the area starting at (UChar*) (&((UChar*)s->arr2)[s->nblock]) These storage aliases are set up in bzCompressInit(), except for the last one, which is arranged in compressBlock(). */ UInt32* ptr = s->ptr; UChar* block = s->block; UInt16* mtfv = s->mtfv; makeMaps_e ( s ); EOB = s->nInUse+1; for (i = 0; i <= EOB; i++) s->mtfFreq[i] = 0; wr = 0; zPend = 0; for (i = 0; i < s->nInUse; i++) yy[i] = (UChar) i; for (i = 0; i < s->nblock; i++) { UChar ll_i; AssertD ( wr <= i, "generateMTFValues(1)" ); j = ptr[i]-1; if (j < 0) j += s->nblock; ll_i = s->unseqToSeq[block[j]]; AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" ); if (yy[0] == ll_i) { zPend++; } else { if (zPend > 0) { zPend--; while (True) { if (zPend & 1) { mtfv[wr] = BZ_RUNB; wr++; s->mtfFreq[BZ_RUNB]++; } else { mtfv[wr] = BZ_RUNA; wr++; s->mtfFreq[BZ_RUNA]++; } if (zPend < 2) break; zPend = (zPend - 2) / 2; }; zPend = 0; } { register UChar rtmp; register UChar* ryy_j; register UChar rll_i; rtmp = yy[1]; yy[1] = yy[0]; ryy_j = &(yy[1]); rll_i = ll_i; while ( rll_i != rtmp ) { register UChar rtmp2; ryy_j++; rtmp2 = rtmp; rtmp = *ryy_j; *ryy_j = rtmp2; }; yy[0] = rtmp; j = ryy_j - &(yy[0]); mtfv[wr] = j+1; wr++; s->mtfFreq[j+1]++; } } } if (zPend > 0) { zPend--; while (True) { if (zPend & 1) { mtfv[wr] = BZ_RUNB; wr++; s->mtfFreq[BZ_RUNB]++; } else { mtfv[wr] = BZ_RUNA; wr++; s->mtfFreq[BZ_RUNA]++; } if (zPend < 2) break; zPend = (zPend - 2) / 2; }; zPend = 0; } mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++; s->nMTF = wr; } /*---------------------------------------------------*/ #define BZ_LESSER_ICOST 0 #define BZ_GREATER_ICOST 15 static void sendMTFValues ( EState* s ) { Int32 v, t, i, j, gs, ge, totc, bt, bc, iter; Int32 nSelectors, alphaSize, minLen, maxLen, selCtr; Int32 nGroups, nBytes; /*-- UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; is a global since the decoder also needs it. Int32 code[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; Int32 rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; are also globals only used in this proc. Made global to keep stack frame size small. --*/ UInt16 cost[BZ_N_GROUPS]; Int32 fave[BZ_N_GROUPS]; UInt16* mtfv = s->mtfv; if (s->verbosity >= 3) VPrintf3( " %d in block, %d after MTF & 1-2 coding, " "%d+2 syms in use\n", s->nblock, s->nMTF, s->nInUse ); alphaSize = s->nInUse+2; for (t = 0; t < BZ_N_GROUPS; t++) for (v = 0; v < alphaSize; v++) s->len[t][v] = BZ_GREATER_ICOST; /*--- Decide how many coding tables to use ---*/ AssertH ( s->nMTF > 0, 3001 ); if (s->nMTF < 200) nGroups = 2; else if (s->nMTF < 600) nGroups = 3; else if (s->nMTF < 1200) nGroups = 4; else if (s->nMTF < 2400) nGroups = 5; else nGroups = 6; /*--- Generate an initial set of coding tables ---*/ { Int32 nPart, remF, tFreq, aFreq; nPart = nGroups; remF = s->nMTF; gs = 0; while (nPart > 0) { tFreq = remF / nPart; ge = gs-1; aFreq = 0; while (aFreq < tFreq && ge < alphaSize-1) { ge++; aFreq += s->mtfFreq[ge]; } if (ge > gs && nPart != nGroups && nPart != 1 && ((nGroups-nPart) % 2 == 1)) { aFreq -= s->mtfFreq[ge]; ge--; } if (s->verbosity >= 3) VPrintf5( " initial group %d, [%d .. %d], " "has %d syms (%4.1f%%)\n", nPart, gs, ge, aFreq, (100.0 * (float)aFreq) / (float)(s->nMTF) ); for (v = 0; v < alphaSize; v++) if (v >= gs && v <= ge) s->len[nPart-1][v] = BZ_LESSER_ICOST; else s->len[nPart-1][v] = BZ_GREATER_ICOST; nPart--; gs = ge+1; remF -= aFreq; } } /*--- Iterate up to BZ_N_ITERS times to improve the tables. ---*/ for (iter = 0; iter < BZ_N_ITERS; iter++) { for (t = 0; t < nGroups; t++) fave[t] = 0; for (t = 0; t < nGroups; t++) for (v = 0; v < alphaSize; v++) s->rfreq[t][v] = 0; /*--- Set up an auxiliary length table which is used to fast-track the common case (nGroups == 6). ---*/ if (nGroups == 6) { for (v = 0; v < alphaSize; v++) { s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v]; s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v]; s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v]; } } nSelectors = 0; totc = 0; gs = 0; while (True) { /*--- Set group start & end marks. --*/ if (gs >= s->nMTF) break; ge = gs + BZ_G_SIZE - 1; if (ge >= s->nMTF) ge = s->nMTF-1; /*-- Calculate the cost of this group as coded by each of the coding tables. --*/ for (t = 0; t < nGroups; t++) cost[t] = 0; if (nGroups == 6 && 50 == ge-gs+1) { /*--- fast track the common case ---*/ register UInt32 cost01, cost23, cost45; register UInt16 icv; cost01 = cost23 = cost45 = 0; # define BZ_ITER(nn) \ icv = mtfv[gs+(nn)]; \ cost01 += s->len_pack[icv][0]; \ cost23 += s->len_pack[icv][1]; \ cost45 += s->len_pack[icv][2]; \ BZ_ITER(0); BZ_ITER(1); BZ_ITER(2); BZ_ITER(3); BZ_ITER(4); BZ_ITER(5); BZ_ITER(6); BZ_ITER(7); BZ_ITER(8); BZ_ITER(9); BZ_ITER(10); BZ_ITER(11); BZ_ITER(12); BZ_ITER(13); BZ_ITER(14); BZ_ITER(15); BZ_ITER(16); BZ_ITER(17); BZ_ITER(18); BZ_ITER(19); BZ_ITER(20); BZ_ITER(21); BZ_ITER(22); BZ_ITER(23); BZ_ITER(24); BZ_ITER(25); BZ_ITER(26); BZ_ITER(27); BZ_ITER(28); BZ_ITER(29); BZ_ITER(30); BZ_ITER(31); BZ_ITER(32); BZ_ITER(33); BZ_ITER(34); BZ_ITER(35); BZ_ITER(36); BZ_ITER(37); BZ_ITER(38); BZ_ITER(39); BZ_ITER(40); BZ_ITER(41); BZ_ITER(42); BZ_ITER(43); BZ_ITER(44); BZ_ITER(45); BZ_ITER(46); BZ_ITER(47); BZ_ITER(48); BZ_ITER(49); # undef BZ_ITER cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16; cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16; cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16; } else { /*--- slow version which correctly handles all situations ---*/ for (i = gs; i <= ge; i++) { UInt16 icv = mtfv[i]; for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv]; } } /*-- Find the coding table which is best for this group, and record its identity in the selector table. --*/ bc = 999999999; bt = -1; for (t = 0; t < nGroups; t++) if (cost[t] < bc) { bc = cost[t]; bt = t; }; totc += bc; fave[bt]++; s->selector[nSelectors] = bt; nSelectors++; /*-- Increment the symbol frequencies for the selected table. --*/ if (nGroups == 6 && 50 == ge-gs+1) { /*--- fast track the common case ---*/ # define BZ_ITUR(nn) s->rfreq[bt][ mtfv[gs+(nn)] ]++ BZ_ITUR(0); BZ_ITUR(1); BZ_ITUR(2); BZ_ITUR(3); BZ_ITUR(4); BZ_ITUR(5); BZ_ITUR(6); BZ_ITUR(7); BZ_ITUR(8); BZ_ITUR(9); BZ_ITUR(10); BZ_ITUR(11); BZ_ITUR(12); BZ_ITUR(13); BZ_ITUR(14); BZ_ITUR(15); BZ_ITUR(16); BZ_ITUR(17); BZ_ITUR(18); BZ_ITUR(19); BZ_ITUR(20); BZ_ITUR(21); BZ_ITUR(22); BZ_ITUR(23); BZ_ITUR(24); BZ_ITUR(25); BZ_ITUR(26); BZ_ITUR(27); BZ_ITUR(28); BZ_ITUR(29); BZ_ITUR(30); BZ_ITUR(31); BZ_ITUR(32); BZ_ITUR(33); BZ_ITUR(34); BZ_ITUR(35); BZ_ITUR(36); BZ_ITUR(37); BZ_ITUR(38); BZ_ITUR(39); BZ_ITUR(40); BZ_ITUR(41); BZ_ITUR(42); BZ_ITUR(43); BZ_ITUR(44); BZ_ITUR(45); BZ_ITUR(46); BZ_ITUR(47); BZ_ITUR(48); BZ_ITUR(49); # undef BZ_ITUR } else { /*--- slow version which correctly handles all situations ---*/ for (i = gs; i <= ge; i++) s->rfreq[bt][ mtfv[i] ]++; } gs = ge+1; } if (s->verbosity >= 3) { VPrintf2 ( " pass %d: size is %d, grp uses are ", iter+1, totc/8 ); for (t = 0; t < nGroups; t++) VPrintf1 ( "%d ", fave[t] ); VPrintf0 ( "\n" ); } /*-- Recompute the tables based on the accumulated frequencies. --*/ /* maxLen was changed from 20 to 17 in bzip2-1.0.3. See comment in huffman.c for details. */ for (t = 0; t < nGroups; t++) BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), alphaSize, 17 /*20*/ ); } AssertH( nGroups < 8, 3002 ); AssertH( nSelectors < 32768 && nSelectors <= (2 + (900000 / BZ_G_SIZE)), 3003 ); /*--- Compute MTF values for the selectors. ---*/ { UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp; for (i = 0; i < nGroups; i++) pos[i] = i; for (i = 0; i < nSelectors; i++) { ll_i = s->selector[i]; j = 0; tmp = pos[j]; while ( ll_i != tmp ) { j++; tmp2 = tmp; tmp = pos[j]; pos[j] = tmp2; }; pos[0] = tmp; s->selectorMtf[i] = j; } }; /*--- Assign actual codes for the tables. --*/ for (t = 0; t < nGroups; t++) { minLen = 32; maxLen = 0; for (i = 0; i < alphaSize; i++) { if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; if (s->len[t][i] < minLen) minLen = s->len[t][i]; } AssertH ( !(maxLen > 17 /*20*/ ), 3004 ); AssertH ( !(minLen < 1), 3005 ); BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), minLen, maxLen, alphaSize ); } /*--- Transmit the mapping table. ---*/ { Bool inUse16[16]; for (i = 0; i < 16; i++) { inUse16[i] = False; for (j = 0; j < 16; j++) if (s->inUse[i * 16 + j]) inUse16[i] = True; } nBytes = s->numZ; for (i = 0; i < 16; i++) if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0); for (i = 0; i < 16; i++) if (inUse16[i]) for (j = 0; j < 16; j++) { if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0); } if (s->verbosity >= 3) VPrintf1( " bytes: mapping %d, ", s->numZ-nBytes ); } /*--- Now the selectors. ---*/ nBytes = s->numZ; bsW ( s, 3, nGroups ); bsW ( s, 15, nSelectors ); for (i = 0; i < nSelectors; i++) { for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1); bsW(s,1,0); } if (s->verbosity >= 3) VPrintf1( "selectors %d, ", s->numZ-nBytes ); /*--- Now the coding tables. ---*/ nBytes = s->numZ; for (t = 0; t < nGroups; t++) { Int32 curr = s->len[t][0]; bsW ( s, 5, curr ); for (i = 0; i < alphaSize; i++) { while (curr < s->len[t][i]) { bsW(s,2,2); curr++; /* 10 */ }; while (curr > s->len[t][i]) { bsW(s,2,3); curr--; /* 11 */ }; bsW ( s, 1, 0 ); } } if (s->verbosity >= 3) VPrintf1 ( "code lengths %d, ", s->numZ-nBytes ); /*--- And finally, the block data proper ---*/ nBytes = s->numZ; selCtr = 0; gs = 0; while (True) { if (gs >= s->nMTF) break; ge = gs + BZ_G_SIZE - 1; if (ge >= s->nMTF) ge = s->nMTF-1; AssertH ( s->selector[selCtr] < nGroups, 3006 ); if (nGroups == 6 && 50 == ge-gs+1) { /*--- fast track the common case ---*/ UInt16 mtfv_i; UChar* s_len_sel_selCtr = &(s->len[s->selector[selCtr]][0]); Int32* s_code_sel_selCtr = &(s->code[s->selector[selCtr]][0]); # define BZ_ITAH(nn) \ mtfv_i = mtfv[gs+(nn)]; \ bsW ( s, \ s_len_sel_selCtr[mtfv_i], \ s_code_sel_selCtr[mtfv_i] ) BZ_ITAH(0); BZ_ITAH(1); BZ_ITAH(2); BZ_ITAH(3); BZ_ITAH(4); BZ_ITAH(5); BZ_ITAH(6); BZ_ITAH(7); BZ_ITAH(8); BZ_ITAH(9); BZ_ITAH(10); BZ_ITAH(11); BZ_ITAH(12); BZ_ITAH(13); BZ_ITAH(14); BZ_ITAH(15); BZ_ITAH(16); BZ_ITAH(17); BZ_ITAH(18); BZ_ITAH(19); BZ_ITAH(20); BZ_ITAH(21); BZ_ITAH(22); BZ_ITAH(23); BZ_ITAH(24); BZ_ITAH(25); BZ_ITAH(26); BZ_ITAH(27); BZ_ITAH(28); BZ_ITAH(29); BZ_ITAH(30); BZ_ITAH(31); BZ_ITAH(32); BZ_ITAH(33); BZ_ITAH(34); BZ_ITAH(35); BZ_ITAH(36); BZ_ITAH(37); BZ_ITAH(38); BZ_ITAH(39); BZ_ITAH(40); BZ_ITAH(41); BZ_ITAH(42); BZ_ITAH(43); BZ_ITAH(44); BZ_ITAH(45); BZ_ITAH(46); BZ_ITAH(47); BZ_ITAH(48); BZ_ITAH(49); # undef BZ_ITAH } else { /*--- slow version which correctly handles all situations ---*/ for (i = gs; i <= ge; i++) { bsW ( s, s->len [s->selector[selCtr]] [mtfv[i]], s->code [s->selector[selCtr]] [mtfv[i]] ); } } gs = ge+1; selCtr++; } AssertH( selCtr == nSelectors, 3007 ); if (s->verbosity >= 3) VPrintf1( "codes %d\n", s->numZ-nBytes ); } /*---------------------------------------------------*/ void BZ2_compressBlock ( EState* s, Bool is_last_block ) { if (s->nblock > 0) { BZ_FINALISE_CRC ( s->blockCRC ); s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31); s->combinedCRC ^= s->blockCRC; if (s->blockNo > 1) s->numZ = 0; if (s->verbosity >= 2) VPrintf4( " block %d: crc = 0x%08x, " "combined CRC = 0x%08x, size = %d\n", s->blockNo, s->blockCRC, s->combinedCRC, s->nblock ); BZ2_blockSort ( s ); } s->zbits = (UChar*) (&((UChar*)s->arr2)[s->nblock]); /*-- If this is the first block, create the stream header. --*/ if (s->blockNo == 1) { BZ2_bsInitWrite ( s ); bsPutUChar ( s, BZ_HDR_B ); bsPutUChar ( s, BZ_HDR_Z ); bsPutUChar ( s, BZ_HDR_h ); bsPutUChar ( s, (UChar)(BZ_HDR_0 + s->blockSize100k) ); } if (s->nblock > 0) { bsPutUChar ( s, 0x31 ); bsPutUChar ( s, 0x41 ); bsPutUChar ( s, 0x59 ); bsPutUChar ( s, 0x26 ); bsPutUChar ( s, 0x53 ); bsPutUChar ( s, 0x59 ); /*-- Now the block's CRC, so it is in a known place. --*/ bsPutUInt32 ( s, s->blockCRC ); /*-- Now a single bit indicating (non-)randomisation. As of version 0.9.5, we use a better sorting algorithm which makes randomisation unnecessary. So always set the randomised bit to 'no'. Of course, the decoder still needs to be able to handle randomised blocks so as to maintain backwards compatibility with older versions of bzip2. --*/ bsW(s,1,0); bsW ( s, 24, s->origPtr ); generateMTFValues ( s ); sendMTFValues ( s ); } /*-- If this is the last block, add the stream trailer. --*/ if (is_last_block) { bsPutUChar ( s, 0x17 ); bsPutUChar ( s, 0x72 ); bsPutUChar ( s, 0x45 ); bsPutUChar ( s, 0x38 ); bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 ); bsPutUInt32 ( s, s->combinedCRC ); if (s->verbosity >= 2) VPrintf1( " final combined CRC = 0x%08x\n ", s->combinedCRC ); bsFinishWrite ( s ); } } /*-------------------------------------------------------------*/ /*--- end compress.c ---*/ /*-------------------------------------------------------------*/ microdc2-0.15.6/src/bzip2/crctable.c0100644000076500007500000001461610516634226017127 0ustar chugunovmicrodc /*-------------------------------------------------------------*/ /*--- Table for doing CRCs ---*/ /*--- crctable.c ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ #include "bzlib_private.h" /*-- I think this is an implementation of the AUTODIN-II, Ethernet & FDDI 32-bit CRC standard. Vaguely derived from code by Rob Warnock, in Section 51 of the comp.compression FAQ. --*/ UInt32 BZ2_crc32Table[256] = { /*-- Ugly, innit? --*/ 0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L, 0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L, 0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L, 0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL, 0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L, 0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L, 0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L, 0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL, 0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L, 0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L, 0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L, 0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL, 0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L, 0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L, 0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L, 0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL, 0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL, 0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L, 0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L, 0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL, 0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL, 0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L, 0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L, 0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL, 0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL, 0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L, 0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L, 0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL, 0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL, 0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L, 0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L, 0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL, 0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L, 0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL, 0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL, 0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L, 0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L, 0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL, 0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL, 0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L, 0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L, 0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL, 0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL, 0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L, 0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L, 0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL, 0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL, 0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L, 0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L, 0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL, 0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L, 0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L, 0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L, 0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL, 0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L, 0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L, 0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L, 0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL, 0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L, 0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L, 0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L, 0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL, 0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L, 0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L }; /*-------------------------------------------------------------*/ /*--- end crctable.c ---*/ /*-------------------------------------------------------------*/ microdc2-0.15.6/src/bzip2/decompress.c0100644000076500007500000005340410516634226017512 0ustar chugunovmicrodc /*-------------------------------------------------------------*/ /*--- Decompression machinery ---*/ /*--- decompress.c ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ #include "bzlib_private.h" /*---------------------------------------------------*/ static void makeMaps_d ( DState* s ) { Int32 i; s->nInUse = 0; for (i = 0; i < 256; i++) if (s->inUse[i]) { s->seqToUnseq[s->nInUse] = i; s->nInUse++; } } /*---------------------------------------------------*/ #define RETURN(rrr) \ { retVal = rrr; goto save_state_and_return; }; #define GET_BITS(lll,vvv,nnn) \ case lll: s->state = lll; \ while (True) { \ if (s->bsLive >= nnn) { \ UInt32 v; \ v = (s->bsBuff >> \ (s->bsLive-nnn)) & ((1 << nnn)-1); \ s->bsLive -= nnn; \ vvv = v; \ break; \ } \ if (s->strm->avail_in == 0) RETURN(BZ_OK); \ s->bsBuff \ = (s->bsBuff << 8) | \ ((UInt32) \ (*((UChar*)(s->strm->next_in)))); \ s->bsLive += 8; \ s->strm->next_in++; \ s->strm->avail_in--; \ s->strm->total_in_lo32++; \ if (s->strm->total_in_lo32 == 0) \ s->strm->total_in_hi32++; \ } #define GET_UCHAR(lll,uuu) \ GET_BITS(lll,uuu,8) #define GET_BIT(lll,uuu) \ GET_BITS(lll,uuu,1) /*---------------------------------------------------*/ #define GET_MTF_VAL(label1,label2,lval) \ { \ if (groupPos == 0) { \ groupNo++; \ if (groupNo >= nSelectors) \ RETURN(BZ_DATA_ERROR); \ groupPos = BZ_G_SIZE; \ gSel = s->selector[groupNo]; \ gMinlen = s->minLens[gSel]; \ gLimit = &(s->limit[gSel][0]); \ gPerm = &(s->perm[gSel][0]); \ gBase = &(s->base[gSel][0]); \ } \ groupPos--; \ zn = gMinlen; \ GET_BITS(label1, zvec, zn); \ while (1) { \ if (zn > 20 /* the longest code */) \ RETURN(BZ_DATA_ERROR); \ if (zvec <= gLimit[zn]) break; \ zn++; \ GET_BIT(label2, zj); \ zvec = (zvec << 1) | zj; \ }; \ if (zvec - gBase[zn] < 0 \ || zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE) \ RETURN(BZ_DATA_ERROR); \ lval = gPerm[zvec - gBase[zn]]; \ } /*---------------------------------------------------*/ Int32 BZ2_decompress ( DState* s ) { UChar uc; Int32 retVal; Int32 minLen, maxLen; bz_stream* strm = s->strm; /* stuff that needs to be saved/restored */ Int32 i; Int32 j; Int32 t; Int32 alphaSize; Int32 nGroups; Int32 nSelectors; Int32 EOB; Int32 groupNo; Int32 groupPos; Int32 nextSym; Int32 nblockMAX; Int32 nblock; Int32 es; Int32 N; Int32 curr; Int32 zt; Int32 zn; Int32 zvec; Int32 zj; Int32 gSel; Int32 gMinlen; Int32* gLimit; Int32* gBase; Int32* gPerm; if (s->state == BZ_X_MAGIC_1) { /*initialise the save area*/ s->save_i = 0; s->save_j = 0; s->save_t = 0; s->save_alphaSize = 0; s->save_nGroups = 0; s->save_nSelectors = 0; s->save_EOB = 0; s->save_groupNo = 0; s->save_groupPos = 0; s->save_nextSym = 0; s->save_nblockMAX = 0; s->save_nblock = 0; s->save_es = 0; s->save_N = 0; s->save_curr = 0; s->save_zt = 0; s->save_zn = 0; s->save_zvec = 0; s->save_zj = 0; s->save_gSel = 0; s->save_gMinlen = 0; s->save_gLimit = NULL; s->save_gBase = NULL; s->save_gPerm = NULL; } /*restore from the save area*/ i = s->save_i; j = s->save_j; t = s->save_t; alphaSize = s->save_alphaSize; nGroups = s->save_nGroups; nSelectors = s->save_nSelectors; EOB = s->save_EOB; groupNo = s->save_groupNo; groupPos = s->save_groupPos; nextSym = s->save_nextSym; nblockMAX = s->save_nblockMAX; nblock = s->save_nblock; es = s->save_es; N = s->save_N; curr = s->save_curr; zt = s->save_zt; zn = s->save_zn; zvec = s->save_zvec; zj = s->save_zj; gSel = s->save_gSel; gMinlen = s->save_gMinlen; gLimit = s->save_gLimit; gBase = s->save_gBase; gPerm = s->save_gPerm; retVal = BZ_OK; switch (s->state) { GET_UCHAR(BZ_X_MAGIC_1, uc); if (uc != BZ_HDR_B) RETURN(BZ_DATA_ERROR_MAGIC); GET_UCHAR(BZ_X_MAGIC_2, uc); if (uc != BZ_HDR_Z) RETURN(BZ_DATA_ERROR_MAGIC); GET_UCHAR(BZ_X_MAGIC_3, uc) if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC); GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8) if (s->blockSize100k < (BZ_HDR_0 + 1) || s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC); s->blockSize100k -= BZ_HDR_0; if (s->smallDecompress) { s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) ); s->ll4 = BZALLOC( ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) ); if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR); } else { s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) ); if (s->tt == NULL) RETURN(BZ_MEM_ERROR); } GET_UCHAR(BZ_X_BLKHDR_1, uc); if (uc == 0x17) goto endhdr_2; if (uc != 0x31) RETURN(BZ_DATA_ERROR); GET_UCHAR(BZ_X_BLKHDR_2, uc); if (uc != 0x41) RETURN(BZ_DATA_ERROR); GET_UCHAR(BZ_X_BLKHDR_3, uc); if (uc != 0x59) RETURN(BZ_DATA_ERROR); GET_UCHAR(BZ_X_BLKHDR_4, uc); if (uc != 0x26) RETURN(BZ_DATA_ERROR); GET_UCHAR(BZ_X_BLKHDR_5, uc); if (uc != 0x53) RETURN(BZ_DATA_ERROR); GET_UCHAR(BZ_X_BLKHDR_6, uc); if (uc != 0x59) RETURN(BZ_DATA_ERROR); s->currBlockNo++; if (s->verbosity >= 2) VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo ); s->storedBlockCRC = 0; GET_UCHAR(BZ_X_BCRC_1, uc); s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); GET_UCHAR(BZ_X_BCRC_2, uc); s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); GET_UCHAR(BZ_X_BCRC_3, uc); s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); GET_UCHAR(BZ_X_BCRC_4, uc); s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc); GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1); s->origPtr = 0; GET_UCHAR(BZ_X_ORIGPTR_1, uc); s->origPtr = (s->origPtr << 8) | ((Int32)uc); GET_UCHAR(BZ_X_ORIGPTR_2, uc); s->origPtr = (s->origPtr << 8) | ((Int32)uc); GET_UCHAR(BZ_X_ORIGPTR_3, uc); s->origPtr = (s->origPtr << 8) | ((Int32)uc); if (s->origPtr < 0) RETURN(BZ_DATA_ERROR); if (s->origPtr > 10 + 100000*s->blockSize100k) RETURN(BZ_DATA_ERROR); /*--- Receive the mapping table ---*/ for (i = 0; i < 16; i++) { GET_BIT(BZ_X_MAPPING_1, uc); if (uc == 1) s->inUse16[i] = True; else s->inUse16[i] = False; } for (i = 0; i < 256; i++) s->inUse[i] = False; for (i = 0; i < 16; i++) if (s->inUse16[i]) for (j = 0; j < 16; j++) { GET_BIT(BZ_X_MAPPING_2, uc); if (uc == 1) s->inUse[i * 16 + j] = True; } makeMaps_d ( s ); if (s->nInUse == 0) RETURN(BZ_DATA_ERROR); alphaSize = s->nInUse+2; /*--- Now the selectors ---*/ GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); if (nSelectors < 1) RETURN(BZ_DATA_ERROR); for (i = 0; i < nSelectors; i++) { j = 0; while (True) { GET_BIT(BZ_X_SELECTOR_3, uc); if (uc == 0) break; j++; if (j >= nGroups) RETURN(BZ_DATA_ERROR); } s->selectorMtf[i] = j; } /*--- Undo the MTF values for the selectors. ---*/ { UChar pos[BZ_N_GROUPS], tmp, v; for (v = 0; v < nGroups; v++) pos[v] = v; for (i = 0; i < nSelectors; i++) { v = s->selectorMtf[i]; tmp = pos[v]; while (v > 0) { pos[v] = pos[v-1]; v--; } pos[0] = tmp; s->selector[i] = tmp; } } /*--- Now the coding tables ---*/ for (t = 0; t < nGroups; t++) { GET_BITS(BZ_X_CODING_1, curr, 5); for (i = 0; i < alphaSize; i++) { while (True) { if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR); GET_BIT(BZ_X_CODING_2, uc); if (uc == 0) break; GET_BIT(BZ_X_CODING_3, uc); if (uc == 0) curr++; else curr--; } s->len[t][i] = curr; } } /*--- Create the Huffman decoding tables ---*/ for (t = 0; t < nGroups; t++) { minLen = 32; maxLen = 0; for (i = 0; i < alphaSize; i++) { if (s->len[t][i] > maxLen) maxLen = s->len[t][i]; if (s->len[t][i] < minLen) minLen = s->len[t][i]; } BZ2_hbCreateDecodeTables ( &(s->limit[t][0]), &(s->base[t][0]), &(s->perm[t][0]), &(s->len[t][0]), minLen, maxLen, alphaSize ); s->minLens[t] = minLen; } /*--- Now the MTF values ---*/ EOB = s->nInUse+1; nblockMAX = 100000 * s->blockSize100k; groupNo = -1; groupPos = 0; for (i = 0; i <= 255; i++) s->unzftab[i] = 0; /*-- MTF init --*/ { Int32 ii, jj, kk; kk = MTFA_SIZE-1; for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) { for (jj = MTFL_SIZE-1; jj >= 0; jj--) { s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj); kk--; } s->mtfbase[ii] = kk + 1; } } /*-- end MTF init --*/ nblock = 0; GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym); while (True) { if (nextSym == EOB) break; if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) { es = -1; N = 1; do { if (nextSym == BZ_RUNA) es = es + (0+1) * N; else if (nextSym == BZ_RUNB) es = es + (1+1) * N; N = N * 2; GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym); } while (nextSym == BZ_RUNA || nextSym == BZ_RUNB); es++; uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ]; s->unzftab[uc] += es; if (s->smallDecompress) while (es > 0) { if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); s->ll16[nblock] = (UInt16)uc; nblock++; es--; } else while (es > 0) { if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); s->tt[nblock] = (UInt32)uc; nblock++; es--; }; continue; } else { if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR); /*-- uc = MTF ( nextSym-1 ) --*/ { Int32 ii, jj, kk, pp, lno, off; UInt32 nn; nn = (UInt32)(nextSym - 1); if (nn < MTFL_SIZE) { /* avoid general-case expense */ pp = s->mtfbase[0]; uc = s->mtfa[pp+nn]; while (nn > 3) { Int32 z = pp+nn; s->mtfa[(z) ] = s->mtfa[(z)-1]; s->mtfa[(z)-1] = s->mtfa[(z)-2]; s->mtfa[(z)-2] = s->mtfa[(z)-3]; s->mtfa[(z)-3] = s->mtfa[(z)-4]; nn -= 4; } while (nn > 0) { s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--; }; s->mtfa[pp] = uc; } else { /* general case */ lno = nn / MTFL_SIZE; off = nn % MTFL_SIZE; pp = s->mtfbase[lno] + off; uc = s->mtfa[pp]; while (pp > s->mtfbase[lno]) { s->mtfa[pp] = s->mtfa[pp-1]; pp--; }; s->mtfbase[lno]++; while (lno > 0) { s->mtfbase[lno]--; s->mtfa[s->mtfbase[lno]] = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1]; lno--; } s->mtfbase[0]--; s->mtfa[s->mtfbase[0]] = uc; if (s->mtfbase[0] == 0) { kk = MTFA_SIZE-1; for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) { for (jj = MTFL_SIZE-1; jj >= 0; jj--) { s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj]; kk--; } s->mtfbase[ii] = kk + 1; } } } } /*-- end uc = MTF ( nextSym-1 ) --*/ s->unzftab[s->seqToUnseq[uc]]++; if (s->smallDecompress) s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]); nblock++; GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym); continue; } } /* Now we know what nblock is, we can do a better sanity check on s->origPtr. */ if (s->origPtr < 0 || s->origPtr >= nblock) RETURN(BZ_DATA_ERROR); /*-- Set up cftab to facilitate generation of T^(-1) --*/ s->cftab[0] = 0; for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1]; for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1]; for (i = 0; i <= 256; i++) { if (s->cftab[i] < 0 || s->cftab[i] > nblock) { /* s->cftab[i] can legitimately be == nblock */ RETURN(BZ_DATA_ERROR); } } s->state_out_len = 0; s->state_out_ch = 0; BZ_INITIALISE_CRC ( s->calculatedBlockCRC ); s->state = BZ_X_OUTPUT; if (s->verbosity >= 2) VPrintf0 ( "rt+rld" ); if (s->smallDecompress) { /*-- Make a copy of cftab, used in generation of T --*/ for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i]; /*-- compute the T vector --*/ for (i = 0; i < nblock; i++) { uc = (UChar)(s->ll16[i]); SET_LL(i, s->cftabCopy[uc]); s->cftabCopy[uc]++; } /*-- Compute T^(-1) by pointer reversal on T --*/ i = s->origPtr; j = GET_LL(i); do { Int32 tmp = GET_LL(j); SET_LL(j, i); i = j; j = tmp; } while (i != s->origPtr); s->tPos = s->origPtr; s->nblock_used = 0; if (s->blockRandomised) { BZ_RAND_INIT_MASK; BZ_GET_SMALL(s->k0); s->nblock_used++; BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; } else { BZ_GET_SMALL(s->k0); s->nblock_used++; } } else { /*-- compute the T^(-1) vector --*/ for (i = 0; i < nblock; i++) { uc = (UChar)(s->tt[i] & 0xff); s->tt[s->cftab[uc]] |= (i << 8); s->cftab[uc]++; } s->tPos = s->tt[s->origPtr] >> 8; s->nblock_used = 0; if (s->blockRandomised) { BZ_RAND_INIT_MASK; BZ_GET_FAST(s->k0); s->nblock_used++; BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; } else { BZ_GET_FAST(s->k0); s->nblock_used++; } } RETURN(BZ_OK); endhdr_2: GET_UCHAR(BZ_X_ENDHDR_2, uc); if (uc != 0x72) RETURN(BZ_DATA_ERROR); GET_UCHAR(BZ_X_ENDHDR_3, uc); if (uc != 0x45) RETURN(BZ_DATA_ERROR); GET_UCHAR(BZ_X_ENDHDR_4, uc); if (uc != 0x38) RETURN(BZ_DATA_ERROR); GET_UCHAR(BZ_X_ENDHDR_5, uc); if (uc != 0x50) RETURN(BZ_DATA_ERROR); GET_UCHAR(BZ_X_ENDHDR_6, uc); if (uc != 0x90) RETURN(BZ_DATA_ERROR); s->storedCombinedCRC = 0; GET_UCHAR(BZ_X_CCRC_1, uc); s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); GET_UCHAR(BZ_X_CCRC_2, uc); s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); GET_UCHAR(BZ_X_CCRC_3, uc); s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); GET_UCHAR(BZ_X_CCRC_4, uc); s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc); s->state = BZ_X_IDLE; RETURN(BZ_STREAM_END); default: AssertH ( False, 4001 ); } AssertH ( False, 4002 ); save_state_and_return: s->save_i = i; s->save_j = j; s->save_t = t; s->save_alphaSize = alphaSize; s->save_nGroups = nGroups; s->save_nSelectors = nSelectors; s->save_EOB = EOB; s->save_groupNo = groupNo; s->save_groupPos = groupPos; s->save_nextSym = nextSym; s->save_nblockMAX = nblockMAX; s->save_nblock = nblock; s->save_es = es; s->save_N = N; s->save_curr = curr; s->save_zt = zt; s->save_zn = zn; s->save_zvec = zvec; s->save_zj = zj; s->save_gSel = gSel; s->save_gMinlen = gMinlen; s->save_gLimit = gLimit; s->save_gBase = gBase; s->save_gPerm = gPerm; return retVal; } /*-------------------------------------------------------------*/ /*--- end decompress.c ---*/ /*-------------------------------------------------------------*/ microdc2-0.15.6/src/bzip2/huffman.c0100644000076500007500000002116010516634226016764 0ustar chugunovmicrodc /*-------------------------------------------------------------*/ /*--- Huffman coding low-level stuff ---*/ /*--- huffman.c ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ #include "bzlib_private.h" /*---------------------------------------------------*/ #define WEIGHTOF(zz0) ((zz0) & 0xffffff00) #define DEPTHOF(zz1) ((zz1) & 0x000000ff) #define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3)) #define ADDWEIGHTS(zw1,zw2) \ (WEIGHTOF(zw1)+WEIGHTOF(zw2)) | \ (1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2))) #define UPHEAP(z) \ { \ Int32 zz, tmp; \ zz = z; tmp = heap[zz]; \ while (weight[tmp] < weight[heap[zz >> 1]]) { \ heap[zz] = heap[zz >> 1]; \ zz >>= 1; \ } \ heap[zz] = tmp; \ } #define DOWNHEAP(z) \ { \ Int32 zz, yy, tmp; \ zz = z; tmp = heap[zz]; \ while (True) { \ yy = zz << 1; \ if (yy > nHeap) break; \ if (yy < nHeap && \ weight[heap[yy+1]] < weight[heap[yy]]) \ yy++; \ if (weight[tmp] < weight[heap[yy]]) break; \ heap[zz] = heap[yy]; \ zz = yy; \ } \ heap[zz] = tmp; \ } /*---------------------------------------------------*/ void BZ2_hbMakeCodeLengths ( UChar *len, Int32 *freq, Int32 alphaSize, Int32 maxLen ) { /*-- Nodes and heap entries run from 1. Entry 0 for both the heap and nodes is a sentinel. --*/ Int32 nNodes, nHeap, n1, n2, i, j, k; Bool tooLong; Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ]; Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ]; Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ]; for (i = 0; i < alphaSize; i++) weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8; while (True) { nNodes = alphaSize; nHeap = 0; heap[0] = 0; weight[0] = 0; parent[0] = -2; for (i = 1; i <= alphaSize; i++) { parent[i] = -1; nHeap++; heap[nHeap] = i; UPHEAP(nHeap); } AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 ); while (nHeap > 1) { n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); nNodes++; parent[n1] = parent[n2] = nNodes; weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]); parent[nNodes] = -1; nHeap++; heap[nHeap] = nNodes; UPHEAP(nHeap); } AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 ); tooLong = False; for (i = 1; i <= alphaSize; i++) { j = 0; k = i; while (parent[k] >= 0) { k = parent[k]; j++; } len[i-1] = j; if (j > maxLen) tooLong = True; } if (! tooLong) break; /* 17 Oct 04: keep-going condition for the following loop used to be 'i < alphaSize', which missed the last element, theoretically leading to the possibility of the compressor looping. However, this count-scaling step is only needed if one of the generated Huffman code words is longer than maxLen, which up to and including version 1.0.2 was 20 bits, which is extremely unlikely. In version 1.0.3 maxLen was changed to 17 bits, which has minimal effect on compression ratio, but does mean this scaling step is used from time to time, enough to verify that it works. This means that bzip2-1.0.3 and later will only produce Huffman codes with a maximum length of 17 bits. However, in order to preserve backwards compatibility with bitstreams produced by versions pre-1.0.3, the decompressor must still handle lengths of up to 20. */ for (i = 1; i <= alphaSize; i++) { j = weight[i] >> 8; j = 1 + (j / 2); weight[i] = j << 8; } } } /*---------------------------------------------------*/ void BZ2_hbAssignCodes ( Int32 *code, UChar *length, Int32 minLen, Int32 maxLen, Int32 alphaSize ) { Int32 n, vec, i; vec = 0; for (n = minLen; n <= maxLen; n++) { for (i = 0; i < alphaSize; i++) if (length[i] == n) { code[i] = vec; vec++; }; vec <<= 1; } } /*---------------------------------------------------*/ void BZ2_hbCreateDecodeTables ( Int32 *limit, Int32 *base, Int32 *perm, UChar *length, Int32 minLen, Int32 maxLen, Int32 alphaSize ) { Int32 pp, i, j, vec; pp = 0; for (i = minLen; i <= maxLen; i++) for (j = 0; j < alphaSize; j++) if (length[j] == i) { perm[pp] = j; pp++; }; for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0; for (i = 0; i < alphaSize; i++) base[length[i]+1]++; for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1]; for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0; vec = 0; for (i = minLen; i <= maxLen; i++) { vec += (base[i+1] - base[i]); limit[i] = vec-1; vec <<= 1; } for (i = minLen + 1; i <= maxLen; i++) base[i] = ((limit[i-1] + 1) << 1) - base[i]; } /*-------------------------------------------------------------*/ /*--- end huffman.c ---*/ /*-------------------------------------------------------------*/ microdc2-0.15.6/src/bzip2/randtable.c0100644000076500007500000001267410516634226017306 0ustar chugunovmicrodc /*-------------------------------------------------------------*/ /*--- Table for randomising repetitive blocks ---*/ /*--- randtable.c ---*/ /*-------------------------------------------------------------*/ /*-- This file is a part of bzip2 and/or libbzip2, a program and library for lossless, block-sorting data compression. Copyright (C) 1996-2005 Julian R Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Julian Seward, Cambridge, UK. jseward@bzip.org bzip2/libbzip2 version 1.0 of 21 March 2000 This program is based on (at least) the work of: Mike Burrows David Wheeler Peter Fenwick Alistair Moffat Radford Neal Ian H. Witten Robert Sedgewick Jon L. Bentley For more information on these sources, see the manual. --*/ #include "bzlib_private.h" /*---------------------------------------------*/ Int32 BZ2_rNums[512] = { 619, 720, 127, 481, 931, 816, 813, 233, 566, 247, 985, 724, 205, 454, 863, 491, 741, 242, 949, 214, 733, 859, 335, 708, 621, 574, 73, 654, 730, 472, 419, 436, 278, 496, 867, 210, 399, 680, 480, 51, 878, 465, 811, 169, 869, 675, 611, 697, 867, 561, 862, 687, 507, 283, 482, 129, 807, 591, 733, 623, 150, 238, 59, 379, 684, 877, 625, 169, 643, 105, 170, 607, 520, 932, 727, 476, 693, 425, 174, 647, 73, 122, 335, 530, 442, 853, 695, 249, 445, 515, 909, 545, 703, 919, 874, 474, 882, 500, 594, 612, 641, 801, 220, 162, 819, 984, 589, 513, 495, 799, 161, 604, 958, 533, 221, 400, 386, 867, 600, 782, 382, 596, 414, 171, 516, 375, 682, 485, 911, 276, 98, 553, 163, 354, 666, 933, 424, 341, 533, 870, 227, 730, 475, 186, 263, 647, 537, 686, 600, 224, 469, 68, 770, 919, 190, 373, 294, 822, 808, 206, 184, 943, 795, 384, 383, 461, 404, 758, 839, 887, 715, 67, 618, 276, 204, 918, 873, 777, 604, 560, 951, 160, 578, 722, 79, 804, 96, 409, 713, 940, 652, 934, 970, 447, 318, 353, 859, 672, 112, 785, 645, 863, 803, 350, 139, 93, 354, 99, 820, 908, 609, 772, 154, 274, 580, 184, 79, 626, 630, 742, 653, 282, 762, 623, 680, 81, 927, 626, 789, 125, 411, 521, 938, 300, 821, 78, 343, 175, 128, 250, 170, 774, 972, 275, 999, 639, 495, 78, 352, 126, 857, 956, 358, 619, 580, 124, 737, 594, 701, 612, 669, 112, 134, 694, 363, 992, 809, 743, 168, 974, 944, 375, 748, 52, 600, 747, 642, 182, 862, 81, 344, 805, 988, 739, 511, 655, 814, 334, 249, 515, 897, 955, 664, 981, 649, 113, 974, 459, 893, 228, 433, 837, 553, 268, 926, 240, 102, 654, 459, 51, 686, 754, 806, 760, 493, 403, 415, 394, 687, 700, 946, 670, 656, 610, 738, 392, 760, 799, 887, 653, 978, 321, 576, 617, 626, 502, 894, 679, 243, 440, 680, 879, 194, 572, 640, 724, 926, 56, 204, 700, 707, 151, 457, 449, 797, 195, 791, 558, 945, 679, 297, 59, 87, 824, 713, 663, 412, 693, 342, 606, 134, 108, 571, 364, 631, 212, 174, 643, 304, 329, 343, 97, 430, 751, 497, 314, 983, 374, 822, 928, 140, 206, 73, 263, 980, 736, 876, 478, 430, 305, 170, 514, 364, 692, 829, 82, 855, 953, 676, 246, 369, 970, 294, 750, 807, 827, 150, 790, 288, 923, 804, 378, 215, 828, 592, 281, 565, 555, 710, 82, 896, 831, 547, 261, 524, 462, 293, 465, 502, 56, 661, 821, 976, 991, 658, 869, 905, 758, 745, 193, 768, 550, 608, 933, 378, 286, 215, 979, 792, 961, 61, 688, 793, 644, 986, 403, 106, 366, 905, 644, 372, 567, 466, 434, 645, 210, 389, 550, 919, 135, 780, 773, 635, 389, 707, 100, 626, 958, 165, 504, 920, 176, 193, 713, 857, 265, 203, 50, 668, 108, 645, 990, 626, 197, 510, 357, 358, 850, 858, 364, 936, 638 }; /*-------------------------------------------------------------*/ /*--- end randtable.c ---*/ /*-------------------------------------------------------------*/ microdc2-0.15.6/src/common/0040755000076500007500000000000010543546024015437 5ustar chugunovmicrodcmicrodc2-0.15.6/src/common/CVS/0040755000076500007500000000000010543546032016071 5ustar chugunovmicrodcmicrodc2-0.15.6/src/common/CVS/Root0100644000076500007500000000003610527341105016727 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/src/common/CVS/Repository0100644000076500007500000000002310527341105020157 0ustar chugunovmicrodcmicrodc/src/common microdc2-0.15.6/src/common/CVS/Entries0100644000076500007500000000460310543546032017425 0ustar chugunovmicrodc/Makefile.am/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /bksearch.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /bksearch.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /byteq.c/1.2/Sun Oct 29 15:51:31 2006//Tmicrodc2_0_13_1_locale /byteq.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /comparison.h/1.2/Sat Nov 4 11:31:12 2006//Tmicrodc2_0_13_1_locale /error.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /error.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /hmap.h/1.2/Wed Nov 8 19:39:49 2006//Tmicrodc2_0_13_1_locale /intutil.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /intutil.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /minmaxonce.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /msgq.c/1.3/Wed Nov 8 19:40:17 2006//Tmicrodc2_0_13_1_locale /msgq.h/1.2/Sat Nov 4 11:31:12 2006//Tmicrodc2_0_13_1_locale /optparser.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /optparser.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /quoting.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /range.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /range.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strbuf.c/1.3/Sun Nov 12 16:51:19 2006//Tmicrodc2_0_13_1_locale /strbuf.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strleftcmp.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /strleftcmp.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /substrcmp.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /substrcmp.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /swap.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /tempdir.c/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /tempdir.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /tempfailure.h/1.1.1.1/Sun Oct 22 08:35:50 2006//Tmicrodc2_0_13_1_locale /tmap.c/1.2/Sat Nov 4 11:31:12 2006//Tmicrodc2_0_13_1_locale /tmap.h/1.2/Sat Nov 4 11:31:12 2006//Tmicrodc2_0_13_1_locale /hmap.c/1.2/Fri Nov 17 21:47:14 2006//Tmicrodc2_0_13_1_locale /ptrv.c/1.2.2.1/Sun Nov 26 14:40:39 2006//Tmicrodc2_0_13_1_locale /ptrv.h/1.1.1.1.2.1/Sun Nov 26 14:40:02 2006//Tmicrodc2_0_13_1_locale /quoting.c/1.2/Sun Dec 24 16:54:29 2006//Tmicrodc2_0_13_1_locale /Makefile.in/1.4/Sun Dec 24 18:44:51 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/src/common/CVS/Tag0100644000076500007500000000003010527341105016511 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/src/common/Makefile.am0100644000076500007500000000120410516626546017475 0ustar chugunovmicrodcAM_CFLAGS = -Wall AM_CPPFLAGS = \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib noinst_LIBRARIES = libcommon.a libcommon_a_SOURCES = \ bksearch.c \ bksearch.h \ byteq.c \ byteq.h \ comparison.h \ error.c \ error.h \ hmap.c \ hmap.h \ intutil.c \ intutil.h \ minmaxonce.h \ msgq.c \ msgq.h \ optparser.c \ optparser.h \ ptrv.c \ ptrv.h \ quoting.c \ quoting.h \ range.c \ range.h \ substrcmp.c \ substrcmp.h \ strbuf.c \ strbuf.h \ strleftcmp.c \ strleftcmp.h \ swap.h \ tempdir.c \ tempdir.h \ tempfailure.h \ tmap.c \ tmap.h libcommon_a_LIBADD = \ ../../lib/libgnu.a microdc2-0.15.6/src/common/Makefile.in0100644000076500007500000004054210543545243017510 0ustar chugunovmicrodc# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/common DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/ac_lib_readline.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/alloca.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/free.m4 \ $(top_srcdir)/m4/getaddrinfo.m4 $(top_srcdir)/m4/getdelim.m4 \ $(top_srcdir)/m4/gethostname.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/human.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconvme.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes.m4 \ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memmem.m4 $(top_srcdir)/m4/minmax.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/sig2str.m4 \ $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stdbool.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strtoimax.m4 \ $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoll.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strtoull.m4 \ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtol.m4 $(top_srcdir)/m4/xstrtoumax.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libcommon_a_AR = $(AR) $(ARFLAGS) libcommon_a_DEPENDENCIES = ../../lib/libgnu.a am_libcommon_a_OBJECTS = bksearch.$(OBJEXT) byteq.$(OBJEXT) \ error.$(OBJEXT) hmap.$(OBJEXT) intutil.$(OBJEXT) \ msgq.$(OBJEXT) optparser.$(OBJEXT) ptrv.$(OBJEXT) \ quoting.$(OBJEXT) range.$(OBJEXT) substrcmp.$(OBJEXT) \ strbuf.$(OBJEXT) strleftcmp.$(OBJEXT) tempdir.$(OBJEXT) \ tmap.$(OBJEXT) libcommon_a_OBJECTS = $(am_libcommon_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libcommon_a_SOURCES) DIST_SOURCES = $(libcommon_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FNMATCH_H = @FNMATCH_H@ GETOPT_H = @GETOPT_H@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ HAVE_LONG_64BIT = @HAVE_LONG_64BIT@ HAVE_LONG_LONG_64BIT = @HAVE_LONG_LONG_64BIT@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LOCALEDIR = @LOCALEDIR@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TR = @TR@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XML_CONFIG = @XML_CONFIG@ ac_ct_CC = @ac_ct_CC@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AM_CFLAGS = -Wall AM_CPPFLAGS = \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib noinst_LIBRARIES = libcommon.a libcommon_a_SOURCES = \ bksearch.c \ bksearch.h \ byteq.c \ byteq.h \ comparison.h \ error.c \ error.h \ hmap.c \ hmap.h \ intutil.c \ intutil.h \ minmaxonce.h \ msgq.c \ msgq.h \ optparser.c \ optparser.h \ ptrv.c \ ptrv.h \ quoting.c \ quoting.h \ range.c \ range.h \ substrcmp.c \ substrcmp.h \ strbuf.c \ strbuf.h \ strleftcmp.c \ strleftcmp.h \ swap.h \ tempdir.c \ tempdir.h \ tempfailure.h \ tmap.c \ tmap.h libcommon_a_LIBADD = \ ../../lib/libgnu.a all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/common/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/common/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libcommon.a: $(libcommon_a_OBJECTS) $(libcommon_a_DEPENDENCIES) -rm -f libcommon.a $(libcommon_a_AR) libcommon.a $(libcommon_a_OBJECTS) $(libcommon_a_LIBADD) $(RANLIB) libcommon.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bksearch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/byteq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msgq.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optparser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quoting.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/range.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strleftcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/substrcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmap.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: microdc2-0.15.6/src/common/bksearch.c0100644000076500007500000001044510516626546017376 0ustar chugunovmicrodc/* bksearch.c - Binary search with key indexing support * * Copyright (C) 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include "bksearch.h" static const void * bsearchpartial(const void *key, const void *base, size_t l, size_t u, size_t size, comparison_fn_t cmp, bool matches_above) { while (l < u) { size_t idx; const void *p; int comparison; idx = (l + u) / 2; p = (const void *) (((const char *) base) + (idx * size)); comparison = (*cmp)(key, p); if ((comparison == 0) == matches_above) u = idx; else l = idx + 1; } if (!matches_above) l--; return (const void *) (((const char *) base) + (l * size)); } static const void * bksearchpartial(const void *key, const void *base, size_t l, size_t u, size_t size, size_t keyoffs, comparison_fn_t cmp, bool matches_above) { while (l < u) { size_t idx; const void *p; int comparison; idx = (l + u) / 2; p = (const void *) (((const char *) base) + (idx * size)); comparison = (*cmp)(key, *(const void **) (((const char *) p) + keyoffs)); if ((comparison == 0) == matches_above) u = idx; else l = idx + 1; } if (!matches_above) l--; return (const void *) (((const char *) base) + (l * size)); } /* Find first and last match in an array using binary search. */ bool bsearchrange(const void *key, const void *base, size_t nmemb, size_t size, comparison_fn_t cmp, const void **first_match, const void **last_match) { const void *match; size_t idx; match = bsearch(key, base, nmemb, size, cmp); if (match == NULL) { if (first_match != NULL) *first_match = NULL; if (last_match != NULL) *last_match = NULL; return false; } idx = (((const char *) match) - ((const char *) base)) / size; if (first_match != NULL) *first_match = bsearchpartial(key, base, 0, idx, size, cmp, true); if (last_match != NULL) *last_match = bsearchpartial(key, base, idx+1, nmemb, size, cmp, false); return true; } /* Find first and last match in an array using binary search. * See bksearch for details regarding the keyoffs argument. */ bool bksearchrange(const void *key, const void *base, size_t nmemb, size_t size, size_t keyoffs, comparison_fn_t cmp, const void **first_match, const void **last_match) { const void *match; size_t idx; match = bksearch(key, base, nmemb, size, keyoffs, cmp); if (match == NULL) { if (first_match != NULL) *first_match = NULL; if (last_match != NULL) *last_match = NULL; return false; } idx = (((const char *) match) - ((const char *) base)) / size; if (first_match != NULL) *first_match = bksearchpartial(key, base, 0, idx, size, keyoffs, cmp, true); if (last_match != NULL) *last_match = bksearchpartial(key, base, idx+1, nmemb, size, keyoffs, cmp, false); return true; } /* Find a match in an array using binary search. * The keyoffs argument specified offset to key pointer in each member. * The key pointer will be passed as second argument to the comparison * function cmp. */ const void * bksearch(const void *key, const void *base, size_t nmemb, size_t size, size_t keyoffs, comparison_fn_t cmp) { size_t l, u, idx; const void *p; int comparison; l = 0; u = nmemb; while (l < u) { idx = (l + u) / 2; p = (const void *) (((const char *) base) + (idx * size)); comparison = (*cmp)(key, *(const void **) (((const char *) p) + keyoffs)); if (comparison < 0) u = idx; else if (comparison > 0) l = idx + 1; else return p; } return NULL; } microdc2-0.15.6/src/common/bksearch.h0100644000076500007500000000261510516626546017403 0ustar chugunovmicrodc/* bksearch.h - Binary search with key indexing support * * Copyright (C) 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef BKSEARCH_H #define BKSEARCH_H #include #include "comparison.h" const void *bksearch(const void *key, const void *base, size_t nmemb, size_t size, size_t keyoffs, comparison_fn_t cmp); bool bksearchrange(const void *key, const void *base, size_t nmemb, size_t size, size_t keyoffs, comparison_fn_t cmp, const void **first_match, const void **last_match); bool bsearchrange(const void *key, const void *base, size_t nmemb, size_t size, comparison_fn_t cmp, const void **first_match, const void **last_match); #endif microdc2-0.15.6/src/common/byteq.c0100644000076500007500000001312710521147003016716 0ustar chugunovmicrodc/* byteq.c - A queue structure holding bytes, designed for I/O tasks * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include "xvasprintf.h" /* Gnulib */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "xalloc.h" /* Gnulib */ #include "byteq.h" #include "full-read.h" #include "full-write.h" /* Arbitrary enlargement of the byteq. This function only guarantees tha * the structure will hold one more byte after the call. * Note: bq->max may never be 0. */ static inline void byteq_enlarge(ByteQ *bq) { bq->max *= 2; bq->buf = xrealloc(bq->buf, bq->max); } /* Allocate a new byteq with space for initial_size bytes. */ ByteQ * byteq_new(size_t initial_size) { ByteQ *bq; bq = xmalloc(sizeof(ByteQ)); bq->cur = 0; bq->max = MAX(1, initial_size); bq->buf = xmalloc(initial_size); return bq; } /* Free byteq and its buffer. */ void byteq_free(ByteQ *bq) { if (bq != NULL) { free(bq->buf); free(bq); } } /* Assure the queue has space for max bytes. */ void byteq_assure(ByteQ *bq, size_t max) { if (max > bq->max) { bq->max = max; bq->buf = xrealloc(bq->buf, bq->max); } } /* Append bytes to the byteq. */ void byteq_append(ByteQ *bq, void *data, size_t len) { if (len > 0) { byteq_assure(bq, bq->cur+len); memcpy(bq->buf + bq->cur, data, len); bq->cur += len; } } /* Append bytes to the byteq, va_list style. * This function cannot fail! */ int byteq_vappendf(ByteQ *bq, const char *format, va_list ap) { char *str; size_t len; str = xvasprintf(format, ap); len = strlen(str); byteq_append(bq, str, len); free(str); return len; } /* Append bytes to the byteq, printf style. */ int byteq_appendf(ByteQ *bq, const char *format, ...) { va_list args; size_t len; va_start(args, format); len = byteq_vappendf(bq, format, args); va_end(args); return len; } /* Remove len bytes from the beginning of the queue. */ void byteq_remove(ByteQ *bq, size_t len) { assert(bq->cur >= len); bq->cur -= len; if (bq->cur > 0) memmove(bq->buf, bq->buf + len, bq->cur); } /* Read once from fd into queue, so that queue ends up being * size bytes. This is the same as calling * * byteq_assure(bq, len); * byteq_read(bq, fd); * */ ssize_t byteq_read_upto(ByteQ *bq, int fd, size_t len) { ssize_t res; if (len <= bq->cur) return 0; byteq_assure(bq, bq->cur + len); res = read(fd, bq->buf + bq->cur, len - bq->cur); if (res > 0) bq->cur += res; return res; } ssize_t byteq_full_read_upto(ByteQ *bq, int fd, size_t len) { ssize_t res; if (len <= bq->cur) return 0; byteq_assure(bq, bq->cur + len); res = full_read(fd, bq->buf + bq->cur, len - bq->cur); if (res > 0) bq->cur += res; return res; } /* Read from fd into queue. If queue if full from beginning, * enlarge it first. */ ssize_t byteq_read(ByteQ *bq, int fd) { ssize_t res; if (bq->cur == bq->max) byteq_enlarge(bq); res = read(fd, bq->buf + bq->cur, bq->max - bq->cur); if (res > 0) bq->cur += res; return res; } /* Should make sure the queue is non-full prior to calling this. */ ssize_t byteq_full_read(ByteQ *bq, int fd) { ssize_t res = 0; res = full_read(fd, bq->buf+bq->cur, bq->max-bq->cur); if (res > 0) bq->cur += res; return res; } /* Write all of queue, removing written data from queue * afterwards. * Should make sure the queue is non-empty prior to calling this. */ ssize_t byteq_write(ByteQ *bq, int fd) { ssize_t res; res = write(fd, bq->buf, bq->cur); if (res > 0) { bq->cur -= res; if (bq->cur > 0) memmove(bq->buf, bq->buf + res, bq->cur); } return res; } /* Should make sure the queue is non-empty prior to calling this. */ ssize_t byteq_full_write(ByteQ *bq, int fd) { ssize_t res; res = full_write(fd, bq->buf, bq->cur); if (res > 0) { bq->cur -= res; if (bq->cur > 0) memmove(bq->buf, bq->buf + res, bq->cur); } return res; } void byteq_clear(ByteQ *bq) { bq->cur = 0; } ssize_t byteq_sendto(ByteQ *bq, int fd, int flags, const struct sockaddr *to, socklen_t tolen) { ssize_t res; res = sendto(fd, bq->buf, bq->cur, flags, to, tolen); if (res > 0) { bq->cur -= res; if (bq->cur > 0) memmove(bq->buf, bq->buf + res, bq->cur); } return res; } ssize_t byteq_recvfrom(ByteQ *bq, int fd, int flags, struct sockaddr *from, socklen_t *fromlen) { ssize_t res; if (bq->cur == bq->max) byteq_enlarge(bq); res = recvfrom(fd, bq->buf+bq->cur, bq->max-bq->cur, flags, from, fromlen); if (res > 0) bq->cur += res; return res; } microdc2-0.15.6/src/common/byteq.h0100644000076500007500000000430410516626546016742 0ustar chugunovmicrodc/* byteq.h - A queue structure holding bytes, designed for I/O tasks * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef BYTEQ_H #define BYTEQ_H #include #include #include #include #include #include typedef struct _ByteQ ByteQ; struct _ByteQ { char *buf; /* Byte buffer */ size_t cur; /* Current number of bytes used in buffer */ size_t max; /* Number of bytes (used or not) in buffer */ #ifdef HAVE_FOPENCOOKIE FILE *file; /* Custom stream for speeding up byteq_(v)appendf */ #endif }; ByteQ *byteq_new(size_t initial_size); void byteq_free(ByteQ *bq); void byteq_append(ByteQ *bq, void *data, size_t len); int byteq_vappendf(ByteQ *bq, const char *format, va_list ap) __attribute__ ((format (printf, 2, 0))); int byteq_appendf(ByteQ *bq, const char *format, ...) __attribute__ ((format (printf, 2, 3))); void byteq_remove(ByteQ *bq, size_t len); void byteq_assure(ByteQ *bq, size_t max); ssize_t byteq_read(ByteQ *bq, int fd); ssize_t byteq_full_read(ByteQ *bq, int fd); ssize_t byteq_read_upto(ByteQ *bq, int fd, size_t len); ssize_t byteq_full_read_upto(ByteQ *bq, int fd, size_t len); ssize_t byteq_write(ByteQ *bq, int fd); ssize_t byteq_full_write(ByteQ *bq, int fd); void byteq_clear(ByteQ *bq); ssize_t byteq_sendto(ByteQ *bq, int fd, int flags, const struct sockaddr *to, socklen_t tolen); ssize_t byteq_recvfrom(ByteQ *bq, int fd, int flags, struct sockaddr *from, socklen_t *fromlen); #endif microdc2-0.15.6/src/common/comparison.h0100644000076500007500000000235610523075000017752 0ustar chugunovmicrodc/* Define the comparison_fn_t type from GNU Libc. * * Copyright (C) 2005 Oskar Liljeblad * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_COMPARISON_H #define COMMON_COMPARISON_H /* This file requires configure.ac additions (in the specified order): * AC_GNU_SOURCE * AC_CHECK_TYPES([comparison_fn_t]) */ /* GNU Libc defines comparison_fn_t in stdlib.h if _GNU_SOURCE set. */ #include #ifndef HAVE_COMPARISON_FN_T typedef int (*comparison_fn_t)(const void *, const void *); #endif typedef int (*complex_comparison_fn_t)(const void *, const void *, void *); #endif microdc2-0.15.6/src/common/error.c0100644000076500007500000000317110516626546016743 0ustar chugunovmicrodc/* error.c - Generic functions for error management and reporting * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "error.h" /* This function will be called by warn and die to write text to the screen * (or log file, etc). */ vprintf_fn_t warn_writer = default_warn_writer; /* The default warning writer, which writes warnings to stderr. */ int default_warn_writer(const char *format, va_list ap) { return vfprintf(stderr, format, ap); } /* Print a message to screen and terminate the program. */ void die(const char *format, ...) { va_list args; va_start(args, format); warn_writer(format, args); va_end(args); exit(EXIT_FAILURE); } /* Print a message to screen. */ void warn(const char *format, ...) { va_list args; va_start(args, format); warn_writer(format, args); va_end(args); } microdc2-0.15.6/src/common/error.h0100644000076500007500000000275310516626546016755 0ustar chugunovmicrodc/* error.h - Generic functions for error management and reporting * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_ERROR_H #define COMMON_ERROR_H #include /* for ... */ #include /* for errstr */ #include /* for strerror */ #include /* for FILE */ /* Current error message as a string. */ #define errstr (strerror(errno)) typedef int (*vprintf_fn_t)(const char *format, va_list ap); typedef int (*vfprintf_fn_t)(FILE *stream, const char *format, va_list ap); extern vprintf_fn_t warn_writer; int default_warn_writer(const char *format, va_list ap); void die(const char *format, ...) __attribute__ ((noreturn, format (printf, 1, 2))); void warn(const char *format, ...) __attribute__ ((format (printf, 1, 2))); #endif microdc2-0.15.6/src/common/hmap.c0100644000076500007500000002241110527426742016533 0ustar chugunovmicrodc/* hmap.c - A hash map data structure * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include /* Gnulib */ #include "xalloc.h" /* Gnulib */ #include "hmap.h" #define DEFAULT_CAPACITY 11 #define DEFAULT_LOAD_FACTOR 0.75F typedef struct _HMapEntry HMapEntry; typedef struct _HMapIteratorPriv HMapIteratorPriv; struct _HMapEntry { void *key; void *value; HMapEntry *next; }; struct _HMap { HMapEntry **buckets; size_t buckets_length; size_t threshold; float load_factor; size_t size; hash_fn_t hash; comparison_fn_t compare; }; struct _HMapIteratorPriv { bool (*has_next)(HMapIterator *it); void *(*next)(HMapIterator *it); HMap *map; uint32_t index; HMapEntry *entry; HMapEntry *previous_entry; }; uint32_t strhash(const char *str) { uint32_t hash = 0; for (; *str != '\0'; str++) hash = (hash << 5) - hash + *str; return hash; } uint32_t strcasehash(const char *str) { uint32_t hash = 0; for (; *str != '\0'; str++) hash = (hash << 5) - hash + tolower(*str); return hash; } static inline uint32_t hmap_hash(HMap *map, const void *key) { return (key == NULL ? 0 : map->hash(key) % map->buckets_length); } static void * hmap_iterator_next(HMapIterator *it) { HMapIteratorPriv *itp = (HMapIteratorPriv *) it; HMap *map = itp->map; void *data; if (itp->entry == NULL) return NULL; data = itp->entry->value; itp->previous_entry = itp->entry; itp->entry = itp->entry->next; if (itp->entry == NULL) { uint32_t i; i = itp->index+1; while (i < map->buckets_length && map->buckets[i] == NULL) i++; itp->index = i; itp->entry = (i < map->buckets_length ? map->buckets[i] : NULL); } return data; } static bool hmap_iterator_has_next(HMapIterator *it) { HMapIteratorPriv *itp = (HMapIteratorPriv *) it; return itp->entry != NULL; } static inline void hmap_rehash(HMap *map) { HMapEntry **old_buckets = map->buckets; uint32_t old_capacity = map->buckets_length; uint32_t i; map->buckets_length = (map->buckets_length * 2) + 1; map->threshold = (uint32_t) (map->buckets_length * map->load_factor); map->buckets = xmalloc(map->buckets_length * sizeof(HMapEntry *)); memset(map->buckets, 0, map->buckets_length * sizeof(HMapEntry *)); for (i = 0; i < old_capacity; i++) { HMapEntry *entry = old_buckets[i]; while (entry != NULL) { uint32_t index = hmap_hash(map, entry->key); HMapEntry *dest = map->buckets[index]; HMapEntry *next; if (dest != NULL) { while (dest->next != NULL) dest = dest->next; dest->next = entry; } else { map->buckets[index] = entry; } next = entry->next; entry->next = NULL; entry = next; } } free(old_buckets); } void hmap_set_compare_fn(HMap *map, comparison_fn_t compare) { map->compare = compare; } void hmap_set_hash_fn(HMap *map, hash_fn_t hash) { map->hash = hash; } HMap * hmap_new(void) { HMap *map; map = xmalloc(sizeof(HMap)); map->buckets_length = DEFAULT_CAPACITY; map->load_factor = DEFAULT_LOAD_FACTOR; map->buckets = xmalloc(map->buckets_length * sizeof(HMapEntry *)); map->threshold = (uint32_t) (map->buckets_length * map->load_factor); map->size = 0; map->hash = (hash_fn_t) strhash; map->compare = (comparison_fn_t) strcmp; memset(map->buckets, 0, map->buckets_length * sizeof(HMapEntry *)); return map; } void hmap_free(HMap *map) { if (map != NULL) { hmap_clear(map); free(map->buckets); free(map); } } #if 0 typedef int (*HMapCustomComparator*)(const void *key0, const void *key, void *data); static HMapEntry * hmap_get_entry_custom(HMap *map, const void *key, HMapCustomComparator *cmp, void *data) { HMapEntry *entry = map->buckets[hmap_hash(map, key)]; if (key == NULL) { for (; entry != NULL; entry = entry->next) { if (entry->key == NULL) return entry; } } else { for (; entry != NULL; entry = entry->next) { if (cmp(key, entry->key, data) == 0) return entry; } } return NULL; } /* Example usage: * int * map_strncmp(const void *key0, const void *key, void *data) * { * size_t n = *(size_t *) data; * return strncmp(key0, key, n); * } * value = hmap_get_custom(map, unterminated_key, map_strncmp, &key_length); */ void * hmap_get_custom(HMap *map, const void *key, HMapCustomComparator *cmp, void *data) { HMapEntry *entry = hmap_get_entry_custom(map, key, cmp, data); return (entry != NULL ? entry->value : NULL); } #endif static HMapEntry * hmap_get_entry(HMap *map, const void *key) { HMapEntry *entry = map->buckets[hmap_hash(map, key)]; if (key == NULL) { for (; entry != NULL; entry = entry->next) { if (entry->key == NULL) return entry; } } else { for (; entry != NULL; entry = entry->next) { if (map->compare(key, entry->key) == 0) return entry; } } return NULL; } void * hmap_get(HMap *map, const void *key) { HMapEntry *entry = hmap_get_entry(map, key); return entry != NULL ? entry->value : NULL; } void * hmap_put(HMap *map, void *key, void *value) { HMapEntry *entry; uint32_t index; index = hmap_hash(map, key); if (key == NULL) { for (entry = map->buckets[index]; entry != NULL; entry = entry->next) { if (entry->key == NULL) { void *old_value = entry->value; entry->value = value; return old_value; } } } else { for (entry = map->buckets[index]; entry != NULL; entry = entry->next) { if (map->compare(key, entry->key) == 0) { void *old_value = entry->value; entry->value = value; return old_value; } } } map->size++; if (map->size > map->threshold) { hmap_rehash(map); index = hmap_hash(map, key); } entry = xmalloc(sizeof(HMapEntry)); entry->key = key; entry->value = value; entry->next = map->buckets[index]; map->buckets[index] = entry; return NULL; } void * hmap_remove(HMap *map, const void *key) { uint32_t index = hmap_hash(map, key); HMapEntry *entry; HMapEntry *last = NULL; if (key == NULL) { for (entry = map->buckets[index]; entry != NULL; entry = entry->next) { if (entry->key == NULL) { void *value = entry->value; if (last == NULL) map->buckets[index] = entry->next; else last->next = entry->next; map->size--; free(entry); return value; } last = entry; } } else { for (entry = map->buckets[index]; entry != NULL; entry = entry->next) { if (map->compare(key, entry->key) == 0) { void *value = entry->value; if (last == NULL) map->buckets[index] = entry->next; else last->next = entry->next; map->size--; free(entry); return value; } last = entry; } } return NULL; } void hmap_iterator(HMap *map, HMapIterator *it) { HMapIteratorPriv *itp = (HMapIteratorPriv *) it; uint32_t i; it->next = hmap_iterator_next; it->has_next = hmap_iterator_has_next; for (i = 0; i < map->buckets_length && map->buckets[i] == NULL; i++); itp->map = map; itp->index = i; itp->entry = (i < map->buckets_length ? map->buckets[i] : NULL); itp->previous_entry = NULL; } /* It is allowed to remove the current entry from the iterator callback * function. But no other entry. */ void hmap_foreach_value(HMap *map, void (*iterator)()) { uint32_t c; for (c = 0; c < map->buckets_length; c++) { HMapEntry *entry; for (entry = map->buckets[c]; entry != NULL; ) { HMapEntry *next = entry->next; iterator(entry->value); entry = next; } } } void hmap_foreach_key(HMap *map, void (*iterator)()) { uint32_t c; for (c = 0; c < map->buckets_length; c++) { HMapEntry *entry; for (entry = map->buckets[c]; entry != NULL; ) { HMapEntry *next = entry->next; iterator(entry->key); entry = next; } } } void hmap_clear(HMap *map) { uint32_t c; for (c = 0; c < map->buckets_length; c++) { HMapEntry *entry = map->buckets[c]; while (entry != NULL) { HMapEntry *next = entry->next; free(entry); entry = next; } map->buckets[c] = NULL; } map->size = 0; } size_t hmap_size(HMap *map) { return map->size; } bool hmap_contains_key(HMap *map, const void *key) { return hmap_get_entry(map, key) != NULL; } microdc2-0.15.6/src/common/hmap.h0100644000076500007500000000365210524431205016531 0ustar chugunovmicrodc/* hmap.h - A hash map data structure * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_HMAP_H #define COMMON_HMAP_H #include #include #include #include "comparison.h" typedef struct _HMap HMap; typedef struct _HMapIterator HMapIterator; typedef uint32_t (*hash_fn_t)(const void *key); struct _HMapIterator { bool (*has_next)(HMapIterator *it); void *(*next)(HMapIterator *it); /* Private data follow */ void *p0; uint32_t p1; void *p2; void *p3; }; uint32_t strhash(const char *str); uint32_t strcasehash(const char *str); #define hmap_is_empty(m) (hmap_size(m) == 0) HMap *hmap_new(void); void hmap_free(HMap *map); void *hmap_get(HMap *map, const void *key); void *hmap_put(HMap *map, void *key, void *value); bool hmap_contains_key(HMap *map, const void *key); void *hmap_remove(HMap *map, const void *key); void hmap_iterator(HMap *map, HMapIterator *it); void hmap_foreach_key(HMap *map, void (*iterator)()); void hmap_foreach_value(HMap *map, void (*iterator)()); void hmap_clear(HMap *map); size_t hmap_size(HMap *map); void hmap_set_hash_fn(HMap *map, hash_fn_t hash); void hmap_set_compare_fn(HMap *map, comparison_fn_t compare); #endif microdc2-0.15.6/src/common/intutil.c0100644000076500007500000001523710516626546017310 0ustar chugunovmicrodc/* intutil.c - Integer utility functions. * * Copyright (C) 2001, 2002, 2003, 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* Gnulib, C99 */ #include /* C89 */ #include /* ? */ #include "intutil.h" #define INT_STR_FUNC(n,t,m) \ char * \ n(t value) \ { \ sprintf(intstr, "%" m, value); \ return intstr; \ } /* Why 23 characters? */ /* 2^64-1 in octal is 22 chars + null byte = 23 */ static char intstr[23]; INT_STR_FUNC(uint64_str, uint64_t, PRIu64); INT_STR_FUNC(uint32_str, uint32_t, PRIu32); INT_STR_FUNC(uint16_str, uint16_t, PRIu16); INT_STR_FUNC(uint8_str, uint8_t, PRIu8); INT_STR_FUNC(int32_str, int32_t, PRIi32); INT_STR_FUNC(int64_str, int64_t, PRIi64); INT_STR_FUNC(int16_str, int16_t, PRIi16); INT_STR_FUNC(int8_str, int8_t, PRIi8); /* These are probably used very seldom, so they are disabled. */ #if 0 INT_STR_FUNC(uintptr_str, uintptr_t, PRIuPTR); INT_STR_FUNC(intptr_str, intptr_t, PRIiPTR); INT_STR_FUNC(uintmax_str, uintmax_t, PRIuMAX); INT_STR_FUNC(intmax_str, intmax_t, PRIiMAX); INT_STR_FUNC(uintptr_octstr, uintptr_t, PRIoPTR); INT_STR_FUNC(uintmax_octstr, uintmax_t, PRIoMAX); INT_STR_FUNC(uint64_octstr, uint64_t, PRIo64); INT_STR_FUNC(uint32_octstr, uint32_t, PRIo32); INT_STR_FUNC(uint16_octstr, uint16_t, PRIo16); INT_STR_FUNC(uint8_octstr, uint8_t, PRIo8); INT_STR_FUNC(uintptr_hexstr, uintptr_t, PRIxPTR); INT_STR_FUNC(uintmax_hexstr, uintmax_t, PRIxMAX); INT_STR_FUNC(uint64_hexstr, uint64_t, PRIx64); INT_STR_FUNC(uint32_hexstr, uint32_t, PRIx32); INT_STR_FUNC(uint16_hexstr, uint16_t, PRIx16); INT_STR_FUNC(uint8_hexstr, uint8_t, PRIx8); INT_STR_FUNC(uintptr_hexustr, uintptr_t, PRIXPTR); INT_STR_FUNC(uintmax_hexustr, uintmax_t, PRIXMAX); INT_STR_FUNC(uint64_hexustr, uint64_t, PRIX64); INT_STR_FUNC(uint32_hexustr, uint32_t, PRIX32); INT_STR_FUNC(uint16_hexustr, uint16_t, PRIX16); INT_STR_FUNC(uint8_hexustr, uint8_t, PRIX8); #endif bool parse_int8(const char *instr, int8_t *outint) { int8_t value = 0; if (*instr == '-') { if (instr[1] == '\0') return false; for (instr++; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value < INT8_MIN/10 || (value == INT8_MIN/10 && c > -(INT8_MIN%10))) return false; value = value*10 - c; } } else { if (*instr == '\0') return false; for (; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value > INT8_MAX/10 || (value == INT8_MAX/10 && c > INT8_MAX%10)) return false; value = value*10 + c; } } *outint = value; return true; } bool parse_int16(const char *instr, int16_t *outint) { int16_t value = 0; if (*instr == '-') { if (instr[1] == '\0') return false; for (instr++; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value < INT16_MIN/10 || (value == INT16_MIN/10 && c > -(INT16_MIN%10))) return false; value = value*10 - c; } } else { if (*instr == '\0') return false; for (; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value > INT16_MAX/10 || (value == INT16_MAX/10 && c > INT16_MAX%10)) return false; value = value*10 + c; } } *outint = value; return true; } bool parse_int32(const char *instr, int32_t *outint) { int32_t value = 0; if (*instr == '-') { if (instr[1] == '\0') return false; for (instr++; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value < INT32_MIN/10L || (value == INT32_MIN/10L && c > -(INT32_MIN%10L))) return false; value = value*10L - c; } } else { if (*instr == '\0') return false; for (; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value > INT32_MAX/10L || (value == INT32_MAX/10L && c > INT32_MAX%10L)) return false; value = value*10L + c; } } *outint = value; return true; } bool parse_int64(const char *instr, int64_t *outint) { int64_t value = 0; if (*instr == '-') { if (instr[1] == '\0') return false; for (instr++; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value < INT64_MIN/10LL || (value == INT64_MIN/10LL && c > -(INT64_MIN%10LL))) return false; value = value*10LL - c; } } else { if (*instr == '\0') return false; for (; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value > INT64_MAX/10LL || (value == INT64_MAX/10LL && c > INT64_MAX%10LL)) return false; value = value*10LL + c; } } *outint = value; return true; } bool parse_uint8(const char *instr, uint8_t *outint) { uint8_t value = 0; for (; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value > UINT8_MAX/10 || (value == UINT8_MAX/10 && c > UINT8_MAX%10)) return false; value = value*10 + c; } *outint = value; return true; } bool parse_uint16(const char *instr, uint16_t *outint) { uint16_t value = 0; for (; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value > UINT16_MAX/10 || (value == UINT16_MAX/10 && c > UINT16_MAX%10)) return false; value = value*10 + c; } *outint = value; return true; } bool parse_uint32(const char *instr, uint32_t *outint) { uint32_t value = 0; for (; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value > UINT32_MAX/10L || (value == UINT32_MAX/10L && c > UINT32_MAX%10)) return false; value = value*10L + c; } *outint = value; return true; } bool parse_uint64(const char *instr, uint64_t *outint) { uint64_t value = 0; for (; *instr != '\0'; instr++) { int8_t c = *instr - '0'; if (c < 0 || c > 9) return false; if (value > UINT64_MAX/10LL || (value == UINT64_MAX/10LL && c > UINT64_MAX%10LL)) return false; value = value*10LL + c; } *outint = value; return true; } microdc2-0.15.6/src/common/intutil.h0100644000076500007500000000323210516626546017305 0ustar chugunovmicrodc/* intutil.c - Integer utility functions. * * Copyright (C) 2001, 2002, 2003, 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_INTUTIL_H #define COMMON_INTUTIL_H #include /* Gnulib, C99, POSIX */ #include /* Gnulib, C99, POSIX */ char *uint64_str(uint64_t value); char *uint32_str(uint32_t value); char *uint16_str(uint16_t value); char *uint8_str(uint8_t value); char *int64_str(int64_t value); char *int32_str(int32_t value); char *int16_str(int16_t value); char *int8_str(int8_t value); bool parse_int8(const char *instr, int8_t *outint); bool parse_int16(const char *instr, int16_t *outint); bool parse_int32(const char *instr, int32_t *outint); bool parse_int64(const char *instr, int64_t *outint); bool parse_uint8(const char *instr, uint8_t *outint); bool parse_uint16(const char *instr, uint16_t *outint); bool parse_uint32(const char *instr, uint32_t *outint); bool parse_uint64(const char *instr, uint64_t *outint); #endif microdc2-0.15.6/src/common/minmaxonce.h0100644000076500007500000000215410516626546017755 0ustar chugunovmicrodc/* minmaxonce.h - min and max macros evaluating arguments once (for GCC) * * Copyright (C) 2005 Oskar Liljeblad * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef MINMAXONCE_H #define MINMAXONCE_H #if HAVE_CONFIG_H #include #endif #ifndef min #define min(a,b) ({ typeof(a) _a = a; typeof(b) _b = b; _a < _b ? _a : _b; }) #endif #ifndef max #define max(a,b) ({ typeof(a) _a = a; typeof(b) _b = b; _a > _b ? _a : _b; }) #endif #endif microdc2-0.15.6/src/common/msgq.c0100644000076500007500000002235610524431241016550 0ustar chugunovmicrodc/* msgq.c - Message passing that is non-blocking * * Copyright (C) 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include "xalloc.h" /* Gnulib */ #include "byteq.h" #include "msgq.h" #define DEFAULT_MSGQ_BYTEQ_SIZE 128 /* It is assumed that fd is in non-blocking mode. */ MsgQ * msgq_new(int fd) { MsgQ *mq = xmalloc(sizeof(MsgQ)); mq->fd = fd; mq->queue = byteq_new(DEFAULT_MSGQ_BYTEQ_SIZE); return mq; } void msgq_free(MsgQ *mq) { if (mq != NULL) { byteq_free(mq->queue); free(mq); } } ssize_t msgq_write(MsgQ *mq) { return byteq_write(mq->queue, mq->fd); } /* This function returns -1 on error, and 1 on success. */ int msgq_write_all(MsgQ *mq) { int cur = mq->queue->cur; if (byteq_full_write(mq->queue, mq->fd) < cur) return -1; return 1; } ssize_t msgq_read(MsgQ *mq) { return byteq_read(mq->queue, mq->fd); } /* This assumes that mq->queue is empty! * It returns 0 on EOF, -1 on error, and 1 on success. */ int msgq_read_complete_msg(MsgQ *mq) { size_t size; int res; if (mq->queue->cur < sizeof(size)) { res = byteq_full_read_upto(mq->queue, mq->fd, sizeof(size)); if (res < sizeof(size)) return (errno == 0 ? 0 : -1); } memcpy(&size, mq->queue->buf, sizeof(size)); if (mq->queue->cur < sizeof(size)+size) { res = byteq_full_read_upto(mq->queue, mq->fd, sizeof(size)+size); if (res < size) return (errno == 0 ? 0 : -1); } return 1; } bool msgq_has_partial_msg(MsgQ *mq) { return mq->queue->cur != 0; } bool msgq_has_complete_msg(MsgQ *mq) { size_t size; if (mq->queue->cur < sizeof(size)) return false; memcpy(&size, mq->queue->buf, sizeof(size)); if (mq->queue->cur < sizeof(size) + size) return false; return true; } size_t msgq_calc_put_args_size(MsgQ *mq, va_list args) { size_t size = 0; MsgQType type; while ((type = va_arg(args, MsgQType)) != MSGQ_END) { if (type == MSGQ_INT) { int intval = va_arg(args, int); size += sizeof(intval); } else if (type == MSGQ_INT32) { int32_t intval = va_arg(args, int32_t); size += sizeof(intval); } else if (type == MSGQ_INT64) { int64_t intval = va_arg(args, int64_t); size += sizeof(intval); } else if (type == MSGQ_BOOL) { bool boolval = va_arg(args, int); size += sizeof(boolval); } else if (type == MSGQ_STR) { char *strval = va_arg(args, char *); size += sizeof(size_t) + (strval == NULL ? 0 : strlen(strval)+1); } else if (type == MSGQ_BLOB) { void *dataval = va_arg(args, void *); size_t sizeval = va_arg(args, size_t); size += sizeof(size_t) + (dataval == NULL ? 0 : sizeval); } else if (type == MSGQ_STRARY) { char **aryval = va_arg(args, char **); size += sizeof(size_t); if (aryval != NULL) { for (; *aryval != NULL; aryval++) size += sizeof(size_t) + strlen(*aryval)+1; } } } return size; } void msgq_vput(MsgQ *mq, size_t size, va_list args) { MsgQType type; byteq_append(mq->queue, &size, sizeof(size)); while ((type = va_arg(args, MsgQType)) != MSGQ_END) { if (type == MSGQ_INT) { int intval = va_arg(args, int); byteq_append(mq->queue, &intval, sizeof(intval)); } else if (type == MSGQ_INT32) { int32_t intval = va_arg(args, int32_t); byteq_append(mq->queue, &intval, sizeof(intval)); } else if (type == MSGQ_INT64) { int64_t intval = va_arg(args, int64_t); byteq_append(mq->queue, &intval, sizeof(intval)); } else if (type == MSGQ_BOOL) { bool boolval = va_arg(args, int); byteq_append(mq->queue, &boolval, sizeof(boolval)); } else if (type == MSGQ_STR) { char *strval = va_arg(args, char *); size_t len = (strval == NULL ? SIZE_MAX : strlen(strval)+1); byteq_append(mq->queue, &len, sizeof(len)); if (strval != NULL) byteq_append(mq->queue, strval, len); } else if (type == MSGQ_BLOB) { void *dataval = va_arg(args, void *); size_t sizeval = va_arg(args, size_t); if (dataval == NULL) sizeval = SIZE_MAX; byteq_append(mq->queue, &sizeval, sizeof(sizeval)); if (dataval != NULL) byteq_append(mq->queue, dataval, sizeval); } else if (type == MSGQ_STRARY) { char **aryval = va_arg(args, char **); size_t len; if (aryval == NULL) { len = SIZE_MAX; byteq_append(mq->queue, &len, sizeof(len)); } else { for (len = 0; aryval[len] != NULL; len++); byteq_append(mq->queue, &len, sizeof(len)); for (; *aryval != NULL; aryval++) { len = strlen(*aryval)+1; byteq_append(mq->queue, &len, sizeof(len)); byteq_append(mq->queue, *aryval, len); } } } } } int msgq_put_sync(MsgQ *mq, ...) { va_list args; size_t size; va_start(args, mq); size = msgq_calc_put_args_size(mq, args); va_end(args); va_start(args, mq); msgq_vput(mq, size, args); va_end(args); return msgq_write_all(mq); /* FIXME handle error? */ } void msgq_put(MsgQ *mq, ...) { va_list args; size_t size; va_start(args, mq); size = msgq_calc_put_args_size(mq, args); va_end(args); va_start(args, mq); msgq_vput(mq, size, args); va_end(args); } /* This function returns the number of bytes that were in the message * (including header). */ static size_t msgq_vget(MsgQ *mq, va_list args) { size_t size; char *buf; MsgQType type; buf = mq->queue->buf; memcpy(&size, buf, sizeof(size)); buf += sizeof(size); while ((type = va_arg(args, MsgQType)) != MSGQ_END) { if (type == MSGQ_INT) { int *intptr = va_arg(args, int *); memcpy(intptr, buf, sizeof(*intptr)); buf += sizeof(*intptr); } else if (type == MSGQ_INT32) { int32_t *intptr = va_arg(args, int32_t *); memcpy(intptr, buf, sizeof(*intptr)); buf += sizeof(*intptr); } else if (type == MSGQ_INT64) { int64_t *intptr = va_arg(args, int64_t *); memcpy(intptr, buf, sizeof(*intptr)); buf += sizeof(*intptr); } else if (type == MSGQ_BOOL) { bool *boolptr = va_arg(args, bool *); memcpy(boolptr, buf, sizeof(*boolptr)); buf += sizeof(*boolptr); } else if (type == MSGQ_STR) { char **strptr = va_arg(args, char **); size_t len; memcpy(&len, buf, sizeof(len)); buf += sizeof(len); if (len == SIZE_MAX) { *strptr = NULL; } else { *strptr = xstrdup(buf); buf += strlen(buf)+1; } } else if (type == MSGQ_BLOB) { void **dataptr = va_arg(args, void **); size_t *sizeptr = va_arg(args, size_t *); size_t len; memcpy(&len, buf, sizeof(len)); buf += sizeof(len); if (len == SIZE_MAX) { *dataptr = NULL; *sizeptr = 0; } else { *dataptr = xmemdup(buf, len); *sizeptr = len; buf += len; } } else if (type == MSGQ_STRARY) { char ***aryptr = va_arg(args, char ***); size_t c; size_t len; memcpy(&len, buf, sizeof(len)); buf += sizeof(len); if (len == SIZE_MAX) { *aryptr = NULL; } else { *aryptr = xmalloc((len+1) * sizeof(char *)); for (c = 0; c < len; c++) { size_t lenstr; memcpy(&lenstr, buf, sizeof(lenstr)); buf += sizeof(lenstr); (*aryptr)[c] = xmemdup(buf, lenstr); buf += lenstr; } (*aryptr)[c] = NULL; } } } return sizeof(size)+size; } void msgq_peek(MsgQ *mq, ...) { va_list args; va_start(args, mq); msgq_vget(mq, args); va_end(args); } /* This function assumes that msgq_has_complete_msg is true. */ void msgq_get(MsgQ *mq, ...) { size_t count; va_list args; va_start(args, mq); count = msgq_vget(mq, args); va_end(args); byteq_remove(mq->queue, count); } int msgq_get_sync(MsgQ *mq, ...) { int res; size_t count; va_list args; res = msgq_read_complete_msg(mq); if (res <= 0) return res; va_start(args, mq); count = msgq_vget(mq, args); va_end(args); byteq_remove(mq->queue, count); return 1; } microdc2-0.15.6/src/common/msgq.h0100644000076500007500000000334710523075000016550 0ustar chugunovmicrodc/* msgq.h - Message passing that is non-blocking * * Copyright (C) 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_MSGQ_H #define COMMON_MSGQ_H #include #include #include #include "byteq.h" typedef enum { MSGQ_END = 0, MSGQ_INT, /* int (signed or not) */ MSGQ_INT32, /* int32 (signed or not) */ MSGQ_INT64, /* int64 (signed or not) */ MSGQ_BOOL, /* bool */ MSGQ_STR, /* char * */ MSGQ_BLOB, /* void *, size_t */ MSGQ_STRARY /* char ** (terminated by NULL entry) */ } MsgQType; struct _MsgQ { int fd; ByteQ *queue; }; typedef struct _MsgQ MsgQ; MsgQ *msgq_new(int fd); void msgq_free(MsgQ *mq); ssize_t msgq_read(MsgQ *mq); ssize_t msgq_write(MsgQ *mq); int msgq_read_complete_msg(MsgQ *mq); int msgq_write_all(MsgQ *mq); bool msgq_has_partial_msg(MsgQ *mq); bool msgq_has_complete_msg(MsgQ *mq); void msgq_put(MsgQ *mq, ...); void msgq_get(MsgQ *mq, ...); void msgq_peek(MsgQ *mq, ...); int msgq_put_sync(MsgQ *mq, ...); int msgq_get_sync(MsgQ *mq, ...); #endif microdc2-0.15.6/src/common/optparser.c0100644000076500007500000002241310516626546017631 0ustar chugunovmicrodc/* optparser.c - Option parser that reports errors properly * * Copyright (C) 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include /* C89 */ #include /* C89 */ #include /* C89 */ #include /* Gnulib/C99/POSIX */ #include "gettext.h" /* Gnulib/GNU gettext */ #define _(s) gettext(s) #define N_(s) gettext_noop(s) #include "xalloc.h" /* Gnulib */ #include "xvasprintf.h" /* Gnulib */ #include "xstrndup.h" /* Gnulib */ #include "tmap.h" #include "strleftcmp.h" #include "substrcmp.h" #include "optparser.h" typedef struct _OptParserState OptParserState; struct _OptParserState { int cur_arg; int cur_chr; bool no_more_opts; char *value; char *error; }; struct _OptParser { TMap *options; OptDetail *short_opts[128-32]; /* XXX: this is crude, but it works */ bool parse_argv0; //bool print_errors; //bool reorder_args; //bool return_args; bool parsing_opts; int argc; char **argv; OptParserState parse_state; }; static void parse_config(OptParser *parser, OptParserConfig field, va_list args) { if (field & OPTP_PARSE_ARGV0) parser->parse_argv0 = true; /*if (field & OPTP_NO_ERRORS) parser->print_errors = false; if (field & OPTP_NO_REORDER) parser->reorder_args = false; if (field & OPTP_RETURN_ARGS) parser->return_args = true;*/ } static void report_error(OptParser *p, const char *format, ...) { va_list args; va_start(args, format); p->parse_state.error = xvasprintf(format, args); va_end(args); } static OptDetail * lookup_long_option(OptParser *p, const char *str) { TMapIterator it; tmap_iterator_partial(p->options, &it, str, (comparison_fn_t) strleftcmp); if (it.has_next(&it)) { OptDetail *option = it.next(&it); while (it.has_next(&it)) { if (it.next(&it) != option) { report_error(p, _("option `--%s' is ambiguous"), str); return NULL; } } return option; } report_error(p, _("unrecognized option `--%s'"), str); return NULL; } OptParser * optparser_new(OptDetail *opts, int count, OptParserConfig field, ...) { OptParser *parser; va_list args; int c; parser = xmalloc(sizeof(OptParser)); parser->parse_argv0 = false; //parser->print_errors = true; //parser->reorder_args = true; //parser->return_args = false; parser->parse_state.error = NULL; if (count < 0) count = INT_MAX; memset(parser->short_opts, 0, sizeof(parser->short_opts)); parser->options = tmap_new(); tmap_set_compare_fn(parser->options, (comparison_fn_t) strcmp); for (c = 0; c < count && opts[c].names != NULL; c++) { const char *s; char *e; for (s = opts[c].names; (e = strchr(s, '|')) != NULL; s = e+1) { if (e-s == 1 && s[0] >= 32) { parser->short_opts[s[0] - 32] = &opts[c]; } else { tmap_put(parser->options, xstrndup(s, e-s), &opts[c]); } } if (s[0] >= 32 && s[1] == '\0') { parser->short_opts[s[0] - 32] = &opts[c]; } else { tmap_put(parser->options, xstrdup(s), &opts[c]); } } va_start(args, field); parse_config(parser, field, args); va_end(args); return parser; } void optparser_free(OptParser *parser) { tmap_foreach_key(parser->options, free); tmap_free(parser->options); free(parser->parse_state.error); free(parser); } void optparser_parse(OptParser *p, int argc, char **argv) { p->argc = argc; p->argv = argv; p->parse_state.cur_arg = p->parse_argv0 ? 0 : 1; p->parse_state.cur_chr = 0; p->parse_state.no_more_opts = false; free(p->parse_state.error); p->parse_state.error = NULL; p->parsing_opts = true; } static int handle_short_option(OptParser *p, OptParserState *s) { char *arg; OptDetail *opt; char name; arg = p->argv[s->cur_arg]; name = arg[s->cur_chr]; if (name < 32) { report_error(p, _("invalid option -- %c"), name); return OPTP_ERROR; } opt = p->short_opts[name - 32]; if (opt == NULL) { report_error(p, _("invalid option -- %c"), name); return OPTP_ERROR; } if (opt->arg == OPTP_NO_ARG) { if (arg[s->cur_chr + 1] == '\0') { s->cur_chr = 0; s->cur_arg++; } else { s->cur_chr++; } s->value = NULL; } else if (opt->arg == OPTP_OPT_ARG) { s->cur_arg++; s->value = (arg[s->cur_chr + 1] == '\0' ? NULL : arg + s->cur_chr + 1); s->cur_chr = 0; } else if (opt->arg == OPTP_REQ_ARG) { s->cur_arg++; if (arg[s->cur_chr + 1] == '\0') { if (s->cur_arg >= p->argc) { report_error(p, _("option requires an argument -- %c"), name); return OPTP_ERROR; } s->value = p->argv[s->cur_arg]; s->cur_arg++; } else { s->value = arg + s->cur_chr + 1; } s->cur_chr = 0; } return opt->code; } static int next_token(OptParser *p, OptParserState *s) { char *arg; if (s->error != NULL) return OPTP_ERROR; if (s->cur_arg >= p->argc) { s->value = NULL; return OPTP_DONE; } if (s->cur_chr != 0) return handle_short_option(p, s); arg = p->argv[s->cur_arg]; if (!s->no_more_opts) { if (arg[0] == '-') { if (arg[1] == '-') { OptDetail *opt; s->cur_arg++; if (arg[2] == '\0') { s->no_more_opts = true; return next_token(p, s); /* will recurse only once */ } s->value = strchr(arg + 2, '='); if (s->value == NULL) { opt = lookup_long_option(p, arg + 2); } else { arg = xstrndup(arg + 2, s->value - arg - 2); opt = lookup_long_option(p, arg); free(arg); s->value++; } if (opt == NULL) return OPTP_ERROR; if (opt->arg == OPTP_NO_ARG) { if (s->value != NULL) { report_error(p, _("option `--%s' doesn't allow an argument"), arg + 2); return OPTP_ERROR; } } else if (opt->arg == OPTP_OPT_ARG) { /* no op */ } else if (opt->arg == OPTP_REQ_ARG) { if (s->value == NULL) { if (s->cur_arg >= p->argc) { report_error(p, _("option `--%s' requires an argument"), arg + 2); return OPTP_ERROR; } s->value = p->argv[s->cur_arg]; s->cur_arg++; } } return opt->code; } if (arg[1] != '\0') { s->cur_chr = 1; return handle_short_option(p, s); } } } s->value = arg; s->cur_arg++; return OPTP_ARG; } static void check_parsing_opts(OptParser *p, OptParserState *s, bool want_parsing_opts) { if (want_parsing_opts != p->parsing_opts) { s->cur_arg = p->parse_argv0 ? 0 : 1; s->cur_chr = 0; s->no_more_opts = false; s->value = NULL; p->parse_state = *s; p->parsing_opts = want_parsing_opts; } } static int look_for_token(OptParser *p, OptParserState *s, bool look_for_options) { check_parsing_opts(p, s, look_for_options); for (;;) { int token; token = next_token(p, s); if (token == OPTP_DONE || token == OPTP_ERROR) return token; if (look_for_options ^ (token == OPTP_ARG)) return token; } } bool optparser_has_next(OptParser *p) { OptParserState tmp_state = p->parse_state; int token = look_for_token(p, &tmp_state, true); return token != OPTP_DONE && token != OPTP_ERROR; } int optparser_next(OptParser *p) { return look_for_token(p, &p->parse_state, true); } bool optparser_has_next_arg(OptParser *p) { OptParserState tmp_state = p->parse_state; int token = look_for_token(p, &tmp_state, false); return token != OPTP_DONE && token != OPTP_ERROR; } char * optparser_next_arg(OptParser *p) { look_for_token(p, &p->parse_state, false); return p->parse_state.value; } char * optparser_value(OptParser *p) { return p->parse_state.value; } char * optparser_error(OptParser *p) { return p->parse_state.error; } microdc2-0.15.6/src/common/optparser.h0100644000076500007500000000552210516626546017640 0ustar chugunovmicrodc/* optparser.h - Option parser that reports errors properly * * Copyright (C) 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_OPTPARSER_H #define COMMON_OPTPARSER_H #include #include #include "tmap.h" typedef enum { OPTP_PARSE_ARGV0, // OPTP_NO_ERRORS, // OPTP_NO_REORDER, // OPTP_RETURN_ARGS, } OptParserConfig; typedef enum { OPTP_NO_ARG, OPTP_OPT_ARG, OPTP_REQ_ARG, } OptParserArgument; typedef enum { OPTP_ERROR = -1, OPTP_DONE = 0, OPTP_ARG = 10000, } OptParserResult; typedef struct _OptParser OptParser; typedef struct _OptDetail OptDetail; struct _OptDetail { const char *names; OptParserArgument arg; int code; }; /* Create a new option parser. The config options may require additional arguments, * thus the variadic optional arguments */ OptParser *optparser_new(OptDetail *opts, int count, OptParserConfig field, ...); /* Start parsing the specified arguments. */ void optparser_parse(OptParser *parser, int argc, char **argv); /* Return the next option. If OPTP_RETURN_ARGS is set, return the next option or * non-option argument (whichever comes first). */ int optparser_next(OptParser *parser); /* Return the next non-option argument. */ char *optparser_next_arg(OptParser *parser); /* This function returns false if the next call to optparser_next will return * OPTP_DONE. (OPTP_ERROR will be reported differently.) */ bool optparser_has_next(OptParser *p); /* This function returns false if the next call to optparser_next_arg will return * OPTP_DONE. (OPTP_ERROR will be reported differently.) */ bool optparser_has_next_arg(OptParser *p); /* Return the value associated with the current option * or the current non-option argument. */ char *optparser_value(OptParser *parser); /* Return an error description if there was an error. * The returned string may not be used after optparser_free has been called. */ char *optparser_error(OptParser *parser); /* Free all resources used by this parser. * No function may be called on the parser reference after this point. */ void optparser_free(OptParser *parser); //int optparser_index(OptParser *parser); #endif microdc2-0.15.6/src/common/ptrv.c0100664000076500007500000000745010532323547016604 0ustar chugunovmicrodc/* ptrv.c - A vector of address pointers * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "xalloc.h" #include "ptrv.h" /* Create a new ptrv with specified size. */ static PtrV * ptrv_new_with_size(uint32_t initial_size) { PtrV *pv; pv = xmalloc(sizeof(PtrV)); pv->cur = 0; pv->max = MAX(1, initial_size); pv->buf = xmalloc(pv->max * sizeof(void *)); return pv; } /* Create a new ptrv that initially is as small as possible. */ PtrV * ptrv_new(void) { return ptrv_new_with_size(1); } /* Free the ptrv. */ void ptrv_free(PtrV *pv) { if (pv != NULL) { free(pv->buf); free(pv); } } /* Append a pointer to the ptrv. */ void ptrv_append(PtrV *pv, void *value) { if (pv->cur >= pv->max) { pv->max = MAX(1, pv->max*2); pv->buf = xrealloc(pv->buf, pv->max * sizeof(void *)); } pv->buf[pv->cur] = value; pv->cur++; } /* Prepend a few values to the ptrv. */ void ptrv_prepend_n(PtrV *pv, uint32_t count, void *value) { uint32_t c; if (pv->cur+count > pv->max) { pv->max = MAX(pv->cur+count, pv->max*2); pv->buf = xrealloc(pv->buf, pv->max*sizeof(void *)); } memmove(pv->buf+count, pv->buf, pv->cur*sizeof(void *)); for (c = 0; c < count; c++) pv->buf[c] = value; pv->cur += count; } /* Remove a range of pointers from the ptrv. */ void ptrv_remove_range(PtrV *pv, uint32_t start, uint32_t end) { if (end < pv->cur) memmove(pv->buf+start, pv->buf+end, (pv->cur - end) * sizeof(void *)); pv->cur -= end - start; } /* Remove the pointer from the ptrv. */ void * ptrv_remove(PtrV *pv, uint32_t pos) { void *value = NULL; if (pos >= 0 && pos < pv->cur) { value = pv->buf[pos]; pv->cur--; if ((pv->cur-pos) > 0) memmove(pv->buf+pos, pv->buf+pos+1, (pv->cur-pos) * sizeof(void *)); } return value; } /* Call some function (callback) for each pointer in the ptrv. */ void ptrv_foreach(PtrV *pv, PtrVForeachCallback callback) { unsigned c; for (c = 0; c < pv->cur; c++) callback(pv->buf[c]); } /* Remove all pointers from the ptrv. */ void ptrv_clear(PtrV *pv) { pv->cur = 0; } int32_t ptrv_find(PtrV *pv, void *element, comparison_fn_t comparator) { uint32_t c; for (c = 0; c < pv->cur; c++) { if (comparator(element, pv->buf[c]) == 0) return c; } return -1; } void ptrv_sort(PtrV *pv, comparison_fn_t comparator) { qsort(pv->buf, pv->cur, sizeof(void *), comparator); } void ptrv_insort(PtrV *pv, void *element, comparison_fn_t comparator) { uint32_t c; /* XXX: this is slow but stable... */ for (c = 0; c < pv->cur; c++) { int cmp; cmp = comparator(element, pv->buf[c]); if (cmp <= 0) { if (pv->cur >= pv->max) { pv->max = MAX(1, pv->max * 2); pv->buf = xrealloc(pv->buf, pv->max * sizeof(void *)); } memmove(pv->buf+c+1, pv->buf+c, sizeof(void *)*(pv->cur-c)); pv->buf[c] = element; pv->cur++; return; } } ptrv_append(pv, element); } microdc2-0.15.6/src/common/ptrv.h0100664000076500007500000000361210532323502016574 0ustar chugunovmicrodc/* ptrv.c - A vector of address pointers * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef PTRV_H #define PTRV_H #include #include #include #include "comparison.h" typedef void (*PtrVForeachCallback)(void *); typedef struct _PtrV PtrV; struct _PtrV { void **buf; /* Pointer buffer */ uint32_t cur; /* Current number of pointers used in buffer */ uint32_t max; /* Number of pointers (used or not) in buffer */ }; /* The good ones */ PtrV *ptrv_new(void); void ptrv_free(PtrV *pv); void ptrv_append(PtrV *pv, void *value); void ptrv_foreach(PtrV *pv, PtrVForeachCallback callback); void ptrv_clear(PtrV *pv); /* The bad ones */ void ptrv_remove_range(PtrV *pv, uint32_t start, uint32_t end); /* XXX: rename ptrv_remove_n? */ void *ptrv_remove(PtrV *pv, uint32_t pos); #define ptrv_remove_first(p) ptrv_remove(p, 0) void ptrv_insort(PtrV *pv, void *element, comparison_fn_t comparator); void ptrv_sort(PtrV *pv, comparison_fn_t comparator); #define ptrv_prepend(p,v) ptrv_prepend_n(p,1,v); void ptrv_prepend_n(PtrV *pv, uint32_t count, void *value); int32_t ptrv_find(PtrV *pv, void *element, comparison_fn_t comparator); #endif microdc2-0.15.6/src/common/quoting.c0100664000076500007500000003366010543530305017273 0ustar chugunovmicrodc/* quoting.c - Various routines for working with quoted strings * * Copyright (C) 2005 Oskar Liljeblad * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* TODO: unified handling of whitespace (single point of definition), * both as string and function? */ #if HAVE_CONFIG_H #include #endif #include /* Gnulib/C99/POSIX */ #include /* C89 */ #include /* Gnulib/C99/POSIX */ #include /* C89 */ #include "xalloc.h" /* Gnulib */ #include "strbuf.h" #include "quoting.h" #define HEX_TO_INT(x) \ ( (x)>='0' && (x)<='9' ? (x)-'0' : ((x)>='A' && (x)<='F' ? (x)-'A'+10 : (x)-'a'+10 )) #define IS_OCT_DIGIT(d) ( (d) >= '0' && (d) <= '7' ) /* Quote STRING with double quotes if QUOTED is true, otherwise * by escaping whitespace, double quote and backslash as well * as characters in QC. Also, if the first character in STRING * is found in LEADING_QC, that character will be escaped. */ char * quote_word_full(const char *string, bool quoted, bool add_end_quote, const char *qc, const char *leading_qc, bool quote_non_print_hex, bool quote_non_print_oct, bool quote_non_print_c, bool quote_wc) { StrBuf *r = strbuf_new(); const char *s; const unsigned char *u_s; if (quoted) { strbuf_append_char(r, '"'); for (s = string; *s != '\0'; s++) { if (quote_non_print_c) { int chr = 0; switch (*s) { case '\a': chr = 'a'; break; case '\b': chr = 'b'; break; case '\f': chr = 'f'; break; case '\n': chr = 'n'; break; case '\r': chr = 'r'; break; case '\t': chr = 't'; break; case '\v': chr = 'v'; break; } if (chr != 0) { strbuf_appendf(r, "\\%c", chr); continue; } } u_s = (const unsigned char *)s; if (quote_non_print_hex && !isprint(*u_s)) { strbuf_appendf(r, "\\x%02x", (unsigned)*s); } else if (quote_non_print_oct && !isprint(*u_s)) { strbuf_appendf(r, "\\%03o", (unsigned)*s); } else { if (*s == '"' || *s == '\\') strbuf_append_char(r, '\\'); strbuf_append_char(r, *s); } } if (add_end_quote) strbuf_append_char(r, '"'); } else { for (s = string; *s != '\0'; s++) { if (quote_non_print_c) { int chr = 0; switch (*s) { case '\a': chr = 'a'; break; case '\b': chr = 'b'; break; case '\f': chr = 'f'; break; case '\n': chr = 'n'; break; case '\r': chr = 'r'; break; case '\t': chr = 't'; break; case '\v': chr = 'v'; break; } if (chr != 0) { strbuf_appendf(r, "\\%c", chr); continue; } } u_s = (const unsigned char *)s; if (quote_non_print_hex && !isprint(*u_s)) { strbuf_appendf(r, "\\x%02x", (unsigned)*s); } else if (quote_non_print_oct && !isprint(*u_s)) { strbuf_appendf(r, "\\%03o", (unsigned)*u_s); } else { if (*s == '"' || *s == '\\' || (quote_wc && *s == ' ') || strchr(qc, *s) != NULL || (s == string && strchr(leading_qc, *u_s) != NULL)) strbuf_append_char(r, '\\'); strbuf_append_char(r, *s); } } } return strbuf_free_to_string(r); } /* Remove quotes and backslashs from STR, looking no further than * MAXEND, or if MAXEND is null, where STR ends. MODE specifies * initial quoting - false for no quoting, true for double quotes. */ char * dequote_words_full(const char *str, bool quoted, bool c_hex_unescape, bool c_oct_unescape, bool c_simple_unescape, const char *maxend) { const char *p; char *result; char *r; if (maxend == NULL) maxend = (void *) UINTPTR_MAX; result = r = xmalloc(strlen(str) + 1); for (p = str; p < maxend && *p != '\0'; p++) { if (*p == '\\') { p++; if (p >= maxend || *p == '\0') break; /* also discards bogus trailing backslash */ if (c_simple_unescape) { int chr = 0; switch (*p) { case 'a': chr = '\a'; break; case 'b': chr = '\b'; break; case 'f': chr = '\f'; break; case 'n': chr = '\n'; break; case 'r': chr = '\r'; break; case 't': chr = '\t'; break; case 'v': chr = '\v'; break; } if (chr != 0) { *r++ = chr; continue; } } if (c_oct_unescape && IS_OCT_DIGIT(*p)) { int chr = *p - '0'; p++; if (p < maxend && IS_OCT_DIGIT(*p)) { chr = (chr * 8) + (*p - '0'); p++; if (p < maxend && IS_OCT_DIGIT(*p)) { chr = (chr * 8) + (*p - '0'); p++; } } p--; *r++ = chr; continue; } if (c_hex_unescape && *p == 'x') { int chr; const char *q = p+1; if (q >= maxend || *q == '\0' || !isxdigit(*(const unsigned char *)q)) break; q++; p++; chr = HEX_TO_INT(*p); if (q < maxend && isxdigit(*(const unsigned char *)q)) { p++; chr = chr*16 + HEX_TO_INT(*p); } *r++ = chr; continue; } *r++ = *p; } else if (*p == '"') { quoted = !quoted; } else { *r++ = *p; } } *r = '\0'; return result; } /* Find the first character which is part of the first word * in STR, i.e. skip past leading whitespace. Look no further * than MAXEND or where STR ends. If MAXEND is NULL, stop only * where STR ends. STR must be non-null. This function never * returns null. */ const char * find_word_start(const char *str, const char *maxend) { const char *whitespace = " \n\t"; if (maxend == NULL) maxend = (void *) UINTPTR_MAX; for (; str < maxend && *str != '\0'; str++) { if (strchr(whitespace, *str) == NULL) break; } return str; } /* Find the first character which is not part of the first word * in STR, but look no at MAXEND or further, or where STR ends or * where an unquoted TERMCHAR is found. * If MAXEND is NULL, stop only where STR ends or TERMCHAR is * found. TERMCHAR can be specified as '\0'. STR must be non-null. * This function does not return null. */ const char * find_word_end_termchar(const char *str, const char *maxend, char termchar) { const char *whitespace = " \n\t"; bool quoted = false; if (maxend == NULL) maxend = (void *) UINTPTR_MAX; str = find_word_start(str, maxend); for (; str < maxend && *str != '\0'; str++) { if (*str == '\\') { str++; if (str >= maxend || *str == '\0') break; } else if (*str == '"') { quoted = !quoted; } else if (!quoted && (*str == termchar || strchr(whitespace, *str) != NULL)) { break; } } return str; } /* Return index of the word at position POS in the string STR. * This is also the index of the word that would be at POS - * there may not necessarily be a complete word at POS. */ int get_word_index(const char *str, int pos) { const char *maxend = str + pos; int index; for (index = 0; ; index++) { str = find_word_end(str, maxend); if (str >= maxend || *str == '\0') return index; } } const char * find_last_unquoted_char(const char *str, const char *maxend, char ch) { bool quoted = false; const char *match = NULL; if (maxend == NULL) maxend = (void *) UINTPTR_MAX; for (; str < maxend && *str != '\0'; str++) { if (*str == '\\') { str++; if (str >= maxend || *str == '\0') break; } else if (*str == '"') { quoted = !quoted; } else if (!quoted && *str == ch) { match = str; } } return match; } /* find_unquoted_char is much like find_word_end_termchar, * except that we treat whitespace like regular characters. * This function will also return NULL. This function is * used to find unquoted semicolons (`;'). */ const char * find_unquoted_char(const char *str, const char *maxend, char ch) { bool quoted = false; if (maxend == NULL) maxend = (void *) UINTPTR_MAX; for (; str < maxend && *str != '\0'; str++) { if (*str == '\\') { str++; if (str >= maxend && *str == '\0') break; } else if (*str == '"') { quoted = !quoted; } else if (!quoted && *str == ch) { return str; } } return NULL; } /* Find a character which is the leading character in an unquoted * word. This is used to detect comments introduced by number sign * (`#'). */ const char * find_unquoted_leading_char(const char *str, const char *maxend, char ch) { const char *whitespace = " \n\t"; bool quoted = false; bool word = false; if (maxend == NULL) maxend = (void *) UINTPTR_MAX; for (; str < maxend && *str != '\0'; str++) { if (*str == '\\') { str++; if (str >= maxend && *str == '\0') break; } else if (*str == '"') { quoted = !quoted; } else if (!quoted) { if (strchr(whitespace, *str) != NULL) { word = false; } else { if (!word && *str == ch) return str; word = true; } } } return NULL; } /* Get the word in STR that would be used for completion if * the user were to press tab at POS. This function may return * partial words in STR, or even the empty string. */ char * get_completion_word_dequoted(const char *str, int pos) { /*return dequote_words(find_completion_word_start(str, pos), false, str+pos);*/ const char *maxend = str + pos; const char *start = str; int index; for (index = 0; ; index++) { str = find_word_end(str, maxend); if (str >= maxend || *str == '\0') { start = find_word_start(start, maxend); if (start >= maxend || *start == '\0') return xstrdup(""); return dequote_words(start, false, maxend); } start = str; } } int find_completion_word_start(const char *str, int pos) { const char *maxend = str + pos; const char *start = str; const char *end = str; int index; for (index = 0; ; index++) { end = find_word_end(end, maxend); if (end >= maxend || *end == '\0') { start = find_word_start(start, maxend); if (start >= maxend || *start == '\0') return pos; return start-str; } start = end; } } /* Split input into an array of words. The array will be null-terminated. * * XXX: this function has not been tested */ char ** get_word_array_dequoted(const char *str, const char *strend, int *argc) { size_t array_cur; size_t array_max; char **array; if (strend == NULL) strend = (void *) UINTPTR_MAX; array_cur = 0; array_max = 8; array = xmalloc(array_max * sizeof(char *)); str = find_word_start(str, strend); if (str < strend && *str != '\0') { while (str < strend && *str != '\0') { const char *end; end = find_word_end(str, strend); if (array_cur >= array_max) { array_max *= 2; array = xrealloc(array, array_max * sizeof(char *)); } array[array_cur++] = dequote_words(str, false, end); if (end >= strend || *end == '\0') break; str = end; } } if (array_cur >= array_max) { array_max *= 2; array = xrealloc(array, array_max * sizeof(char *)); } array[array_cur] = NULL; return array; } /* Return a newly allocated string of COUNT words starting at * INDEX in string STR. The returned string with be dequoted. * Do not look at or beyond STREND. TERMCHAR is a character which * signifies end of STR. * * Note: A non-null-byte TERMCHAR is generally only useful * when INDEX is 0. This is because TERMCHAR isn't counted * as a word, so a TERMCHAR in STR will mark the end of the * string - this function won't actually look beyond a * TERMCHAR in STR. */ char * get_subwords_dequoted_termchar(const char *str, const char *strend, int index, size_t count, char termchar) { const char *end; int c; /*if (str == NULL) // This is not necessary any longer! return NULL;*/ if (strend == NULL) strend = (void *) UINTPTR_MAX; for (c = 0; c < index; c++) { str = find_word_end_termchar(str, strend, termchar); if (str >= strend || *str == '\0' || *str == termchar) return NULL; } str = find_word_start(str, strend); if (str >= strend || *str == '\0' || *str == termchar) return NULL; end = str; for (c = 0; c < count; c++) { end = find_word_end_termchar(end, strend, termchar); if (end >= strend || *end == '\0' || *end == termchar) break; } return dequote_words(str, false, end); } /* Determine if character INDEX in STRING is * inside a quoted string or right behind a backslash. */ int char_is_quoted(char *string, int index) { bool escaped = false; int c; for (c = 0; c <= index; c++) { if (escaped) { if (c >= index) return 1; escaped = false; } else if (string[c] == '"') { char quote = string[c]; c++; for (; c < index && string[c] != '\0' && string[c] != quote; c++) { if (string[c] == '\\' && string[c+1] != '\0') c++; } if (c >= index) return 1; } else if (string[c] == '\\') { escaped = true; } } return 0; } int count_unquoted_chars(const char *str, const char *end) { int count = 0; for (; *str && str < end; str++) { if (*str != '"' && *str != '\\') count++; } return count; } microdc2-0.15.6/src/common/quoting.h0100644000076500007500000000614510516626546017311 0ustar chugunovmicrodc/* quoting.h - Various routines for working with quoted strings * * Copyright (C) 2005 Oskar Liljeblad * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef QUOTING_H #define QUOTING_H #include /*#define quote_word(s,q,e) quote_word_full((s),(q),(e),"","",false,false,false,true)*/ char *quote_word_full(const char *string, bool quoted, bool add_end_quote, const char *qc, const char *leading_qc, bool quote_non_print_hex, bool quote_non_print_oct, bool quote_non_print_c, bool quote_wc); #define dequote_words(s,q,m) dequote_words_full((s),(q),false,true,true,(m)) char *dequote_words_full(const char *str, bool quoted, bool c_hex_unescape, bool c_oct_unescape, bool c_simple_unescape, const char *end); int get_word_index(const char *str, int pos); char *get_completion_word_dequoted(const char *str, int pos); char *get_words_dequoted(const char *str, int index, size_t count); int find_completion_word_start(const char *str, int pos); /* = find_word_start_backwards */ const char *find_word_start(const char *str, const char *maxend); const char *find_word_end_termchar(const char *str, const char *maxend, char termchar); #define find_word_end(str,maxend) find_word_end_termchar(str,maxend,'\0') const char *find_unquoted_char(const char *str, const char *strmax, char ch); const char *find_last_unquoted_char(const char *str, const char *strmax, char ch); const char *find_unquoted_leading_char(const char *str, const char *strmax, char ch); char *get_subwords_dequoted_termchar(const char *str, const char *strend, int index, size_t count, char termchar); #define get_subwords_dequoted(str,strend,index,count) get_subwords_dequoted_termchar(str,strend,index,count,'\0') #define get_subword_dequoted(str,strend,index) get_subwords_dequoted(str,strend,index,1) #define get_subword_dequoted_termchar(str,strend,index,termchar) get_subwords_dequoted_termchar(str,strend,index,1,termchar) #define get_words_dequoted(str,index,count) get_subwords_dequoted(str,NULL,index,count) #define get_words_dequoted_termchar(str,index,count,termchar) get_subwords_dequoted_termchar(str,NULL,index,count,termchar) #define get_word_dequoted(str,index) get_words_dequoted(str,index,1) #define get_word_dequoted_termchar(str,index,termchar) get_words_dequoted_termchar(str,index,1,termchar) char **get_word_array_dequoted(const char *str, const char *strend, int *argc); int char_is_quoted(char *string, int index); int count_unquoted_chars(const char *start, const char *end); #endif microdc2-0.15.6/src/common/range.c0100644000076500007500000000725510516626546016715 0ustar chugunovmicrodc/* range.c - Parsing of simple range expressions * * Copyright (C) 2005 Oskar Liljeblad * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include "range.h" /* foreach_in_range implements parsing of simple range expressions * such as "a,b-c,d-,-e" etc. It implements the following yacc/bison * parser: */ /* %token NUM %% input : // empty | exprs ; exprs : expr | exprs ',' expr ; expr : NUM '-' NUM | NUM '-' | '-' NUM | NUM ; */ #define DIGIT_A2I(a) ( (a)>='a' ? (a)-'a' : (a)>='A' ? (a)-'A' : (a)-'0' ) typedef struct { char type; /* 0 = EOF, '#' = NUM */ uint32_t num; } RangeToken; static void pop_token(const char **range, RangeToken *token) { if (isdigit(**range)) { token->type = '#'; token->num = DIGIT_A2I(**range); for ((*range)++; isdigit(**range); (*range)++) token->num = token->num * 10 + DIGIT_A2I(**range); } else { token->type = **range; (*range)++; } } bool foreach_in_range(const char *range, uint32_t start, uint32_t end, RangeCallback callback, void *userdata) { RangeToken t; pop_token(&range, &t); if (t.type == 0) return true; for (;;) { if (t.type == '-') { pop_token(&range, &t); if (t.type != '#') return false; if (t.num < start || t.num > end) return false; if (callback != NULL) callback(start, t.num, userdata); pop_token(&range, &t); if (t.type == 0) return true; if (t.type != ',') return false; } else if (t.type == '#') { RangeToken t2; if (t.num < start || t.num > end) return false; pop_token(&range, &t2); if (t2.type == 0) { if (callback != NULL) callback(t.num, t.num, userdata); return true; } if (t2.type == ',') { if (callback != NULL) callback(t.num, t.num, userdata); } else if (t2.type == '-') { pop_token(&range, &t2); if (t2.type == 0) { if (callback != NULL) callback(t.num, end, userdata); return true; } if (t2.type == ',') { if (callback != NULL) callback(t.num, end, userdata); } else if (t2.type == '#') { if (t2.num < start || t2.num > end) return false; if (callback != NULL) callback(t.num, t2.num, userdata); pop_token(&range, &t); if (t.type == 0) return true; if (t.type != ',') return false; } else { return false; } } } else { return false; } pop_token(&range, &t); } } microdc2-0.15.6/src/common/range.h0100644000076500007500000000211710516626546016712 0ustar chugunovmicrodc/* range.h - Parsing of simple range expressions * * Copyright (C) 2005 Oskar Liljeblad * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_RANGE_H #define COMMON_RANGE_H #include #include typedef void (*RangeCallback)(uint32_t start, uint32_t end, void *userdata); bool foreach_in_range(const char *range, uint32_t start, uint32_t end, RangeCallback callback, void *userdata); #endif microdc2-0.15.6/src/common/strbuf.c0100644000076500007500000002005610525650407017111 0ustar chugunovmicrodc/* strbuf.c - The string buffer data-structure. * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ /* Depends on * gl_MODULES([strnlen vasprintf xalloc minmax]) * Optionally * gl_MODULES([stdint]) */ #ifdef HAVE_CONFIG_H #include #endif #include /* Gnulib/C99 */ #include /* C89 */ #include /* C89 */ #include /* C89 */ #include "strnlen.h" /* Gnulib */ #include "vasprintf.h" /* Gnulib */ #include "xalloc.h" /* Gnulib */ #include "minmax.h" /* Gnulib */ #include "strbuf.h" #define DEFAULT_STRBUF_CAPACITY 16 #define SWAP_INT32(a,b) { int32_t _t = (a); (a) = (b); (b) = _t; } static int32_t normalize_strbuf_pos(StrBuf *sb, int32_t pos) { if (pos >= sb->len) return sb->len; if (pos >= 0) return pos; pos += 1 + sb->len; if (pos >= 0) return pos; return 0; } static int32_t normalize_str_pos(const char *str, int32_t pos) { if (str == NULL) return 0; if (pos >= 0) return strnlen(str, pos); pos += 1 + strlen(str); if (pos >= 0) return pos; return 0; } char * strbuf_buffer(StrBuf *sb) { return sb->buf; } uint32_t strbuf_length(StrBuf *sb) { return sb->len; } uint32_t strbuf_capacity(StrBuf *sb) { return sb->capacity; } StrBuf * strbuf_new(void) { return strbuf_new_with_capacity(DEFAULT_STRBUF_CAPACITY); } StrBuf * strbuf_new_with_capacity(uint32_t capacity) { StrBuf *sb; sb = xmalloc(sizeof(StrBuf)); sb->len = 0; sb->capacity = capacity; sb->buf = xmalloc(sb->capacity * sizeof(char)); if (sb->capacity > 0) sb->buf[0] = '\0'; return sb; } StrBuf * strbuf_new_from_char_n(uint32_t times, char ch) { return strbuf_new_from_substring_n(times, &ch, 0, 1); } StrBuf * strbuf_new_from_substring_n(uint32_t times, const char *substr, int32_t subsp, int32_t subep) { subsp = normalize_str_pos(substr, subsp); subep = normalize_str_pos(substr, subep); if (subsp > subep) SWAP_INT32(subsp, subep); return strbuf_new_from_data_n(times, substr+subsp, subep-subsp); } StrBuf * strbuf_new_from_data_n(uint32_t times, const void *mem, uint32_t len) { StrBuf *sb; sb = strbuf_new_with_capacity(len * times + 1); sb->len = len * times; for (; times > 0; times--) memcpy(sb->buf + len*(times-1), mem, len); sb->buf[sb->len] = '\0'; return sb; } StrBuf * strbuf_newf_n(uint32_t times, const char *fmt, ...) { va_list ap; StrBuf *buf; va_start(ap, fmt); buf = strbuf_vnewf_n(times, fmt, ap); va_end(ap); return buf; } StrBuf * strbuf_vnewf_n(uint32_t times, const char *fmt, va_list ap) { char *str; int len; StrBuf *buf; len = vasprintf(&str, fmt, ap); if (len < 0) xalloc_die(); buf = strbuf_new_from_substring_n(times, str, 0, len); free(str); return buf; } void strbuf_free(StrBuf *sb) { if (sb != NULL) { free(sb->buf); free(sb); } } char * strbuf_free_to_substring(StrBuf *sb, int32_t sp, int32_t ep) { char *buf; sp = normalize_strbuf_pos(sb, sp); ep = normalize_strbuf_pos(sb, ep); if (sp != 0) memmove(sb->buf, sb->buf+sp, ep-sp); sb->buf[ep-sp] = '\0'; /* Call realloc so that unused memory can be used for other purpose. */ if (sp == 0 && ep == sb->len) buf = sb->buf; else buf = xrealloc(sb->buf, ep-sp+1); free(sb); return buf; } void strbuf_replace_char_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, char ch) { strbuf_replace_substring_n(sb, sp, ep, times, &ch, 0, 1); } void strbuf_replace_data_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, const void *mem, uint32_t len) { uint32_t addlen; uint32_t dellen; sp = normalize_strbuf_pos(sb, sp); ep = normalize_strbuf_pos(sb, ep); if (sp > ep) SWAP_INT32(sp, ep); addlen = len * times; dellen = ep-sp; if (addlen != dellen) { strbuf_ensure_capacity(sb, sb->len+1-dellen+addlen); memmove(sb->buf+sp+addlen, sb->buf+ep, sb->len+1-ep); sb->len += addlen-dellen; } if (addlen > 0) { for (; times > 0; times--) { memcpy(sb->buf+sp, mem, len); sp += len; } } } void strbuf_replace_substring_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, const char *substr, int32_t subsp, int32_t subep) { subsp = normalize_str_pos(substr, subsp); subep = normalize_str_pos(substr, subep); if (subsp > subep) SWAP_INT32(subsp, subep); strbuf_replace_data_n(sb, sp, ep, times, substr+subsp, subep-subsp); } int strbuf_replacef_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, const char *fmt, ...) { va_list ap; int len; va_start(ap, fmt); len = strbuf_vreplacef_n(sb, sp, ep, times, fmt, ap); va_end(ap); return len; } int strbuf_vreplacef_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, const char *fmt, va_list ap) { char *str; int len; sp = normalize_strbuf_pos(sb, sp); ep = normalize_strbuf_pos(sb, ep); if (sp > ep) SWAP_INT32(sp, ep); len = vasprintf(&str, fmt, ap); if (len < 0) xalloc_die(); strbuf_replace_substring_n(sb, sp, ep, times, str, 0, len); free(str); return len; } void strbuf_reverse_substring(StrBuf *sb, int32_t sp, int32_t ep) { sp = normalize_strbuf_pos(sb, sp); ep = normalize_strbuf_pos(sb, ep); while (sp < ep) { SWAP_INT32(sb->buf[sp], sb->buf[ep]); sp++; ep--; } } void strbuf_repeat_substring(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times) { int32_t addlen; sp = normalize_strbuf_pos(sb, sp); ep = normalize_strbuf_pos(sb, ep); addlen = (ep-sp) * (times - 1); if (addlen != 0) { uint32_t p; strbuf_ensure_capacity(sb, sb->len+1+addlen); memmove(sb->buf+sp+addlen, sb->buf+ep, sb->len+1-ep); sb->len += addlen; p = ep; for (; times > 0; times--) { memmove(sb->buf+p, sb->buf+sp, ep-sp); p += ep-sp; } } } void strbuf_set_length(StrBuf *sb, uint32_t new_length) { strbuf_ensure_capacity(sb, new_length+1); sb->buf[new_length] = '\0'; sb->len = new_length; } /* Note: The terminating null-byte counts as 1 in min_capacity */ void strbuf_ensure_capacity(StrBuf *sb, uint32_t min_capacity) { if (min_capacity > sb->capacity) { sb->capacity = MAX(min_capacity, sb->len*2+2); /* MAX -> max */ sb->buf = xrealloc(sb->buf, sb->capacity * sizeof(char)); if (sb->len == 0) sb->buf[0] = '\0'; } } char * strbuf_substring(StrBuf *sb, int32_t sp, int32_t ep) { char *str; sp = normalize_strbuf_pos(sb, sp); ep = normalize_strbuf_pos(sb, ep); if (sp > ep) SWAP_INT32(sp, ep); str = xmalloc((ep-sp+1) * sizeof(char)); memcpy(str, sb->buf+sp, (ep-sp+1) * sizeof(char)); str[ep-sp] = '\0'; return str; } char strbuf_char_at(StrBuf *sb, int32_t sp) { return sb->buf[normalize_strbuf_pos(sb, sp)]; } #if 0 char strbuf_set_char_at(StrBuf *sb, int32_t sp, char chr) { char old; sp = normalize_strbuf_pos(sb, sp); old = str[sp]; str[sp] = chr; if (sp == sb->len) { sb->len++; strbuf_ensure_capacity(sb, sb->len+1); str[sb->len] = '\0' } return old; } void strbuf_replace_strbuf(StrBuf *sb, int32_t sp, int32_t ep, StrBuf *strbuf) { strbuf_replace_data_n(sb,sp,ep,1,strbuf->buf,strbuf->len); } char strbuf_delete_char(StrBuf *sb, int32_t sp) { } #endif microdc2-0.15.6/src/common/strbuf.h0100644000076500007500000002327310516626546017131 0ustar chugunovmicrodc/* strbuf.h - The string buffer data-structure. * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* TODO: add datatype (many functions): strbuf_substring / substrbuf */ #ifndef STRBUF_H #define STRBUF_H #include /* Gnulib/C99 */ #include /* C89 */ typedef struct _StrBuf StrBuf; struct _StrBuf { char *buf; uint32_t len; uint32_t capacity; }; void strbuf_free(StrBuf *sb); #define strbuf_free_to_string(sb) strbuf_free_to_substring(sb,0,-1) char *strbuf_free_to_substring(StrBuf *sb, int32_t sp, int32_t ep); StrBuf *strbuf_new(void); StrBuf *strbuf_new_with_capacity(uint32_t capacity); #define strbuf_new_from_char(chr) strbuf_new_from_char_n(1,chr) #define strbuf_new_from_string(str) strbuf_new_from_substring(str,0,-1) #define strbuf_new_from_data(mem,len) strbuf_new_from_data_n(str,1,mem,len) #define strbuf_new_from_strbuf(strbuf) strbuf_new_from_strbuf_n(1,strbuf) #define strbuf_new_from_substring(str,ssp,sep) strbuf_new_from_substring_n(1,str,ssp,sep) #define strbuf_newf(fmt...) strbuf_newf_n(1,fmt) #define strbuf_vnewf(fmt,ap) strbuf_vnewf_n(1,fmt,ap) StrBuf *strbuf_new_from_char_n(uint32_t times, char ch); #define strbuf_new_from_string_n(n,str) strbuf_new_from_substring_n(n,str,0,-1) StrBuf *strbuf_new_from_substring_n(uint32_t times, const char *str, int32_t sp, int32_t ep); StrBuf *strbuf_new_from_data_n(uint32_t times, const void *mem, uint32_t len); StrBuf *strbuf_newf_n(uint32_t times, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); StrBuf *strbuf_vnewf_n(uint32_t times, const char *fmt, va_list ap) __attribute__ ((format (printf, 2, 0))); #define strbuf_append_char(sb,chr) strbuf_append_char_n(sb,1,chr) #define strbuf_append(sb,str) strbuf_append_n(sb,1,str) #define strbuf_append_data(sb,mem,len) strbuf_append_data_n(sb,1,mem,len) #define strbuf_append_strbuf(sb,strbuf) strbuf_append_strbuf_n(sb,1,strbuf) #define strbuf_append_substring(sb,str,ssp,sep) strbuf_append_substring_n(sb,1,str,ssp,sep) #define strbuf_appendf(sb,fmt...) strbuf_appendf_n(sb,1,fmt) #define strbuf_vappendf(sb,fmt,ap) strbuf_vappendf_n(sb,1,fmt,ap) #define strbuf_append_char_n(sb,n,chr) strbuf_replace_char_n(sb,-1,-1,n,chr) #define strbuf_append_n(sb,n,str) strbuf_replace_n(sb,-1,-1,n,str) #define strbuf_append_data_n(sb,n,mem,len) strbuf_replace_data_n(sb,-1,-1,n,mem,len) #define strbuf_append_strbuf_n(sb,n,strbuf) strbuf_replace_strbuf_n(sb,-1,-1,n,strbuf) #define strbuf_append_substring_n(sb,n,str,ssp,sep) strbuf_replace_substring_n(sb,-1,-1,n,str,ssp,sep) #define strbuf_appendf_n(sb,n,fmt...) strbuf_replacef_n(sb,-1,-1,n,fmt) #define strbuf_vappendf_n(sb,n,fmt,ap) strbuf_vreplacef_n(sb,-1,-1,n,fmt,ap) #define strbuf_prepend_char(sb,chr) strbuf_prepend_char_n(sb,1,chr) #define strbuf_prepend(sb,str) strbuf_prepend_n(sb,1,str) #define strbuf_prepend_data(sb,mem,len) strbuf_prepend_data_n(sb,1,mem,len) #define strbuf_prepend_strbuf(sb,strbuf) strbuf_prepend_strbuf_n(sb,1,strbuf) #define strbuf_prepend_substring(sb,str,ssp,sep) strbuf_prepend_substring_n(sb,1,str,ssp,sep) #define strbuf_prependf(sb,fmt...) strbuf_prependf_n(sb,1,fmt) #define strbuf_vprependf(sb,fmt,ap) strbuf_vprependf_n(sb,1,fmt,ap) #define strbuf_prepend_char_n(sb,n,chr) strbuf_replace_char_n(sb,0,0,n,chr) #define strbuf_prepend_n(sb,n,str) strbuf_replace_n(sb,0,0,n,str) #define strbuf_prepend_data_n(sb,n,mem,len) strbuf_replace_data_n(sb,0,0,n,mem,len) #define strbuf_prepend_strbuf_n(sb,n,strbuf) strbuf_replace_strbuf_n(sb,0,0,n,strbuf) #define strbuf_prepend_substring_n(sb,n,str,ssp,sep) strbuf_replace_substring_n(sb,0,0,n,str,ssp,sep) #define strbuf_prependf_n(sb,n,fmt...) strbuf_replacef_n(sb,0,0,n,fmt) #define strbuf_vprependf_n(sb,n,fmt,ap) strbuf_vreplacef_n(sb,0,0,n,fmt,ap) #define strbuf_insert_char(sb,sp,chr) strbuf_insert_char_n(sb,sp,1,chr) #define strbuf_insert(sb,sp,str) strbuf_insert_n(sb,sp,1,str) #define strbuf_insert_data(sb,sp,mem,len) strbuf_insert_data_n(sb,sp,1,mem,len) #define strbuf_insert_strbuf(sb,sp,strbuf) strbuf_insert_strbuf_n(sb,sp,1,strbuf) #define strbuf_insert_substring(sb,sp,str,ssp,sep) strbuf_insert_substring_n(sb,sp,1,str,ssp,sep) #define strbuf_insertf(sb,sp,fmt...) strbuf_insertf_n(sb,sp,1,fmt) #define strbuf_vinsertf(sb,sp,fmt,ap) strbuf_vinsertf_n(sb,sp,1,fmt,ap) #define strbuf_insert_char_n(sb,sp,n,chr) strbuf_replace_char_n(sb,sp,sp,n,chr) #define strbuf_insert_n(sb,sp,n,str) strbuf_replace_n(sb,sp,sp,n,str) #define strbuf_insert_data_n(sb,sp,n,mem,len) strbuf_replace_data_n(sb,sp,sp,n,mem,len) #define strbuf_insert_strbuf_n(sb,sp,n,strbuf) strbuf_replace_strbuf_n(sb,sp,sp,n,strbuf) #define strbuf_insert_substring_n(sb,sp,n,str,ssp,sep) strbuf_replace_substring_n(sb,sp,sp,n,str,ssp,sep) #define strbuf_insertf_n(sb,sp,n,fmt...) strbuf_replacef_n(sb,sp,sp,n,fmt) #define strbuf_vinsertf_n(sb,sp,n,fmt,ap) strbuf_vreplacef_n(sb,sp,sp,n,fmt,ap) #define strbuf_set_char(sb,chr) strbuf_set_char_n(sb,1,chr) #define strbuf_set(sb,str) strbuf_set_n(sb,1,str) #define strbuf_set_data(sb,mem,len) strbuf_set_data_n(sb,1,mem,len) #define strbuf_set_strbuf(sb,strbuf) strbuf_set_strbuf(sb,1,strbuf) #define strbuf_set_substring(sb,str,ssp,sep) strbuf_set_substring_n(sb,1,str,ssp,sep) #define strbuf_setf(sb,fmt...) strbuf_setf_n(sb,1,fmt) #define strbuf_vsetf(sb,fmt,ap) strbuf_vsetf_n(sb,1,fmt,ap) #define strbuf_set_char_n(sb,n,chr) strbuf_replace_char_n(sb,0,-1,n,chr) #define strbuf_set_n(sb,n,str) strbuf_replace_n(sb,0,-1,n,str) #define strbuf_set_data_n(sb,n,mem,len) strbuf_replace_data_n(sb,0,-1,n,mem,len) #define strbuf_set_strbuf_n(sb,n,strbuf) strbuf_replace_strbuf_n(sb,0,-1,n,strbuf) #define strbuf_set_substring_n(sb,n,str,ssp,sep) strbuf_replace_substring_n(sb,0,-1,n,str,ssp,sep) #define strbuf_setf_n(sb,n,fmt...) strbuf_replacef_n(sb,0,-1,n,fmt) #define strbuf_vsetf_n(sb,n,fmt,ap) strbuf_vreplacef_n(sb,0,-1,n,fmt,ap) #define strbuf_replace_char(sb,sp,ep,ch) strbuf_replace_char_n(sb,sp,ep,1,ch) #define strbuf_replace(sb,sp,ep,str) strbuf_replace_n(sb,sp,ep,1,str) #define strbuf_replace_data(sb,sp,ep,mem,len) strbuf_replace_data_n(sb,sp,ep,1,mem,len) void strbuf_replace_strbuf(StrBuf *sb, int32_t sp, int32_t ep, StrBuf *strbuf); /* or strbuf_replace_data_n(sb,sp,ep,1,strbuf_buffer(strbuf),strbuf_length(strbuf))*/ #define strbuf_replace_substring(sb,sp,ep,str,ssp,sep) strbuf_replace_substring_n(sb,sp,ep,1,str,ssp,sep) #define strbuf_replacef(sb,sp,ep,fmt...) strbuf_replacef_n(sb,sp,ep,1,fmt) #define strbuf_vreplacef(sb,sp,ep,fmt,ap) strbuf_vreplacef_n(sb,sp,ep,1,fmt,ap) void strbuf_replace_char_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, char ch); #define strbuf_replace_n(sb,sp,ep,n,str) strbuf_replace_substring_n(sb,sp,ep,n,str,0,-1) void strbuf_replace_substring_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, const char *str, int32_t ssp, int32_t sep); void strbuf_replace_data_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, const void *mem, uint32_t len); int strbuf_replacef_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, const char *fmt, ...) __attribute__ ((format (printf, 5, 6))); int strbuf_vreplacef_n(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times, const char *fmt, va_list ap) __attribute__ ((format (printf, 5, 0))); char strbuf_set_char_at(StrBuf *sb, int32_t sp, char chr); /* or strbuf_replace_char(sb,sp,strbuf_next_pos(sb,sp),chr) */ char strbuf_delete_char(StrBuf *sb, int32_t sp); /* or strbuf_replace(sb,sp,strbuf_next_pos(sb,sp),NULL) */ #define strbuf_delete(sb,sp,ep) strbuf_replace(sb,sp,ep,NULL) #define strbuf_clear(sb) strbuf_replace(sb,0,-1,NULL) void strbuf_reverse_substring(StrBuf *sb, int32_t sp, int32_t ep); #define strbuf_reverse(sb) strbuf_reverse_substring(sb,0,-1) void strbuf_repeat_substring(StrBuf *sb, int32_t sp, int32_t ep, uint32_t times); #define strbuf_repeat(sb,n) strbuf_repeat_substring(sb,0,-1,n) uint32_t strbuf_length(StrBuf *sb); uint32_t strbuf_capacity(StrBuf *sb); char *strbuf_buffer(StrBuf *sb); #define strbuf_is_empty(sb) (strbuf_length(sb) == 0) void strbuf_set_length(StrBuf *sb, uint32_t new_length); void strbuf_ensure_capacity(StrBuf *sb, uint32_t minimum_capacity); char *strbuf_substring(StrBuf *sb, int32_t sp, int32_t ep); #define strbuf_to_string(sb) strbuf_substring(sb,0,-1) char strbuf_char_at(StrBuf *sb, int32_t index); #endif microdc2-0.15.6/src/common/strleftcmp.c0100644000076500007500000000221710516626546017775 0ustar chugunovmicrodc/* strleftcmp.c - The strleftcmp function * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "strleftcmp.h" /* Determine if 'full' starts with 'base'. * * XXX: Rename this starts_with? strendcmp(full, base)? * XXX: Add ends_with? strstartcmp(full, base)? */ int strleftcmp(const char *base, const char *full) { while (*base) { if (*base != *full) return *base - *full; base++; full++; } return 0; } microdc2-0.15.6/src/common/strleftcmp.h0100644000076500007500000000170510516626546020003 0ustar chugunovmicrodc/* strleftcmp.h - The strleftcmp function * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef STRLEFTCMP_H #define STRLEFTCMP_H #include /* C89: size_t */ int strleftcmp(const char *base, const char *full); #endif microdc2-0.15.6/src/common/substrcmp.c0100644000076500007500000000204110516626546017627 0ustar chugunovmicrodc/* substrcmp.c - The substrcmp function * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "substrcmp.h" int substrcmp(const char *s1, const char *s2, size_t s2len) { while (s2len > 0) { if (*s1 != *s2) return *s1 - *s2; s1++; s2++; s2len--; } return *s1; /* strncmp would return 0 here */ } microdc2-0.15.6/src/common/substrcmp.h0100644000076500007500000000202410516626546017635 0ustar chugunovmicrodc/* substrcmp.h - The substrcmp function * * Copyright (C) 2004, 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SUBSTRCMP_H #define SUBSTRCMP_H #include /* Compare a s1[0..length(s1)-1] to s2[0..s2len-1]. * This is not the same as strncmp. */ int substrcmp(const char *s1, const char *s2, size_t s2len); #endif microdc2-0.15.6/src/common/swap.h0100644000076500007500000000174210516626546016573 0ustar chugunovmicrodc/* swap.h - swap macro for compilers that support typeof * * Copyright (C) 2005 Oskar Liljeblad * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SWAP_H #define SWAP_H #if HAVE_CONFIG_H #include #endif #ifndef swap #define swap(a,b) ({ typeof(a) _a = (a); (a) = (b); (b) = _a; }) #endif #endif microdc2-0.15.6/src/common/tempdir.c0100644000076500007500000000334110516626546017255 0ustar chugunovmicrodc/* tempdir.c - Get path of temporary directory * * Copyright (C) 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include static bool direxists(const char *dir) { struct stat sb; return stat(dir, &sb) == 0 && S_ISDIR(sb.st_mode); } /* This does in no way replace the mkdtemp function provided by Gnulib. * mkdtemp still needs to know which directory to create the temporary * directory inside - it doesn't figure that out by itself. */ char * tempdir(void) { char *tmpdir; if (getuid() == geteuid() && getgid() == getegid()) { tmpdir = getenv("TMPDIR"); if (tmpdir != NULL && direxists(tmpdir)) return tmpdir; } tmpdir = P_tmpdir; if (tmpdir != NULL && direxists(tmpdir)) return tmpdir; tmpdir = "/tmp"; if (direxists(tmpdir)) return tmpdir; errno = ENOENT; return NULL; } microdc2-0.15.6/src/common/tempdir.h0100644000076500007500000000160610516626546017264 0ustar chugunovmicrodc/* tempdir.h - Get path of temporary directory * * Copyright (C) 2005 Oskar Liljeblad * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_TEMPDIR_H #define COMMON_TEMPDIR_H char *tempdir(void); #endif microdc2-0.15.6/src/common/tempfailure.h0100644000076500007500000000237410516626546020140 0ustar chugunovmicrodc/* Define the TEMP_FAILURE_RETRY macro from GNU Libc. * * Copyright (C) 2005 Oskar Liljeblad * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_TEMPFAILURE_H #define COMMON_TEMPFAILURE_H #include #include /* TEMP_FAILURE_RETRY uses ({ }) syntax which is probably only supported * by GCC. That is why this file is not in Gnulib. */ #ifndef TEMP_FAILURE_RETRY #define TEMP_FAILURE_RETRY(expression) \ ({ \ long int _result; \ do _result = (long int) (expression); \ while (_result == -1L && errno == EINTR); \ _result; \ }) #endif #endif microdc2-0.15.6/src/common/tmap.c0100644000076500007500000003417510523075000016540 0ustar chugunovmicrodc/* tmap.c - A red-black tree map implementation. * * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 * Oskar Liljeblad * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if HAVE_CONFIG_H #include #endif #include /* C89 */ #include /* C89 */ #include "xalloc.h" /* Gnulib */ #include "tmap.h" typedef struct _TMapNode TMapNode; typedef struct _TMapIteratorPriv TMapIteratorPriv; struct _TMapNode { void *key; void *value; bool red; TMapNode *left; TMapNode *right; TMapNode *parent; }; struct _TMap { TMapNode *root; size_t size; union { comparison_fn_t simple; complex_comparison_fn_t complex; } comparator; bool complex; /* XXX: should really make this more general? */ void *userdata; }; struct _TMapIteratorPriv { bool (*has_next)(TMapIterator *it); void *(*next)(TMapIterator *it); TMapNode *n0; /* first node, inclusive */ TMapNode *n1; /* last node, inclusive */ }; /* In the nil node, any field (including key and value) may be referenced * No field may be written, except `red', which may be overwritten with * the `false' value (for black). */ static TMapNode nil = { NULL, NULL, false, &nil, &nil, &nil }; static int ptrcmp(const void *v0, const void *v1) { return (int) (v0-v1); } static void tmap_clear_nodes(TMapNode *node) { if (node->left != &nil) tmap_clear_nodes(node->left); if (node->right != &nil) tmap_clear_nodes(node->right); free(node); } TMap * tmap_new(void) { TMap *map = xmalloc(sizeof(TMap)); map->root = &nil; map->size = 0; map->comparator.simple = ptrcmp; map->complex = false; return map; } void tmap_free(TMap *map) { if (map->root != &nil) tmap_clear_nodes(map->root); free(map); } void tmap_set_compare_fn(TMap *map, comparison_fn_t comparator) { map->comparator.simple = comparator; map->complex = false; } void tmap_set_complex_compare_fn(TMap *map, complex_comparison_fn_t comparator, void *userdata) { map->comparator.complex = comparator; map->complex = true; map->userdata = userdata; } size_t tmap_size(TMap *map) { return map->size; } static TMapNode * tmap_first_node(TMap *map) { TMapNode *node = map->root; while (node->left != &nil) node = node->left; return node; } static TMapNode * tmap_last_node(TMap *map) { TMapNode *node = map->root; while (node->right != &nil) node = node->right; return node; } static int tmap_compare(TMap *map, const void *k1, const void *k2) { if (map->complex) return map->comparator.complex(k1, k2, map->userdata); return map->comparator.simple(k1, k2); } static TMapNode * tmap_get_node(TMap *map, const void *key) { TMapNode *node = map->root; while (node != &nil) { int compare = tmap_compare(map, key, node->key); if (compare > 0) { node = node->right; } else if (compare < 0) { node = node->left; } else { return node; } } return node; } bool tmap_contains_key(TMap *map, const void *key) { return tmap_get_node(map, key) != &nil; } void * tmap_first_key(TMap *map) { return tmap_first_node(map)->key; } void * tmap_last_key(TMap *map) { return tmap_last_node(map)->key; } void * tmap_first_value(TMap *map) { return tmap_first_node(map)->value; } void * tmap_last_value(TMap *map) { return tmap_last_node(map)->value; } void * tmap_get(TMap *map, const void *key) { return tmap_get_node(map, key)->value; } void tmap_clear(TMap *map) { if (map->root != &nil) { tmap_clear_nodes(map->root); map->root = &nil; } map->size = 0; } static void tmap_rotate_left(TMap *map, TMapNode *node) { TMapNode *child = node->right; node->right = child->left; if (child->left != &nil) child->left->parent = node; child->parent = node->parent; if (node->parent != &nil) { if (node == node->parent->left) node->parent->left = child; else node->parent->right = child; } else { map->root = child; } child->left = node; node->parent = child; } static void tmap_rotate_right(TMap *map, TMapNode *node) { TMapNode *child = node->left; node->left = child->right; if (child->right != &nil) child->right->parent = node; child->parent = node->parent; if (node->parent != &nil) { if (node == node->parent->right) node->parent->right = child; else node->parent->left = child; } else { map->root = child; } child->right = node; node->parent = child; } static void tmap_delete_rebalance(TMap *map, TMapNode *node, TMapNode *parent) { while (node != map->root && !node->red) { if (node == parent->left) { TMapNode *sibling = parent->right; if (sibling->red) { sibling->red = false; parent->red = true; tmap_rotate_left(map, parent); sibling = parent->right; } if (!sibling->left->red && !sibling->right->red) { sibling->red = true; node = parent; parent = parent->parent; } else { if (!sibling->right->red) { sibling->left->red = false; sibling->red = true; tmap_rotate_right(map, sibling); sibling = parent->right; } sibling->red = parent->red; parent->red = false; sibling->right->red = false; tmap_rotate_left(map, parent); node = map->root; } } else { TMapNode *sibling = parent->left; if (sibling->red) { sibling->red = false; parent->red = true; tmap_rotate_right(map, parent); sibling = parent->left; } if (!sibling->left->red && !sibling->right->red) { sibling->red = true; node = parent; parent = parent->parent; } else { if (!sibling->left->red) { sibling->right->red = false; sibling->red = true; tmap_rotate_left(map, sibling); sibling = parent->left; } sibling->red = parent->red; parent->red = false; sibling->left->red = false; tmap_rotate_right(map, parent); node = map->root; } } } node->red = false; } static void tmap_remove_node(TMap *map, TMapNode *node) { TMapNode *splice; TMapNode *child; TMapNode *parent; map->size--; if (node->left == &nil) { splice = node; child = node->right; } else if (node->right == &nil) { splice = node; child = node->left; } else { splice = node->left; while (splice->right != &nil) splice = splice->right; child = splice->left; node->key = splice->key; node->value = splice->value; } parent = splice->parent; if (child != &nil) child->parent = parent; if (parent == &nil) { map->root = child; free(splice); return; } if (splice == parent->left) parent->left = child; else parent->right = child; if (!splice->red) tmap_delete_rebalance(map, child, parent); free(splice); } void * tmap_remove(TMap *map, const void *key) { TMapNode *node = tmap_get_node(map, key); if (node != &nil) { void *value = node->value; tmap_remove_node(map, node); return value; } return NULL; } static void tmap_insert_rebalance(TMap *map, TMapNode *node) { while (node->parent->red && node->parent->parent != &nil) { if (node->parent == node->parent->parent->left) { TMapNode *uncle = node->parent->parent->right; if (uncle->red) { node->parent->red = false; uncle->red = false; uncle->parent->red = true; node = uncle->parent; } else { if (node == node->parent->right) { node = node->parent; tmap_rotate_left(map, node); } node->parent->red = false; node->parent->parent->red = true; tmap_rotate_right(map, node->parent->parent); } } else { TMapNode *uncle = node->parent->parent->left; if (uncle->red) { node->parent->red = false; uncle->red = false; uncle->parent->red = true; node = uncle->parent; } else { if (node == node->parent->left) { node = node->parent; tmap_rotate_right(map, node); } node->parent->red = false; node->parent->parent->red = true; tmap_rotate_left(map, node->parent->parent); } } } map->root->red = false; } void * tmap_put(TMap *map, void *key, void *value) { TMapNode *node = map->root; TMapNode *parent = &nil; int compare = 0; while (node != &nil) { parent = node; compare = tmap_compare(map, key, node->key); if (compare > 0) { node = node->right; } else if (compare < 0) { node = node->left; } else { void *old_value = node->value; node->value = value; return old_value; } } node = xmalloc(sizeof(TMapNode)); node->key = key; node->value = value; node->red = true; node->parent = parent; node->left = &nil; node->right = &nil; map->size++; if (parent == &nil) { map->root = node; node->red = false; return NULL; } if (compare > 0) { parent->right = node; } else { parent->left = node; } tmap_insert_rebalance(map, node); return NULL; } static TMapNode * successor(TMapNode *node) { TMapNode *parent; if (node->right != &nil) { node = node->right; while (node->left != &nil) node = node->left; return node; } parent = node->parent; while (node == parent->right) { node = parent; parent = parent->parent; } return parent; } #if 0 static TMapNode * predecessor(TMapNode *node) { TMapNode *parent; if (node->left != &nil) { node = node->left; while (node->right != &nil) node = node->right; return node; } parent = node->parent; while (node == parent->left) { node = parent; parent = parent->parent; } return parent; } #endif static void tmap_foreach_nodes_key(TMapNode *node, void (*iterator)()) { if (node->left != &nil) tmap_foreach_nodes_key(node->left, iterator); if (node->right != &nil) tmap_foreach_nodes_key(node->right, iterator); iterator(node->key); } static void tmap_foreach_nodes_value(TMapNode *node, void (*iterator)()) { if (node->left != &nil) tmap_foreach_nodes_value(node->left, iterator); if (node->right != &nil) tmap_foreach_nodes_value(node->right, iterator); iterator(node->value); } void tmap_foreach_key(TMap *map, void (*iterator)()) { if (map->root != &nil) tmap_foreach_nodes_key(map->root, iterator); } void tmap_foreach_value(TMap *map, void (*iterator)()) { if (map->root != &nil) tmap_foreach_nodes_value(map->root, iterator); } static bool tmap_iterator_has_next(TMapIterator *it) { TMapIteratorPriv *itp = (TMapIteratorPriv *) it; return itp->n0 != &nil; } static void * tmap_iterator_next(TMapIterator *it) { TMapIteratorPriv *itp = (TMapIteratorPriv *) it; void *data; if (itp->n0 == &nil) return NULL; data = itp->n0->value; itp->n0 = (itp->n0 == itp->n1 ? &nil : successor(itp->n0)); return data; } void tmap_iterator(TMap *map, TMapIterator *it) { TMapIteratorPriv *itp = (TMapIteratorPriv *) it; itp->n0 = tmap_first_node(map); itp->n1 = &nil; itp->has_next = tmap_iterator_has_next; itp->next = tmap_iterator_next; } #ifdef ENABLE_TMAP_TESTING #include static bool tmap_node_verify(TMapNode *node, int *expect) { if (node == &nil) return true; if (node->red) { if (node->left->red || node->right->red) return false; } if (node->left == &nil && node->right == &nil) { int count = 0; TMapNode *x; for (x = node; x != &nil; x = x->parent) { if (!x->red) count++; } if (*expect == -1) { *expect = count; } else if (count != *expect) { return false; } } return tmap_node_verify(node->left, expect) && tmap_node_verify(node->right, expect); } bool tmap_verify(TMap *map) { int expect = -1; return tmap_node_verify(map->root, &expect); } static void tmap_dump_node(TMapNode *n, FILE *out, int i) { int c; if (n == &nil) return; for (c=0;cred ? "red" : "black", (char *) n->value); if (n->left != &nil) { for (c=0;cleft, out, i+1); } if (n->right != &nil) { for (c=0;cright, out, i+1); } } void tmap_dump(TMap *map, FILE *out) { printf("VERIFIED: %d\n", tmap_verify(map)); tmap_dump_node(map->root, out, 0); } #endif bool tmap_iterator_partial(TMap *map, TMapIterator *it, const void *match, comparison_fn_t comparator) { TMapNode *n = map->root; TMapIteratorPriv *itp = (TMapIteratorPriv *) it; itp->has_next = tmap_iterator_has_next; itp->next = tmap_iterator_next; while (n != &nil) { int compare = comparator(match, n->key); if (compare > 0) { n = n->right; } else if (compare < 0) { n = n->left; } else { TMapNode *nx; TMapNode *nn; nx = n; for (nn = n->left; nn != &nil; ) { if (comparator(match, nn->key) == 0) { nx = nn; nn = nn->left; } else { nn = nn->right; } } itp->n0 = nx; nx = n; for (nn = n->right; nn != &nil; ) { if (comparator(match, nn->key) == 0) { nx = nn; nn = nn->right; } else { nn = nn->left; } } itp->n1 = nx; //printf("match=[%s] n=[%s] n0=[%s] n1=[%s]\n", match, n->value, itp->n0->value, itp->n1->value); return true; } } itp->n0 = &nil; itp->n1 = &nil; return false; } microdc2-0.15.6/src/common/tmap.h0100644000076500007500000000433610523075000016541 0ustar chugunovmicrodc/* tmap.h - A red-black tree map implementation. * * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 * Oskar Liljeblad * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef COMMON_TMAP_H #define COMMON_TMAP_H #include /* Gnulib/C99/POSIX */ #include "comparison.h" typedef struct _TMap TMap; typedef struct _TMapIterator TMapIterator; struct _TMapIterator { bool (*has_next)(TMapIterator *it); void *(*next)(TMapIterator *it); /* Private data follow */ void *p0; void *p1; }; #define tmap_is_empty(m) ((tmap_size(m) == 0) TMap *tmap_new(void); void tmap_free(TMap *map); void tmap_set_compare_fn(TMap *map, comparison_fn_t comparator); void tmap_set_complex_compare_fn(TMap *map, complex_comparison_fn_t comparator, void *userdata); size_t tmap_size(TMap *map); bool tmap_contains_key(TMap *map, const void *key); void *tmap_first_key(TMap *map); void *tmap_last_key(TMap *map); void *tmap_first_value(TMap *map); void *tmap_last_value(TMap *map); void *tmap_get(TMap *map, const void *key); void *tmap_put(TMap *map, void *key, void *value); void *tmap_remove(TMap *map, const void *key); void tmap_iterator(TMap *map, TMapIterator *it); /* value iterator */ bool tmap_iterator_partial(TMap *map, TMapIterator *it, const void *match, comparison_fn_t comparator); void tmap_clear(TMap *map); void tmap_foreach_key(TMap *map, void (*iterator)()); void tmap_foreach_value(TMap *map, void (*iterator)()); #ifdef ENABLE_TMAP_TESTING #include void tmap_dump(TMap *map, FILE *out); bool tmap_verify(TMap *map); #endif #endif microdc2-0.15.6/src/tth/0040755000076500007500000000000010543546023014745 5ustar chugunovmicrodcmicrodc2-0.15.6/src/tth/CVS/0040755000076500007500000000000010543546032015400 5ustar chugunovmicrodcmicrodc2-0.15.6/src/tth/CVS/Root0100644000076500007500000000003610527341105016236 0ustar chugunovmicrodc/projects/microdc/cvs/cvsroot microdc2-0.15.6/src/tth/CVS/Repository0100644000076500007500000000002010527341105017463 0ustar chugunovmicrodcmicrodc/src/tth microdc2-0.15.6/src/tth/CVS/Entries0100644000076500007500000000131610543546032016732 0ustar chugunovmicrodc/Makefile.am/1.2/Thu Nov 16 11:21:20 2006//Tmicrodc2_0_13_1_locale /base32.c/1.1/Tue Oct 24 05:00:28 2006//Tmicrodc2_0_13_1_locale /base32.h/1.1/Tue Oct 24 05:00:28 2006//Tmicrodc2_0_13_1_locale /sboxes.c/1.1/Tue Oct 24 05:00:28 2006//Tmicrodc2_0_13_1_locale /tiger.c/1.2/Thu Nov 16 11:21:20 2006//Tmicrodc2_0_13_1_locale /tiger.h/1.1/Thu Nov 16 11:21:20 2006//Tmicrodc2_0_13_1_locale /tigertree.h/1.1/Thu Nov 16 11:21:20 2006//Tmicrodc2_0_13_1_locale /tth.h/1.2/Thu Nov 16 11:21:20 2006//Tmicrodc2_0_13_1_locale /tigertree.c/1.1.2.2/Tue Nov 28 12:49:09 2006//Tmicrodc2_0_13_1_locale /tth.c/1.6.2.3/Tue Nov 28 12:49:09 2006//Tmicrodc2_0_13_1_locale /Makefile.in/1.2/Sun Dec 24 18:44:52 2006//Tmicrodc2_0_13_1_locale D microdc2-0.15.6/src/tth/CVS/Tag0100644000076500007500000000003010527341106016021 0ustar chugunovmicrodcTmicrodc2_0_13_1_locale microdc2-0.15.6/src/tth/Makefile.am0100644000076500007500000000036710527044660017006 0ustar chugunovmicrodcAM_CFLAGS = -Wall AM_CPPFLAGS = \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib noinst_LIBRARIES = libtth.a libtth_a_SOURCES = \ tiger.c \ tiger.h \ sboxes.c \ base32.c \ base32.h \ tigertree.c \ tigertree.h \ tth.c \ tth.h microdc2-0.15.6/src/tth/Makefile.in0100644000076500007500000003600710543545244017021 0ustar chugunovmicrodc# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/tth DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/ac_lib_readline.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/alloca.m4 \ $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \ $(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \ $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/free.m4 \ $(top_srcdir)/m4/getaddrinfo.m4 $(top_srcdir)/m4/getdelim.m4 \ $(top_srcdir)/m4/gethostname.m4 $(top_srcdir)/m4/getline.m4 \ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/human.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconvme.m4 \ $(top_srcdir)/m4/intmax_t.m4 $(top_srcdir)/m4/inttypes.m4 \ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \ $(top_srcdir)/m4/memmem.m4 $(top_srcdir)/m4/minmax.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/quote.m4 $(top_srcdir)/m4/quotearg.m4 \ $(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/safe-read.m4 \ $(top_srcdir)/m4/safe-write.m4 $(top_srcdir)/m4/sig2str.m4 \ $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stdbool.m4 \ $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strdup.m4 \ $(top_srcdir)/m4/strftime.m4 $(top_srcdir)/m4/strndup.m4 \ $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strtoimax.m4 \ $(top_srcdir)/m4/strtol.m4 $(top_srcdir)/m4/strtoll.m4 \ $(top_srcdir)/m4/strtoul.m4 $(top_srcdir)/m4/strtoull.m4 \ $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/time_r.m4 \ $(top_srcdir)/m4/tm_gmtoff.m4 $(top_srcdir)/m4/uintmax_t.m4 \ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/vasnprintf.m4 \ $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ $(top_srcdir)/m4/xstrtol.m4 $(top_srcdir)/m4/xstrtoumax.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libtth_a_AR = $(AR) $(ARFLAGS) libtth_a_LIBADD = am_libtth_a_OBJECTS = tiger.$(OBJEXT) sboxes.$(OBJEXT) \ base32.$(OBJEXT) tigertree.$(OBJEXT) tth.$(OBJEXT) libtth_a_OBJECTS = $(am_libtth_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libtth_a_SOURCES) DIST_SOURCES = $(libtth_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALLOCA_H = @ALLOCA_H@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EOVERFLOW = @EOVERFLOW@ EXEEXT = @EXEEXT@ FNMATCH_H = @FNMATCH_H@ GETOPT_H = @GETOPT_H@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ HAVE_LONG_64BIT = @HAVE_LONG_64BIT@ HAVE_LONG_LONG_64BIT = @HAVE_LONG_LONG_64BIT@ HAVE__BOOL = @HAVE__BOOL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LOCALEDIR = @LOCALEDIR@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STDBOOL_H = @STDBOOL_H@ STDINT_H = @STDINT_H@ STRIP = @STRIP@ TR = @TR@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XML_CONFIG = @XML_CONFIG@ ac_ct_CC = @ac_ct_CC@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AM_CFLAGS = -Wall AM_CPPFLAGS = \ -I$(top_builddir)/lib \ -I$(top_srcdir)/lib noinst_LIBRARIES = libtth.a libtth_a_SOURCES = \ tiger.c \ tiger.h \ sboxes.c \ base32.c \ base32.h \ tigertree.c \ tigertree.h \ tth.c \ tth.h all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tth/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/tth/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libtth.a: $(libtth_a_OBJECTS) $(libtth_a_DEPENDENCIES) -rm -f libtth.a $(libtth_a_AR) libtth.a $(libtth_a_OBJECTS) $(libtth_a_LIBADD) $(RANLIB) libtth.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sboxes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tiger.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tigertree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tth.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: microdc2-0.15.6/src/tth/base32.c0100644000076500007500000000337610517316754016205 0ustar chugunovmicrodc#include #include #include "base32.h" char base32_alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; char* base32_encode(const unsigned char* buffer, int len) { unsigned char* digest = NULL; if (len > 0) { int i, j = 0; int bits_remain = 0; unsigned short value = 0; unsigned long digest_len = len*8; digest_len = 1 + ((digest_len % 5) == 0 ? (digest_len / 5) : (digest_len / 5) + 1); digest = (unsigned char*)malloc(digest_len); if (digest != NULL) { for (i = 0; i < len; i++) { value = (value << 8) | buffer[i]; bits_remain += 8; while (bits_remain > 5 && j < 1023) { int idx = (value >> (bits_remain-5)) & 0x1F; digest[j++] = base32_alphabet[idx]; bits_remain -= 5; } } if (bits_remain > 0) { int idx = (value << (5-bits_remain)) & 0x1F; digest[j++] = base32_alphabet[idx]; } digest[j] = '\0'; } } return digest; } #if 0 char* base32_decode(const unsigned char* buffer, int len) { int i, j = 0; int bits_remain = 0; unsigned short value = 0; for (i = 0; i < len; i++) { value |= (buffer[i] << bits_remain); bits_remain += 8; while (bits_remain > 5 && j < 1023) { base32_digest[j++] = (value & 0x1F) < 26 ? 'A'+(value & 0x1F) : '2' + (value & 0x1F); value >>= 5; bits_remain -= 5; } } if (bits_remain > 0) { base32_digest[j++] = (value & 0x1F) < 26 ? 'A'+(value & 0x1F) : '2' + (value & 0x1F); } base32_digest[j] = '\0'; return base32_digest; } #endif microdc2-0.15.6/src/tth/base32.h0100644000076500007500000000043110517316754016177 0ustar chugunovmicrodc#ifndef __BASE32_H #define __BASE32_H #if defined(__cplusplus) extern "C" { #endif // user must call free() funtion on pointer returned from these functions char* base32_encode(const unsigned char* in, int inlen); #if defined(__cplusplus) } #endif #endif // ifndef __BASE32_H microdc2-0.15.6/src/tth/sboxes.c0100644000076500007500000011513610517316754016427 0ustar chugunovmicrodc/* sboxes.c: Tiger S boxes */ typedef unsigned long long int word64; word64 table[4*256] = { 0x02AAB17CF7E90C5ELL /* 0 */, 0xAC424B03E243A8ECLL /* 1 */, 0x72CD5BE30DD5FCD3LL /* 2 */, 0x6D019B93F6F97F3ALL /* 3 */, 0xCD9978FFD21F9193LL /* 4 */, 0x7573A1C9708029E2LL /* 5 */, 0xB164326B922A83C3LL /* 6 */, 0x46883EEE04915870LL /* 7 */, 0xEAACE3057103ECE6LL /* 8 */, 0xC54169B808A3535CLL /* 9 */, 0x4CE754918DDEC47CLL /* 10 */, 0x0AA2F4DFDC0DF40CLL /* 11 */, 0x10B76F18A74DBEFALL /* 12 */, 0xC6CCB6235AD1AB6ALL /* 13 */, 0x13726121572FE2FFLL /* 14 */, 0x1A488C6F199D921ELL /* 15 */, 0x4BC9F9F4DA0007CALL /* 16 */, 0x26F5E6F6E85241C7LL /* 17 */, 0x859079DBEA5947B6LL /* 18 */, 0x4F1885C5C99E8C92LL /* 19 */, 0xD78E761EA96F864BLL /* 20 */, 0x8E36428C52B5C17DLL /* 21 */, 0x69CF6827373063C1LL /* 22 */, 0xB607C93D9BB4C56ELL /* 23 */, 0x7D820E760E76B5EALL /* 24 */, 0x645C9CC6F07FDC42LL /* 25 */, 0xBF38A078243342E0LL /* 26 */, 0x5F6B343C9D2E7D04LL /* 27 */, 0xF2C28AEB600B0EC6LL /* 28 */, 0x6C0ED85F7254BCACLL /* 29 */, 0x71592281A4DB4FE5LL /* 30 */, 0x1967FA69CE0FED9FLL /* 31 */, 0xFD5293F8B96545DBLL /* 32 */, 0xC879E9D7F2A7600BLL /* 33 */, 0x860248920193194ELL /* 34 */, 0xA4F9533B2D9CC0B3LL /* 35 */, 0x9053836C15957613LL /* 36 */, 0xDB6DCF8AFC357BF1LL /* 37 */, 0x18BEEA7A7A370F57LL /* 38 */, 0x037117CA50B99066LL /* 39 */, 0x6AB30A9774424A35LL /* 40 */, 0xF4E92F02E325249BLL /* 41 */, 0x7739DB07061CCAE1LL /* 42 */, 0xD8F3B49CECA42A05LL /* 43 */, 0xBD56BE3F51382F73LL /* 44 */, 0x45FAED5843B0BB28LL /* 45 */, 0x1C813D5C11BF1F83LL /* 46 */, 0x8AF0E4B6D75FA169LL /* 47 */, 0x33EE18A487AD9999LL /* 48 */, 0x3C26E8EAB1C94410LL /* 49 */, 0xB510102BC0A822F9LL /* 50 */, 0x141EEF310CE6123BLL /* 51 */, 0xFC65B90059DDB154LL /* 52 */, 0xE0158640C5E0E607LL /* 53 */, 0x884E079826C3A3CFLL /* 54 */, 0x930D0D9523C535FDLL /* 55 */, 0x35638D754E9A2B00LL /* 56 */, 0x4085FCCF40469DD5LL /* 57 */, 0xC4B17AD28BE23A4CLL /* 58 */, 0xCAB2F0FC6A3E6A2ELL /* 59 */, 0x2860971A6B943FCDLL /* 60 */, 0x3DDE6EE212E30446LL /* 61 */, 0x6222F32AE01765AELL /* 62 */, 0x5D550BB5478308FELL /* 63 */, 0xA9EFA98DA0EDA22ALL /* 64 */, 0xC351A71686C40DA7LL /* 65 */, 0x1105586D9C867C84LL /* 66 */, 0xDCFFEE85FDA22853LL /* 67 */, 0xCCFBD0262C5EEF76LL /* 68 */, 0xBAF294CB8990D201LL /* 69 */, 0xE69464F52AFAD975LL /* 70 */, 0x94B013AFDF133E14LL /* 71 */, 0x06A7D1A32823C958LL /* 72 */, 0x6F95FE5130F61119LL /* 73 */, 0xD92AB34E462C06C0LL /* 74 */, 0xED7BDE33887C71D2LL /* 75 */, 0x79746D6E6518393ELL /* 76 */, 0x5BA419385D713329LL /* 77 */, 0x7C1BA6B948A97564LL /* 78 */, 0x31987C197BFDAC67LL /* 79 */, 0xDE6C23C44B053D02LL /* 80 */, 0x581C49FED002D64DLL /* 81 */, 0xDD474D6338261571LL /* 82 */, 0xAA4546C3E473D062LL /* 83 */, 0x928FCE349455F860LL /* 84 */, 0x48161BBACAAB94D9LL /* 85 */, 0x63912430770E6F68LL /* 86 */, 0x6EC8A5E602C6641CLL /* 87 */, 0x87282515337DDD2BLL /* 88 */, 0x2CDA6B42034B701BLL /* 89 */, 0xB03D37C181CB096DLL /* 90 */, 0xE108438266C71C6FLL /* 91 */, 0x2B3180C7EB51B255LL /* 92 */, 0xDF92B82F96C08BBCLL /* 93 */, 0x5C68C8C0A632F3BALL /* 94 */, 0x5504CC861C3D0556LL /* 95 */, 0xABBFA4E55FB26B8FLL /* 96 */, 0x41848B0AB3BACEB4LL /* 97 */, 0xB334A273AA445D32LL /* 98 */, 0xBCA696F0A85AD881LL /* 99 */, 0x24F6EC65B528D56CLL /* 100 */, 0x0CE1512E90F4524ALL /* 101 */, 0x4E9DD79D5506D35ALL /* 102 */, 0x258905FAC6CE9779LL /* 103 */, 0x2019295B3E109B33LL /* 104 */, 0xF8A9478B73A054CCLL /* 105 */, 0x2924F2F934417EB0LL /* 106 */, 0x3993357D536D1BC4LL /* 107 */, 0x38A81AC21DB6FF8BLL /* 108 */, 0x47C4FBF17D6016BFLL /* 109 */, 0x1E0FAADD7667E3F5LL /* 110 */, 0x7ABCFF62938BEB96LL /* 111 */, 0xA78DAD948FC179C9LL /* 112 */, 0x8F1F98B72911E50DLL /* 113 */, 0x61E48EAE27121A91LL /* 114 */, 0x4D62F7AD31859808LL /* 115 */, 0xECEBA345EF5CEAEBLL /* 116 */, 0xF5CEB25EBC9684CELL /* 117 */, 0xF633E20CB7F76221LL /* 118 */, 0xA32CDF06AB8293E4LL /* 119 */, 0x985A202CA5EE2CA4LL /* 120 */, 0xCF0B8447CC8A8FB1LL /* 121 */, 0x9F765244979859A3LL /* 122 */, 0xA8D516B1A1240017LL /* 123 */, 0x0BD7BA3EBB5DC726LL /* 124 */, 0xE54BCA55B86ADB39LL /* 125 */, 0x1D7A3AFD6C478063LL /* 126 */, 0x519EC608E7669EDDLL /* 127 */, 0x0E5715A2D149AA23LL /* 128 */, 0x177D4571848FF194LL /* 129 */, 0xEEB55F3241014C22LL /* 130 */, 0x0F5E5CA13A6E2EC2LL /* 131 */, 0x8029927B75F5C361LL /* 132 */, 0xAD139FABC3D6E436LL /* 133 */, 0x0D5DF1A94CCF402FLL /* 134 */, 0x3E8BD948BEA5DFC8LL /* 135 */, 0xA5A0D357BD3FF77ELL /* 136 */, 0xA2D12E251F74F645LL /* 137 */, 0x66FD9E525E81A082LL /* 138 */, 0x2E0C90CE7F687A49LL /* 139 */, 0xC2E8BCBEBA973BC5LL /* 140 */, 0x000001BCE509745FLL /* 141 */, 0x423777BBE6DAB3D6LL /* 142 */, 0xD1661C7EAEF06EB5LL /* 143 */, 0xA1781F354DAACFD8LL /* 144 */, 0x2D11284A2B16AFFCLL /* 145 */, 0xF1FC4F67FA891D1FLL /* 146 */, 0x73ECC25DCB920ADALL /* 147 */, 0xAE610C22C2A12651LL /* 148 */, 0x96E0A810D356B78ALL /* 149 */, 0x5A9A381F2FE7870FLL /* 150 */, 0xD5AD62EDE94E5530LL /* 151 */, 0xD225E5E8368D1427LL /* 152 */, 0x65977B70C7AF4631LL /* 153 */, 0x99F889B2DE39D74FLL /* 154 */, 0x233F30BF54E1D143LL /* 155 */, 0x9A9675D3D9A63C97LL /* 156 */, 0x5470554FF334F9A8LL /* 157 */, 0x166ACB744A4F5688LL /* 158 */, 0x70C74CAAB2E4AEADLL /* 159 */, 0xF0D091646F294D12LL /* 160 */, 0x57B82A89684031D1LL /* 161 */, 0xEFD95A5A61BE0B6BLL /* 162 */, 0x2FBD12E969F2F29ALL /* 163 */, 0x9BD37013FEFF9FE8LL /* 164 */, 0x3F9B0404D6085A06LL /* 165 */, 0x4940C1F3166CFE15LL /* 166 */, 0x09542C4DCDF3DEFBLL /* 167 */, 0xB4C5218385CD5CE3LL /* 168 */, 0xC935B7DC4462A641LL /* 169 */, 0x3417F8A68ED3B63FLL /* 170 */, 0xB80959295B215B40LL /* 171 */, 0xF99CDAEF3B8C8572LL /* 172 */, 0x018C0614F8FCB95DLL /* 173 */, 0x1B14ACCD1A3ACDF3LL /* 174 */, 0x84D471F200BB732DLL /* 175 */, 0xC1A3110E95E8DA16LL /* 176 */, 0x430A7220BF1A82B8LL /* 177 */, 0xB77E090D39DF210ELL /* 178 */, 0x5EF4BD9F3CD05E9DLL /* 179 */, 0x9D4FF6DA7E57A444LL /* 180 */, 0xDA1D60E183D4A5F8LL /* 181 */, 0xB287C38417998E47LL /* 182 */, 0xFE3EDC121BB31886LL /* 183 */, 0xC7FE3CCC980CCBEFLL /* 184 */, 0xE46FB590189BFD03LL /* 185 */, 0x3732FD469A4C57DCLL /* 186 */, 0x7EF700A07CF1AD65LL /* 187 */, 0x59C64468A31D8859LL /* 188 */, 0x762FB0B4D45B61F6LL /* 189 */, 0x155BAED099047718LL /* 190 */, 0x68755E4C3D50BAA6LL /* 191 */, 0xE9214E7F22D8B4DFLL /* 192 */, 0x2ADDBF532EAC95F4LL /* 193 */, 0x32AE3909B4BD0109LL /* 194 */, 0x834DF537B08E3450LL /* 195 */, 0xFA209DA84220728DLL /* 196 */, 0x9E691D9B9EFE23F7LL /* 197 */, 0x0446D288C4AE8D7FLL /* 198 */, 0x7B4CC524E169785BLL /* 199 */, 0x21D87F0135CA1385LL /* 200 */, 0xCEBB400F137B8AA5LL /* 201 */, 0x272E2B66580796BELL /* 202 */, 0x3612264125C2B0DELL /* 203 */, 0x057702BDAD1EFBB2LL /* 204 */, 0xD4BABB8EACF84BE9LL /* 205 */, 0x91583139641BC67BLL /* 206 */, 0x8BDC2DE08036E024LL /* 207 */, 0x603C8156F49F68EDLL /* 208 */, 0xF7D236F7DBEF5111LL /* 209 */, 0x9727C4598AD21E80LL /* 210 */, 0xA08A0896670A5FD7LL /* 211 */, 0xCB4A8F4309EBA9CBLL /* 212 */, 0x81AF564B0F7036A1LL /* 213 */, 0xC0B99AA778199ABDLL /* 214 */, 0x959F1EC83FC8E952LL /* 215 */, 0x8C505077794A81B9LL /* 216 */, 0x3ACAAF8F056338F0LL /* 217 */, 0x07B43F50627A6778LL /* 218 */, 0x4A44AB49F5ECCC77LL /* 219 */, 0x3BC3D6E4B679EE98LL /* 220 */, 0x9CC0D4D1CF14108CLL /* 221 */, 0x4406C00B206BC8A0LL /* 222 */, 0x82A18854C8D72D89LL /* 223 */, 0x67E366B35C3C432CLL /* 224 */, 0xB923DD61102B37F2LL /* 225 */, 0x56AB2779D884271DLL /* 226 */, 0xBE83E1B0FF1525AFLL /* 227 */, 0xFB7C65D4217E49A9LL /* 228 */, 0x6BDBE0E76D48E7D4LL /* 229 */, 0x08DF828745D9179ELL /* 230 */, 0x22EA6A9ADD53BD34LL /* 231 */, 0xE36E141C5622200ALL /* 232 */, 0x7F805D1B8CB750EELL /* 233 */, 0xAFE5C7A59F58E837LL /* 234 */, 0xE27F996A4FB1C23CLL /* 235 */, 0xD3867DFB0775F0D0LL /* 236 */, 0xD0E673DE6E88891ALL /* 237 */, 0x123AEB9EAFB86C25LL /* 238 */, 0x30F1D5D5C145B895LL /* 239 */, 0xBB434A2DEE7269E7LL /* 240 */, 0x78CB67ECF931FA38LL /* 241 */, 0xF33B0372323BBF9CLL /* 242 */, 0x52D66336FB279C74LL /* 243 */, 0x505F33AC0AFB4EAALL /* 244 */, 0xE8A5CD99A2CCE187LL /* 245 */, 0x534974801E2D30BBLL /* 246 */, 0x8D2D5711D5876D90LL /* 247 */, 0x1F1A412891BC038ELL /* 248 */, 0xD6E2E71D82E56648LL /* 249 */, 0x74036C3A497732B7LL /* 250 */, 0x89B67ED96361F5ABLL /* 251 */, 0xFFED95D8F1EA02A2LL /* 252 */, 0xE72B3BD61464D43DLL /* 253 */, 0xA6300F170BDC4820LL /* 254 */, 0xEBC18760ED78A77ALL /* 255 */, 0xE6A6BE5A05A12138LL /* 256 */, 0xB5A122A5B4F87C98LL /* 257 */, 0x563C6089140B6990LL /* 258 */, 0x4C46CB2E391F5DD5LL /* 259 */, 0xD932ADDBC9B79434LL /* 260 */, 0x08EA70E42015AFF5LL /* 261 */, 0xD765A6673E478CF1LL /* 262 */, 0xC4FB757EAB278D99LL /* 263 */, 0xDF11C6862D6E0692LL /* 264 */, 0xDDEB84F10D7F3B16LL /* 265 */, 0x6F2EF604A665EA04LL /* 266 */, 0x4A8E0F0FF0E0DFB3LL /* 267 */, 0xA5EDEEF83DBCBA51LL /* 268 */, 0xFC4F0A2A0EA4371ELL /* 269 */, 0xE83E1DA85CB38429LL /* 270 */, 0xDC8FF882BA1B1CE2LL /* 271 */, 0xCD45505E8353E80DLL /* 272 */, 0x18D19A00D4DB0717LL /* 273 */, 0x34A0CFEDA5F38101LL /* 274 */, 0x0BE77E518887CAF2LL /* 275 */, 0x1E341438B3C45136LL /* 276 */, 0xE05797F49089CCF9LL /* 277 */, 0xFFD23F9DF2591D14LL /* 278 */, 0x543DDA228595C5CDLL /* 279 */, 0x661F81FD99052A33LL /* 280 */, 0x8736E641DB0F7B76LL /* 281 */, 0x15227725418E5307LL /* 282 */, 0xE25F7F46162EB2FALL /* 283 */, 0x48A8B2126C13D9FELL /* 284 */, 0xAFDC541792E76EEALL /* 285 */, 0x03D912BFC6D1898FLL /* 286 */, 0x31B1AAFA1B83F51BLL /* 287 */, 0xF1AC2796E42AB7D9LL /* 288 */, 0x40A3A7D7FCD2EBACLL /* 289 */, 0x1056136D0AFBBCC5LL /* 290 */, 0x7889E1DD9A6D0C85LL /* 291 */, 0xD33525782A7974AALL /* 292 */, 0xA7E25D09078AC09BLL /* 293 */, 0xBD4138B3EAC6EDD0LL /* 294 */, 0x920ABFBE71EB9E70LL /* 295 */, 0xA2A5D0F54FC2625CLL /* 296 */, 0xC054E36B0B1290A3LL /* 297 */, 0xF6DD59FF62FE932BLL /* 298 */, 0x3537354511A8AC7DLL /* 299 */, 0xCA845E9172FADCD4LL /* 300 */, 0x84F82B60329D20DCLL /* 301 */, 0x79C62CE1CD672F18LL /* 302 */, 0x8B09A2ADD124642CLL /* 303 */, 0xD0C1E96A19D9E726LL /* 304 */, 0x5A786A9B4BA9500CLL /* 305 */, 0x0E020336634C43F3LL /* 306 */, 0xC17B474AEB66D822LL /* 307 */, 0x6A731AE3EC9BAAC2LL /* 308 */, 0x8226667AE0840258LL /* 309 */, 0x67D4567691CAECA5LL /* 310 */, 0x1D94155C4875ADB5LL /* 311 */, 0x6D00FD985B813FDFLL /* 312 */, 0x51286EFCB774CD06LL /* 313 */, 0x5E8834471FA744AFLL /* 314 */, 0xF72CA0AEE761AE2ELL /* 315 */, 0xBE40E4CDAEE8E09ALL /* 316 */, 0xE9970BBB5118F665LL /* 317 */, 0x726E4BEB33DF1964LL /* 318 */, 0x703B000729199762LL /* 319 */, 0x4631D816F5EF30A7LL /* 320 */, 0xB880B5B51504A6BELL /* 321 */, 0x641793C37ED84B6CLL /* 322 */, 0x7B21ED77F6E97D96LL /* 323 */, 0x776306312EF96B73LL /* 324 */, 0xAE528948E86FF3F4LL /* 325 */, 0x53DBD7F286A3F8F8LL /* 326 */, 0x16CADCE74CFC1063LL /* 327 */, 0x005C19BDFA52C6DDLL /* 328 */, 0x68868F5D64D46AD3LL /* 329 */, 0x3A9D512CCF1E186ALL /* 330 */, 0x367E62C2385660AELL /* 331 */, 0xE359E7EA77DCB1D7LL /* 332 */, 0x526C0773749ABE6ELL /* 333 */, 0x735AE5F9D09F734BLL /* 334 */, 0x493FC7CC8A558BA8LL /* 335 */, 0xB0B9C1533041AB45LL /* 336 */, 0x321958BA470A59BDLL /* 337 */, 0x852DB00B5F46C393LL /* 338 */, 0x91209B2BD336B0E5LL /* 339 */, 0x6E604F7D659EF19FLL /* 340 */, 0xB99A8AE2782CCB24LL /* 341 */, 0xCCF52AB6C814C4C7LL /* 342 */, 0x4727D9AFBE11727BLL /* 343 */, 0x7E950D0C0121B34DLL /* 344 */, 0x756F435670AD471FLL /* 345 */, 0xF5ADD442615A6849LL /* 346 */, 0x4E87E09980B9957ALL /* 347 */, 0x2ACFA1DF50AEE355LL /* 348 */, 0xD898263AFD2FD556LL /* 349 */, 0xC8F4924DD80C8FD6LL /* 350 */, 0xCF99CA3D754A173ALL /* 351 */, 0xFE477BACAF91BF3CLL /* 352 */, 0xED5371F6D690C12DLL /* 353 */, 0x831A5C285E687094LL /* 354 */, 0xC5D3C90A3708A0A4LL /* 355 */, 0x0F7F903717D06580LL /* 356 */, 0x19F9BB13B8FDF27FLL /* 357 */, 0xB1BD6F1B4D502843LL /* 358 */, 0x1C761BA38FFF4012LL /* 359 */, 0x0D1530C4E2E21F3BLL /* 360 */, 0x8943CE69A7372C8ALL /* 361 */, 0xE5184E11FEB5CE66LL /* 362 */, 0x618BDB80BD736621LL /* 363 */, 0x7D29BAD68B574D0BLL /* 364 */, 0x81BB613E25E6FE5BLL /* 365 */, 0x071C9C10BC07913FLL /* 366 */, 0xC7BEEB7909AC2D97LL /* 367 */, 0xC3E58D353BC5D757LL /* 368 */, 0xEB017892F38F61E8LL /* 369 */, 0xD4EFFB9C9B1CC21ALL /* 370 */, 0x99727D26F494F7ABLL /* 371 */, 0xA3E063A2956B3E03LL /* 372 */, 0x9D4A8B9A4AA09C30LL /* 373 */, 0x3F6AB7D500090FB4LL /* 374 */, 0x9CC0F2A057268AC0LL /* 375 */, 0x3DEE9D2DEDBF42D1LL /* 376 */, 0x330F49C87960A972LL /* 377 */, 0xC6B2720287421B41LL /* 378 */, 0x0AC59EC07C00369CLL /* 379 */, 0xEF4EAC49CB353425LL /* 380 */, 0xF450244EEF0129D8LL /* 381 */, 0x8ACC46E5CAF4DEB6LL /* 382 */, 0x2FFEAB63989263F7LL /* 383 */, 0x8F7CB9FE5D7A4578LL /* 384 */, 0x5BD8F7644E634635LL /* 385 */, 0x427A7315BF2DC900LL /* 386 */, 0x17D0C4AA2125261CLL /* 387 */, 0x3992486C93518E50LL /* 388 */, 0xB4CBFEE0A2D7D4C3LL /* 389 */, 0x7C75D6202C5DDD8DLL /* 390 */, 0xDBC295D8E35B6C61LL /* 391 */, 0x60B369D302032B19LL /* 392 */, 0xCE42685FDCE44132LL /* 393 */, 0x06F3DDB9DDF65610LL /* 394 */, 0x8EA4D21DB5E148F0LL /* 395 */, 0x20B0FCE62FCD496FLL /* 396 */, 0x2C1B912358B0EE31LL /* 397 */, 0xB28317B818F5A308LL /* 398 */, 0xA89C1E189CA6D2CFLL /* 399 */, 0x0C6B18576AAADBC8LL /* 400 */, 0xB65DEAA91299FAE3LL /* 401 */, 0xFB2B794B7F1027E7LL /* 402 */, 0x04E4317F443B5BEBLL /* 403 */, 0x4B852D325939D0A6LL /* 404 */, 0xD5AE6BEEFB207FFCLL /* 405 */, 0x309682B281C7D374LL /* 406 */, 0xBAE309A194C3B475LL /* 407 */, 0x8CC3F97B13B49F05LL /* 408 */, 0x98A9422FF8293967LL /* 409 */, 0x244B16B01076FF7CLL /* 410 */, 0xF8BF571C663D67EELL /* 411 */, 0x1F0D6758EEE30DA1LL /* 412 */, 0xC9B611D97ADEB9B7LL /* 413 */, 0xB7AFD5887B6C57A2LL /* 414 */, 0x6290AE846B984FE1LL /* 415 */, 0x94DF4CDEACC1A5FDLL /* 416 */, 0x058A5BD1C5483AFFLL /* 417 */, 0x63166CC142BA3C37LL /* 418 */, 0x8DB8526EB2F76F40LL /* 419 */, 0xE10880036F0D6D4ELL /* 420 */, 0x9E0523C9971D311DLL /* 421 */, 0x45EC2824CC7CD691LL /* 422 */, 0x575B8359E62382C9LL /* 423 */, 0xFA9E400DC4889995LL /* 424 */, 0xD1823ECB45721568LL /* 425 */, 0xDAFD983B8206082FLL /* 426 */, 0xAA7D29082386A8CBLL /* 427 */, 0x269FCD4403B87588LL /* 428 */, 0x1B91F5F728BDD1E0LL /* 429 */, 0xE4669F39040201F6LL /* 430 */, 0x7A1D7C218CF04ADELL /* 431 */, 0x65623C29D79CE5CELL /* 432 */, 0x2368449096C00BB1LL /* 433 */, 0xAB9BF1879DA503BALL /* 434 */, 0xBC23ECB1A458058ELL /* 435 */, 0x9A58DF01BB401ECCLL /* 436 */, 0xA070E868A85F143DLL /* 437 */, 0x4FF188307DF2239ELL /* 438 */, 0x14D565B41A641183LL /* 439 */, 0xEE13337452701602LL /* 440 */, 0x950E3DCF3F285E09LL /* 441 */, 0x59930254B9C80953LL /* 442 */, 0x3BF299408930DA6DLL /* 443 */, 0xA955943F53691387LL /* 444 */, 0xA15EDECAA9CB8784LL /* 445 */, 0x29142127352BE9A0LL /* 446 */, 0x76F0371FFF4E7AFBLL /* 447 */, 0x0239F450274F2228LL /* 448 */, 0xBB073AF01D5E868BLL /* 449 */, 0xBFC80571C10E96C1LL /* 450 */, 0xD267088568222E23LL /* 451 */, 0x9671A3D48E80B5B0LL /* 452 */, 0x55B5D38AE193BB81LL /* 453 */, 0x693AE2D0A18B04B8LL /* 454 */, 0x5C48B4ECADD5335FLL /* 455 */, 0xFD743B194916A1CALL /* 456 */, 0x2577018134BE98C4LL /* 457 */, 0xE77987E83C54A4ADLL /* 458 */, 0x28E11014DA33E1B9LL /* 459 */, 0x270CC59E226AA213LL /* 460 */, 0x71495F756D1A5F60LL /* 461 */, 0x9BE853FB60AFEF77LL /* 462 */, 0xADC786A7F7443DBFLL /* 463 */, 0x0904456173B29A82LL /* 464 */, 0x58BC7A66C232BD5ELL /* 465 */, 0xF306558C673AC8B2LL /* 466 */, 0x41F639C6B6C9772ALL /* 467 */, 0x216DEFE99FDA35DALL /* 468 */, 0x11640CC71C7BE615LL /* 469 */, 0x93C43694565C5527LL /* 470 */, 0xEA038E6246777839LL /* 471 */, 0xF9ABF3CE5A3E2469LL /* 472 */, 0x741E768D0FD312D2LL /* 473 */, 0x0144B883CED652C6LL /* 474 */, 0xC20B5A5BA33F8552LL /* 475 */, 0x1AE69633C3435A9DLL /* 476 */, 0x97A28CA4088CFDECLL /* 477 */, 0x8824A43C1E96F420LL /* 478 */, 0x37612FA66EEEA746LL /* 479 */, 0x6B4CB165F9CF0E5ALL /* 480 */, 0x43AA1C06A0ABFB4ALL /* 481 */, 0x7F4DC26FF162796BLL /* 482 */, 0x6CBACC8E54ED9B0FLL /* 483 */, 0xA6B7FFEFD2BB253ELL /* 484 */, 0x2E25BC95B0A29D4FLL /* 485 */, 0x86D6A58BDEF1388CLL /* 486 */, 0xDED74AC576B6F054LL /* 487 */, 0x8030BDBC2B45805DLL /* 488 */, 0x3C81AF70E94D9289LL /* 489 */, 0x3EFF6DDA9E3100DBLL /* 490 */, 0xB38DC39FDFCC8847LL /* 491 */, 0x123885528D17B87ELL /* 492 */, 0xF2DA0ED240B1B642LL /* 493 */, 0x44CEFADCD54BF9A9LL /* 494 */, 0x1312200E433C7EE6LL /* 495 */, 0x9FFCC84F3A78C748LL /* 496 */, 0xF0CD1F72248576BBLL /* 497 */, 0xEC6974053638CFE4LL /* 498 */, 0x2BA7B67C0CEC4E4CLL /* 499 */, 0xAC2F4DF3E5CE32EDLL /* 500 */, 0xCB33D14326EA4C11LL /* 501 */, 0xA4E9044CC77E58BCLL /* 502 */, 0x5F513293D934FCEFLL /* 503 */, 0x5DC9645506E55444LL /* 504 */, 0x50DE418F317DE40ALL /* 505 */, 0x388CB31A69DDE259LL /* 506 */, 0x2DB4A83455820A86LL /* 507 */, 0x9010A91E84711AE9LL /* 508 */, 0x4DF7F0B7B1498371LL /* 509 */, 0xD62A2EABC0977179LL /* 510 */, 0x22FAC097AA8D5C0ELL /* 511 */, 0xF49FCC2FF1DAF39BLL /* 512 */, 0x487FD5C66FF29281LL /* 513 */, 0xE8A30667FCDCA83FLL /* 514 */, 0x2C9B4BE3D2FCCE63LL /* 515 */, 0xDA3FF74B93FBBBC2LL /* 516 */, 0x2FA165D2FE70BA66LL /* 517 */, 0xA103E279970E93D4LL /* 518 */, 0xBECDEC77B0E45E71LL /* 519 */, 0xCFB41E723985E497LL /* 520 */, 0xB70AAA025EF75017LL /* 521 */, 0xD42309F03840B8E0LL /* 522 */, 0x8EFC1AD035898579LL /* 523 */, 0x96C6920BE2B2ABC5LL /* 524 */, 0x66AF4163375A9172LL /* 525 */, 0x2174ABDCCA7127FBLL /* 526 */, 0xB33CCEA64A72FF41LL /* 527 */, 0xF04A4933083066A5LL /* 528 */, 0x8D970ACDD7289AF5LL /* 529 */, 0x8F96E8E031C8C25ELL /* 530 */, 0xF3FEC02276875D47LL /* 531 */, 0xEC7BF310056190DDLL /* 532 */, 0xF5ADB0AEBB0F1491LL /* 533 */, 0x9B50F8850FD58892LL /* 534 */, 0x4975488358B74DE8LL /* 535 */, 0xA3354FF691531C61LL /* 536 */, 0x0702BBE481D2C6EELL /* 537 */, 0x89FB24057DEDED98LL /* 538 */, 0xAC3075138596E902LL /* 539 */, 0x1D2D3580172772EDLL /* 540 */, 0xEB738FC28E6BC30DLL /* 541 */, 0x5854EF8F63044326LL /* 542 */, 0x9E5C52325ADD3BBELL /* 543 */, 0x90AA53CF325C4623LL /* 544 */, 0xC1D24D51349DD067LL /* 545 */, 0x2051CFEEA69EA624LL /* 546 */, 0x13220F0A862E7E4FLL /* 547 */, 0xCE39399404E04864LL /* 548 */, 0xD9C42CA47086FCB7LL /* 549 */, 0x685AD2238A03E7CCLL /* 550 */, 0x066484B2AB2FF1DBLL /* 551 */, 0xFE9D5D70EFBF79ECLL /* 552 */, 0x5B13B9DD9C481854LL /* 553 */, 0x15F0D475ED1509ADLL /* 554 */, 0x0BEBCD060EC79851LL /* 555 */, 0xD58C6791183AB7F8LL /* 556 */, 0xD1187C5052F3EEE4LL /* 557 */, 0xC95D1192E54E82FFLL /* 558 */, 0x86EEA14CB9AC6CA2LL /* 559 */, 0x3485BEB153677D5DLL /* 560 */, 0xDD191D781F8C492ALL /* 561 */, 0xF60866BAA784EBF9LL /* 562 */, 0x518F643BA2D08C74LL /* 563 */, 0x8852E956E1087C22LL /* 564 */, 0xA768CB8DC410AE8DLL /* 565 */, 0x38047726BFEC8E1ALL /* 566 */, 0xA67738B4CD3B45AALL /* 567 */, 0xAD16691CEC0DDE19LL /* 568 */, 0xC6D4319380462E07LL /* 569 */, 0xC5A5876D0BA61938LL /* 570 */, 0x16B9FA1FA58FD840LL /* 571 */, 0x188AB1173CA74F18LL /* 572 */, 0xABDA2F98C99C021FLL /* 573 */, 0x3E0580AB134AE816LL /* 574 */, 0x5F3B05B773645ABBLL /* 575 */, 0x2501A2BE5575F2F6LL /* 576 */, 0x1B2F74004E7E8BA9LL /* 577 */, 0x1CD7580371E8D953LL /* 578 */, 0x7F6ED89562764E30LL /* 579 */, 0xB15926FF596F003DLL /* 580 */, 0x9F65293DA8C5D6B9LL /* 581 */, 0x6ECEF04DD690F84CLL /* 582 */, 0x4782275FFF33AF88LL /* 583 */, 0xE41433083F820801LL /* 584 */, 0xFD0DFE409A1AF9B5LL /* 585 */, 0x4325A3342CDB396BLL /* 586 */, 0x8AE77E62B301B252LL /* 587 */, 0xC36F9E9F6655615ALL /* 588 */, 0x85455A2D92D32C09LL /* 589 */, 0xF2C7DEA949477485LL /* 590 */, 0x63CFB4C133A39EBALL /* 591 */, 0x83B040CC6EBC5462LL /* 592 */, 0x3B9454C8FDB326B0LL /* 593 */, 0x56F56A9E87FFD78CLL /* 594 */, 0x2DC2940D99F42BC6LL /* 595 */, 0x98F7DF096B096E2DLL /* 596 */, 0x19A6E01E3AD852BFLL /* 597 */, 0x42A99CCBDBD4B40BLL /* 598 */, 0xA59998AF45E9C559LL /* 599 */, 0x366295E807D93186LL /* 600 */, 0x6B48181BFAA1F773LL /* 601 */, 0x1FEC57E2157A0A1DLL /* 602 */, 0x4667446AF6201AD5LL /* 603 */, 0xE615EBCACFB0F075LL /* 604 */, 0xB8F31F4F68290778LL /* 605 */, 0x22713ED6CE22D11ELL /* 606 */, 0x3057C1A72EC3C93BLL /* 607 */, 0xCB46ACC37C3F1F2FLL /* 608 */, 0xDBB893FD02AAF50ELL /* 609 */, 0x331FD92E600B9FCFLL /* 610 */, 0xA498F96148EA3AD6LL /* 611 */, 0xA8D8426E8B6A83EALL /* 612 */, 0xA089B274B7735CDCLL /* 613 */, 0x87F6B3731E524A11LL /* 614 */, 0x118808E5CBC96749LL /* 615 */, 0x9906E4C7B19BD394LL /* 616 */, 0xAFED7F7E9B24A20CLL /* 617 */, 0x6509EADEEB3644A7LL /* 618 */, 0x6C1EF1D3E8EF0EDELL /* 619 */, 0xB9C97D43E9798FB4LL /* 620 */, 0xA2F2D784740C28A3LL /* 621 */, 0x7B8496476197566FLL /* 622 */, 0x7A5BE3E6B65F069DLL /* 623 */, 0xF96330ED78BE6F10LL /* 624 */, 0xEEE60DE77A076A15LL /* 625 */, 0x2B4BEE4AA08B9BD0LL /* 626 */, 0x6A56A63EC7B8894ELL /* 627 */, 0x02121359BA34FEF4LL /* 628 */, 0x4CBF99F8283703FCLL /* 629 */, 0x398071350CAF30C8LL /* 630 */, 0xD0A77A89F017687ALL /* 631 */, 0xF1C1A9EB9E423569LL /* 632 */, 0x8C7976282DEE8199LL /* 633 */, 0x5D1737A5DD1F7ABDLL /* 634 */, 0x4F53433C09A9FA80LL /* 635 */, 0xFA8B0C53DF7CA1D9LL /* 636 */, 0x3FD9DCBC886CCB77LL /* 637 */, 0xC040917CA91B4720LL /* 638 */, 0x7DD00142F9D1DCDFLL /* 639 */, 0x8476FC1D4F387B58LL /* 640 */, 0x23F8E7C5F3316503LL /* 641 */, 0x032A2244E7E37339LL /* 642 */, 0x5C87A5D750F5A74BLL /* 643 */, 0x082B4CC43698992ELL /* 644 */, 0xDF917BECB858F63CLL /* 645 */, 0x3270B8FC5BF86DDALL /* 646 */, 0x10AE72BB29B5DD76LL /* 647 */, 0x576AC94E7700362BLL /* 648 */, 0x1AD112DAC61EFB8FLL /* 649 */, 0x691BC30EC5FAA427LL /* 650 */, 0xFF246311CC327143LL /* 651 */, 0x3142368E30E53206LL /* 652 */, 0x71380E31E02CA396LL /* 653 */, 0x958D5C960AAD76F1LL /* 654 */, 0xF8D6F430C16DA536LL /* 655 */, 0xC8FFD13F1BE7E1D2LL /* 656 */, 0x7578AE66004DDBE1LL /* 657 */, 0x05833F01067BE646LL /* 658 */, 0xBB34B5AD3BFE586DLL /* 659 */, 0x095F34C9A12B97F0LL /* 660 */, 0x247AB64525D60CA8LL /* 661 */, 0xDCDBC6F3017477D1LL /* 662 */, 0x4A2E14D4DECAD24DLL /* 663 */, 0xBDB5E6D9BE0A1EEBLL /* 664 */, 0x2A7E70F7794301ABLL /* 665 */, 0xDEF42D8A270540FDLL /* 666 */, 0x01078EC0A34C22C1LL /* 667 */, 0xE5DE511AF4C16387LL /* 668 */, 0x7EBB3A52BD9A330ALL /* 669 */, 0x77697857AA7D6435LL /* 670 */, 0x004E831603AE4C32LL /* 671 */, 0xE7A21020AD78E312LL /* 672 */, 0x9D41A70C6AB420F2LL /* 673 */, 0x28E06C18EA1141E6LL /* 674 */, 0xD2B28CBD984F6B28LL /* 675 */, 0x26B75F6C446E9D83LL /* 676 */, 0xBA47568C4D418D7FLL /* 677 */, 0xD80BADBFE6183D8ELL /* 678 */, 0x0E206D7F5F166044LL /* 679 */, 0xE258A43911CBCA3ELL /* 680 */, 0x723A1746B21DC0BCLL /* 681 */, 0xC7CAA854F5D7CDD3LL /* 682 */, 0x7CAC32883D261D9CLL /* 683 */, 0x7690C26423BA942CLL /* 684 */, 0x17E55524478042B8LL /* 685 */, 0xE0BE477656A2389FLL /* 686 */, 0x4D289B5E67AB2DA0LL /* 687 */, 0x44862B9C8FBBFD31LL /* 688 */, 0xB47CC8049D141365LL /* 689 */, 0x822C1B362B91C793LL /* 690 */, 0x4EB14655FB13DFD8LL /* 691 */, 0x1ECBBA0714E2A97BLL /* 692 */, 0x6143459D5CDE5F14LL /* 693 */, 0x53A8FBF1D5F0AC89LL /* 694 */, 0x97EA04D81C5E5B00LL /* 695 */, 0x622181A8D4FDB3F3LL /* 696 */, 0xE9BCD341572A1208LL /* 697 */, 0x1411258643CCE58ALL /* 698 */, 0x9144C5FEA4C6E0A4LL /* 699 */, 0x0D33D06565CF620FLL /* 700 */, 0x54A48D489F219CA1LL /* 701 */, 0xC43E5EAC6D63C821LL /* 702 */, 0xA9728B3A72770DAFLL /* 703 */, 0xD7934E7B20DF87EFLL /* 704 */, 0xE35503B61A3E86E5LL /* 705 */, 0xCAE321FBC819D504LL /* 706 */, 0x129A50B3AC60BFA6LL /* 707 */, 0xCD5E68EA7E9FB6C3LL /* 708 */, 0xB01C90199483B1C7LL /* 709 */, 0x3DE93CD5C295376CLL /* 710 */, 0xAED52EDF2AB9AD13LL /* 711 */, 0x2E60F512C0A07884LL /* 712 */, 0xBC3D86A3E36210C9LL /* 713 */, 0x35269D9B163951CELL /* 714 */, 0x0C7D6E2AD0CDB5FALL /* 715 */, 0x59E86297D87F5733LL /* 716 */, 0x298EF221898DB0E7LL /* 717 */, 0x55000029D1A5AA7ELL /* 718 */, 0x8BC08AE1B5061B45LL /* 719 */, 0xC2C31C2B6C92703ALL /* 720 */, 0x94CC596BAF25EF42LL /* 721 */, 0x0A1D73DB22540456LL /* 722 */, 0x04B6A0F9D9C4179ALL /* 723 */, 0xEFFDAFA2AE3D3C60LL /* 724 */, 0xF7C8075BB49496C4LL /* 725 */, 0x9CC5C7141D1CD4E3LL /* 726 */, 0x78BD1638218E5534LL /* 727 */, 0xB2F11568F850246ALL /* 728 */, 0xEDFABCFA9502BC29LL /* 729 */, 0x796CE5F2DA23051BLL /* 730 */, 0xAAE128B0DC93537CLL /* 731 */, 0x3A493DA0EE4B29AELL /* 732 */, 0xB5DF6B2C416895D7LL /* 733 */, 0xFCABBD25122D7F37LL /* 734 */, 0x70810B58105DC4B1LL /* 735 */, 0xE10FDD37F7882A90LL /* 736 */, 0x524DCAB5518A3F5CLL /* 737 */, 0x3C9E85878451255BLL /* 738 */, 0x4029828119BD34E2LL /* 739 */, 0x74A05B6F5D3CECCBLL /* 740 */, 0xB610021542E13ECALL /* 741 */, 0x0FF979D12F59E2ACLL /* 742 */, 0x6037DA27E4F9CC50LL /* 743 */, 0x5E92975A0DF1847DLL /* 744 */, 0xD66DE190D3E623FELL /* 745 */, 0x5032D6B87B568048LL /* 746 */, 0x9A36B7CE8235216ELL /* 747 */, 0x80272A7A24F64B4ALL /* 748 */, 0x93EFED8B8C6916F7LL /* 749 */, 0x37DDBFF44CCE1555LL /* 750 */, 0x4B95DB5D4B99BD25LL /* 751 */, 0x92D3FDA169812FC0LL /* 752 */, 0xFB1A4A9A90660BB6LL /* 753 */, 0x730C196946A4B9B2LL /* 754 */, 0x81E289AA7F49DA68LL /* 755 */, 0x64669A0F83B1A05FLL /* 756 */, 0x27B3FF7D9644F48BLL /* 757 */, 0xCC6B615C8DB675B3LL /* 758 */, 0x674F20B9BCEBBE95LL /* 759 */, 0x6F31238275655982LL /* 760 */, 0x5AE488713E45CF05LL /* 761 */, 0xBF619F9954C21157LL /* 762 */, 0xEABAC46040A8EAE9LL /* 763 */, 0x454C6FE9F2C0C1CDLL /* 764 */, 0x419CF6496412691CLL /* 765 */, 0xD3DC3BEF265B0F70LL /* 766 */, 0x6D0E60F5C3578A9ELL /* 767 */, 0x5B0E608526323C55LL /* 768 */, 0x1A46C1A9FA1B59F5LL /* 769 */, 0xA9E245A17C4C8FFALL /* 770 */, 0x65CA5159DB2955D7LL /* 771 */, 0x05DB0A76CE35AFC2LL /* 772 */, 0x81EAC77EA9113D45LL /* 773 */, 0x528EF88AB6AC0A0DLL /* 774 */, 0xA09EA253597BE3FFLL /* 775 */, 0x430DDFB3AC48CD56LL /* 776 */, 0xC4B3A67AF45CE46FLL /* 777 */, 0x4ECECFD8FBE2D05ELL /* 778 */, 0x3EF56F10B39935F0LL /* 779 */, 0x0B22D6829CD619C6LL /* 780 */, 0x17FD460A74DF2069LL /* 781 */, 0x6CF8CC8E8510ED40LL /* 782 */, 0xD6C824BF3A6ECAA7LL /* 783 */, 0x61243D581A817049LL /* 784 */, 0x048BACB6BBC163A2LL /* 785 */, 0xD9A38AC27D44CC32LL /* 786 */, 0x7FDDFF5BAAF410ABLL /* 787 */, 0xAD6D495AA804824BLL /* 788 */, 0xE1A6A74F2D8C9F94LL /* 789 */, 0xD4F7851235DEE8E3LL /* 790 */, 0xFD4B7F886540D893LL /* 791 */, 0x247C20042AA4BFDALL /* 792 */, 0x096EA1C517D1327CLL /* 793 */, 0xD56966B4361A6685LL /* 794 */, 0x277DA5C31221057DLL /* 795 */, 0x94D59893A43ACFF7LL /* 796 */, 0x64F0C51CCDC02281LL /* 797 */, 0x3D33BCC4FF6189DBLL /* 798 */, 0xE005CB184CE66AF1LL /* 799 */, 0xFF5CCD1D1DB99BEALL /* 800 */, 0xB0B854A7FE42980FLL /* 801 */, 0x7BD46A6A718D4B9FLL /* 802 */, 0xD10FA8CC22A5FD8CLL /* 803 */, 0xD31484952BE4BD31LL /* 804 */, 0xC7FA975FCB243847LL /* 805 */, 0x4886ED1E5846C407LL /* 806 */, 0x28CDDB791EB70B04LL /* 807 */, 0xC2B00BE2F573417FLL /* 808 */, 0x5C9590452180F877LL /* 809 */, 0x7A6BDDFFF370EB00LL /* 810 */, 0xCE509E38D6D9D6A4LL /* 811 */, 0xEBEB0F00647FA702LL /* 812 */, 0x1DCC06CF76606F06LL /* 813 */, 0xE4D9F28BA286FF0ALL /* 814 */, 0xD85A305DC918C262LL /* 815 */, 0x475B1D8732225F54LL /* 816 */, 0x2D4FB51668CCB5FELL /* 817 */, 0xA679B9D9D72BBA20LL /* 818 */, 0x53841C0D912D43A5LL /* 819 */, 0x3B7EAA48BF12A4E8LL /* 820 */, 0x781E0E47F22F1DDFLL /* 821 */, 0xEFF20CE60AB50973LL /* 822 */, 0x20D261D19DFFB742LL /* 823 */, 0x16A12B03062A2E39LL /* 824 */, 0x1960EB2239650495LL /* 825 */, 0x251C16FED50EB8B8LL /* 826 */, 0x9AC0C330F826016ELL /* 827 */, 0xED152665953E7671LL /* 828 */, 0x02D63194A6369570LL /* 829 */, 0x5074F08394B1C987LL /* 830 */, 0x70BA598C90B25CE1LL /* 831 */, 0x794A15810B9742F6LL /* 832 */, 0x0D5925E9FCAF8C6CLL /* 833 */, 0x3067716CD868744ELL /* 834 */, 0x910AB077E8D7731BLL /* 835 */, 0x6A61BBDB5AC42F61LL /* 836 */, 0x93513EFBF0851567LL /* 837 */, 0xF494724B9E83E9D5LL /* 838 */, 0xE887E1985C09648DLL /* 839 */, 0x34B1D3C675370CFDLL /* 840 */, 0xDC35E433BC0D255DLL /* 841 */, 0xD0AAB84234131BE0LL /* 842 */, 0x08042A50B48B7EAFLL /* 843 */, 0x9997C4EE44A3AB35LL /* 844 */, 0x829A7B49201799D0LL /* 845 */, 0x263B8307B7C54441LL /* 846 */, 0x752F95F4FD6A6CA6LL /* 847 */, 0x927217402C08C6E5LL /* 848 */, 0x2A8AB754A795D9EELL /* 849 */, 0xA442F7552F72943DLL /* 850 */, 0x2C31334E19781208LL /* 851 */, 0x4FA98D7CEAEE6291LL /* 852 */, 0x55C3862F665DB309LL /* 853 */, 0xBD0610175D53B1F3LL /* 854 */, 0x46FE6CB840413F27LL /* 855 */, 0x3FE03792DF0CFA59LL /* 856 */, 0xCFE700372EB85E8FLL /* 857 */, 0xA7BE29E7ADBCE118LL /* 858 */, 0xE544EE5CDE8431DDLL /* 859 */, 0x8A781B1B41F1873ELL /* 860 */, 0xA5C94C78A0D2F0E7LL /* 861 */, 0x39412E2877B60728LL /* 862 */, 0xA1265EF3AFC9A62CLL /* 863 */, 0xBCC2770C6A2506C5LL /* 864 */, 0x3AB66DD5DCE1CE12LL /* 865 */, 0xE65499D04A675B37LL /* 866 */, 0x7D8F523481BFD216LL /* 867 */, 0x0F6F64FCEC15F389LL /* 868 */, 0x74EFBE618B5B13C8LL /* 869 */, 0xACDC82B714273E1DLL /* 870 */, 0xDD40BFE003199D17LL /* 871 */, 0x37E99257E7E061F8LL /* 872 */, 0xFA52626904775AAALL /* 873 */, 0x8BBBF63A463D56F9LL /* 874 */, 0xF0013F1543A26E64LL /* 875 */, 0xA8307E9F879EC898LL /* 876 */, 0xCC4C27A4150177CCLL /* 877 */, 0x1B432F2CCA1D3348LL /* 878 */, 0xDE1D1F8F9F6FA013LL /* 879 */, 0x606602A047A7DDD6LL /* 880 */, 0xD237AB64CC1CB2C7LL /* 881 */, 0x9B938E7225FCD1D3LL /* 882 */, 0xEC4E03708E0FF476LL /* 883 */, 0xFEB2FBDA3D03C12DLL /* 884 */, 0xAE0BCED2EE43889ALL /* 885 */, 0x22CB8923EBFB4F43LL /* 886 */, 0x69360D013CF7396DLL /* 887 */, 0x855E3602D2D4E022LL /* 888 */, 0x073805BAD01F784CLL /* 889 */, 0x33E17A133852F546LL /* 890 */, 0xDF4874058AC7B638LL /* 891 */, 0xBA92B29C678AA14ALL /* 892 */, 0x0CE89FC76CFAADCDLL /* 893 */, 0x5F9D4E0908339E34LL /* 894 */, 0xF1AFE9291F5923B9LL /* 895 */, 0x6E3480F60F4A265FLL /* 896 */, 0xEEBF3A2AB29B841CLL /* 897 */, 0xE21938A88F91B4ADLL /* 898 */, 0x57DFEFF845C6D3C3LL /* 899 */, 0x2F006B0BF62CAAF2LL /* 900 */, 0x62F479EF6F75EE78LL /* 901 */, 0x11A55AD41C8916A9LL /* 902 */, 0xF229D29084FED453LL /* 903 */, 0x42F1C27B16B000E6LL /* 904 */, 0x2B1F76749823C074LL /* 905 */, 0x4B76ECA3C2745360LL /* 906 */, 0x8C98F463B91691BDLL /* 907 */, 0x14BCC93CF1ADE66ALL /* 908 */, 0x8885213E6D458397LL /* 909 */, 0x8E177DF0274D4711LL /* 910 */, 0xB49B73B5503F2951LL /* 911 */, 0x10168168C3F96B6BLL /* 912 */, 0x0E3D963B63CAB0AELL /* 913 */, 0x8DFC4B5655A1DB14LL /* 914 */, 0xF789F1356E14DE5CLL /* 915 */, 0x683E68AF4E51DAC1LL /* 916 */, 0xC9A84F9D8D4B0FD9LL /* 917 */, 0x3691E03F52A0F9D1LL /* 918 */, 0x5ED86E46E1878E80LL /* 919 */, 0x3C711A0E99D07150LL /* 920 */, 0x5A0865B20C4E9310LL /* 921 */, 0x56FBFC1FE4F0682ELL /* 922 */, 0xEA8D5DE3105EDF9BLL /* 923 */, 0x71ABFDB12379187ALL /* 924 */, 0x2EB99DE1BEE77B9CLL /* 925 */, 0x21ECC0EA33CF4523LL /* 926 */, 0x59A4D7521805C7A1LL /* 927 */, 0x3896F5EB56AE7C72LL /* 928 */, 0xAA638F3DB18F75DCLL /* 929 */, 0x9F39358DABE9808ELL /* 930 */, 0xB7DEFA91C00B72ACLL /* 931 */, 0x6B5541FD62492D92LL /* 932 */, 0x6DC6DEE8F92E4D5BLL /* 933 */, 0x353F57ABC4BEEA7ELL /* 934 */, 0x735769D6DA5690CELL /* 935 */, 0x0A234AA642391484LL /* 936 */, 0xF6F9508028F80D9DLL /* 937 */, 0xB8E319A27AB3F215LL /* 938 */, 0x31AD9C1151341A4DLL /* 939 */, 0x773C22A57BEF5805LL /* 940 */, 0x45C7561A07968633LL /* 941 */, 0xF913DA9E249DBE36LL /* 942 */, 0xDA652D9B78A64C68LL /* 943 */, 0x4C27A97F3BC334EFLL /* 944 */, 0x76621220E66B17F4LL /* 945 */, 0x967743899ACD7D0BLL /* 946 */, 0xF3EE5BCAE0ED6782LL /* 947 */, 0x409F753600C879FCLL /* 948 */, 0x06D09A39B5926DB6LL /* 949 */, 0x6F83AEB0317AC588LL /* 950 */, 0x01E6CA4A86381F21LL /* 951 */, 0x66FF3462D19F3025LL /* 952 */, 0x72207C24DDFD3BFBLL /* 953 */, 0x4AF6B6D3E2ECE2EBLL /* 954 */, 0x9C994DBEC7EA08DELL /* 955 */, 0x49ACE597B09A8BC4LL /* 956 */, 0xB38C4766CF0797BALL /* 957 */, 0x131B9373C57C2A75LL /* 958 */, 0xB1822CCE61931E58LL /* 959 */, 0x9D7555B909BA1C0CLL /* 960 */, 0x127FAFDD937D11D2LL /* 961 */, 0x29DA3BADC66D92E4LL /* 962 */, 0xA2C1D57154C2ECBCLL /* 963 */, 0x58C5134D82F6FE24LL /* 964 */, 0x1C3AE3515B62274FLL /* 965 */, 0xE907C82E01CB8126LL /* 966 */, 0xF8ED091913E37FCBLL /* 967 */, 0x3249D8F9C80046C9LL /* 968 */, 0x80CF9BEDE388FB63LL /* 969 */, 0x1881539A116CF19ELL /* 970 */, 0x5103F3F76BD52457LL /* 971 */, 0x15B7E6F5AE47F7A8LL /* 972 */, 0xDBD7C6DED47E9CCFLL /* 973 */, 0x44E55C410228BB1ALL /* 974 */, 0xB647D4255EDB4E99LL /* 975 */, 0x5D11882BB8AAFC30LL /* 976 */, 0xF5098BBB29D3212ALL /* 977 */, 0x8FB5EA14E90296B3LL /* 978 */, 0x677B942157DD025ALL /* 979 */, 0xFB58E7C0A390ACB5LL /* 980 */, 0x89D3674C83BD4A01LL /* 981 */, 0x9E2DA4DF4BF3B93BLL /* 982 */, 0xFCC41E328CAB4829LL /* 983 */, 0x03F38C96BA582C52LL /* 984 */, 0xCAD1BDBD7FD85DB2LL /* 985 */, 0xBBB442C16082AE83LL /* 986 */, 0xB95FE86BA5DA9AB0LL /* 987 */, 0xB22E04673771A93FLL /* 988 */, 0x845358C9493152D8LL /* 989 */, 0xBE2A488697B4541ELL /* 990 */, 0x95A2DC2DD38E6966LL /* 991 */, 0xC02C11AC923C852BLL /* 992 */, 0x2388B1990DF2A87BLL /* 993 */, 0x7C8008FA1B4F37BELL /* 994 */, 0x1F70D0C84D54E503LL /* 995 */, 0x5490ADEC7ECE57D4LL /* 996 */, 0x002B3C27D9063A3ALL /* 997 */, 0x7EAEA3848030A2BFLL /* 998 */, 0xC602326DED2003C0LL /* 999 */, 0x83A7287D69A94086LL /* 1000 */, 0xC57A5FCB30F57A8ALL /* 1001 */, 0xB56844E479EBE779LL /* 1002 */, 0xA373B40F05DCBCE9LL /* 1003 */, 0xD71A786E88570EE2LL /* 1004 */, 0x879CBACDBDE8F6A0LL /* 1005 */, 0x976AD1BCC164A32FLL /* 1006 */, 0xAB21E25E9666D78BLL /* 1007 */, 0x901063AAE5E5C33CLL /* 1008 */, 0x9818B34448698D90LL /* 1009 */, 0xE36487AE3E1E8ABBLL /* 1010 */, 0xAFBDF931893BDCB4LL /* 1011 */, 0x6345A0DC5FBBD519LL /* 1012 */, 0x8628FE269B9465CALL /* 1013 */, 0x1E5D01603F9C51ECLL /* 1014 */, 0x4DE44006A15049B7LL /* 1015 */, 0xBF6C70E5F776CBB1LL /* 1016 */, 0x411218F2EF552BEDLL /* 1017 */, 0xCB0C0708705A36A3LL /* 1018 */, 0xE74D14754F986044LL /* 1019 */, 0xCD56D9430EA8280ELL /* 1020 */, 0xC12591D7535F5065LL /* 1021 */, 0xC83223F1720AEF96LL /* 1022 */, 0xC3A0396F7363A51FLL /* 1023 */}; microdc2-0.15.6/src/tth/tiger.c0100644000076500007500000001351510527044660016227 0ustar chugunovmicrodc/* (PD) 2001 The Bitzi Corporation * Please see file COPYING or http://bitzi.com/publicdomain * for more info. * * Created and released into the public domain by Eli Biham * * $Id: tiger.c,v 1.2 2006/11/16 11:21:20 chugunov Exp $ */ #include "tiger.h" #ifdef _WIN32 #undef WORDS_BIGENDIAN #else #include #endif #define _ULL(x) x##ull #ifdef WORDS_BIGENDIAN # define USE_BIG_ENDIAN 1 #else # define USE_BIG_ENDIAN 0 #endif /* The following macro denotes that an optimization */ /* for Alpha is required. It is used only for */ /* optimization of time. Otherwise it does nothing. */ #ifdef __alpha #define OPTIMIZE_FOR_ALPHA #endif /* NOTE that this code is NOT FULLY OPTIMIZED for any */ /* machine. Assembly code might be much faster on some */ /* machines, especially if the code is compiled with */ /* gcc. */ /* The number of passes of the hash function. */ /* Three passes are recommended. */ /* Use four passes when you need extra security. */ /* Must be at least three. */ #define PASSES 3 extern word64 table[4*256]; #define t1 (table) #define t2 (table+256) #define t3 (table+256*2) #define t4 (table+256*3) #define save_abc \ aa = a; \ bb = b; \ cc = c; #ifdef OPTIMIZE_FOR_ALPHA /* This is the official definition of round */ #define round(a,b,c,x,mul) \ c ^= x; \ a -= t1[((c)>>(0*8))&0xFF] ^ t2[((c)>>(2*8))&0xFF] ^ \ t3[((c)>>(4*8))&0xFF] ^ t4[((c)>>(6*8))&0xFF] ; \ b += t4[((c)>>(1*8))&0xFF] ^ t3[((c)>>(3*8))&0xFF] ^ \ t2[((c)>>(5*8))&0xFF] ^ t1[((c)>>(7*8))&0xFF] ; \ b *= mul; #else /* This code works faster when compiled on 32-bit machines */ /* (but works slower on Alpha) */ #define round(a,b,c,x,mul) \ c ^= x; \ a -= t1[(byte)(c)] ^ \ t2[(byte)(((word32)(c))>>(2*8))] ^ \ t3[(byte)((c)>>(4*8))] ^ \ t4[(byte)(((word32)((c)>>(4*8)))>>(2*8))] ; \ b += t4[(byte)(((word32)(c))>>(1*8))] ^ \ t3[(byte)(((word32)(c))>>(3*8))] ^ \ t2[(byte)(((word32)((c)>>(4*8)))>>(1*8))] ^ \ t1[(byte)(((word32)((c)>>(4*8)))>>(3*8))]; \ b *= mul; #endif #define pass(a,b,c,mul) \ round(a,b,c,x0,mul) \ round(b,c,a,x1,mul) \ round(c,a,b,x2,mul) \ round(a,b,c,x3,mul) \ round(b,c,a,x4,mul) \ round(c,a,b,x5,mul) \ round(a,b,c,x6,mul) \ round(b,c,a,x7,mul) #define key_schedule \ x0 -= x7 ^ _ULL(0xA5A5A5A5A5A5A5A5); \ x1 ^= x0; \ x2 += x1; \ x3 -= x2 ^ ((~x1)<<19); \ x4 ^= x3; \ x5 += x4; \ x6 -= x5 ^ ((~x4)>>23); \ x7 ^= x6; \ x0 += x7; \ x1 -= x0 ^ ((~x7)<<19); \ x2 ^= x1; \ x3 += x2; \ x4 -= x3 ^ ((~x2)>>23); \ x5 ^= x4; \ x6 += x5; \ x7 -= x6 ^ _ULL(0x0123456789ABCDEF); #define feedforward \ a ^= aa; \ b -= bb; \ c += cc; #ifdef OPTIMIZE_FOR_ALPHA /* The loop is unrolled: works better on Alpha */ #define compress \ save_abc \ pass(a,b,c,5) \ key_schedule \ pass(c,a,b,7) \ key_schedule \ pass(b,c,a,9) \ for(pass_no=3; pass_no=64; i-=64) { #if USE_BIG_ENDIAN for(j=0; j<64; j++) temp[j^7] = ((byte*)str)[j]; tiger_compress(((word64*)temp), res); #else tiger_compress(str, res); #endif str += 8; } #if USE_BIG_ENDIAN for(j=0; j56) { for(; j<64; j++) temp[j] = 0; tiger_compress(((word64*)temp), res); j=0; } for(; j<56; j++) temp[j] = 0; ((word64*)(&(temp[56])))[0] = ((word64)length)<<3; tiger_compress(((word64*)temp), res); } microdc2-0.15.6/src/tth/tiger.h0100644000076500007500000000134210527044660016227 0ustar chugunovmicrodc/* (PD) 2001 The Bitzi Corporation * Please see file COPYING or http://bitzi.com/publicdomain * for more info. * * $Id: tiger.h,v 1.1 2006/11/16 11:21:20 chugunov Exp $ */ #ifndef TIGER_H #define TIGER_H #ifdef _WIN32 #if defined (_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS >= 64) typedef unsigned __int64 word64; #else #error __int64 type not supported #endif typedef unsigned long int tword; #else #include typedef u_int64_t word64; typedef u_int32_t word32; typedef u_int16_t word16; #endif #ifndef __BYTE__ #define __BYTE__ typedef unsigned char byte; #endif #if defined(__cplusplus) extern "C" { #endif void tiger(word64 *str, word64 length, word64 *res); #if defined(__cplusplus) } #endif #endif microdc2-0.15.6/src/tth/tigertree.c0100644000076500007500000001113310533030105017063 0ustar chugunovmicrodc/* (PD) 2001 The Bitzi Corporation * Copyright (C) 2006 Alexey Illarionov * * Please see file COPYING or http://bitzi.com/publicdomain * for more info. * * tigertree.c - Implementation of the TigerTree algorithm * * NOTE: The TigerTree hash value cannot be calculated using a * constant amount of memory; rather, the memory required grows * with the size of input. (Roughly, one more interim value must * be remembered for each doubling of the input size.) The * default TT_CONTEXT struct size reserves enough memory for * input up to 2^64 in length * * Requires the tiger() function as defined in the reference * implementation provided by the creators of the Tiger * algorithm. See * * http://www.cs.technion.ac.il/~biham/Reports/Tiger/ * */ #include #include #include "tigertree.h" //#define _TRACE #if defined(_TRACE) #include #define TRACE(x) printf x; fflush(stdout); #else #define TRACE(x) #endif #ifdef _WIN32 #undef WORDS_BIGENDIAN #else #include "../../config.h" #endif #ifdef WORDS_BIGENDIAN # define USE_BIG_ENDIAN 1 void tt_endian(byte *s); #else # define USE_BIG_ENDIAN 0 #endif /* Initialize the tigertree context */ void tt_init(TT_CONTEXT *ctx, unsigned char *tthl, unsigned depth) { ctx->count = 0; ctx->node[0] = '\1'; // flag for inner node calculation -- never changed ctx->index = 0; // partial block pointer/block length ctx->top = ctx->nodes; ctx->tthl = tthl; ctx->depth = depth; } static void tt_compose(TT_CONTEXT *ctx) { byte *node = ctx->top - NODESIZE; memmove((ctx->node)+1,node,NODESIZE); // copy to scratch area tiger((word64*)(ctx->node),(word64)(NODESIZE+1),(word64*)(ctx->top)); // combine two nodes #if USE_BIG_ENDIAN tt_endian((byte *)ctx->top); #endif memmove(node,ctx->top,TIGERSIZE); // move up result ctx->top -= TIGERSIZE; // update top ptr } void tt_block(TT_CONTEXT *ctx) { word64 b; unsigned depth; tiger((word64*)ctx->leaf,(word64)ctx->index+1,(word64*)ctx->top); #if USE_BIG_ENDIAN tt_endian((byte *)ctx->top); #endif ctx->top += TIGERSIZE; ++ctx->count; b = ctx->count; depth = 0; while(b == ((b >> 1)<<1)) { // while evenly divisible by 2... /* if (depth == ctx->depth) { TRACE(("depth = %d, b == %lld\n", depth, b)); memmove(ctx->tthl, ctx->top - 2*TIGERSIZE, 2*TIGERSIZE); ctx->tthl += 2*TIGERSIZE; } */ tt_compose(ctx); b = b >> 1; depth++; } } // no need to call this directly; tt_digest calls it for you static void tt_final(TT_CONTEXT *ctx) { // do last partial block, unless index is 1 (empty leaf) // AND we're past the first block if((ctx->index>0)||(ctx->top==ctx->nodes)) tt_block(ctx); } void tt_digest(TT_CONTEXT *ctx, byte *s) { unsigned dth_top0 = 0, dth_top1 = 0; word64 tmp, cnt; tt_final(ctx); /* dth_top0 = 0; cnt = ctx->count; tmp = cnt; while(tmp == ((tmp >> 1)<<1)) { dth_top0++; tmp >>= 1; } cnt -= ((word64)1 << dth_top0); TRACE(("ctx->top-TIGERSIZE - ctx->nodes == %d\n", ctx->top-TIGERSIZE - ctx->nodes)); */ while( (ctx->top-TIGERSIZE) > ctx->nodes) { /* assert(cnt > 0); dth_top1 = 0; tmp = cnt; while (tmp == ((tmp >> 1)<<1)) { dth_top1++; tmp >>= 1; } cnt -= ((word64)1 << dth_top1); if ((ctx->depth <= dth_top1) && (ctx->depth >= dth_top0)) { if ( dth_top1 == ctx->depth) { TRACE(("depth = %d, dth_top0 == %d, dth_top1 == %d\n", ctx->depth, dth_top0, dth_top1)); memmove(ctx->tthl, ctx->top - 2*TIGERSIZE, 2*TIGERSIZE); ctx->tthl += 2*TIGERSIZE; } else { TRACE(("depth = %d, dth_top0 == %d, dth_top1 == %d\n", ctx->depth, dth_top0, dth_top1)); memmove(ctx->tthl, ctx->top - TIGERSIZE, TIGERSIZE); ctx->tthl += TIGERSIZE; } } */ tt_compose(ctx); dth_top0 = dth_top1 + 1; } memmove(s,ctx->nodes, TIGERSIZE); } #if USE_BIG_ENDIAN void tt_endian(byte *s) { word64 *i; byte *b, btemp; word16 *w, wtemp; for(w = (word16 *)s; w < ((word16 *)s) + 12; w++) { b = (byte *)w; btemp = *b; *b = *(b + 1); *(b + 1) = btemp; } for(i = (word64 *)s; i < ((word64 *)s) + 3; i++) { w = (word16 *)i; wtemp = *w; *w = *(w + 3); *(w + 3) = wtemp; wtemp = *(w + 1); *(w + 1) = *(w + 2); *(w + 2) = wtemp; } } #endif microdc2-0.15.6/src/tth/tigertree.h0100644000076500007500000000322710527044660017113 0ustar chugunovmicrodc/* (PD) 2001 The Bitzi Corporation * Copyright (C) 2006 Alexey Illarionov * Please see file COPYING or http://bitzi.com/publicdomain * for more info. * */ #include "tiger.h" /* tiger hash result size, in bytes */ #define TIGERSIZE 24 /* size of each block independently tiger-hashed, not counting leaf 0x00 prefix */ #define BLOCKSIZE 1024 /* size of input to each non-leaf hash-tree node, not counting node 0x01 prefix */ #define NODESIZE (TIGERSIZE*2) /* default size of interim values stack, in TIGERSIZE * blocks. If this overflows (as it will for input * longer than 2^64 in size), havoc may ensue. */ #define STACKSIZE TIGERSIZE*56 typedef struct tt_context { word64 count; /* total blocks processed */ #if 0 unsigned char leaf[1+BLOCKSIZE]; /* leaf in progress */ unsigned char *block; /* leaf data */ #endif unsigned char *leaf; /* leaf in progress */ unsigned char node[1+NODESIZE]; /* node scratch space */ int index; /* index into block */ unsigned char *top; /* top (next empty) stack slot */ unsigned char *tthl; /* index into buf for tth leaves */ unsigned depth; /* num of generations in tree to discard */ unsigned char nodes[STACKSIZE]; /* stack of interim node values */ } TT_CONTEXT; #if defined(__cplusplus) extern "C" { #endif void tt_init(TT_CONTEXT *ctx, unsigned char *tthl, unsigned depth); //void tt_update(TT_CONTEXT *ctx, unsigned char *buffer, word32 len); void tt_block(TT_CONTEXT *ctx); void tt_digest(TT_CONTEXT *ctx, unsigned char *hash); void tt_copy(TT_CONTEXT *dest, TT_CONTEXT *src); #if defined(__cplusplus) } #endif microdc2-0.15.6/src/tth/tth.c0100644000076500007500000000665710533030105015707 0ustar chugunovmicrodc/* * tth.c * This file is part of microdc * * Copyright (C) 2006 Alexey Illarionov * * 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 Library 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include "tigertree.h" #include "base32.h" //#define _TRACE #if defined(_TRACE) #define TRACE(x) printf x; fflush(stdout); #else #define TRACE(x) #endif const size_t default_block_level = 6; const int max_block_count = (1 << 6); #define MAXHASHES ( ((word64)1) << 9 ) /* blocksize for one leaf is 65536 bytes */ #define STARTDEPTH 6 int calc_block_level(word64 filesize, int max_block_count) { int level; for (level = default_block_level; (((word64)1) << (level+10)) * max_block_count < filesize; level++); return level; } char* tth(const char* filename, char **tthl, size_t *tthl_len) { char *tth; size_t numbytes; unsigned char root[24]; unsigned char *cur; TT_CONTEXT tt; unsigned char buf[1 + 512 * BLOCKSIZE]; struct stat sb; unsigned leaf_cnt, level; size_t leaf_blocksize; int fd = open(filename, O_RDONLY); if ((fd == -1) || ( fstat(fd, &sb) == -1)) { return NULL; } level = calc_block_level(sb.st_size, max_block_count); leaf_blocksize = 1 << (level+10); //TRACE(("level == %d, leaf_blocksize == %d\n", level, leaf_blocksize)); /* get memry for leaves */ leaf_cnt = sb.st_size / leaf_blocksize; if (sb.st_size % leaf_blocksize) leaf_cnt++; //TRACE(("leaf_cnt == %d\n", leaf_cnt)); /* if (leaf_cnt >= 2) { *tthl_len = leaf_cnt * TIGERSIZE; *tthl = malloc(leaf_cnt * TIGERSIZE); if (*tthl == NULL) return NULL; } else */ { *tthl_len = 0; *tthl = NULL; } tt_init(&tt, *tthl, level); tt.leaf = buf; buf[0] = '\0'; while ( (numbytes = read(fd, &buf[1], sizeof(buf) - 1) ) > 0) { tt.index = BLOCKSIZE; for (cur = &buf[1]; cur + BLOCKSIZE <= &buf[numbytes + 1]; cur += BLOCKSIZE) { tt.leaf = cur - 1; tt.leaf[0] = '\0'; tt_block(&tt); } tt.index = numbytes - (cur - &buf[1]); tt.leaf = cur - 1; tt.leaf[0] = '\0'; } close(fd); tt_digest(&tt, root); if (*tthl_len) { if (*tthl_len != (tt.tthl - *(unsigned char **)tthl)) { fprintf(stderr, "*tthl_len == %d, (tt.tthl - *(unsigned char **)tthl) == %d\n", *tthl_len, (tt.tthl - *(unsigned char **)tthl)); fflush(stderr); } assert(*tthl_len == (tt.tthl - *(unsigned char **)tthl)); } tth = base32_encode(root, sizeof(root)); return tth; } microdc2-0.15.6/src/tth/tth.h0100644000076500007500000000045410527044660015717 0ustar chugunovmicrodc#ifndef __TTH_H #define __TTH_H #include "tiger.h" #if defined(__cplusplus) extern "C" { #endif // user must call free() funtion on pointer returned from these functions char* tth(const char* filename, char **tthl, size_t *tthl_len); #if defined(__cplusplus) } #endif #endif // ifndef __TTH_H microdc2-0.15.6/src/tth.c0100664000076500007500000000421010533252571015106 0ustar chugunovmicrodc#include #include /* for errstr */ #include /* ? */ #include /* ? */ #include /* POSIX */ #include /* ? */ #include /* C89 */ #include #include #include #include "version-etc.h" /* Gnulib */ #include "dirname.h" /* Gnulib */ #include "tth/tth.h" #define errstr (strerror(errno)) enum { VERSION_OPT = 256, HELP_OPT }; static const char *short_opts = "v"; static struct option long_opts[] = { { "version", no_argument, NULL, VERSION_OPT }, { "help", no_argument, NULL, HELP_OPT }, { 0, } }; const char version_etc_copyright[] = "Copyright (C) 2006 Vladimir Chugunov"; int main(int argc, char* argv[]) { int print_help = 0, i; int opt = -1, long_idx = -1; while (!print_help && (-1 != (opt = getopt_long(argc, argv, short_opts, long_opts, &long_idx)))) { switch (opt) { case VERSION_OPT: version_etc(stdout, NULL, base_name(argv[0]), VERSION, "Vladimir Chugunov", NULL); exit(EXIT_SUCCESS); case HELP_OPT: print_help = 1; break; default: fprintf(stderr, "unknown option value %d\n", opt); break; } } if (argc < 2 || print_help) { fprintf(stderr, "Usage: %s file [file...]\n\n", base_name(argv[0])); fprintf(stderr, "Calculate Tiger Tree Hash.\n\n" "Available options:\n" " --version - print version information\n" " --help - print this help\n\n"); return 255; } for (i = optind; i < argc; i++) { char* filename = argv[i]; char* tthl = NULL; size_t tthl_size; char* hash = tth(filename, &tthl, &tthl_size); if (tthl != NULL) { free(tthl); } if (tth != NULL) { printf("%40s %s\n", hash, filename); free(hash); } else { printf("Cannot process file %s - %s\n", filename, errstr); } fflush(stdout); } return 0; }